summaryrefslogtreecommitdiff
path: root/sxhkd/sxhkdrc
blob: f1f9a2a04bfb09a3800a582ee6262f69f435af28 (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
#######################
# Program Keybindings #
#######################

# Spawn Terminal of a certain geometry
super + Return
	alacritty

# Rofi
super + d
	rofi -show drun -theme iconic -show-icons

# rofi-emoji script
super + j
	rofi-emoji

# Screenshot
Print
	maim -s ~/Pictures/Screenshots/$(date +%Y-%m-%d_%H-%M-%S).png

shift + Print
	maim --window $(xdotool getactivewindow) ~/Pictures/Screenshots/$(date +%Y-%m-%d_%H-%M-%S).png

#####################
# BSPWM Keybindings #
#####################

#----~ Init ~----#

# make sxhkd reload its configuration files:
super + Escape
	pkill -USR1 -x sxhkd

# Toggle compositor
super + shift + c
	picom_toggle

# Toggle glava
super + shift + m
	pkill -USR1 -x glava || glava --desktop > /dev/null &

# Reload Polybar
super + shift + Escape
	~/.config/polybar/launch.sh

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

# Quit all ~ return to login
super + alt + x
	kill -9 -1

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

#----~ Workspace Switching ~----#

# Switch Active Workspaces
alt + {Tab, shift + Tab}
	bspc {desktop next.occupied -f, desktop prev.occupied -f}

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

#----~ Workspace Management ~----#

# alternate between the tiled and monocle layout
super + m
	bspc desktop -l next
super + f
	bspc node -t \~fullscreen

# swap the current node and the biggest local node
super + g
	bspc node -s biggest.local

# set the node flags
super + ctrl + {m,l,s,p}
	bspc node -g {marked,locked,sticky,private}

# Toggle between floating and tiling
super + u
	bspc node focused.tiled -t floating || bspc node focused.floating -t tiled

# Toggle between pseudo-tiling and tiling
super + i
	bspc node focused.tiled -t pseudo_tiled || bspc node -t tiled

# Mark node as hidden/unhide all
super + {_, shift} + h
	{bspc node --flag hidden=on, bspunhide}

# Hide all on current desktop
super + ctrl + h
	bsphide

# Rotate layout by 90 degrees
super + shift + r
	bspc node @/ -R 90

#send node to next/previous window
super + {_, shift} + k
	bspc node -d {next, prev} -f

#----~ Focus Settings ~----#

# focus the node in the given direction
super + {Left, Down, Up, Right}
	bspc node -f {west,south,north,east}

# focus the node for the given path jump
super + shift + {p,b}
	bspc node -f @{parent,brother}

# focus the next/previous node in the current desktop
super + {_,shift + }n
	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 or send to the given desktop
super + {_,shift + }{1-9}
	bspc {desktop -f,node -d} '{1-9}'

# Switch places with the direction window or create an empty node
super + shift + {Left, Down, Up, Right}
	bspwm_move {west,south,north,east}

# Show or hide marked nodes
super + semicolon
	bspc_marked_hidden

#----~ Preselection ~----#

# preselect the direction
super + ctrl + {Left, Down, Up, Right}
	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

#----~ Movement/Resizing ~----#

# Move current window to a pre-selected space or an empty node
super + y
    bspwm_fill

# Resize
super + alt + {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}

#----~ BSPWM tabs using Suckless tabbetd ~----#

# At given direction: join two windows into a new tabbed or add window to an existing tabbed
super + t; {Left,Down,Up,Right}
        tabc.sh $(bspc query -N -n {west,south,north,east}) add $(bspc query -N -n focused)

# Remove current tab from tabbed
super + t; r
        tabc.sh $(bspc query -N -n focused) remove



###################################
########### System Keys ###########
###################################

#Volume Control
XF86AudioLowerVolume
	pamixer -u && pamixer -d 5
XF86AudioRaiseVolume
	pamixer -u && pamixer -i 5
XF86AudioMute
	pamixer -t

#Brightness control
XF86MonBrightnessDown
	brightness -dec 5
XF86MonBrightnessUp
	brightness -inc 5

## Lcok screen
super + shift + l
	lock.sh

## Personal password manager
super + p
	dpass

## Music Controls
super  + {less, greater, question}
	playerctl {previous, next, play-pause}

## Mic Toggle
super + apostrophe
	micfn --toggle

## Open Applications

## Tdrop, a drop down terminal to act like a scratchpad. Check scripts

# Spawn a term with tmux
super + shift + Return
	st -g 90x24 -e "tmux"

# General app shortcuts
super + o; {w, p, r}
	{firefox, pavucontrol, tdrop_c -n 3 -p 'bspc rule -a St -o state=floating' st -e lf}

# Ncmpcpp
super + alt + m
	tdrop_c -n 2 -p 'bspc rule -a St -o state=floating' st -e ncmpcpp