diff --git a/files/.config/systemd/user/multi-user.target.wants/tmux.service b/files/.config/systemd/user/multi-user.target.wants/tmux.service new file mode 120000 index 0000000..6ae3bc7 --- /dev/null +++ b/files/.config/systemd/user/multi-user.target.wants/tmux.service @@ -0,0 +1 @@ +/home/marchambault/.config/systemd/user/tmux.service \ No newline at end of file diff --git a/files/.config/systemd/user/wob.service b/files/.config/systemd/user/wob.service new file mode 100644 index 0000000..224d2fd --- /dev/null +++ b/files/.config/systemd/user/wob.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 diff --git a/files/bin/brightness-control b/files/bin/brightness-control index 8f83f66..9017170 100755 --- a/files/bin/brightness-control +++ b/files/bin/brightness-control @@ -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 diff --git a/files/bin/volume-control b/files/bin/volume-control index e8136dc..d6864b7 100755 --- a/files/bin/volume-control +++ b/files/bin/volume-control @@ -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 } diff --git a/files/bin/wob b/files/bin/wob new file mode 100755 index 0000000..a6b1d40 --- /dev/null +++ b/files/bin/wob @@ -0,0 +1,4 @@ +#!/bin/bash + +mkfifo "$XDG_RUNTIME_DIR/wobpipe" +tail -f "$XDG_RUNTIME_DIR/wobpipe" | /bin/wob diff --git a/scripts/post-install.sh b/scripts/post-install.sh index a757d13..e66bfc6 100644 --- a/scripts/post-install.sh +++ b/scripts/post-install.sh @@ -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