summaryrefslogtreecommitdiff
path: root/desktop-x11/.config/sxhkd/sxhkdrc
blob: f993ab53d91c6dcd876cabf8e37b01f75c0dca19 (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
# make sxhkd reload its configuration files:
super + Escape
  dunstctl set-paused true ; i3lock -tfi ~/Dropbox/Images/wallpapers/stmichael.png ; dunstctl set-paused false

# make sxhkd reload its configuration files:
super + ctrl + Escape
  pkill -usr1 -x sxhkd; dunstify 'sxhkd' 'Reloaded config'

#
# Gaps
#
super + {_,shift + }equal
  bspc config -d focused window_gap $(($(bspc config -d focused window_gap) + {2,10}))

super + {_,shift + }minus
  bspc config -d focused window_gap $(($(bspc config -d focused window_gap) - {2,10}))

# Terminal
super + Return
  alacritty -e tmux

super + shift + Return
  alacritty

super + ctrl + Return
  alacritty --class Floating

super + e
  st -z 14
  # alacritty --class Floating --option 'font.size=24.0' --option 'window.dimensions={columns=100,lines=20}' --command vim ~/scratchpad

super + shift + e
  st -z 14 -e tmux

super + control + e
  st -c Floating -z 16

  # alacritty --class Floating --option 'font.size=24.0' --option 'window.dimensions={columns=100,lines=20}' --command vim --clean ~/scratchpad

# Settings
super + shift + s
  pavucontrol

# program launcher
super + @space
  rofi -show drun -window-thumbnail -window-format "\{w\}     \{t\}"

super + shift + @space
  rofi -show run -window-thumbnail -window-format "\{w\}     \{t\}"

super + ctrl + @space
  rofi -show window -window-thumbnail -window-format "\{w\}     \{t\}" -window-command "bspc node \{window\} -d newest -f"

super + i
  rofi -show filebrowser -theme dark-grid

super + ctrl + i
  rofi -filebrowser-directory $HOME/Pictures/Screenshots -show filebrowser -show filebrowser -theme dark-grid

super + p
  rofi-pass --last-used -lines 12

# Notifications

# Redisplay last message(s).
ctrl + grave
  dunstctl history-pop

# Close notification.
ctrl + shift + grave
  dunstctl close

# Close all notifications.
ctrl + shift + alt + grave
  dunstctl close-all

# Context menu.
ctrl + shift + period
  dunstctl context

# start a web browser
super + o
  /usr/bin/librewolf -P personal

super + ctrl + o
  /usr/bin/librewolf -P work

super + alt + o
  bspc rule -a '*:*' -o state=floating ; /usr/bin/librewolf -P personal

super + shift + p
  bspc rule -a '*:*' -o state=floating ; /usr/bin/librewolf --private-window

# super + alt + b
#   ~/.local/bin/rofi-buku2
  # rofi-buku -show

# start a file browser
super + n
  /usr/bin/nautilus

super + shift + n
  ~/.config/regolith/bin/open-dirs.sh

super + shift + i
  catfish ~/storage/Downloads/images --name Floating

# Audio Controls
{shift + XF86AudioLowerVolume, super + less}
  ~/.local/bin/volume-control down

{shift + XF86AudioRaiseVolume, super + greater}
  ~/.local/bin/volume-control up

XF86AudioLowerVolume
  ~/.local/bin/volume-control down-a-bit

XF86AudioRaiseVolume
  ~/.local/bin/volume-control up-a-bit

{XF86AudioMute, super + shift + m}
  ~/.local/bin/volume-control mute
  # ~/.local/bin/volume-control medium

super + shift + less
  ~/.local/bin/volume-control quiet

super + shift + greater
  ~/.local/bin/volume-control max

# Music Player Daemon controls
super + ctrl + p
  song-control toggle
  # dunstify --urgency normal --timeout 2000 --icon multimedia-player --hints=string:x-dunst-stack-tag:song "$(mpc toggle | head -n2)"

super + ctrl + less
  song-control prev
  # dunstify --urgency normal --timeout 2000 --icon multimedia-player --hints=string:x-dunst-stack-tag:song "$(mpc prev | head -n1)"

super + ctrl + greater
  song-control next
  # dunstify --urgency normal --timeout 2000 --icon multimedia-player --hints=string:x-dunst-stack-tag:song "$(mpc next | head -n1)"

# bspwm hotkeys
#

# quit/restart bspwm
super + shift + r
  [ $(printf "Yes\nNo" | rofi -dmenu -i -p "Restart BSPWM") = "Yes" ] && bspc wm -r

super + q
  rofi -show session-menu -modi "session-menu:/home/setanta/.local/bin/rofi-power-menu"
  # [ $(printf "Yes\nNo" | rofi -dmenu -i -p "Logout") = "Yes" ] && bspc quit

# close and kill
super + {_,shift + }w
  bspc node -{c,k}

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

super + alt + n
  bsp-layout next | head -n1 | xargs dunstify

super + alt + p
  bsp-layout previous | head -n1 | xargs dunstify

super + alt + t
  bsp-layout set tall | head -n1 | xargs dunstify

super + alt + shift + t
  bsp-layout set tiled | head -n1 | xargs dunstify

# 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}

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

#
# focus/swap
#

# focus the node in the given direction
super + {_,shift + }{h,j,k,l}
  bspc node -{f,s} {west,south,north,east}
super + {_,shift + }{Left,Down,Up,Right}
  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
super + comma
  bspc node -f prev.local.!hidden.window
super + period
  bspc node -f next.local.!hidden.window

# focus the next/previous desktop in the current monitor
super + {Prior,Next}
  bspc desktop -f {prev,next}.local.occupied

super + ctrl + {Prior,Next}
  bspc desktop -f {prev,next}.local

super + bracket{left,right}
  bspc desktop -f {prev,next}.local.occupied

super + ctrl + bracket{left,right}
  bspc desktop -f {prev,next}.local

# focus the last node/desktop
super + {Tab,grave}
  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}'

