add bar, fix xinitrc, add vdirsyncer to imap and update config.h
authorMart Lubbers <mart@martlubbers.net>
Fri, 13 Jul 2018 04:53:39 +0000 (06:53 +0200)
committerMart Lubbers <mart@martlubbers.net>
Fri, 13 Jul 2018 04:53:39 +0000 (06:53 +0200)
config.h/dwm/config.h
email/.config/offlineimap/config
x/.local/bin/bar
x/.xinitrc

index d332607..6ef64a4 100644 (file)
@@ -1,5 +1,7 @@
 /* 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 */
@@ -64,6 +66,11 @@ static const char *passmenu_type[]  = { "passmenu", "--type", NULL };
 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[] = {
@@ -75,6 +82,11 @@ 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 } },
index a206ce8..5dcf2ae 100644 (file)
@@ -9,7 +9,7 @@ localrepository = Local
 remoterepository = Remote
 autorefresh = 0.5
 quick = 10
-postsynchook = notmuch new && /home/mrl/.mutt/newmail.sh
+postsynchook = notmuch new && /home/mrl/.mutt/newmail.sh && vdirsyncer sync
 #proxy = SOCKS5:localhost:8008
 
 [Repository Local]
index 15b1f87..33e1fa4 100755 (executable)
@@ -1,4 +1,21 @@
 #!/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")"
index eda3c10..763a2b5 100755 (executable)
@@ -14,4 +14,4 @@ if [ -d /etc/X11/xinit/xinitrc.d ] ; then
 fi
 
 while true; do xsetroot -name "$(bar)"; sleep 1m; done &
-while true; do dwm >/dev/null 2>&1; done
+while true; do dwm >dwm.log 2>&1; done