summaryrefslogtreecommitdiff
path: root/.config/sxhkd/sxhkdrc
blob: af7473c83aa97bdf2debf979ab278b9b4632010c (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
#
# General keybindings.
#

# Basic.
super + Return
	$TERMINAL
# Read after releasing 'd' because as soon
# as dmenu runs it listens for kb presses.
super + @d
	dmenu_run -fn "Noto Sans Mono:size=12" -nb "$(xresource background)" -nf "$(xresource foreground)" -sb "$(xresource color4)" -sf "$(xresource color0)"
super + Escape
	pkill -USR1 -x sxhkd
# Inside polybar_panel, it actually kills it and then starts it again.
super + shift + Escape
	polybar_panel
# Change keyboard layout.
super + space
	setxkbmap -option grp:win_space_toggle latam,us

# Run programs.
super + shift + w
	$BROWSER
super + shift + f
	$TERMINAL -e $FILE
super + Delete
	$TERMINAL -e htop

# Screenshots.
{_,super + , super + shift + } Print
	$SSMGR {gui,full -c,full -p $SSPATH}

#
# bspwm keybindings.
#

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

# Close and kill.
super + {shift + alt + ,shift + }q
	bspc node -{k,c}

# Alternate between the tiled and monocle layout.
super + m
	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}

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

# 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 + brace{left,right}
	bspc desktop -f {prev,next}.local

# Focus the last node/desktop.
super + {_,shift + } 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}'

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

#
# Move/resize.
#

# Smart resize, will grow or shrink depending on location.
# Will always grow for floating nodes.
super + 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

# Move a floating window.
super + {Left,Down,Up,Right}
	n=10; \
	bspc node -v {-$n 0,0 $n,0 -$n,$n 0}

#
# Extra XF86 keys.
#
{_,shift + } XF86AudioRaiseVolume
	pactl set-sink-volume @DEFAULT_SINK@ +{2,10}%

{_,shift + } XF86AudioLowerVolume
	pactl set-sink-volume @DEFAULT_SINK@ -{2,10}%

XF86AudioMute
	pactl set-sink-mute @DEFAULT_SINK@ toggle
F86AudioPrev
	playerctl previous
F86AudioNext
	playerctl next
F86AudioPlay
	playerctl play-pause

# XF86AudioMedia
# Same as XF86AudioPlay in my keyboard. That's why the 'play-pause' option is used.
# XF86AudioPause
# XF86AudioStop
# XF86AudioRecord
# XF86AudioRewind
# XF86AudioForward
# XF86AudioMicMute
# 	pactl set-source-mute @DEFAULT_SOURCE@ toggle
# XF86PowerOff
# XF86Copy
# XF86Open
# XF86Past
# XF86Cut
# XF86MenuKB
# XF86Calculator
# This binding is typically mapped by systemd automatically.
# XF86Sleep
# XF86WakeUp
# XF86Explorer
# XF86Send
# XF86Xfer
# XF86WWW
# XF86DOS
# XF86ScreenSaver
# XF86RotateWindows
# XF86TaskPane
# XF86Favorites
# XF86MyComputer
# XF86Back
# XF86Forward
# XF86Eject
# XF86Phone
# XF86Tools
# XF86HomePage
# XF86Reload
# XF86ScrollUp
# XF86ScrollDown
# XF86New
# XF86LaunchA
# XF86LaunchB
# XF86Launch2
# XF86Launch3
# XF86Launch4
# XF86Launch5
# XF86Launch6
# XF86Launch7
# XF86Launch8
# XF86Launch9
# XF86TouchpadToggle
# XF86TouchpadOn
# XF86TouchpadOff
# XF86Suspend
# XF86Close
# XF86WebCam
# XF86Mail
# XF86Messenger
# XF86Search
# XF86Go
# XF86Finance
# XF86Game
# XF86Shop
# XF86MonBrightnessDown
# XF86MonBrightnessUp
# XF86Display
# XF86KbdLightOnOff
# XF86KbdBrightnessDown
# XF86KbdBrightnessUp
# XF86Reply
# XF86MailForward
# XF86Save
# XF86Documents
# XF86Battery
# XF86Bluetooth
# XF86WLAN