notify-send grouping

This commit is contained in:
nomadics9 2024-10-25 18:56:17 +03:00
parent e55574c842
commit f6a47b4eb3
3 changed files with 8 additions and 8 deletions

View file

@ -3,13 +3,13 @@
down() { down() {
brightnessctl set 5%- brightnessctl set 5%-
brightnessctl=$(brightnessctl | grep -oP "(\d+(\.\d+)?(?=%))") brightnessctl=$(brightnessctl | grep -oP "(\d+(\.\d+)?(?=%))")
notify-send -a "Brightness" "Decreasing to $brightnessctl%" -h int:value:"$brightnessctl" -i ~/icons/brightness.png -r 2593 -u normal notify-send -a "Brightness" "Decreasing to $brightnessctl%" -h int:value:"$brightnessctl" -i ~/icons/brightness.png -h string:x-canonical-private-synchronous:brightness
} }
up() { up() {
brightnessctl set 5%+ brightnessctl set 5%+
brightnessctl=$(brightnessctl | grep -oP "(\d+(\.\d+)?(?=%))") brightnessctl=$(brightnessctl | grep -oP "(\d+(\.\d+)?(?=%))")
notify-send -a "BRightness" "Increasing to $brightnessctl%" -h int:value:"$brightnessctl" -i ~/icons/brightness.png -r 2593 -u normal notify-send -a "BRightness" "Increasing to $brightnessctl%" -h int:value:"$brightnessctl" -i ~/icons/brightness.png -h string:x-canonical-private-synchronous:brightness
} }
case "$1" in case "$1" in

View file

@ -4,7 +4,7 @@ down() {
pamixer -d 2 pamixer -d 2
volume=$(pamixer --get-volume) volume=$(pamixer --get-volume)
[$volume -gt 0 ] && volume=`expr $volume` [$volume -gt 0 ] && volume=`expr $volume`
notify-send -a "Volume" "Decreasing to $volume%" -h int:value:"$volume" -i ~/icons/low-volume.png -r 2593 -u normal notify-send -a "Volume" "Decreasing to $volume%" -h int:value:"$volume" -i ~/icons/low-volume.png -h string:x-canonical-private-synchronous:volume
canberra-gtk-play -i audio-volume-change -d "changevolume" canberra-gtk-play -i audio-volume-change -d "changevolume"
} }
@ -12,7 +12,7 @@ up() {
pamixer -i 2 pamixer -i 2
volume=$(pamixer --get-volume) volume=$(pamixer --get-volume)
[ $volume -lt 1000 ] && volume=`expr $volume` [ $volume -lt 1000 ] && volume=`expr $volume`
notify-send -a "Volume" "Increasing to $volume%" -h int:value:"$volume" -i ~/icons/high-volume.png -r 2593 -u normal notify-send -a "Volume" "Increasing to $volume%" -h int:value:"$volume" -i ~/icons/high-volume.png -h string:x-canonical-private-synchronous:volume
canberra-gtk-play -i audio-volume-change -d "changevolume" canberra-gtk-play -i audio-volume-change -d "changevolume"
} }
@ -20,10 +20,10 @@ mute() {
muted="$(pamixer --get-mute)" muted="$(pamixer --get-mute)"
if $muted; then if $muted; then
pamixer -u pamixer -u
notify-send -a "VOLUME" "UNMUTED" -i ~/.config/dunst/assets/ui/volume_high.svg -r 2593 -u normal notify-send -a "VOLUME" "UNMUTED" -i ~/.config/dunst/assets/ui/volume_high.svg -h string:x-canonical-private-synchronous:volume
else else
pamixer -m pamixer -m
notify-send -a "VOLUME" "MUTED" -i ~/.config/dunst/assets/ui/volume_muted.svg -r 2593 -u normal notify-send -a "VOLUME" "MUTED" -i ~/.config/dunst/assets/ui/volume_muted.svg -h string:x-canonical-private-synchronous:volume
fi fi
} }

View file

@ -9,9 +9,9 @@ handshake=$(ip a show "$interface" | grep 'link')
if [[ -n "$handshake" ]]; then if [[ -n "$handshake" ]]; then
# If it's up, bring it down # If it's up, bring it down
pkexec wg-quick down "$interface" pkexec wg-quick down "$interface"
notify-send -a "WireGuard" "Disconnected from $interface" notify-send -a "WireGuard" "Disconnected from $interface" -h string:x-canonical-private-synchronous:vpn
else else
# Otherwise, bring it up # Otherwise, bring it up
pkexec wg-quick up "$interface" pkexec wg-quick up "$interface"
notify-send -a "WireGuard" "Connected to $interface" notify-send -a "WireGuard" "Connected to $interface" -h string:x-canonical-private-synchronous:vpn
fi fi