-
Notifications
You must be signed in to change notification settings - Fork 0
/
autostart
executable file
·235 lines (199 loc) · 7.16 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
#!/bin/bash
hc() {
herbstclient "$@"
}
#==============================================================================
# startup
#==============================================================================
hc emit_hook reload
# load theme settings
source $HOME/.config/herbstluftwm/theme.sh
#-external---------------------------------------------------------------------
# set wallpaper
feh --bg-scale ~/mm/image/wp/IRC-o-meter.png & #haskell-ornament.jpg
# start compositor
compton -f --inactive-dim 0.1 -O 0.05 -I 0.95 -b
# turn off screensaver
xset s noblank
# unlock, just to be sure
hc unlock
# monitor setup
hc detect_monitors
#-panel------------------------------------------------------------------------
# kill previously running panels
killall dzen2 &
panel=~/.config/herbstluftwm/panel.sh
[ -x "$panel" ] || panel=/etc/xdg/herbstluftwm/panel.sh
for monitor in $(herbstclient list_monitors | cut -d: -f1) ; do
# start it on each monitor
"$panel" $monitor &
done
#==============================================================================
# settings
#==============================================================================
hc set always_show_frame 0
hc set auto_detect_monitors 1
set default_direction_external_only 0
hc set default_frame_layout 3 # grid
hc set focus_follows_mouse 1
hc set focus_stealing_prevention 1
hc set frame_active_opacity 100
hc set frame_bg_transparent 1
hc set frame_normal_opacity 100
hc set gapless_grid 0
hc set mouse_recenter_gap 1
hc set pseudotile_center_threshold 0
hc set raise_on_click 1
hc set raise_on_focus 0
hc set raise_on_focus_temporarily 1
hc set smart_frame_surroundings 1
hc set smart_window_surroundings 0
hc set snap_distance 20
hc set snap_gap 10
hc set swap_monitors_to_get_tag 0
hc set tree_style '╾│ ├└╼─┐'
hc set wmname 'Herbstluftwm'
#-rules------------------------------------------------------------------------
hc unrule -F
hc rule focus=on # normally focus new clients
# give focus to most common terminals
hc rule class~'(.*[Rr]xvt.*|.*[Tt]erm|Konsole)' focus=on
hc rule class~'(qiv)' pseudotile=on
hc rule class~'([Ff]irefox|Vimperator)' tag=1
hc rule class='gimp' tag='gimp'
hc rule class~'(Pidgin)' tag='im'
hc rule class='vlc' pseudotile=on
hc rule class='mplayer' pseudotile=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 instance~'(.*X11-XDialogPeer.*)' pseudotile=on
#==============================================================================
# keybindings
#==============================================================================
# remove all existing keybindings
hc keyunbind --all
# set mod key
Mod=Mod4 # Use the super key as the main modifier
# general
hc keybind $Mod-Shift-q quit
hc keybind $Mod-Shift-r reload
hc keybind $Mod-Shift-c close
hc keybind $Mod-Return spawn lilyterm
# basic movement
# focusing clients
hc keybind $Mod-Left focus left
hc keybind $Mod-Down focus down
hc keybind $Mod-Up focus up
hc keybind $Mod-Right focus right
hc keybind $Mod-h focus left
hc keybind $Mod-j focus down
hc keybind $Mod-k focus up
hc keybind $Mod-l focus right
# moving clients
hc keybind $Mod-Shift-Left shift left
hc keybind $Mod-Shift-Down shift down
hc keybind $Mod-Shift-Up shift up
hc keybind $Mod-Shift-Right shift right
hc keybind $Mod-Shift-h shift left
hc keybind $Mod-Shift-j shift down
hc keybind $Mod-Shift-k shift up
hc keybind $Mod-Shift-l shift right
# resizing gap
hc keybind $Mod-g cycle_value frame_gap 0 10 20 30 40 50 60 80
hc keybind $Mod-Shift-g cycle_value frame_gap 80 60 50 40 30 20 10 0
# resizing frames
resizestep=0.005
hc keybind $Mod-Control-h resize left +$resizestep
hc keybind $Mod-Control-j resize down +$resizestep
hc keybind $Mod-Control-k resize up +$resizestep
hc keybind $Mod-Control-l resize right +$resizestep
hc keybind $Mod-Control-Left resize left +$resizestep
hc keybind $Mod-Control-Down resize down +$resizestep
hc keybind $Mod-Control-Up resize up +$resizestep
hc keybind $Mod-Control-Right resize right +$resizestep
# cycle through tags
hc keybind $Mod-period use_index +1 --skip-visible
hc keybind $Mod-comma use_index -1 --skip-visible
# layouting
hc keybind $Mod-space cycle_layout 1
hc keybind $Mod-r remove
hc keybind $Mod-s split vertical 0.5
hc keybind $Mod-Shift-s split horizontal 0.5
hc keybind $Mod-f fullscreen toggle
hc keybind $Mod-Shift-f floating toggle
hc keybind $Mod-p pseudotile toggle
hc keybind $Mod-u split bottom 0.5
hc keybind $Mod-o split right 0.5
# mouse
hc mouseunbind --all
hc mousebind $Mod-Button1 move
hc mousebind $Mod-Button2 zoom
hc mousebind $Mod-Button3 resize
# focus
#hc keybind $Mod-BackSpace cycle_monitor # find different key
hc keybind $Mod-Tab cycle_all +1
hc keybind $Mod-Shift-Tab cycle_all -1
hc keybind $Mod-c cycle
hc keybind $Mod-i jumpto urgent
# media keys
hc keybind XF86AudioNext spawn mpc --host passwd@localhost next
hc keybind XF86AudioPrev spawn mpc --host passwd@localhost prev
hc keybind XF86AudioPlay spawn mpc --host passwd@localhost toggle
hc keybind XF86AudioStop spawn mpc --host passwd@localhost stop
hc keybind XF86AudioRaiseVolume spawn amixer sset Master 1%+
hc keybind XF86AudioLowerVolume spawn amixer sset Master 5%-
hc keybind XF86AudioMute spawn amixer sset Master toggle
hc keybind XF86AudioMedia spawn urxvt -e ncmpcpp
hc keybind XF86Tools spawn gnome-terminal -e ncmpcpp
hc keybind XF86Mail spawn urxvt -e sup
# turn DPMS on/off
hc keybind $Mod-x spawn xset +dpms
hc keybind $Mod-Shift-x spawn xset -dpms
# screen lock
hc keybind $Mod-Escape spawn slock
# screenshot
hc keybind Print spawn scrot
# dmenu
hc keybind $Mod-BackSpace spawn dmenu_run -fn 'snap-7' -nb '#151515' -nf '#919191' -sb '#151515' -sf '#c98f0a'
#-tags-------------------------------------------------------------------------
tag_names=( {1..8} im 0 )
tag_keys=( {1..9} 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
# pidgin
hc load im '
(split horizontal:0.200000:1
(clients grid:1))
'
# GIMP
# ensure there is a gimp tag
hc add gimp
hc load gimp '
(split horizontal:0.850000:0
(split horizontal:0.200000:1
(clients vertical:0)
(clients grid:0))
(clients vertical:0))
' # load predefined layout
# center all other gimp windows on gimp tag
hc rule class=Gimp tag=gimp index=01 pseudotile=on
hc rule class=Gimp windowrole~'gimp-(image-window|toolbox|dock)' \
pseudotile=off
hc rule class=Gimp windowrole=gimp-toolbox focus=off index=00
hc rule class=Gimp windowrole=gimp-dock focus=off index=1
#hc keybind $Mod-g use gimp
#hc keybind $Mod-Shift-g move gimp
#for tag in ${TAG_NAMES}; do
# layoutfile=${XDG_DATA_HOME}/herbstluftwm/layout/${tag}
# if [ -f ${layoutfile} ]; then
# hc load ${tag} $(cat ${layoutfile})
# fi
#done