summaryrefslogtreecommitdiffstats
path: root/herbstluftwm/.config/herbstluftwm/autostart
blob: 9a3c2ee4c414ced2bf8e7476c6fd9750bbb335bd (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
#!/bin/bash

# this is a simple config for herbstluftwm

function hc() {
    herbstclient "$@"
}

function random-wallpaper() {
    ls -1d ~/pictures/wallpapers/3840x1080/* \
       ~/pictures/wallpapers/patterns/* \
        | shuf -n 1
}

hc emit_hook reload

feh --bg-tile "$(random-wallpaper)"

# remove all existing keybindings
hc keyunbind --all

# keybindings
Mod=Mod4
hc keybind $Mod-Shift-q quit
hc keybind $Mod-Shift-r reload
hc keybind $Mod-Shift-c close
hc keybind $Mod-Return spawn urxvt

hc keybind $Mod-t spawn hrunorraise Emacs emacsclient -ca ''
hc keybind $Mod-c spawn hrunorraise URxvt urxvtc
hc keybind $Mod-b spawn hrunorraise Conkeror conkeror
hc keybind Control-Mod1-l spawn i3lock --color 000000

# Set the default frame layout to max before the tags are created. If
# the tags are created before the default layout is set they will all
# be using the vertical layout.
hc set default_frame_layout 2

# tags
TAG_NAMES=( {1..2} )
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

# cycle through tags
hc keybind $Mod-period use_index +1 --skip-visible
hc keybind $Mod-comma  use_index -1 --skip-visible
hc keybind $Mod-Right use_index +1 --skip-visible
hc keybind $Mod-Left  use_index -1 --skip-visible

# layouting
hc keybind $Mod-k remove
hc keybind $Mod-space cycle_layout 1
hc keybind $Mod-s split vertical 0.5
hc keybind $Mod-Shift-s split horizontal 0.5
hc keybind $Mod-f cycle_layout 1 vertical max
hc keybind $Mod-Control-f floating toggle
hc keybind $Mod-Shift-f fullscreen toggle
hc keybind $Mod-p pseudotile toggle

# resizing
RESIZESTEP=0.05
hc keybind $Mod-Control-h resize left +$RESIZESTEP
hc keybind $Mod-Control-n resize down +$RESIZESTEP
hc keybind $Mod-Control-e resize up +$RESIZESTEP
hc keybind $Mod-Control-i resize right +$RESIZESTEP

# mouse
hc mouseunbind --all
hc mousebind $Mod-Button1 move
hc mousebind $Mod-Button2 resize
hc mousebind $Mod-Button3 zoom

# focus
hc keybind $Mod-BackSpace   cycle_monitor
hc keybind $Mod-Tab         cycle_all +1
hc keybind $Mod-Shift-Tab   cycle_all -1
# hc keybind $Mod-c cycle
hc keybind $Mod-h focus left
hc keybind $Mod-n focus down
hc keybind $Mod-e focus up
hc keybind $Mod-i focus right
hc keybind $Mod-u jumpto urgent
hc keybind $Mod-Shift-h shift left
hc keybind $Mod-Shift-n shift down
hc keybind $Mod-Shift-e shift up
hc keybind $Mod-Shift-i shift right

# colors
hc set frame_border_active_color '#3d3d3d'
hc set frame_border_normal_color '#222222'
hc set frame_bg_normal_color '#111111'
hc set frame_bg_active_color '#263f1f'
hc set frame_border_width 0
hc set window_border_width 2
hc set window_border_inner_width 0
hc set window_border_normal_color '#222222'
hc set window_border_active_color '#3d3d3d'
hc set window_border_inner_color '#111111'
hc set always_show_frame 0
hc set frame_gap 30
# add overlapping window borders
hc set window_gap 30
hc set frame_padding -30
hc set smart_window_surroundings 0
hc set smart_frame_surroundings 0
hc set mouse_recenter_gap 0
hc set switch_monitors_to_get_tag 0
hc set frame_bg_transparent 1
hc set swap_monitors_to_get_tag 0

## Make sure the windows update immediately when being resized in
## floating mode.
hc set update_dragged_clients 1

# rules
hc unrule -F
hc rule focus=on # normally do focus new clients
hc rule class=URxvt tag=1 index=1 switchtag=on
hc rule class=Emacs tag=1 index=0
hc rule class~"Conkeror|Firefox" tag=2 index=0
hc rule class=Pinentry pseudotile=on
hc rule class=Alsaplayer pseudotile=on
hc rule title="Torchlight II Mod Launcher" pseudotile=on
hc rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' pseudotile=on
hc rule windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK)' manage=off
hc rule title="SpaceChem" pseudotile=on
hc rule instance=pinball.exe pseudotile=on

# unlock, just to be sure
hc unlock

herbstclient set tree_style '╾│ ├└╼─┐'

hc lock

# do multi monitor setup
hc set_monitors \
   1920x1080+0+0 \
   1920x1080+1920+0

# Pad the first monitor 16 pixels on the bottom.
hc pad 0 0 0 16 16

hc load 1 '(split horizontal:0.535:1 (clients max:0) (clients vertical:0))'
hc load 2 '(clients max:0)'
hc focus_edge left

hc unlock

trayer --transparent true --alpha 255 --widthtype request --edge left \
       --align right --padding 0 --margin 15 --distance 15 --height 19 \
       --SetDockType true &