-
Notifications
You must be signed in to change notification settings - Fork 13
/
autostart
executable file
·253 lines (215 loc) · 8.77 KB
/
autostart
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
#!/bin/bash
###############################################################################
# _ _ _ _ __ _ #
# | |__ ___ _ __| |__ ___| |_| |_ _ / _| |_ _ _ _ __ ___ #
# | '_ \ / _ \ '__| '_ \/ __| __| | | | | |_| __| \ /\ / | '_ ` _ \ #
# | | | | __/ | | |_) \__ \ |_| | |_| | _| |_ \ V V /| | | | | | #
# |_| |_|\___|_| |_.__/|___/\__|_|\__,_|_| \__| \_/\_/ |_| |_| |_| #
# #
###############################################################################
# Initialise {{{
#------------------------------------------------------------------------------
hc() {
herbstclient "$@"
}
# use example script from:
src='/usr/share/doc/herbstluftwm/examples/'
hc emit_hook reload
if hc new_attr bool my_not_first_autostart 2> /dev/null; then
gnome-settings-daemon &
xscreensaver -no-splash &
libinput-gestures-setup start
xset r rate 200 50
~/bin/brightness_change_wrapper.sh eDP-1 =
compton -b --config $HOME/.config/compton/compton.conf
nmcli device connect wlp1s0h
fi
# dropbox start
if hash nitrogen 2>&1 1>/dev/null; then
nitrogen --restore
elif [ -f $HOME/.fehbg ]; then
hc spawn $HOME/.fehbg
fi
# do multi monitor setup here, e.g.:
# hc set_monitors 1280x1024+0+0 1280x1024+1280+0
# or simply:
hc detect_monitors
hc set auto_detect_monitors 1
source ~/.config/herbstluftwm/pad.sh
split_rate_h=${split_rate_h:-0.5}
resizestep_h=${resizestep_h:-0.005}
split_rate_v=${split_rate_v:-0.5}
resizestep_v=${resizestep_v:-0.02}
hc set tree_style '╾│ ├└╼─┐'
#---------------------------------------------------------------------------}}}
# Keybindings {{{
#------------------------------------------------------------------------------
# remove all existing keybindings
hc keyunbind --all
# keybindings
# if you have a super key you will be much happier with Mod set to Mod4
#Mod=Mod1 # Use alt as the main modifier
Mod=Mod4 # Use the super key as the main modifier
hc keybind $Mod-Shift-q quit
hc keybind $Mod-Shift-r reload
hc keybind $Mod-c close_or_remove
hc keybind $Mod-Shift-c remove
hc keybind $Mod-Return spawn urxvt
# basic movement
# focusing clients
hc keybind $Mod-j focus down
hc keybind $Mod-k focus up
hc keybind $Mod-h focus left
hc keybind $Mod-l focus right
# moving clients
hc keybind $Mod-Shift-j shift down
hc keybind $Mod-Shift-k shift up
hc keybind $Mod-Shift-h shift left
hc keybind $Mod-Shift-l shift right
# resizing frames
hc keybind $Mod-z resize down +$resizestep_v
hc keybind $Mod-a resize up +$resizestep_v
hc keybind $Mod-comma resize left +$resizestep_h
hc keybind $Mod-period resize right +$resizestep_h
# splitting frames
# create an empty frame at the specified direction
hc keybind $Mod-s chain , split bottom $split_rate_h , focus down
hc keybind $Mod-v chain , split right $split_rate_v , focus right
hc keybind $Mod-Control-j chain , split bottom 0.5 , focus down
hc keybind $Mod-Control-k chain , split top 0.5 , focus up
hc keybind $Mod-Control-h chain , split left 0.5 , focus left
hc keybind $Mod-Control-l chain , split right 0.5 , focus right
# let the current frame explode into subframes
hc keybind $Mod-Control-space split explode
# tags
tag_names=( {1..5} )
tag_keys=( {1..5} 0 )
hc rename default "${tag_names[0]}" || true
for i in ${!tag_names[@]} ; do
hc add "${tag_names[$i]}"
key="${tag_keys[$i]}"
if ! [ -z "$key" ] ; then
hc keybind "$Mod-$key" use_index "$i"
hc keybind "$Mod-Shift-$key" move_index "$i"
fi
done
# cycle through tags
hc keybind $Mod-Right use_index +1 --skip-visible
hc keybind $Mod-Left use_index -1 --skip-visible
# shift client to neighbor tag
hc keybind $Mod-Shift-Right move_index +1 --skip-visible
hc keybind $Mod-Shift-Left move_index -1 --skip-visible
# layouting
# in tag
hc keybind $Mod-t floating toggle
hc keybind $Mod-Shift-t spawn ~/.config/herbstluftwm/toggle_single_float.sh
hc keybind $Mod-Control-f spawn ~/.config/herbstluftwm/maximize.sh
hc keybind $Mod-Shift-f fullscreen toggle
# in flame
hc keybind $Mod-space cycle_layout 1
hc keybind $Mod-f cycle_layout 1 max vertical
# for window
hc keybind $Mod-o pseudotile toggle
# mouse
hc mouseunbind --all
hc mousebind $Mod-Button1 move
hc mousebind $Mod-Button2 zoom
hc mousebind $Mod-Button3 resize
# switch focus to different monitor
hc keybind $Mod-Tab cycle_monitor +1
hc keybind $Mod-Shift-Tab cycle_monitor -1
# rotate default screen(eDP-1)
hc keybind $Mod-Up spawn ~/bin/flip_screen_orientation.sh eDP-1
hc keybind $Mod-Down spawn ~/bin/flip_screen_orientation.sh eDP-1
# reload dzen2
hc keybind $Mod-F11 spawn ~/.config/herbstluftwm/reload_panel.sh
# dmenu_run
hc keybind $Mod-p spawn dmenu_run -l 12 -fn "Migu 1M:size=24"
# toggle compton
hc keybind Alt-Control-t spawn bash toggle_compton.sh
# lock screen
hc keybind Alt-Control-l spawn xscreensaver-command -lock
# hc keybind Alt-Control-l spawn gnome-screensaver-command -l
# Launch file manager
hc keybind $Mod-e spawn thunar
# Play / Pause media key
hc keybind XF86AudioPlay spawn mpc toggle
hc keybind XF86HomePage spawn mpc toggle
hc keybind Shift-F6 spawn mpc toggle
hc keybind Shift-XF86AudioPlay spawn streamradio pause
hc keybind Shift-XF86HomePage spawn streamradio pause
# Volume setting media key
hc keybind XF86AudioRaiseVolume spawn sound_volume_change_wrapper.sh +
hc keybind XF86AudioLowerVolume spawn sound_volume_change_wrapper.sh -
hc keybind XF86AudioMute spawn sound_volume_change_wrapper.sh m
# Brightness
hc keybind XF86MonBrightnessUp spawn ~/bin/brightness_change_wrapper.sh eDP-1 +
hc keybind XF86MonBrightnessDown spawn ~/bin/brightness_change_wrapper.sh eDP-1 -
# Take a screenshot (whole window)
hc keybind Print spawn screenshot.sh
# Take a screenshot (selected area)
hc keybind Shift-Print spawn screenshot_select.sh
# Toggle touchpad
hc keybind Control-Escape spawn touchpad_toggle.sh
# Toggle trackpoint (Lenovo PC)
hc keybind Alt-Escape spawn trackpoint_toggle.sh
# herbstcommander
hc keybind $Mod-colon spawn ${src}herbstcommander.sh
# Focus specified client by name (using dmenu)
hc keybind $Mod-g spawn ${src}herbstcommander.sh jumpto
# Bring specified client by name (using dmenu)
hc keybind $Mod-b spawn ${src}herbstcommander.sh bring
# Open q3-like terminal for arbitrary application
hc keybind $Mod-bracketright chain . spawn ${src}q3terminal.sh . emit_hook focus_changed
#---------------------------------------------------------------------------}}}
# Appearance {{{
#------------------------------------------------------------------------------
hc set frame_gap 8
hc set frame_padding -12
hc set frame_border_width 2
hc set frame_transparent_width 0
hc set window_gap 12
hc set window_border_width 2
hc set window_border_inner_width 0
# frame options
hc set always_show_frame 0
hc set frame_bg_transparent 1
hc set smart_window_surroundings 0
hc set smart_frame_surroundings 0
hc set mouse_recenter_gap 0
# colors
hc set frame_border_active_color '#ff005f'
hc set frame_border_normal_color '#262626'
hc set frame_bg_active_color '#ff005f'
hc set frame_bg_normal_color '#262626'
hc set window_border_active_color '#ff005f'
hc set window_border_normal_color '#262626'
# opacities (%)
hc set frame_active_opacity 40
hc set frame_normal_opacity 40
hc set pseudotile_center_threshold 14
hc set focus_follows_mouse 1
hc set snap_distance 14
hc set snap_gap 9
hc set default_frame_layout 3
#---------------------------------------------------------------------------}}}
# Rules {{{
#------------------------------------------------------------------------------
hc unrule -F
#hc rule class=XTerm tag=3 # move all xterms to tag 3
hc rule focus=on
# give focus to most common terminals
hc rule class~'(.*[Rr]xvt.*|.*[Tt]erm|Konsole)' focus=on
hc rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' pseudotile=on
hc rule windowtype='_NET_WM_WINDOW_TYPE_DIALOG' focus=on
hc rule windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK)' manage=off
hc rule class='XClock' pseudotile=on
hc rule class='Conky' manage=off
hc rule class='Screenkey' manage=off
hc rule title='Figure 1' monitor=1
#---------------------------------------------------------------------------}}}
# Panel {{{
#------------------------------------------------------------------------------
hc spawn ~/.config/herbstluftwm/reload_panel.sh
#---------------------------------------------------------------------------}}}
hc unlock