aboutsummaryrefslogtreecommitdiffstats
path: root/.config/herbstluftwm
diff options
context:
space:
mode:
Diffstat (limited to '.config/herbstluftwm')
-rwxr-xr-x.config/herbstluftwm/autostart200
-rwxr-xr-x.config/herbstluftwm/panel.sh189
2 files changed, 389 insertions, 0 deletions
diff --git a/.config/herbstluftwm/autostart b/.config/herbstluftwm/autostart
new file mode 100755
index 0000000..500eabf
--- /dev/null
+++ b/.config/herbstluftwm/autostart
@@ -0,0 +1,200 @@
1#!/bin/bash
2
3# this is a simple config for herbstluftwm
4
5#Wallpaper
6WALLPAPER=/usr/share/backgrounds/gnome/Road.jpg
7
8#Numix color palette
9LIGHT='#f9f9f9'
10LLIGHT='#dedede'
11ACCENT='#d64937'
12LDARK='#333333'
13DARK='#2d2d2d'
14
15hc() {
16 herbstclient "$@"
17}
18
19hc emir_hook reload
20
21xsetroot -solid $ACCENT
22
23# remove all existing keybindings
24hc keyunbind --all
25
26# keybindings
27# if you have a super key you will be much happier with Mod set to Mod4
28#Mod=Mod1 # Use alt as the main modifier
29Mod=Mod4 # Use the super key as the main modifier
30
31hc keybind $Mod-Shift-q quit
32hc keybind $Mod-Shift-r reload
33hc keybind $Mod-Shift-c close
34hc keybind $Mod-Return spawn xfce4-terminal
35hc keybind ~ spawn xfce4-terminal --drop-down
36
37# basic movement
38# focusing clients
39hc keybind $Mod-Left focus left
40hc keybind $Mod-Down focus down
41hc keybind $Mod-Up focus up
42hc keybind $Mod-Right focus right
43hc keybind $Mod-h focus left
44hc keybind $Mod-j focus down
45hc keybind $Mod-k focus up
46hc keybind $Mod-l focus right
47
48# moving clients
49hc keybind $Mod-Shift-Left shift left
50hc keybind $Mod-Shift-Down shift down
51hc keybind $Mod-Shift-Up shift up
52hc keybind $Mod-Shift-Right shift right
53hc keybind $Mod-Shift-h shift left
54hc keybind $Mod-Shift-j shift down
55hc keybind $Mod-Shift-k shift up
56hc keybind $Mod-Shift-l shift right
57
58# splitting frames
59# create an empty frame at the specified direction
60hc keybind $Mod-u split bottom 0.5
61hc keybind $Mod-o split right 0.5
62# let the current frame explode into subframes
63hc keybind $Mod-Control-space split explode
64
65# resizing frames
66resizestep=0.05
67hc keybind $Mod-Control-h resize left +$resizestep
68hc keybind $Mod-Control-j resize down +$resizestep
69hc keybind $Mod-Control-k resize up +$resizestep
70hc keybind $Mod-Control-l resize right +$resizestep
71hc keybind $Mod-Control-Left resize left +$resizestep
72hc keybind $Mod-Control-Down resize down +$resizestep
73hc keybind $Mod-Control-Up resize up +$resizestep
74hc keybind $Mod-Control-Right resize right +$resizestep
75
76# tags
77tag_names=( {1..9} )
78tag_keys=( {1..9} 0 )
79
80# Selecting workspaces
81hc keybind Alt-Control-Left use_index -1
82hc keybind Alt-Control-Right use_index +1
83hc rename default "${tag_names[0]}" || true
84for i in ${!tag_names[@]} ; do
85 hc add "${tag_names[$i]}"
86 key="${tag_keys[$i]}"
87 if ! [ -z "$key" ] ; then
88 hc keybind "$Mod-$key" use_index "$i"
89 hc keybind "$Mod-Shift-$key" move_index "$i"
90 fi
91done
92
93# cycle through tags
94hc keybind $Mod-period use_index +1 --skip-visible
95hc keybind $Mod-comma use_index -1 --skip-visible
96
97# layouting
98hc keybind $Mod-r remove
99hc keybind $Mod-space cycle_layout 1
100hc keybind $Mod-s floating toggle
101hc keybind $Mod-f fullscreen toggle
102hc keybind $Mod-p pseudotile toggle
103
104# mouse
105hc mouseunbind --all
106hc mousebind $Mod-Button1 move
107hc mousebind $Mod-Button2 zoom
108hc mousebind $Mod-Button3 resize
109
110# focus
111hc keybind $Mod-BackSpace cycle_monitor
112hc keybind $Mod-Tab cycle_all +1
113hc keybind $Mod-Shift-Tab cycle_all -1
114hc keybind $Mod-c cycle
115hc keybind $Mod-i jumpto urgent
116hc set focus_follows_mouse 1
117
118# theme
119hc attr theme.tiling.reset 1
120hc attr theme.floating.reset 1
121hc set frame_border_active_color $LDARK
122hc set frame_border_normal_color $DARK
123hc set frame_bg_normal_color $LDARK
124hc set frame_bg_active_color $DARK
125hc set frame_border_width 0
126hc set always_show_frame 0
127hc set frame_bg_transparent 1
128hc set frame_transparent_width 0
129hc set frame_gap 0
130
131hc attr theme.active.color $ACCENT
132hc attr theme.normal.color $DARK
133hc attr theme.urgent.color orange
134hc attr theme.inner_width 1
135hc attr theme.inner_color $DARK
136hc attr theme.border_width 3
137hc attr theme.floating.border_width 4
138hc attr theme.floating.outer_width 1
139hc attr theme.floating.outer_color black
140hc attr theme.active.inner_color $DARK
141hc attr theme.active.outer_color $DARK
142hc attr theme.background_color $DARK
143
144hc set window_gap 20
145hc set frame_padding 0
146hc set smart_window_surroundings 0
147hc set smart_frame_surroundings 1
148hc set mouse_recenter_gap 1
149
150# rules
151hc unrule -F
152#hc rule class=XTerm tag=3 # move all xterms to tag 3
153hc rule focus=on # normally focus new clients
154#hc rule focus=off # normally do not focus new clients
155# give focus to most common terminals
156#hc rule class~'(.*[Rr]xvt.*|.*[Tt]erm|Konsole)' focus=on
157hc rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' pseudotile=on
158hc rule windowtype='_NET_WM_WINDOW_TYPE_DIALOG' focus=on
159hc rule windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK|DESKTOP)' manage=off
160
161# unlock, just to be sure
162hc unlock
163
164herbstclient set tree_style '╾│ ├└╼─┐'
165
166# do multi monitor setup here, e.g.:
167# hc set_monitors 1280x1024+0+0 1280x1024+1280+0
168# or simply:
169# hc detect_monitors
170
171#Start panel in all monitors
172start_panel() {
173 for monitor in $(herbstclient list_monitors | cut -d: -f1) ; do
174 "$1" $monitor &
175 done
176}
177
178# find the panel
179panel=~/.config/herbstluftwm/panel.sh
180[ -x "$panel" ] || panel=/etc/xdg/herbstluftwm/panel.sh
181if pgrep panel.sh >> /dev/null
182then
183 kill $(pgrep panel.sh)
184 start_panel $panel
185else
186 start_panel $panel
187fi
188
189#Wallpaper
190feh --bg-scale $WALLPAPER
191
192#Start compton if not running
193start_compton(){ compton -c -z & }
194if pgrep compton >> /dev/null
195then
196 kill $(pgrep compton)
197 start_compton
198else
199 start_compton
200fi
diff --git a/.config/herbstluftwm/panel.sh b/.config/herbstluftwm/panel.sh
new file mode 100755
index 0000000..cc4fb1e
--- /dev/null
+++ b/.config/herbstluftwm/panel.sh
@@ -0,0 +1,189 @@
1#!/bin/bash
2
3hc() { "${herbstclient_command[@]:-herbstclient}" "$@" ;}
4monitor=${1:-0}
5geometry=( $(herbstclient monitor_rect "$monitor") )
6if [ -z "$geometry" ] ;then
7 echo "Invalid monitor $monitor"
8 exit 1
9fi
10# geometry has the format W H X Y
11x=${geometry[0]}
12y=${geometry[1]}
13panel_width=${geometry[2]}
14panel_height=24
15font="-*-fixed-medium-*-*-*-14-*-*-*-*-*-*-*"
16bgcolor=$(hc get frame_border_normal_color)
17selbg=$(hc get window_border_active_color)
18selfg='#101010'
19
20########################################################################################
21# Try to find textwidth binary.
22# In e.g. Ubuntu, this is named dzen2-textwidth.
23if which textwidth &> /dev/null ; then
24 textwidth="textwidth";
25elif which dzen2-textwidth &> /dev/null ; then
26 textwidth="dzen2-textwidth";
27else
28 echo "This script requires the textwidth tool of the dzen2 project."
29 exit 1
30fi
31
32########################################################################################
33# true if we are using the svn version of dzen2
34# depending on version/distribution, this seems to have version strings like
35# "dzen-" or "dzen-x.x.x-svn"
36if dzen2 -v 2>&1 | head -n 1 | grep -q '^dzen-\([^,]*-svn\|\),'; then
37 dzen2_svn="true"
38else
39 dzen2_svn=""
40fi