From b2b1e1397638532097a476e4e6545026457b4215 Mon Sep 17 00:00:00 2001 From: Enrico Fasoli Date: Tue, 25 Aug 2015 22:56:33 +0000 Subject: [PATCH] now with lemonbar --- bspwmrc | 8 ++++++-- configuration.nix | 7 ++++--- install | 1 + lemonbar.sh | 25 +++++++++++++++++++++++++ sxhkdrc | 6 ++---- 5 files changed, 38 insertions(+), 9 deletions(-) create mode 100755 lemonbar.sh diff --git a/bspwmrc b/bspwmrc index fe08724..b02c211 100755 --- a/bspwmrc +++ b/bspwmrc @@ -3,8 +3,14 @@ setxkbmap it xsetroot -cursor_name left_ptr +sh ~/.config/bspwm/lemonbar.sh & + +bspc monitor DVI-I-0 -d 1 2 +bspc monitor HDMI-0 -d 3 4 + bspc config border_width 2 bspc window_gap 24 +bspc config -m DVI-I-0 top_padding 36 bspc config focused_border_color '#858585' bspc config normal_border_color '#2e343D' bspc config split_ratio 0.52 @@ -12,6 +18,4 @@ bspc config borderless_monocle true bspc config gapless monocle true bspc config focus_follows_pointer true -bspc monitor DVI-I-0 -d 1 2 -bspc monitor HDMI-0 -d 3 4 feh --no--fehbg --bg-center ~/Pictures/background.png diff --git a/configuration.nix b/configuration.nix index 9d44cd1..aaa710e 100644 --- a/configuration.nix +++ b/configuration.nix @@ -36,15 +36,16 @@ # Development atom git # Desktop and appliations - sxhkd tmux htop ranger w3m rxvt_unicode chromium dmenu gnupg irssi + sxhkd tmux htop ranger w3m rxvt_unicode chromium dmenu gnupg irssi bar + # Games + minecraft # Media mpv cmus # System utilities, drivers... - ntfs # Services syncthing transmission # Other stuff - screenfetch scrot + screenfetch scrot iotop iftop ]; fonts = { diff --git a/install b/install index 5b6c06e..f593d00 100755 --- a/install +++ b/install @@ -18,6 +18,7 @@ mkdir -p ~/.config/bspwm mkdir -p ~/.config/sxhkd cp bspwmrc ~/.config/bspwm/ cp sxhkdrc ~/.config/sxhkd/ +cp lemonbar.sh ~/.config/bspwm/ cp ./.Xresources ~/ # Vim diff --git a/lemonbar.sh b/lemonbar.sh new file mode 100755 index 0000000..f681601 --- /dev/null +++ b/lemonbar.sh @@ -0,0 +1,25 @@ +buildClock() { + echo -n $(date "+%A, %e %B | %k:%M:%S") +} + +getVolume() { + echo -n "|Vol| $(amixer get Master | sed -n 's/^.*\[\([0-9]\+\)%.*$/\1/p' | uniq)%%" +} + +getRAM(){ + echo -n "free -m | awk 'NR == 2 {gsub(/%/,''); print }'" +} + +getCPU(){ + echo -n "grep 'cpu ' /proc/stat | awk '{usage=(+)*100/(++)} END {print usage}'" +} + +buildBar () { + while true + do + echo "$(getVolume)%{c}$(buildClock)%{r}|IP| $(curl -s http://canihazip.com/s)" + sleep 1 + done +} + +buildBar | lemonbar -p -g "1872x20+24+8" -B "#181b20" -F "#9b9081" -f -gohu-gohufont-medium-r-normal--14-100-100-100-c-80-iso10646-1 diff --git a/sxhkdrc b/sxhkdrc index c27f21d..5da8cbd 100755 --- a/sxhkdrc +++ b/sxhkdrc @@ -98,7 +98,7 @@ F9 F10 amixer set Master 3+ unmute F11 - amixer set Master toggle + amixer set Master 0 # turn screen off F12 @@ -108,6 +108,4 @@ alt + F12 # screenshots Print - scrot "~/Pictures/screenshots/%d-%m-%Y %H:%M:%S.png" -# scrot /tmp/screenshot.png -e 'copyq copy image/png - < $f && rm $f' -# scrot -s /tmp/screenshot.png -e 'copyq copy image/png - < $f && rm $f' + scrot -m "~/Pictures/screenshots/%d-%m-%Y %H:%M:%S.png"