diff --git a/home/config/sxhkd/sxhkdrc b/home/config/sxhkd/sxhkdrc index 5041591..b4f219a 100644 --- a/home/config/sxhkd/sxhkdrc +++ b/home/config/sxhkd/sxhkdrc @@ -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 -------------------- diff --git a/home/local/bin/scripts/volume.sh b/home/local/bin/scripts/volume.sh new file mode 100755 index 0000000..7fd2e0a --- /dev/null +++ b/home/local/bin/scripts/volume.sh @@ -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 \ No newline at end of file diff --git a/home/local/share/dunst/bluetooth.png b/home/local/share/dunst/bluetooth.png new file mode 100644 index 0000000..8ff4bbd Binary files /dev/null and b/home/local/share/dunst/bluetooth.png differ diff --git a/home/local/share/dunst/brightness-100.png b/home/local/share/dunst/brightness-100.png new file mode 100644 index 0000000..957d471 Binary files /dev/null and b/home/local/share/dunst/brightness-100.png differ diff --git a/home/local/share/dunst/brightness-20.png b/home/local/share/dunst/brightness-20.png new file mode 100644 index 0000000..ff22531 Binary files /dev/null and b/home/local/share/dunst/brightness-20.png differ diff --git a/home/local/share/dunst/brightness-40.png b/home/local/share/dunst/brightness-40.png new file mode 100644 index 0000000..0466ccc Binary files /dev/null and b/home/local/share/dunst/brightness-40.png differ diff --git a/home/local/share/dunst/brightness-60.png b/home/local/share/dunst/brightness-60.png new file mode 100644 index 0000000..1553dc0 Binary files /dev/null and b/home/local/share/dunst/brightness-60.png differ diff --git a/home/local/share/dunst/brightness-80.png b/home/local/share/dunst/brightness-80.png new file mode 100644 index 0000000..41962c9 Binary files /dev/null and b/home/local/share/dunst/brightness-80.png differ diff --git a/home/local/share/dunst/clock.png b/home/local/share/dunst/clock.png new file mode 100644 index 0000000..1ae2be7 Binary files /dev/null and b/home/local/share/dunst/clock.png differ diff --git a/home/local/share/dunst/desktop.png b/home/local/share/dunst/desktop.png new file mode 100644 index 0000000..a6d1209 Binary files /dev/null and b/home/local/share/dunst/desktop.png differ diff --git a/home/local/share/dunst/dropper.png b/home/local/share/dunst/dropper.png new file mode 100644 index 0000000..3153c5d Binary files /dev/null and b/home/local/share/dunst/dropper.png differ diff --git a/home/local/share/dunst/hourglass.png b/home/local/share/dunst/hourglass.png new file mode 100644 index 0000000..bf10262 Binary files /dev/null and b/home/local/share/dunst/hourglass.png differ diff --git a/home/local/share/dunst/leaf.png b/home/local/share/dunst/leaf.png new file mode 100644 index 0000000..bc0374c Binary files /dev/null and b/home/local/share/dunst/leaf.png differ diff --git a/home/local/share/dunst/mails.png b/home/local/share/dunst/mails.png new file mode 100644 index 0000000..eb63de1 Binary files /dev/null and b/home/local/share/dunst/mails.png differ diff --git a/home/local/share/dunst/microphone-mute.png b/home/local/share/dunst/microphone-mute.png new file mode 100644 index 0000000..c1e729a Binary files /dev/null and b/home/local/share/dunst/microphone-mute.png differ diff --git a/home/local/share/dunst/microphone.png b/home/local/share/dunst/microphone.png new file mode 100644 index 0000000..dfed697 Binary files /dev/null and b/home/local/share/dunst/microphone.png differ diff --git a/home/local/share/dunst/music.png b/home/local/share/dunst/music.png new file mode 100644 index 0000000..96276b3 Binary files /dev/null and b/home/local/share/dunst/music.png differ diff --git a/home/local/share/dunst/palette.png b/home/local/share/dunst/palette.png new file mode 100644 index 0000000..182de33 Binary files /dev/null and b/home/local/share/dunst/palette.png differ diff --git a/home/local/share/dunst/picture.png b/home/local/share/dunst/picture.png new file mode 100644 index 0000000..cdfa3f3 Binary files /dev/null and b/home/local/share/dunst/picture.png differ diff --git a/home/local/share/dunst/playlist.png b/home/local/share/dunst/playlist.png new file mode 100644 index 0000000..dfac4e9 Binary files /dev/null and b/home/local/share/dunst/playlist.png differ diff --git a/home/local/share/dunst/search.png b/home/local/share/dunst/search.png new file mode 100644 index 0000000..91ad13b Binary files /dev/null and b/home/local/share/dunst/search.png differ diff --git a/home/local/share/dunst/themes.png b/home/local/share/dunst/themes.png new file mode 100644 index 0000000..6bfb7e5 Binary files /dev/null and b/home/local/share/dunst/themes.png differ diff --git a/home/local/share/dunst/timer.png b/home/local/share/dunst/timer.png new file mode 100644 index 0000000..ee4522a Binary files /dev/null and b/home/local/share/dunst/timer.png differ diff --git a/home/local/share/dunst/updates.png b/home/local/share/dunst/updates.png new file mode 100644 index 0000000..17efe70 Binary files /dev/null and b/home/local/share/dunst/updates.png differ diff --git a/home/local/share/dunst/video.png b/home/local/share/dunst/video.png new file mode 100644 index 0000000..bde8353 Binary files /dev/null and b/home/local/share/dunst/video.png differ diff --git a/home/local/share/dunst/volume-high.png b/home/local/share/dunst/volume-high.png new file mode 100644 index 0000000..7f77bba Binary files /dev/null and b/home/local/share/dunst/volume-high.png differ diff --git a/home/local/share/dunst/volume-low.png b/home/local/share/dunst/volume-low.png new file mode 100644 index 0000000..fcc6267 Binary files /dev/null and b/home/local/share/dunst/volume-low.png differ diff --git a/home/local/share/dunst/volume-mid.png b/home/local/share/dunst/volume-mid.png new file mode 100644 index 0000000..ed2ee93 Binary files /dev/null and b/home/local/share/dunst/volume-mid.png differ diff --git a/home/local/share/dunst/volume-mute.png b/home/local/share/dunst/volume-mute.png new file mode 100644 index 0000000..647547d Binary files /dev/null and b/home/local/share/dunst/volume-mute.png differ diff --git a/home/local/share/dunst/wifi.png b/home/local/share/dunst/wifi.png new file mode 100644 index 0000000..8890407 Binary files /dev/null and b/home/local/share/dunst/wifi.png differ