Browse Source

Added notification tone for swaync notification

pull/109/head
SherLock707 2 years ago
parent
commit
bee281ef32
  1. 2
      config/hypr/scripts/Brightness.sh
  2. 2
      config/hypr/scripts/BrightnessKbd.sh
  3. 14
      config/hypr/scripts/Volume.sh
  4. 6
      config/swaync/config.json
  5. BIN
      config/swaync/tone/notification.ogg

2
config/hypr/scripts/Brightness.sh

@ -26,7 +26,7 @@ get_icon() {
# Notify # Notify
notify_user() { notify_user() {
notify-send -e -h string:x-canonical-private-synchronous:brightness_notif -h int:value:$current -u low -i "$icon" "Brightness : $current%" notify-send -e -a brightness -h string:x-canonical-private-synchronous:brightness_notif -h int:value:$current -u low -i "$icon" "Brightness : $current%"
} }
# Change brightness # Change brightness

2
config/hypr/scripts/BrightnessKbd.sh

@ -24,7 +24,7 @@ get_icon() {
} }
# Notify # Notify
notify_user() { notify_user() {
notify-send -e -h string:x-canonical-private-synchronous:brightness_notif -h int:value:$current -u low -i "$icon" "Keyboard Brightness : $current%" notify-send -e -a brightness -h string:x-canonical-private-synchronous:brightness_notif -h int:value:$current -u low -i "$icon" "Keyboard Brightness : $current%"
} }
# Change brightness # Change brightness

14
config/hypr/scripts/Volume.sh

@ -29,9 +29,9 @@ get_icon() {
# Notify # Notify
notify_user() { notify_user() {
if [[ "$(get_volume)" == "Muted" ]]; then if [[ "$(get_volume)" == "Muted" ]]; then
notify-send -e -h string:x-canonical-private-synchronous:volume_notif -u low -i "$(get_icon)" "Volume: Muted" notify-send -e -a volume -h string:x-canonical-private-synchronous:volume_notif -u low -i "$(get_icon)" "Volume: Muted"
else else
notify-send -e -h int:value:"$(get_volume | sed 's/%//')" -h string:x-canonical-private-synchronous:volume_notif -u low -i "$(get_icon)" "Volume: $(get_volume)" notify-send -e -a volume -h int:value:"$(get_volume | sed 's/%//')" -h string:x-canonical-private-synchronous:volume_notif -u low -i "$(get_icon)" "Volume: $(get_volume)"
fi fi
} }
@ -54,18 +54,18 @@ dec_volume() {
# Toggle Mute # Toggle Mute
toggle_mute() { toggle_mute() {
if [ "$(pamixer --get-mute)" == "false" ]; then if [ "$(pamixer --get-mute)" == "false" ]; then
pamixer -m && notify-send -e -u low -i "$iDIR/volume-mute.png" "Volume Switched OFF" pamixer -m && notify-send -e -a volume -u low -i "$iDIR/volume-mute.png" "Volume Switched OFF"
elif [ "$(pamixer --get-mute)" == "true" ]; then elif [ "$(pamixer --get-mute)" == "true" ]; then
pamixer -u && notify-send -e -u low -i "$(get_icon)" "Volume Switched ON" pamixer -u && notify-send -e -a volume -u low -i "$(get_icon)" "Volume Switched ON"
fi fi
} }
# Toggle Mic # Toggle Mic
toggle_mic() { toggle_mic() {
if [ "$(pamixer --default-source --get-mute)" == "false" ]; then if [ "$(pamixer --default-source --get-mute)" == "false" ]; then
pamixer --default-source -m && notify-send -e -u low -i "$iDIR/microphone-mute.png" "Microphone Switched OFF" pamixer --default-source -m && notify-send -e -a volume -u low -i "$iDIR/microphone-mute.png" "Microphone Switched OFF"
elif [ "$(pamixer --default-source --get-mute)" == "true" ]; then elif [ "$(pamixer --default-source --get-mute)" == "true" ]; then
pamixer -u --default-source u && notify-send -e -u low -i "$iDIR/microphone.png" "Microphone Switched ON" pamixer -u --default-source u && notify-send -e -a volume -u low -i "$iDIR/microphone.png" "Microphone Switched ON"
fi fi
} }
# Get Mic Icon # Get Mic Icon
@ -92,7 +92,7 @@ get_mic_volume() {
notify_mic_user() { notify_mic_user() {
volume=$(get_mic_volume) volume=$(get_mic_volume)
icon=$(get_mic_icon) icon=$(get_mic_icon)
notify-send -e -h int:value:"$volume" -h "string:x-canonical-private-synchronous:volume_notif" -u low -i "$icon" "Mic-Level: $volume" notify-send -e -a volume -h int:value:"$volume" -h "string:x-canonical-private-synchronous:volume_notif" -u low -i "$icon" "Mic-Level: $volume"
} }
# Increase MIC Volume # Increase MIC Volume

6
config/swaync/config.json

@ -28,6 +28,12 @@
"hide-on-clear": false, "hide-on-clear": false,
"hide-on-action": true, "hide-on-action": true,
"script-fail-notify": true, "script-fail-notify": true,
"scripts": {
"sound-script": {
"exec": "play -v 0.5 ~/.config/swaync/tone/notification.ogg",
"app-name": "^(?!.*\\b(volume|brightness)\\b).*"
}
},
"widgets": [ "widgets": [
"dnd", "dnd",
"buttons-grid", "buttons-grid",

BIN
config/swaync/tone/notification.ogg

Binary file not shown.
Loading…
Cancel
Save