From 98ef8dd720b8a4c6a3a19be3d5b4972188951967 Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Fri, 13 Jul 2018 06:53:39 +0200 Subject: [PATCH] add bar, fix xinitrc, add vdirsyncer to imap and update config.h --- config.h/dwm/config.h | 12 ++++++++++++ email/.config/offlineimap/config | 2 +- x/.local/bin/bar | 21 +++++++++++++++++++-- x/.xinitrc | 2 +- 4 files changed, 33 insertions(+), 4 deletions(-) diff --git a/config.h/dwm/config.h b/config.h/dwm/config.h index d332607..6ef64a4 100644 --- a/config.h/dwm/config.h +++ b/config.h/dwm/config.h @@ -1,5 +1,7 @@ /* See LICENSE file for copyright and license details. */ +#include + /* 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 } }, diff --git a/email/.config/offlineimap/config b/email/.config/offlineimap/config index a206ce8..5dcf2ae 100644 --- a/email/.config/offlineimap/config +++ b/email/.config/offlineimap/config @@ -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] diff --git a/x/.local/bin/bar b/x/.local/bin/bar index 15b1f87..33e1fa4 100755 --- a/x/.local/bin/bar +++ b/x/.local/bin/bar @@ -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")" diff --git a/x/.xinitrc b/x/.xinitrc index eda3c10..763a2b5 100755 --- a/x/.xinitrc +++ b/x/.xinitrc @@ -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 -- 2.20.1