-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsxhkdrc
executable file
·622 lines (488 loc) · 18.9 KB
/
sxhkdrc
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
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
# Keys are listed with an ordered preference of:
# 1. mod3 (hyper)
# 2. super
# 3. ctrl
# 4. alt
# 5. shift
# ╭──────────────────────────────────────────────────────────╮
# │ Keys │
# ╰──────────────────────────────────────────────────────────╯ [[[
# xte "keyup h" "key Left"
## Autokey does this much better
# Modify keys with mod3 to mimic arrow keys
# mod3 + h
# xdotool keyup h key --clearmodifiers Left
# mod3 + j
# xdotool keyup j key --clearmodifiers Down
#
# mod3 + k
# xdotool keyup k key --clearmodifiers Up
#
# mod3 + l
# xdotool keyup l key --clearmodifiers Right
# Help: sxhkd keybindings
super + shift + question
sxhkhmenu
# ]]]
# ╭──────────────────────────────────────────────────────────╮
# │ Restart │
# ╰──────────────────────────────────────────────────────────╯ [[[
# Quit: bspwm
super + shift + escape
prompt "Are you sure you would like to quit this Xsession" "bspc quit"
# Restart: bspwm
super + alt + shift + r
notify-send "bpswm" "Configuration reloaded" && bspc wm -r
# Restart: sxhkd
super + shift + x
killandnotify sxhkd "Config reloaded" && sxhkd &
# Restart: polybar
super + shift + p
reloadpolybar
# Restart: dunst
super + shift + d
killandnotify dunst "Dunst reloaded" && dunst &
# Happens when using `bustd`
# Restart: crashed items
super + shift + c
notify-send "Crashed" "Items were reloaded" && restart-crashed
# ]]]
# ╭──────────────────────────────────────────────────────────╮
# │ Screen │
# ╰──────────────────────────────────────────────────────────╯ [[[
# Screen: lock
super + Delete
xidlehook-client --socket /tmp/xidlehook.sock control --action trigger --timer 1
# ]]]
# ╭──────────────────────────────────────────────────────────╮
# │ Window │
# ╰──────────────────────────────────────────────────────────╯ [[[
# NODE_SEL :=
#
# [NODE_SEL#]
# (DIR|CYCLE_DIR|PATH|any|first_ancestor|last|newest|
# older|newer|focused|pointed|biggest|smallest|
# <node_id>
# )[.[!]focused][.[!]active][.[!]automatic][.[!]local]
# [.[!]leaf][.[!]window][.[!]STATE][.[!]FLAG][.[!]LAYER][.[!]SPLIT_TYPE]
# [.[!]same_class][.[!]descendant_of][.[!]ancestor_of]
#
# STATE := tiled | pseudo_tiled | floating | fullscreen
# FLAG := hidden | sticky | private | locked | marked | urgent
# LAYER := below | normal | above
# SPLIT_TYPE := horizontal | vertical
# PATH := @[DESKTOP_SEL:][[/]JUMP](/JUMP)*
# JUMP := first | 1 | second | 2 | brother | parent | DIR
# DIR := north | west | south | east
# CYCLE_DIR := next | prev
# ╭───────────────────────╮
# │ (Pseudo) Tiled Window │
# ╰───────────────────────╯ [[[
# State: toggle (tiled|pseudo_tiled)
mod3 + t
bspc node -t tiled || bspc node -t pseudo_tiled
# (floating|fullscreen|monocle)
# State: all windows to tile
super + ctrl + t
bspcp tile
# bspc desktop --layout tiled || bspcp tile
# Focus: cycle {next,prev} (tiled)
super + {_,shift + }t
bspc node -f '{next,prev}.local.!hidden.!floating.!fullscreen.window'
# bspc node -f 'focused.!floating.!fullscreen.window#{next,prev}.local.!hidden.!floating.!fullscreen.window' \
# || bspc node -f 'last.local.!focused.!hidden.!floating.!fullscreen.window' \
# || bspc node -f 'any.local.!focused.!hidden.!floating.!fullscreen.window'
# Focus: in direction {left,down,up,right} (tiled)
alt + {h,j,k,l}
bspc node -f {west,south,north,east}
# Rotate: cycle tree {90,-90}
mod3 + {_,shift +} r
bspc node @/ --rotate {90,-90}
# Circulate: tree {backward,forward}
super + {_,shift +} r
bspc node @/ --circulate {backward,forward}
# Circulate: tree {backward,forward}
super + shift + {comma,period}
bspc node @/ --circulate {backward,forward}
# Swap: flip leaves of tree {vertical,horizontal}ly
alt + shift + {comma,period}
bspc node @/ --flip {vertical,horizontal}
# (tiled)
# Swap: in direction {left,down,up,right}
alt + shift + {h,j,k,l}
bspc node -s {west,south,north,east}
# bspwm-smart-move {west,south,north,east}
# Swap: size {biggest,smallest} node
alt + shift + {b,s}
bspc node -s '{biggest,smallest}.!focused.!hidden.local.window'
# Transplant: in direction {left,down,up,right} (tiled)
ctrl + alt + shift + {h,j,k,l}
bspc node -n {west,south,north,east}
# Transplant: size {biggest,smallest} node
ctrl + alt + shift + {b,s}
bspc node -n '{biggest,smallest}.!focused.!hidden.local.window'
# Resize: {equalize,balance} ratios
super + ctrl + {_,shift + }0
bspc node @/ -{E,B}
# bspc node {@/,_} --equalize
# bspc node {@/,_} --balance
# Resize: {left,down,up,right} by 50 (float: sides in)
# super + ctrl + {h,j,k,l}
# bspwm-resize {west,south,north,east} 50
# Resize: {left,down,up,right} by 20 (float: sides in)
ctrl + alt + {h,j,k,l}
bspwm-resize {west,south,north,east} 20
# Resize: {left,down,up,right} by 10 (float: sides out)
super + ctrl + alt + {h,j,k,l}
n=10; \
{ d1=left; d2=right; dx=-$n; dy=0; \
, d1=bottom; d2=top; dx=0; dy=$n; \
, d1=top; d2=bottom; dx=0; dy=-$n; \
, d1=right; d2=left; dx=$n; dy=0; \
} \
bspc node --resize $d1 $dx $dy || bspc node --resize $d2 $dx $dy
# Gaps: dynamically {-,+}
mod3 + shift + bracket{left,right}
bspc config -d focused window_gap "$(($(bspc config -d focused window_gap) {-,+} 5 ))"
# ]]]
# ╭────────────────╮
# │ Monocle Window │
# ╰────────────────╯ [[[
# State: toggle (monocle|tiled)
mod3 + m
bspc desktop -l next
# Rotate: cycle {left,down,up,right} (monocle)
super + alt + {Left,Down,Up,Right}
m='.local'; \
bspwm-monocle {west$m next$m,south$m prev$m,north$m next$m,east$m prev$m}
# Layer: alternate stacking layer (below|above) (doesn't switch focus)
super + shift + j
bspc node -l below || bspc node -l above
# Layer: alternate stacking layer (above ? normal : below) (doesn't switch focus)
super + shift + h
bspc node -l "$(bspc query -T -n | jq -r 'if .client.layer == "above" then "normal" else "below" end')"
# Layer: alternate stacking layer (below ? normal : above) (doesn't switch focus)
super + shift + l
bspc node -l "$(bspc query -T -n | jq -r 'if .client.layer == "below" then "normal" else "above" end')"
# Layer: focus any (above|below) layer to the front
super + shift + k
bspc node any.below -l normal -f || bspc node any.above -l normal -f
# ]]]
# ╭───────────────────╮
# │ Fullscreen Window │
# ╰───────────────────╯ [[[
# State: toggle (tiled|fullscreen)
mod3 + f
bspc node -t tiled || bspc node -t fullscreen
# Rotate: cycle {prev,next} (fullscreen)
mod3 + bracket{left,right}
bspc node -f '{prev,next}.!focused.window' && bspc node focused -t fullscreen
# This wont' focus the fullscreen
# bspc node -f '{prev,next}.!focused.window' -t fullscreen
# ]]]
# ╭─────────────────╮
# │ Floating Window │
# ╰─────────────────╯ [[[
# State: toggle (floating|tiled)
mod3 + space
bspc node focused.tiled -t floating || bspc node focused.floating -t tiled
# Focus: cycle {next,prev} (floating)
super + {_,shift + }f
bspc node -f '{next,prev}.local.!hidden.floating.window'
# bspc node -f 'focused.floating#{next,prev}.local.!hidden.floating' \
# || bspc node -f 'last.local.!focused.!hidden.floating' \
# || bspc node -f 'any.local.!focused.!hidden.floating'
# (Alternative: Ctrl + Right Mouse | mod3 + c : {h,j,k,l})
# Move: {left,down,up,right} arrow key (floating)
ctrl + alt + {Left,Down,Up,Right}
bspc node -v {-20 0,0 20,0 -20,20 0}
# ]]]
# ╭────────────╮
# │ Any Window │
# ╰────────────╯ [[[
# State: toggle last state
mod3 + a
bspc node -t "$(bspc query -T -n | jq -r '.client.lastState')"
# TODO: Add fullscreen
# Keeps those layouts
# Focus: cycle {next,prev} (tiled|floating|monocle)
super + {j,k}
bspc node -f '{next,prev}.local.!hidden.window'
# bspc node -f '{next,prev}.local.window'
# [[ $(bspc query -T -n last | jq -r '.client.lastState') == 'fullscreen' ]] && bspc node focused -t fullscreen
# bspc node -f 'focused.window#{next,prev}.local.!hidden.window' \
# || bspc node -f 'last.local.!focused.!hidden.window' \
# || bspc node -f 'any.local.!focused.!hidden.window';
# Keeps tiled|floating|monocle layout
# Focus: cycle {next,prev} (tiled|floating|monocle|hidden)
super + alt + {j,k}
bspc node -f {next,prev}.local.window
# Focus: {older,newer} node history
super + {o,i}
bspc wm -h off; \
bspc node -f {older,newer}; \
bspc wm -h on
# Focus: last window (tiled|floating|monocle)
super + comma
bspc node -f 'last.local.!hidden.window'
# Focus: {parent,first child}
# super + {less,greater}
# bspc node -f @{parent,first}
# Kind of confusing
# Focus: {parent,brother,first child,second child}
super + ctrl + {n,m,comma,period}
bspc node -f @{parent,brother,first,second}
# Action: {close,kill} window
alt + shift + {_,ctrl + }x
bspc node -{c,k}
# Action: {close,kill} window
# super + alt + {_,ctrl + }x
# bspc node -{c,k}
# (equivalent to minimizing)
# Action: (open|close) window with menu
super + m
whid dmenu
# (equivalent to minimizing)
# Action: close window
super + shift + m
whid hide
# Action: reopen last closed window
super + ctrl + m
whid last
# Flag: set hidden=on
super + ctrl + u
bspc node -g hidden
# Flag: set hidden=off (any.hidden)
super + ctrl + shift + u
bspc node any.hidden -g hidden=off
# Flag: toggle {marked,locked,sticky,private}
super + ctrl + alt + {m,x,y,z}
bspwm-toggle-state {marked,locked,sticky,private}
# bspc node -g {marked,locked,sticky,private}
# bspc node -t {tiled,pseudo_tiled,floating,fullscreen}
# ]]]
# ╭──────────────╮
# │ Preselection │
# ╰──────────────╯ [[[
# Transplant: current with preselected area
super + ctrl + shift + y
bspc node -n last.!automatic.local
# Enters manual-tiling mode that splits the current node
# Preselect: {left,down,up,right} (cancel)
super + ctrl + shift + {h,j,k,l}
bspc node --presel-dir '~{west,south,north,east}'
# Preselect: cancel {current node,desktop}
super + ctrl + {_,shift +} c
{bspc node -p cancel,bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel}
# Preselect: auto detect direction (cancel)
super + ctrl + Return
bspwm-auto-presel
# Preselect: set splitting ratio {1-9}
super + ctrl + shift + {1-9}
bspc node -o 0.{1-9}
# ]]]
# ]]]
# ╭──────────────────────────────────────────────────────────╮
# │ Desktop │
# ╰──────────────────────────────────────────────────────────╯ [[[
# DESKTOP_SEL :=
#
# [DESKTOP_SEL#]
# (CYCLE_DIR|any|last|newest|older|newer|
# [MONITOR_SEL:](focused|^<n>)|
# <desktop_id>|<desktop_name>
# )[.[!]focused][.[!]active][.[!]occupied][.[!]urgent][.[!]local]
# Desktop: {focus,send to} ({1-9,0})
super + {_,alt + }{1-9,0}
bspc {desktop -f,node -d} '^{1-9,10}'
# Desktop: send and follow ({1-9,0})
super + ctrl + alt + {1-9,0}
bspc node -d '^{1-9,10}' --follow
# Desktop: focus {prev,next}
super + bracket{left,right}
bspc desktop -f {prev,next}.local
# Desktop: focus {prev,next}
super + {Left,Right}
bspc desktop -f {prev,next}.local
# Desktop: focus {prev,next} occupied
super + shift + bracket{left,right}
bspc desktop -f {prev.occupied,next.occupied}
# Desktop: focus {prev,next} occupied
# super + shift + {Left,Right}
# bspc desktop -f {prev.occupied,next.occupied}
# Desktop: transpose {without,with} following
super + {_, shift + }u
bspc desktop --swap next.active {_,--follow}
# ]]]
# ╭──────────────────────────────────────────────────────────╮
# │ Monitor │
# ╰──────────────────────────────────────────────────────────╯ [[[
# MONITOR_SEL :=
#
# [MONITOR_SEL#]
# (DIR|CYCLE_DIR|any|last|newest|older|newer|focused|pointed|primary|^<n>|
# <monitor_id>|<monitor_name>
# )[.[!]focused][.[!]occupied]
# ]]]
# Monitor: focus {prev,next} occupied
super + shift + {Left,Right}
bspc monitor -f {prev,next}
# ╭──────────────────────────────────────────────────────────╮
# │ Other │
# ╰──────────────────────────────────────────────────────────╯ [[[
# ╭─────────────╮
# │ Receptacles │
# ╰─────────────╯ [[[
# A leaf node that doesn’t hold any window.
# When a node is inserted on a receptacle in automatic mode, it will replace the receptacle.
# A receptacle can be inserted on a node, preselected and killed.
# mod3 + x ; n ; r
# bspc node -i
# ]]]
# ╭──────────────────╮
# │ Continuous Input │
# ╰──────────────────╯ [[[
# Resize: {left,down,up,right} by 50 (float: sides in)
mod3 + c : {h,j,k,l}
bspwm-resize {west,south,north,east} 50
# Gaps: dynamically {-,+} (continous)
mod3 + c : bracket{left,right}
bspc config -d focused window_gap "$(($(bspc config -d focused window_gap) {-,+} 5 ))"
# (Alternative: Ctrl + Right Mouse | ctrl + alt + {h,j,k,l})
# Move: {left,down,up,right} arrow key (floating)
mod3 + c : {Left,Down,Up,Right}
bspc node -v {-20 0,0 20,0 -20,20 0}
# ]]]
# ╭────────╮
# │ Launch │
# ╰────────╯ [[[
# Launch: alacritty
super + Return
alacritty
# Launch: tdrop
super + alt + Return
tdrop -ma -w 1916 -y 0 alacritty
# Launch: open URL in clipboard
super + ctrl + alt + o
handlr open "$(xsel -b)"
# Launch: rofi application launcher
mod3 + d
rofi -show drun
# Launch: rofi
# mod3 x ; {x,b}
# rofi -show {drun,window}
# Launch: {librewolf,brave,mullvad-browser,chromium,pcmanfm,thunderbird,signal}
mod3 + {b,v,o,g,p,period,s}
{librewolf,brave,mullvad-browser,chromium,pcmanfm,thunderbird,signal-desktop}
# Launch: prs rofi script
super + ctrl + alt + p
prs-copy
# # Launch: prs dmenu script
# super + ctrl + alt + p
# prs-dmenu
# Launch: greenclip history
ctrl + alt + y
rofi-greenclip
# Launch: color picker epick
super + alt + c
epick
# Launch: color picker xcolor
super + alt + v
xcolor -s clipboard
# Launch: ncmpcpp
super + F1
alacritty --class ncmpcpp -e 'ncmpcpp'
# $TERMINAL -e ncmpcpp
# amixer-notify "toggle"
# amixer-notify "set" "{5%-,5%+}"
# pulsevolctrl-notify "output-vol" "alsa_output.pci-0000_00_1f.3.hdmi-stereo" {+2%, -2%}
# pulsevolctrl-notify "output-mute" "alsa_output.pci-0000_00_1f.3.hdmi-stereo"
# Launch: mpd toggle {previous,stop,play/pause,next}
shift + XF86Audio{Prev,Play,Next}
playerctl -p "mpd" {previous,play-pause,next}
# Launch: [last] active player toggle {play/pause,previous,next}
XF86Audio{Prev,Play,Next}
playerctl {previous,play-pause,next}
# Launch: dunst {toggle,close} history
mod3 + {_,shift + }n
dunstctl {history-pop,close-all}
# Launch: dunst action
mod3 + a
dunstctl action
# Launch: fzf-bluetooth
super + F7
alacritty --class fzf-bluetooth -e 'fzf-bluetooth'
# $TERMINAL -e "fzf-bluetooth" &
# Launch: mailsync
super + F8
mailsync
# Launch: toggle caffeinate
super + F10
togglecaffeine
# Launch: remap keys
F11
remaps && dunstify "remaps" "remapped"
# Launch: neomutt
alt + F12
alacritty --class neomutt -e 'neomutt'
# $TERMINAL -e neomutt
# ]]]
# ╭───────────────╮
# │ Miscellaneous │
# ╰───────────────╯ [[[
# ╭────────╮
# │ Tabbed │
# ╰────────╯ [[[
# Add to tabbed container
# ctrl + alt + {Left,Down,Up,Right}
# tabc attach $(bspc query -N -n) {$(bspc query -N -n west),$(bspc query -N -n south),$(bspc query -N -n north),$(bspc query -N -n east)}
# Create/remove from tabbed container
# super + z
# id=$(bspc query -N -n); \
# [[ "$(tabc printclass $id)" == "tabbed" ]] \
# && tabc detach $id \
# || tabc create $id
# Toggle autoattach in tabbed container
# super + shift + z
# tabc autoattach $(bspc query -N -n)
# ]]]
# Volume: computer speaker {toggle,-5%,+5%}
XF86Audio{Mute,LowerVolume,RaiseVolume}
volume-notify '' {toggle,-5%,+5%}
# Volume: bluetooth speaker {toggle,-5%,+5%}
shift + XF86Audio{Mute,LowerVolume,RaiseVolume}
volume-notify 'bluetooth' {toggle,-5%,+5%}
# Scrot:
# Print
# scrot -u -z '%Y-%m-%d_%H:%M:%S_$wx$h$n.png' -e 'mv $f ~/Pictures'
# Screenshot: flameshot capture entire screen
Print
flameshot full -p ~/Pictures/screenshot
# Screenshot: flameshot GUI
Print + shift
flameshot gui
# Screenshot: flameshot capture single screen
Print + super
flameshot screen -p ~/Pictures/screenshot
# Screenshot: maimpick
Print + ctrl
maimpick
# Screenshot: entire screen
ctrl + shift + 3
prtscr
# Screenshot: selected region
ctrl + shift + 4
prtregion --disk
# Screenshot: focused window
ctrl + shift + 5
prtwindow
# Screenshot: focused window
super + ctrl + alt + u
prtwindow
# ]]]
# ]]]
# NOTE: the presence of the tilde ~.
# If current state matches the given state, then the argument is interpreted as the last state
# mod4 + {shift + space,space,f}
# bspc node -t ~{tiled,floating,fullscreen}
# vim: ft=sxhkdrc:et:sw=0:ts=2:sts=2:fdm=marker:fmr=[[[,]]]: