diff --git a/Makefile b/Makefile index a15bdf9..26f889c 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ LOCATION="$(HOME)/.config" -install: install_bspwm install_nvim install_sx install_sxhkd install_vimb install_zathura install_wyebadblock +install: install_bspwm install_nvim install_sx install_sxhkd install_vimb install_zathura install_wyebadblock install_simplestatus install_bspwm: cp -r bspwm $(LOCATION) install_nvim: @@ -14,3 +14,5 @@ install_zathura: cp -r zathura $(LOCATION) install_wyebadblock: cp -r wyebadblock $(LOCATION) +install_simplestatus: + cp -r simplestatus $(LOCATION) diff --git a/simplestatus/bspwm b/simplestatus/bspwm new file mode 100755 index 0000000..8ce8bd9 --- /dev/null +++ b/simplestatus/bspwm @@ -0,0 +1,20 @@ +#!/bin/sh + +used_desk=$(bspc query -D -d .occupied --names | tr '\n' ' ') +current_desk=$(bspc query -D -d .focused --names) +final_string="" +current_printed=0 + +for i in $used_desk; do + [ "$i" = "$current_desk" ] && \ + final_string=${final_string}"%{R}$i%{R} " && \ + current_printed=1 || \ + final_string=${final_string}"$i " +done + +[ $current_printed -eq 0 ] && + final_string=${final_string}"%{R}$current_desk%{R}" + +printf "%s" "$final_string" + +exit diff --git a/simplestatus/config b/simplestatus/config new file mode 100644 index 0000000..03f00de --- /dev/null +++ b/simplestatus/config @@ -0,0 +1,8 @@ +module power 7 30 +module time 7 30 +module date 7 30 +module bspwm 10 1000000 + +order bspwm date time power + +format %{l}&%{c}& &%{r}& diff --git a/simplestatus/date b/simplestatus/date new file mode 100755 index 0000000..e76a83a --- /dev/null +++ b/simplestatus/date @@ -0,0 +1,5 @@ +#!/bin/sh + +printf "%s" $(date '+%Y-%m-%d') + +exit diff --git a/simplestatus/power b/simplestatus/power new file mode 100755 index 0000000..40a1f8c --- /dev/null +++ b/simplestatus/power @@ -0,0 +1,11 @@ +#!/bin/sh + +battery="sbs-20-000b" +perc=$(cat /sys/class/power_supply/$battery/capacity) +state=$( + cat /sys/class/power_supply/$battery/status | \ + sed 's/Discharging/↓/g;s/Charging/↑/g' +) +printf "%s %s" "$perc" "$state" + +exit diff --git a/simplestatus/time b/simplestatus/time new file mode 100755 index 0000000..35fcc3c --- /dev/null +++ b/simplestatus/time @@ -0,0 +1,5 @@ +#!/bin/sh + +printf "%s" $(date '+%R') + +exit