use wob to display volume and brightness change
This commit is contained in:
parent
d902ee6e76
commit
a4ccd9e79c
|
@ -0,0 +1 @@
|
|||
/home/marchambault/.config/systemd/user/tmux.service
|
|
@ -0,0 +1,10 @@
|
|||
[Unit]
|
||||
Description=A lightweight overlay volume/backlight/progress/anything bar for Wayland.
|
||||
PartOf=graphical-session.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/bin/bash -c "exec $HOME/bin/wob"
|
||||
|
||||
[Install]
|
||||
WantedBy=sway-session.target
|
|
@ -14,12 +14,7 @@ function get_brightness {
|
|||
|
||||
function send_notification {
|
||||
icon="notification-display-brightness"
|
||||
brightness=$(get_brightness)
|
||||
# Make the bar with the special character ─ (it's not dash -)
|
||||
# https://en.wikipedia.org/wiki/Box-drawing_character
|
||||
bar=$(seq -s "━" 0 $((brightness / 2)) | sed 's/[0-9]//g')
|
||||
# Send the notification
|
||||
dunstify -i "$icon" -r 5555 -u normal " $bar"
|
||||
echo $(get_brightness) >"$XDG_RUNTIME_DIR/wobpipe"
|
||||
}
|
||||
|
||||
case $1 in
|
||||
|
|
|
@ -21,14 +21,9 @@ function send_notification {
|
|||
iconSound="notification-audio-volume-high"
|
||||
iconMuted="notification-audio-volume-muted"
|
||||
if is_mute ; then
|
||||
dunstify -i $iconMuted -r 2593 -u normal ""
|
||||
echo 0 >"$XDG_RUNTIME_DIR/wobpipe"
|
||||
else
|
||||
volume=$(get_volume)
|
||||
# Make the bar with the special character ─ (it's not dash -)
|
||||
# https://en.wikipedia.org/wiki/Box-drawing_character
|
||||
bar=$(seq --separator="━" 0 "$((volume / 2))" | sed 's/[0-9]//g')
|
||||
# Send the notification
|
||||
dunstify -i $iconSound -r 2593 -u normal " $bar"
|
||||
echo "$(get_volume)" >"$XDG_RUNTIME_DIR/wobpipe"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
#!/bin/bash
|
||||
|
||||
mkfifo "$XDG_RUNTIME_DIR/wobpipe"
|
||||
tail -f "$XDG_RUNTIME_DIR/wobpipe" | /bin/wob
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
# run units
|
||||
systemctl --user daemon-reload
|
||||
systemctl --user enable --now tmux.service
|
||||
systemctl --user enable --now redshift.service
|
||||
systemctl --user enable --now swayidle.service
|
||||
systemctl --user enable --now wob.service
|
||||
|
||||
# install tmux plugins
|
||||
tmux run-shell ~/.tmux/plugins/tpm/bin/install_plugins
|
||||
|
|
Loading…
Reference in New Issue