diff options
author | Saumit Dinesan <justsaumit@protonmail.com> | 2022-10-12 23:16:46 +0530 |
---|---|---|
committer | Saumit Dinesan <justsaumit@protonmail.com> | 2022-10-12 23:16:46 +0530 |
commit | a0298de68dcf476e88f67a338a40f4c7606d17e8 (patch) | |
tree | af156eb8e99de00717e3fe729c055ebb4f048602 | |
parent | 504a9d3a2c4ac31dba7586f3576423a98ed442be (diff) |
sxhkdrc - wpctl using scripts removing pactl
-rw-r--r-- | .config/sxhkd/sxhkdrc | 6 | ||||
-rwxr-xr-x | .scripts/volumechanger | 7 | ||||
-rwxr-xr-x | .scripts/volumecurr | 10 |
3 files changed, 22 insertions, 1 deletions
diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc index 33fd91a..f31c3ac 100644 --- a/.config/sxhkd/sxhkdrc +++ b/.config/sxhkd/sxhkdrc @@ -15,7 +15,7 @@ super + F4 ##Not able to set wpctl here temporarily fix in future # Change volume XF86Audio{Raise,Lower}Volume - pactl set-sink-volume @DEFAULT_SINK@ {+,-}2% && dunstify "Volume Changed" "Volume set to $(pamixer --get-volume)" -i {volume-high,volume-low} -t 1500 -r {1235,1236} + volumechanger {up,down} && dunstify "Volume Changed" "Volume set to $(volumecurr)" -i {volume-high,volume-low} -t 1500 -r {1235,1236} #Toggle play/pause in spotify (universal) XF86AudioPlay @@ -76,6 +76,10 @@ super + ctrl + e super + alt + e qutebrowser https://mail.proton.me/u/0/inbox +# Launch twitter +super + alt + t + qutebrowser https://twitter.com + # Launch teams super + shift + t qutebrowser https://teams.microsoft.com diff --git a/.scripts/volumechanger b/.scripts/volumechanger new file mode 100755 index 0000000..2e97506 --- /dev/null +++ b/.scripts/volumechanger @@ -0,0 +1,7 @@ +#!/bin/sh + +if [ $1 = up ]; then + wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%+ ##increase by 2% +elif [ $1 = down ];then + wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%- ##decrease by 2% +fi diff --git a/.scripts/volumecurr b/.scripts/volumecurr new file mode 100755 index 0000000..7b08cab --- /dev/null +++ b/.scripts/volumecurr @@ -0,0 +1,10 @@ +#!/bin/sh + +volume="$(wpctl get-volume @DEFAULT_SINK@)" +volume=${volume#Volume: *} + +case "$volume" + in (*MUTED*) volume=0;; +esac + +printf "%0.0f%%\n" "${volume%% *}e+2" |