add simplestatus configs

This commit is contained in:
randomuser 2022-01-07 02:40:12 -06:00
parent f6e5395aad
commit e67ddf9a7f
6 changed files with 52 additions and 1 deletions

View File

@ -1,5 +1,5 @@
LOCATION="$(HOME)/.config" 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: install_bspwm:
cp -r bspwm $(LOCATION) cp -r bspwm $(LOCATION)
install_nvim: install_nvim:
@ -14,3 +14,5 @@ install_zathura:
cp -r zathura $(LOCATION) cp -r zathura $(LOCATION)
install_wyebadblock: install_wyebadblock:
cp -r wyebadblock $(LOCATION) cp -r wyebadblock $(LOCATION)
install_simplestatus:
cp -r simplestatus $(LOCATION)

20
simplestatus/bspwm Executable file
View File

@ -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

8
simplestatus/config Normal file
View File

@ -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}&

5
simplestatus/date Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
printf "%s" $(date '+%Y-%m-%d')
exit

11
simplestatus/power Executable file
View File

@ -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

5
simplestatus/time Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
printf "%s" $(date '+%R')
exit