aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/scripts/Volume.sh
diff options
context:
space:
mode:
authorJa.KooLit <jimmielovejay@gmail.com>2023-12-17 16:15:04 +0900
committerGitHub <noreply@github.com>2023-12-17 16:15:04 +0900
commitf6cac04f24927419aba506e7bb51dd085f8aa8c2 (patch)
tree650e29a07cb52ff7973361f92968ece49ea19066 /config/hypr/scripts/Volume.sh
parent948d1db075ec815983628ebf467d0d49bbe1b5e4 (diff)
parent338f213dd13ba560a08440d66302c96eea59d6de (diff)
Merge pull request #78 from JaKooLit/Development
some small tweaks
Diffstat (limited to 'config/hypr/scripts/Volume.sh')
-rwxr-xr-xconfig/hypr/scripts/Volume.sh28
1 files changed, 20 insertions, 8 deletions
diff --git a/config/hypr/scripts/Volume.sh b/config/hypr/scripts/Volume.sh
index a51999df..6a50cb77 100755
--- a/config/hypr/scripts/Volume.sh
+++ b/config/hypr/scripts/Volume.sh
@@ -30,29 +30,35 @@ notify_user() {
# Increase Volume
inc_volume() {
- pamixer -i 5 && notify_user
+ if [ "$(pamixer --get-mute)" == "true" ]; then
+ pamixer -u && notify_user
+ fi
+ pamixer -i 5 && notify_user
}
# Decrease Volume
dec_volume() {
- pamixer -d 5 && notify_user
+ if [ "$(pamixer --get-mute)" == "true" ]; then
+ pamixer -u && notify_user
+ fi
+ pamixer -d 5 && notify_user
}
# Toggle Mute
toggle_mute() {
if [ "$(pamixer --get-mute)" == "false" ]; then
- pamixer -m && notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$iDIR/volume-mute.png" "Volume Switched OFF"
+ pamixer -m && dunstify -u low -i "$iDIR/volume-mute.png" "Volume Switched OFF"
elif [ "$(pamixer --get-mute)" == "true" ]; then
- pamixer -u && notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$(get_icon)" "Volume Switched ON"
+ pamixer -u && dunstify -u low -i "$(get_icon)" "Volume Switched ON"
fi
}
# Toggle Mic
toggle_mic() {
if [ "$(pamixer --default-source --get-mute)" == "false" ]; then
- pamixer --default-source -m && notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$iDIR/microphone-mute.png" "Microphone Switched OFF"
+ pamixer --default-source -m && dunstify -u low -i "$iDIR/microphone-mute.png" "Microphone Switched OFF"
elif [ "$(pamixer --default-source --get-mute)" == "true" ]; then
- pamixer -u --default-source u && notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$iDIR/microphone.png" "Microphone Switched ON"
+ pamixer -u --default-source u && dunstify -u low -i "$iDIR/microphone.png" "Microphone Switched ON"
fi
}
# Get icons
@@ -75,12 +81,18 @@ notify_mic_user() {
# Increase MIC Volume
inc_mic_volume() {
- pamixer --default-source -i 5 && notify_mic_user
+ if [ "$(pamixer --default-source --get-mute)" == "true" ]; then
+ pamixer --default-source -u && notify_mic_user
+ fi
+ pamixer --default-source -i 5 && notify_mic_user
}
# Decrease MIC Volume
dec_mic_volume() {
- pamixer --default-source -d 5 && notify_mic_user
+ if [ "$(pamixer --default-source --get-mute)" == "true" ]; then
+ pamixer --default-source -u && notify_mic_user
+ fi
+ pamixer --default-source -d 5 && notify_mic_user
}
# Execute accordingly
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage