more sway and some waybar
This commit is contained in:
parent
2ac99db38b
commit
93879b3ef7
21 changed files with 760 additions and 26 deletions
28
.config/sway/scripts/wluma.sh
Executable file
28
.config/sway/scripts/wluma.sh
Executable file
|
@ -0,0 +1,28 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
status() {
|
||||
systemctl --user is-active wluma >/dev/null 2>&1
|
||||
}
|
||||
|
||||
#Accepts managing parameter
|
||||
case $1'' in
|
||||
'toggle')
|
||||
status && systemctl --user stop wluma || systemctl --user --now enable wluma
|
||||
waybar-signal adaptive-brightness
|
||||
;;
|
||||
'check')
|
||||
[ -x "$(command -v wluma)" ] && [ $(ls -A /sys/class/backlight/ | wc -l) -gt 0 ]
|
||||
exit $?
|
||||
;;
|
||||
esac
|
||||
|
||||
#Returns data for Waybar
|
||||
if status; then
|
||||
class="on"
|
||||
text="adaptive brightness"
|
||||
else
|
||||
class="off"
|
||||
text="static brightness"
|
||||
fi
|
||||
|
||||
printf '{"alt":"%s","tooltip":"%s"}\n' "$class" "$text"
|
Loading…
Add table
Add a link
Reference in a new issue