/* See LICENSE file for copyright and license details. */
+#include <X11/XF86keysym.h>
+
/* appearance */
static const unsigned int borderpx = 1; /* border pixel of windows */
static const unsigned int snap = 32; /* snap pixel */
static const char *scr[] = { "scr", NULL };
static const char *scr_sel[] = { "scr", "selection", NULL };
static const char *lock[] = { "slock", NULL };
+static const char *brightup[] = { "xbacklight", "-inc", "5", NULL };
+static const char *brightdown[] = { "xbacklight", "-inc", "5", NULL };
+static const char *volume_mute[] = {"pactl", "set-sink-mute", "@DEFAULT_SINK@", "toggle", NULL};
+static const char *volume_dec[] = {"pactl", "set-sink-volume", "@DEFAULT_SINK@", "-5%", NULL};
+static const char *volume_inc[] = {"pactl", "set-sink-volume", "@DEFAULT_SINK@", "+5%", NULL};
static Key keys[] = {
{ MODKEY, XK_Print, spawn, {.v = scr } },
{ MODKEY|ShiftMask, XK_Print, spawn, {.v = scr_sel } },
{ MODKEY|ShiftMask, XK_l, spawn, {.v = lock } },
+ { 0 , XF86XK_MonBrightnessUp, spawn, {.v = brightup } },
+ { 0 , XF86XK_MonBrightnessDown, spawn, {.v = brightdown } },
+ { 0 , XF86XK_AudioLowerVolume, spawn, {.v = volume_dec } },
+ { 0 , XF86XK_AudioMute, spawn, {.v = volume_mute } },
+ { 0 , XF86XK_AudioRaiseVolume, spawn, {.v = volume_inc } },
{ MODKEY, XK_b, togglebar, {0} },
{ MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY, XK_k, focusstack, {.i = -1 } },
#!/bin/sh
+batprefix=/sys/class/power_supply/BAT0
+if [ -f $batprefix/charge_full -a -f $batprefix/charge_now ]; then
+ bat="$(echo $(cat $batprefix/charge_now)*100/$(cat $batprefix/charge_full) | bc)% |"
+fi
+
+if ip -br a | grep -q '^wlp'; then
+ wlan="$(/sbin/iwconfig 2>/dev/null | grep -oP '(?<=ESSID:\").*(?=\")')"
+ if [ -z "$wlan" ]; then
+ wlan="Not connected |"
+ else
+ wlan="$wlan |"
+ fi
+fi
+
echo \
- "$(df -h | grep '/$' | awk '{print $4"/"$2}')"\
- " | $(date +"%Y-%m-%d %H:%M:%S")"
+ "W $wlan"\
+ "♪ $(pactl list sinks | grep -Po "(?<=Volume: front)[^%]*" | grep -o "100$") |"\
+ "⚡$bat"\
+ "Dsk: $(df -h | grep '/$' | awk '{print $4"/"$2}') |"\
+ "$(date +"%Y-%m-%d %H:%M:%S")"