增加通知图标; 快捷键增加多媒体按键的绑定

master
yutent 2023-07-17 03:59:46 +00:00 committed by GitHub
parent e05cac5e71
commit 6b488f3dc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
30 changed files with 92 additions and 0 deletions

View File

@ -66,6 +66,20 @@ shift + super + space
shift + super + backslash
bspc desktop -l {monocle,tiled}
# 音量调节
XF86Audio{RaiseVolume,LowerVolume}
~/.local/bin/scripts/volume.sh {up, down}
# 静音/取消静音
XF86AudioMute
~/.local/bin/scripts/volume.sh mute
# 音乐控制
XF86Audio{Next,Prev,Play,Stop}
mpc {next,prev,toggle,stop}
# --------------- end --------------------
@ -89,6 +103,14 @@ ctrl + alt + shift + a
shift + Print
flameshot screen -d 2000
# 浏览器快捷键
XF86HomePage
x-www-browser
# 计算器
XF86Calculator
gnome-calculator
# --------------- end --------------------

View File

@ -0,0 +1,70 @@
#!/bin/bash
ICONS=~/.local/share/dunst
if [[ ! -x $(which pulsemixer) ]]; then
echo -e "\e[1;31merror\e[m: pulsemixer is not installed."
exit 1
fi
notify() {
get_icon
if [[ $is_mute == 1 ]]; then
dunstify -a Volume -i $icon -u low "Volume mute!"
else
dunstify -a Volume -i $icon -u low -h int:value:$curr_volume "currtent volume: ${curr_volume}%"
fi
}
get_volume() {
echo $(pulsemixer --get-volume | cut -d' ' -f1)
}
get_icon() {
curr_volume=$(get_volume)
is_mute=$(pulsemixer --get-mute)
if [[ $is_mute == 1 || "$curr_volume" -eq "0" ]]; then
icon="${ICONS}/volume-mute.png"
curr_volume=0
elif [[ "$curr_volume" -le "35" ]]; then
icon="${ICONS}/volume-low.png"
elif [[ "$curr_volume" -le "70" ]]; then
icon="${ICONS}/volume-mid.png"
else
icon="${ICONS}/volume-high.png"
fi
}
volume_up() {
[[ $(pulsemixer --get-mute) == 1 ]] && pulsemixer --unmute
pulsemixer --max-volume 100 --change-volume +5
notify
}
volume_down() {
[[ $(pulsemixer --get-mute) == 1 ]] && pulsemixer --unmute
pulsemixer --max-volume 100 --change-volume -5
notify
}
toggle_mute() {
pulsemixer --toggle-mute
notify
}
case "$1" in
"up")
volume_up
;;
"down")
volume_down
;;
"mute")
toggle_mute
;;
*)
get_volume
esac

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB