Init repository
This commit is contained in:
20
.config/sway/status.sh
Executable file
20
.config/sway/status.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
print_status() {
|
||||
volume_info=$(wpctl get-volume @DEFAULT_AUDIO_SINK@ 2>/dev/null)
|
||||
volume=$(printf '%s' "$volume_info" | awk '{printf "%d%%", $2 * 100}')
|
||||
printf '%s' "$volume_info" | grep -q MUTED && volume="muted"
|
||||
|
||||
brightness=$(brightnessctl -m 2>/dev/null | awk -F, '{print $4}')
|
||||
|
||||
printf 'VOL %s | BRI %s | %s\n' "${volume:-n/a}" "${brightness:-n/a}" "$(date +'%Y-%m-%d %H:%M:%S')"
|
||||
}
|
||||
|
||||
trap print_status USR1
|
||||
|
||||
print_status
|
||||
while :; do
|
||||
sleep 60 &
|
||||
wait $!
|
||||
print_status
|
||||
done
|
||||
Reference in New Issue
Block a user