Fixed volume and media keybinds

This commit is contained in:
Michel Fedde 2025-05-30 23:04:26 +02:00
parent 0e111ad114
commit 88bda96496
4 changed files with 40 additions and 17 deletions

View file

@ -2,7 +2,7 @@
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
# Scripts for volume controls for audio and mic
iDIR="$HOME/.config/swaync/icons"
iDIR="/usr/share/icons/Qogir/24/actions"
sDIR="$HOME/.config/hypr/scripts"
# Get Volume
@ -19,13 +19,13 @@ get_volume() {
get_icon() {
current=$(get_volume)
if [[ "$current" == "Muted" ]]; then
echo "$iDIR/volume-mute.png"
echo "$iDIR/audio-volume-muted.svg"
elif [[ "${current%\%}" -le 30 ]]; then
echo "$iDIR/volume-low.png"
echo "$iDIR/audio-volume-low.svg"
elif [[ "${current%\%}" -le 60 ]]; then
echo "$iDIR/volume-mid.png"
echo "$iDIR/audio-volume-medium.svg"
else
echo "$iDIR/volume-high.png"
echo "$iDIR/audio-volume-high.svg"
fi
}
@ -60,7 +60,7 @@ dec_volume() {
# Toggle Mute
toggle_mute() {
if [ "$(pamixer --get-mute)" == "false" ]; then
pamixer -m && notify-send -e -u low -i "$iDIR/volume-mute.png" " Mute"
pamixer -m && notify-send -e -u low -i "$iDIR/audio-volume-muted.svg" " Mute"
elif [ "$(pamixer --get-mute)" == "true" ]; then
pamixer -u && notify-send -e -u low -i "$(get_icon)" " Volume:" " Switched ON"
fi