2023-12-25 19:35:15 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
act=$1
|
2024-03-24 19:37:05 +00:00
|
|
|
timestamp=$(date)
|
2023-12-25 19:35:15 +00:00
|
|
|
|
2024-03-24 19:37:05 +00:00
|
|
|
echo "$0 - $timestamp - $act" >> ~/dwl_key_act.log
|
2023-12-25 19:35:15 +00:00
|
|
|
|
|
|
|
# In Wayland, use the following like X11's xev:
|
|
|
|
#
|
|
|
|
# % wev | grep "sym"
|
|
|
|
#
|
|
|
|
|
|
|
|
case $act in
|
2024-09-29 20:26:40 +00:00
|
|
|
# Without modifier
|
2023-12-25 19:35:15 +00:00
|
|
|
vol_mute) wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle;;
|
|
|
|
vol_lower) wpctl set-volume --limit 1.0 @DEFAULT_AUDIO_SINK@ 10%-;;
|
|
|
|
vol_raise) wpctl set-volume --limit 1.0 @DEFAULT_AUDIO_SINK@ 10%+;;
|
2024-09-19 01:46:07 +00:00
|
|
|
mic_mute) rofi -show sound -modes "sound:~/bin/rofi_sound.pl";;
|
|
|
|
bright_low) echo 20 >> /sys/class/backlight/intel_backlight/brightness;;
|
|
|
|
bright_high) echo 200 >> /sys/class/backlight/intel_backlight/brightness;;
|
|
|
|
media_toggle) mpc toggle;; # XF86AudioPlay
|
|
|
|
media_stop) mpc stop;; # XF86AudioStop
|
|
|
|
media_prev) mpc prev;; # XF86AudioPrev
|
|
|
|
media_next) mpc next;; # XF86AudioNext
|
2024-09-29 20:26:40 +00:00
|
|
|
disp) /home/mahesh/bin/switch_context.sh;;
|
2023-12-25 19:35:15 +00:00
|
|
|
# wlan) ;;
|
|
|
|
# tools) ;;
|
|
|
|
# search) ;;
|
2024-03-24 19:37:05 +00:00
|
|
|
launch) wldash;;
|
2023-12-25 19:35:15 +00:00
|
|
|
# explore) ;;
|
2024-09-29 20:26:40 +00:00
|
|
|
print) grim -c -g "$(slurp -o -r -c '#ff0000ff')" -t ppm - | satty --filename - --fullscreen --output-filename ~/Screenshots/satty-$(date '+%Y%m%d-%H:%M:%S').png ;;
|
|
|
|
|
|
|
|
# With CTRL modifier
|
|
|
|
# C_vol_mute) ;;
|
|
|
|
# C_vol_lower) ;;
|
|
|
|
# C_vol_raise) ;;
|
|
|
|
# C_mic_mute) ;;
|
|
|
|
# C_bright_low) ;;
|
|
|
|
# C_bright_high) ;;
|
|
|
|
# C_media_toggle) ;;
|
|
|
|
# C_media_stop) ;;
|
|
|
|
# C_media_prev) ;;
|
|
|
|
# C_media_next) ;;
|
|
|
|
# C_disp) ;;
|
|
|
|
# C_wlan) ;;
|
|
|
|
# C_tools) ;;
|
|
|
|
# C_search) ;;
|
|
|
|
# C_launch) ;;
|
|
|
|
# C_explore) ;;
|
|
|
|
C_print) grim -c -g "$(slurp -d -c '#0000ffff')" -t ppm - | satty --filename - --fullscreen --output-filename ~/Screenshots/satty-$(date '+%Y%m%d-%H:%M:%S').png ;;
|
|
|
|
|
|
|
|
# With SHIFT modifier
|
|
|
|
# S_vol_mute) ;;
|
|
|
|
# S_vol_lower) ;;
|
|
|
|
# S_vol_raise) ;;
|
|
|
|
# S_mic_mute) ;;
|
|
|
|
# S_bright_low) ;;
|
|
|
|
# S_bright_high) ;;
|
|
|
|
# S_media_toggle) ;;
|
|
|
|
# S_media_stop) ;;
|
|
|
|
# S_media_prev) ;;
|
|
|
|
# S_media_next) ;;
|
|
|
|
# S_disp) ;;
|
|
|
|
# S_wlan) ;;
|
|
|
|
# S_tools) ;;
|
|
|
|
# S_search) ;;
|
|
|
|
# S_launch) ;;
|
|
|
|
# S_explore) ;;
|
|
|
|
# S_print) ;;
|
|
|
|
|
|
|
|
# With SHIFT+CTRL modifiers
|
|
|
|
# SC_vol_mute) ;;
|
|
|
|
# SC_vol_lower) ;;
|
|
|
|
# SC_vol_raise) ;;
|
|
|
|
# SC_mic_mute) ;;
|
|
|
|
# SC_bright_low) ;;
|
|
|
|
# SC_bright_high) ;;
|
|
|
|
# SC_media_toggle) ;;
|
|
|
|
# SC_media_stop) ;;
|
|
|
|
# SC_media_prev) ;;
|
|
|
|
# SC_media_next) ;;
|
|
|
|
# SC_disp) ;;
|
|
|
|
# SC_wlan) ;;
|
|
|
|
# SC_tools) ;;
|
|
|
|
# SC_search) ;;
|
|
|
|
# SC_launch) ;;
|
|
|
|
|
2023-12-25 19:35:15 +00:00
|
|
|
*) echo "Unknown action '$act'";;
|
|
|
|
esac
|