super + alt + {1-9,0}
  bspc node -d '^{1-9,10}' --follow

#
# preselect
#

# preselect the direction
super + ctrl + shift + {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
super + alt + space
  bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel

#
# move/resize
#

# move a floating window
super + ctrl + {Left,Down,Up,Right}
  bspc node -v {-20 0,0 20,0 -20,20 0}

super + ctrl + {h,j,k,l}
  bspc node -v {-20 0,0 20,0 -20,20 0}

# expand/contract a window
# super + control + shift + {h,j,k,l}
#   bspc node -z {left -20 0 || bspc node -z right -20 0, \
#                 bottom 0 20 || bspc node -z top 0 20,\
#                 top 0 -20 || bspc node -z bottom 0 -20,\
#                 right 20 0 || bspc node -z left 20 0}

super + control + shift + {Left,Down,Up,Right}
  bspc node -z {left -20 0 || bspc node -z right -20 0, \
                bottom 0 20 || bspc node -z top 0 20,\
                top 0 -20 || bspc node -z bottom 0 -20,\
                right 20 0 || bspc node -z left 20 0}

# expand a window by moving one of its side outward
super + alt + {h,j,k,l}
  bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0}

super + alt + {Left,Down,Up,Right}
  bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0}

# contract a window by moving one of its side inward
super + alt + shift + {h,j,k,l}
  bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0}

super + alt + shift + {Left,Down,Up,Right}
  bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0}

#
# Prayers
#
super + shift + o
  sxiv -bsf ~/Dropbox/Images/prayers/ -g 1700x1010

super + shift + z
  sxiv -bsf ~/Nextcloud/Images/imgs-ca-from-gdrive/Rosary-2/ -g 1430x1044

#
# Calendar & Clock
#

super + c
  ~/.local/bin/mycal

super + shift + c
  ~/.local/bin/mytime

#
# Screenshots
#

# Select area to capture
Print
  SCREENSHOT_FILE=$HOME/Pictures/Screenshots/Screenshot_$(date +%Y%b%d-%H%M%S).png ; \
  maim -s $SCREENSHOT_FILE && \
  xclip -selection clipboard -t image/png -i ~/Pictures/Screenshots/`ls -1 -t ~/Pictures/Screenshots | head -1` && \
  add_recent_file $SCREENSHOT_FILE && \
  if [ "$(dunstify 'Screenshot taken.' --action='show,Show Image' --action='dismiss,Dismiss' -I $SCREENSHOT_FILE)" = "show" ]; then sxiv $SCREENSHOT_FILE; fi;

# Capture the whole screen
shift + Print
  SCREENSHOT_FILE=$HOME/Pictures/Screenshots/Screenshot_$(date +%Y%b%d-%H%M%S).png ; \
  maim $SCREENSHOT_FILE && \
  xclip -selection clipboard -t image/png -i ~/Pictures/Screenshots/`ls -1 -t ~/Pictures/Screenshots | head -1` && \
  add_recent_file $SCREENSHOT_FILE && \
  if [ "$(dunstify 'Screenshot taken.' --action='show,Show Image' --action='dismiss,Dismiss' -I $SCREENSHOT_FILE)" = "show" ]; then sxiv $SCREENSHOT_FILE; fi;

# Capture focused window
alt + Print
  SCREENSHOT_FILE=$HOME/Pictures/Screenshots/Screenshot_$(date +%Y%b%d-%H%M%S).png ; \
  maim -i $(xdotool getactivewindow) $SCREENSHOT_FILE && \
  xclip -selection clipboard -t image/png -i ~/Pictures/Screenshots/`ls -1 -t ~/Pictures/Screenshots | head -1` && \
  add_recent_file $SCREENSHOT_FILE && \
  if [ "$(dunstify 'Screenshot taken.' --action='show,Show Image' --action='dismiss,Dismiss' -I $SCREENSHOT_FILE)" = "show" ]; then sxiv $SCREENSHOT_FILE; fi;

# vim:ft=bash