aboutsummaryrefslogtreecommitdiff
path: root/.config/sxhkd/sxhkdrc
blob: 4924bc59705d6b910a9a980980654da1640b04be (plain)
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
#              __      __          __
#             /\ \    /\ \        /\ \
#  ____  __  _\ \ \___\ \ \/'\    \_\ \
# /',__\/\ \/'\\ \  _ `\ \ , <    /'_` \
#/\__, `\/>  </ \ \ \ \ \ \ \\`\ /\ \L\ \
#\/\____//\_/\_\ \ \_\ \_\ \_\ \_\ \___,_\
# \/___/ \//\/_/  \/_/\/_/\/_/\/_/\/__,_ /
#

#---------------------------------------------------------------
#
# WM independent hotkeys
#

# Help
super + F1
  ~/.config/sxhkd/show_help.sh -m -3

# Application menu
super + a
	~/.config/polybar/scripts/menu.sh

# Shutdown menu
ctrl + alt + Delete
	~/.config/polybar/scripts/sysmenu.sh

# lockscreen
super + Escape
	betterlockscreen -l

# Program launcher
super + @space
	rofi -show drun

# Run launcher (commands)
super + r
	rofi -show run

# Task switcher
alt + Tab
	rofi -show window

# Turn off compositor
super + shift + p
	toggleprogram "picom" "--experimental-backends"

#picom-trans -c -10
#picom-trans -c +10

# Launch eww
#super + ctrl + a
#	~/.config/eww/launch_widgets.sh

# Terminal emulator
super + Return
	$TERMINAL

# Browser
super + w
	$BROWSER

# Show clipmenu
alt + x
    rofi -modi "clipboard:greenclip print" -show clipboard -run-command '{cmd}' \
        -location 1 \
        -m -3 \
        -no-show-icons \
        -theme-str '* \{ font: 10px; \}' \
        -theme-str 'listview \{ spacing: 0; \}' \
        -theme-str 'window \{ width: 20em; \}'

# Screenshots tool (selection)
ctrl + Print
	flameshot gui -p ~/pictures/screenshots

# Screenshots tool (screen)
shift + Print
	flameshot full -p ~/pictures/screenshots

# make sxhkd reload its configuration files:
super + ctrl + x
	pkill -USR1 -x sxhkd; dunstify "Sxhkd configuration reloaded"

#---------------------------------------------------------------
#
# bspwm hotkeys
#

# Quit/restart bspwm
super + alt + shift + {q,r}
	bspc {quit,wm -r}

# Close and kill
super + d
	bspc node -c

# Alternate between the tiled and monocle layout
super + m
	bspc desktop -l next
super + z
	bspc desktop -l next

# Send the newest marked node to the newest preselected node
super + y
	bspc node newest.marked.local -n newest.!automatic.local

# Swap the current node and the biggest window
super + g
	bspc node -s biggest.window


#---------------------------------------------------------------
#
# state/flags
#

# Set the window state
#super + {t,shift + t,s,f}
#	bspc node -t {tiled,pseudo_tiled,floating,fullscreen}

# Floating into monocle layout
super + shift + m
	bspc node -t pseudo_tiled; bspc node -t floating && wtp 10 40 1342 716 "$(pfw)"

# Set the window state
super + {t,shift + t,s}
	bspc node -t {tiled,pseudo_tiled,floating}; \
	xdo raise -N Plank; \
	xdo raise -N '*:*:Picture in picture'; \
  xdo raise -N "Picture-in-Picture"

# Toggle fullscreen
super + {f}
	bspc node -t \~fullscreen

# Toggle sticky
#super + q
#  bspc node -g sticky=on

# Set the node flags
super + ctrl + {m,x,y,z}
	bspc node -g {marked,locked,sticky,private}

# Move layers of windows above/below each other (script)
super + {equal,minus}
    layer.sh {+,-}

## Add a new desktop on the current monitor with name set by rofi
#super + plus
#    bspc monitor -a "$(rofi -dmenu)"
#
## Remove the current desktop
#super + underscore
#    bspc desktop -r


#---------------------------------------------------------------
#
# Focus/Swap
#

# Focus the node in the given direction
super + {_,shift + }{h,j,k,l}
	bspc node -{f,s} {west,south,north,east}

# Focus the node for the given path jump
#super + {p,b,comma,period}
#	bspc node -f @{parent,brother,first,second}

# Focus the next/previous window in the current desktop
super + {_,shift + }c
	bspc node -f {next,prev}.local.!hidden.window

# Focus the next/previous desktop in the current monitor
super + bracket{left,right}
	bspc desktop -f {prev,next}.local

# Focus the last node/desktop
super + {grave,Tab}
	bspc {node,desktop} -f last

# Focus the older or newer node in the focus history
#super + {o,i}
#	bspc wm -h off; \
#	bspc node {older,newer} -f; \
#	bspc wm -h on

# Focus or send to the given desktop
super + {_,shift + }{1-9,0}
	bspc {desktop -f,node -d} '^{1-9,10}'

# Hide window
super + comma
    bspc node -g hidden

# Unhide window (script)
super + period
    ${HOME}/.config/bspwm/bspcmd unhide


#---------------------------------------------------------------
#
# Preselect
#

# Preselect the direction
super + ctrl + {h,j,k,l}
	bspc node -p {west,south,north,east}

# Preselect the ratio
super + ctrl + {1-9}
	bspc node -o 0.{1-9}

# Cancel the preselection for the focused node
super + ctrl + space
	bspc node -p cancel

# Cancel the preselection for the focused desktop
super + ctrl + shift + space
	bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel

# Close all receptacle
super + shift + i
   for win in `bspc query -N -n .leaf.\!window`; do bspc node $win -k ; done;

# Insert receptacle
super + i; {h,j,k,l}
   bspc node --presel-dir {west,south,north,east} -i

# Move to rectacle
super + ctrl + i
   bspreceptacle

# Balance nodes
super + alt + i
   bspc node @/ -B

#---------------------------------------------------------------
#
# Move/resize
#

# Move a floating window or swap with any other adjacent tiled/pseudo_tiled window
ctrl + alt + {h,j,k,l}
    { dir=west  dx=-20 dy=0 \
    , dir=south dx=0   dy=20 \
    , dir=north dx=0   dy=-20 \
    , dir=east  dx=20  dy=0 \
    }; \
    bspc node --move "$dx" "$dy" || bspc node --swap $dir

# Move a tiled window to any direction
super + shift + {h,j,k,l}
	/path/to/bspwm_smart_move {west,south,north,east}

# Rotate windows to different nodes
super + ctrl + r
  bspc node @parent -R 90

# Resize tiled/floating windows (script)
shift + alt + {h,j,k,l}
	bspwm_resize.sh {west,south,north,east}

# Resize window into predefined pseudo_tiled window
super + shift + s
	bspc node -t pseudo_tiled; bspc node -t floating && wtp 340 40 680 700 "$(pfw)"

# Spawn next window/program into predefined floating window
ctrl + alt + 1
	bspc rule -a '*' -o state=floating rectangle=680x700+340+40

# Spawn next window/program into predefined smaller Heads-Up-Display like floating window
ctrl + alt + 2
	bspc rule -a '*' -o state=floating rectangle=320x140+1030+32

# Spawn next window/program into another desktop
super + alt + {1-9,0}
  bspc rule -a '*' -o desktop=^{1-9,10}


#---------------------------------------------------------------
#
#	Multimedia
#
# Multimedia control
{XF86AudioStop,XF86AudioPlay,XF86AudioPrev,XF86AudioNext}
	playerctl {stop,play-pause,previous,next}

# Use arrow keys as multimedia keys
alt + shift + {Left,Up,Right}
	playerctl {previous,play-pause,next}

# Brightness control
XF86MonBrightness{Up,Down}
	brightnessctl s 5%{+,-}

# Use arrow keys as brightness keys
alt + {Up,Down}
	brightnessctl s 5%{+,-}

# Volume control
XF86Audio{Raise,Lower}Volume
	pulsemixer --change-volume {+,-}10

# Use arrow keys as volume keys
alt + {Right,Left}
	pulsemixer --change-volume {+,-}10


#---------------------------------------------------------------
#
# Xdotool keys
#

# Move mouse cursor north, west, south, east
alt + {w,a,s,d}
  xdotool mousemove_relative --sync {-- 0 -24, -- -24 0, 0 24, 24 0}

# Move mouse cursor diagonally north-west, north-east, south-west, south-east
shift + alt + {q,e,a,d}
    xdotool mousemove_relative --sync {-- -24 -24, -- 24 -24, -- -24 24,-- 24 24}

# Emulate left mouse click
alt + i
    xdotool click --clearmodifiers 1

# Emulate left mouse click select
alt + shift + i
    xdotool mousedown 1 sleep 0.5 mousemove_relative --sync {-- -8 0, 0 8, -- 0 -8, 8 0} sleep 0.5 mouseup 1

# Emulate mouse right click
alt + o
    xdotool click --clearmodifiers 3

# Emulate mouse scroll up
alt + n
    xdotool click --clearmodifiers 4

# Emulate mouse scroll down
alt + m
    xdotool click --clearmodifiers 5

# Emulate mouse scroll button
alt + p
    xdotool click --clearmodifiers 2

# Emulate home key
alt + ctrl + Left
    xdotool keyup Left key --clearmodifiers Home

# Emulate end key
alt + ctrl + Right
    xdotool keyup Right key --clearmodifiers End

# Emulate delete key
~alt + BackSpace
    xte 'keyup Alt_L' 'key Delete' 'keydown Alt_L'


#---------------------------------------------------------------
#
# Programs
#

# Scratchpad
super + semicolon
	~/.local/bin/scripts/scratchpad

super + x
	~/.local/bin/scripts/scratchpad

# Heads-Up-Display scratchpad terminal
super + e
	~/.local/bin/scripts/Heads-Up-Display

# File manager nnn
super + shift + n
	$TERMINAL -e nnn

# File manager pcmanfm (GUI)
super + shift + f
	pcmanfm

# Bitwarden-rofi
super + shift + b
  rofi-rbw

# Thunderbird mail
#super + shift + m
#    thunderbird

# VirtualBox gui
super + v
  /usr/bin/VirtualBox  -- :0 vt1

# Discord
super + shift + d
    discord

# Spotify
super + shift + y
	spotify

# Book reader (zathura)
super + shift + z
	zathura

# Dictionary
super + ctrl + w
	goldendict

# Thesaurus
super + shift + w
	artha