3 # Herbstluftm configuration file.
5 # Copyright (C) 2014 Simon Ruderich
7 # This file is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
12 # This file is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this file. If not, see <http://www.gnu.org/licenses/>.
28 type "$1" >/dev/null 2>&1
32 if installed dzen2; then
34 printf '%s\n' "$x" | sed 's/\^/^^/g' \
35 | dzen2 -fg blue -bg yellow -y 15 -h 30 -p "$1" &
36 elif installed xmessage; then
37 # Fallback solution, display first line of stdin.
39 xmessage -timeout "$1" "$x" &
41 # Last way to send a "message", create a stupid window layout so I
42 # notice something is up and look at the logs.
47 hc unlock # or we might not see the changes
51 # Tell all clients the configuration file was reloaded. Should be the first
52 # command in the autostart file.
58 # Use Super (= "Windows") key as modifier which is used for all herbstluftwm
62 # Remove all existing key bindings.
66 hc keybind $mod-Shift-Return spawn urxvt
67 hc keybind $mod-Shift-c close
68 hc keybind $mod-q reload
69 hc keybind $mod-Shift-q quit
71 hc keybind $mod-z spawn "$HOME/.xlockscreen" lock
73 # Run programs/select windows
74 hc keybind $mod-t spawn rofi -show run
75 hc keybind $mod-g spawn rofi -show window
77 # Tag key bindings. Create tags 1 to 0 with bindings to switch and move
79 hc rename default 1 2>/dev/null || true
80 for i in `seq 1 9` 0; do
82 hc keybind "$mod-$i" use "$i"
83 hc keybind "$mod-Shift-$i" move "$i"
85 # Switch to last active tag.
86 hc keybind $mod-b use_previous
88 # Layouting key bindings.
89 hc keybind $mod-space cycle_layout 1 horizontal max # toggle these layouts
90 hc keybind $mod-u split vertical 0.5
91 hc keybind $mod-o split horizontal 0.5
92 hc keybind $mod-r remove # remove a split
93 # Change window state.
94 hc keybind $mod-f fullscreen toggle
95 # Reset fullscreen and layout. Just in case I get confused.
96 hc keybind $mod-Shift-space chain , fullscreen off , set_layout horizontal
99 hc keybind $mod-h focus left
100 hc keybind $mod-j focus down
101 hc keybind $mod-k focus up
102 hc keybind $mod-l focus right
104 hc keybind $mod-Shift-h shift left
105 hc keybind $mod-Shift-j shift down
106 hc keybind $mod-Shift-k shift up
107 hc keybind $mod-Shift-l shift right
108 # Swap top and bottom frame (only works with two frames).
109 hc keybind $mod-s chain , lock , rotate , rotate , unlock
114 # Remove all existing key bindings.
120 # Necessary for Java so it recognizes herbstluftwm as tiling window manager.
122 # Auto-detect new monitors.
123 hc set auto_detect_monitors 1
126 # WINDOW and FRAME SETTINGS
128 # No border for frames, only for windows.
129 hc set frame_border_width 0
130 hc set window_border_width 1
131 # No gaps between frames or windows.
134 # Inactive window borders are black, almost invisible on my black screen.
135 # Active window borders are dark red.
136 hc set window_border_normal_color '#000000'
137 hc set window_border_active_color '#990000'
138 # Transparent background for empty frames.
139 hc set frame_bg_transparent 1
141 # Use vertical layout for windows in frames per default.
142 hc set default_frame_layout 1 # vertical
147 # Run only on startup, not when reloading the config. Thanks to The-Compiler
148 # in #herbstluftwm on Freenode (2014-01-10 16:26 CET) for the idea to use
149 # environment variables.
150 if ! hc getenv HLWMRC_LOADED >/dev/null; then
151 hc setenv HLWMRC_LOADED 1
153 # Setup my layout: Vertical split with my main terminal window in the top
154 # frame, secondary windows in the bottom frame.
155 hc split vertical 0.5
161 # Remove all existing rules.
164 # * Do not focus new clients (default).
165 # * Don't allow clients to toggle fullscreen via EWMH.
166 # * Move new windows to the frame at the bottom of the screen.
171 # Focus important windows when they are opened.
172 hc rule instance=xmessage focus=on
174 # Move Iceweasel to tag 2.
175 hc rule instance=Navigator class=Iceweasel tag=2
178 # After everything is done, allow redrawing of the windows.
182 # To notify me if set -eu has terminated the script (then this part won't get
184 echo 'hlwm restarted' | notify 1