improve status bar scripts
This commit is contained in:
parent
8e941231bc
commit
10c2fdd721
8 changed files with 34 additions and 22 deletions
6
.local/bin/daemons/remapd
Executable file
6
.local/bin/daemons/remapd
Executable file
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/sh
|
||||||
|
while : ; do
|
||||||
|
dmesg -W -f kern | grep "input:" -q
|
||||||
|
sleep 1
|
||||||
|
remaps-dvorak
|
||||||
|
done
|
6
.local/bin/daemons/sbd-battery
Executable file
6
.local/bin/daemons/sbd-battery
Executable file
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# battery status file is sent in as an argument from sb-battery
|
||||||
|
|
||||||
|
while inotifywait -e modify "$1/status"; do
|
||||||
|
pkill -RTMIN+3 dwmblocks || break
|
||||||
|
done
|
4
.local/bin/daemons/sbd-music
Executable file
4
.local/bin/daemons/sbd-music
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
|
while : ; do
|
||||||
|
mpc idle >/dev/null && pkill -RTMIN+11 dwmblocks || break
|
||||||
|
done
|
2
.local/bin/daemons/sbd-playerctl
Executable file
2
.local/bin/daemons/sbd-playerctl
Executable file
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/sh
|
||||||
|
playerctl status -F | (while read -r _; do pkill -RTMIN+11 dwmblocks; done;)
|
|
@ -6,6 +6,7 @@ green="\033[32m"
|
||||||
white="\033[37m"
|
white="\033[37m"
|
||||||
reset="\033[0m"
|
reset="\033[0m"
|
||||||
for battery in /sys/class/power_supply/BAT?*; do
|
for battery in /sys/class/power_supply/BAT?*; do
|
||||||
|
pidof -x sbd-battery >/dev/null 2>&1 || sbd-battery "$battery" >/dev/null 2>&1 &
|
||||||
[ -n "${capacity+x}" ] && printf " "
|
[ -n "${capacity+x}" ] && printf " "
|
||||||
capacity="$(cat "$battery/capacity" 2>&1)"
|
capacity="$(cat "$battery/capacity" 2>&1)"
|
||||||
case "$(cat "$battery/status" 2>&1)" in
|
case "$(cat "$battery/status" 2>&1)" in
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# FIX: Script dies when ethernet cable is plugged in through docking station
|
|
||||||
shift=""
|
shift=""
|
||||||
|
|
||||||
if ls /sys/class/net/w*/operstate 1>/dev/null 2>&1; then
|
if ls /sys/class/net/w*/operstate 1>/dev/null 2>&1; then
|
||||||
for w in /sys/class/net/w*/operstate; do
|
for w in /sys/class/net/w*/; do
|
||||||
percent="$(cat /proc/net/wireless | grep "$(basename "$(dirname $w)")" | tr -s ' ' | cut -d ' ' -f3 | tr -dc "[:digit:]")"
|
percent="$(cat /proc/net/wireless | grep "$(basename "$(dirname $w/operstate)")" | tr -s ' ' | cut -d ' ' -f3 | tr -dc "[:digit:]")"
|
||||||
grep -vxq '0x1003' && wifi_icon="" || wifi_icon="$(sed "s/up/直/;s/down/睊/" $w | tr -d "[:space:]")"
|
grep -vxq '0x1003' "$w/flags" && wifi_icon="" || wifi_icon="$(sed "s/up/直/;s/down/睊/" $w/operstate | tr -d "[:space:]")"
|
||||||
printf "$shift\033[11m%s\033[10m %s" "$wifi_icon" "$percent"
|
printf "$shift\033[11m%s\033[10m %s" "$wifi_icon" "$percent"
|
||||||
shift=" "
|
shift=" "
|
||||||
done
|
done
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
while : ; do
|
|
||||||
mpc idle >/dev/null && pkill -RTMIN+11 dwmblocks || break
|
|
||||||
done
|
|
|
@ -1,2 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
playerctl status -F | tee "/tmp/playerctl-status" | (while read -r _; do pkill -RTMIN+11 dwmblocks; done;)
|
|
Loading…
Add table
Reference in a new issue