-
Notifications
You must be signed in to change notification settings - Fork 0
/
keybinds
executable file
·160 lines (144 loc) · 5.57 KB
/
keybinds
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
#!/bin/bash
[[ -e /tmp/keybindslockfile ]] && exit 1
touch -- /tmp/keybindslockfile
MOD=SUPER
function workspace() {
echo "$MOD${1:+" "}$1, $2, workspace, $3"
echo "$MOD SHIFT${1:+" "}$1, $2, movetoworkspace, $3"
}
IFS=$'\n'
# shellcheck disable=SC2207
keybinds=(
"$MOD CTRL, Space, exec, true | wl-copy" # Clear clipboard
"$MOD CTRL, C, exec, true | wl-copy" # Clear clipboard
"$MOD, A, exec, \$HOME/.bin/emojiclip rofi" # Emoji menu
"$MOD, B, exec, if pidof -sq waybar; then killall -SIGUSR1 waybar; else ~/.bin/rewaybar; fi" # Toggle waybar
"$MOD, C, exec, cliphist list | rofi -dmenu | cliphist decode | wl-copy" # Clipboard history
"$MOD, X, exec, \$HOME/.bin/ctp-rofi" # Rofi Catppuccin color picker, this code is a mess so I'm not including it here
"$MOD SHIFT, C, exec, true | wl-copy; cliphist wipe && notify-send 'cleared clipboard history' -a ''" # Clear clipboard history
"$MOD SHIFT, V, exec, ~/.bin/dictation" # Voice dictation, https://github.com/ideasman42/nerd-dictation, pain to setup so I'm not including it here
"$MOD, Z, exec, dunstctl history-pop" # Show last notification
"$MOD, L, exec, loginctl lock-session" # Lock screen
"$MOD SHIFT, I, exec, pkill -RTMIN -x wvkbd-mobintl" # Toggle software keyboard
"$MOD, K, exec, ~/.bin/start-keepassxc" # Password manager
"CTRL ALT SUPER, Delete, exec, \$HOME/.bin/power" # Power menu
"$MOD, R, exec, rofi -show drun" # Application menu
"$MOD SHIFT, R, exec, rofi -show run"
"$MOD, N, exec, nemo" # File manager
"$MOD, T, exec, kitty" # Terminal emulator
"$MOD, Y, exec, firefox" # Browser
"$MOD SHIFT, Y, exec, ~/.bin/open-qutebrowser" # Browser 2: Electric Boogaloo
# Backlight control
"l:, XF86MonBrightnessUp, exec, swayosd-client --brightness raise"
"l:, XF86MonBrightnessDown, exec, swayosd-client --brightness lower"
# Volume control
"l:, XF86AudioRaiseVolume, exec, swayosd-client --output-volume +5"
"l:, XF86AudioLowerVolume, exec, swayosd-client --output-volume -5"
"l:, XF86AudioMute, exec, swayosd-client --output-volume mute-toggle"
"l:, XF86AudioMicMute, exec, swayosd-client --input-volume mute-toggle"
"l:$MOD, KP_Up, exec, swayosd-client --output-volume +5"
"l:$MOD, KP_Begin, exec, swayosd-client --output-volume mute-toggle"
"l:$MOD, KP_Down, exec, swayosd-client --output-volume -5"
# Song control
"l:, XF86AudioPlay, exec, mpc toggle"
"l:, XF86AudioStop, exec, mpc stop"
"l:, XF86AudioPrev, exec, mpc prev"
"l:, XF86AudioNext, exec, mpc next"
# Screenshot
", Print, exec, ~/.bin/screenshot area"
"CTRL, Print, exec, ~/.bin/screenshot active"
"ALT, Print, exec, ~/.bin/screenshot color"
"SHIFT, Print, exec, ~/.bin/screenshot monitor"
"CTRL SHIFT, Print, exec, ~/.bin/screenshot desktop"
":SUPER, Print, exec, notify-send -- $'\n-: selection\nCTRL: active window\nALT: color\nSHIFT: monitor\nCTRL SHIFT: all monitors'"
# Screenshot preview, scan QR code, or scan text with OCR
"$MOD, P, exec, ~/.bin/screenshot-preview"
"$MOD CTRL, P, exec, ~/.bin/screenshot-qr"
"$MOD SHIFT, P, exec, ~/.bin/screenshot-ocr"
# Calender
"$MOD, M, exec, orage"
# Image editor
"$MOD, G, exec, gimp"
# Toggle floating window
"$MOD, V, togglefloating"
# Make window fullscreen
"$MOD, F, fullscreenstate, 3 3"
"$MOD SHIFT, F, fullscreenstate, 3 -1" # Toggle actual fullscreen (window doesn't realise)
"$MOD CTRL, F, fullscreenstate, -1 3" # Toggle fake fullscreen (window realises, but doesn't actually)
"$MOD CTRL SHIFT, F, fullscreenstate, 3 3" # Toggle both
# Workspaces
$(workspace "" "1" "1")
$(workspace "" "2" "2")
$(workspace "" "3" "3")
$(workspace "" "4" "4")
$(workspace "" "5" "5")
$(workspace "" "6" "6")
$(workspace "" "0" "10")
$(workspace "" "Q" "10")
$(workspace "" "minus" "11")
$(workspace "" "W" "11")
$(workspace "" "equal" "12")
$(workspace "" "E" "12")
$(workspace "" "7" "7")
$(workspace "CTRL" "Q" "7")
$(workspace "" "8" "8")
$(workspace "CTRL" "W" "8")
$(workspace "" "9" "9")
$(workspace "CTRL" "E" "9")
$(workspace "" "grave" "9")
$(workspace "CTRL" "1" "13")
$(workspace "CTRL" "2" "14")
$(workspace "CTRL" "3" "15")
$(workspace "CTRL" "4" "16")
$(workspace "CTRL" "5" "17")
$(workspace "CTRL" "6" "18")
$(workspace "CTRL" "7" "19")
$(workspace "CTRL" "8" "20")
$(workspace "CTRL" "9" "21")
$(workspace "CTRL" "0" "22")
$(workspace "CTRL" "minus" "23")
$(workspace "CTRL" "equal" "24")
"$MOD, Tab, workspace, +1"
"$MOD SHIFT, Tab, workspace, -1"
"$MOD CTRL, Tab, movetoworkspace, +1"
"$MOD CTRL SHIFT, Tab, movetoworkspace, -1"
"ALT, Tab, cyclenext"
"ALT SHIFT, Tab, cyclenext, prev"
"$MOD, left, movefocus, l"
"$MOD, right, movefocus, r"
"$MOD, up, movefocus, u"
"$MOD, down, movefocus, d"
"$MOD SHIFT, left, movewindow, l"
"$MOD SHIFT, right, movewindow, r"
"$MOD SHIFT, up, movewindow, u"
"$MOD SHIFT, down, movewindow, d"
)
if [[ "$1" == "off" ]]; then
hyprctl keyword unbind "$MOD, Escape"
hyprctl keyword bind "$MOD, Escape, exec, ~/.bin/keybinds on"
hyprctl keyword general:col.active_border 0xfff38ba8
fi
if [[ "$1" == "off" ]] || [[ "$1" == "on" ]]; then
for keybind in "${keybinds[@]}"; do
hyprctl keyword unbind "$(cut -d, -f1,2 <<<"$keybind")"
done
else
echo "Usage: keybinds <on|off>"
rm -- /tmp/keybindslockfile
exit 1
fi
if [[ "$1" == "on" ]]; then
hyprctl keyword unbind "$MOD, Escape"
hyprctl keyword bind "$MOD, Escape, exec, ~/.bin/keybinds off"
hyprctl keyword general:col.active_border 0xfff5c2e7
for keybind in "${keybinds[@]}"; do
opts=""
if [[ "$keybind" == *":"* ]]; then
opts="$(cut -f1 -d":" <<< "$keybind")"
keybind="$(cut -f2- -d":" <<< "$keybind")"
fi
hyprctl keyword "bind$opts" "$keybind"
done
fi
rm -- /tmp/keybindslockfile
exit 0