You are not logged in.
I'm using hlwm as my default wm since two months and I'm really happy with it. When I first installed it, I was totally new to manual tiling but I picked it up quite fast, as hlwm's default keybindings are really intuitive for vim-users and you get used to the look and feel in no time... Anyway I thought I'd make a thread to share configs with other users (I hope there are some here
) and provide help for beginners.
You can get Herbstluftwm and some documentation here: http://wwwcip.cs.fau.de/~re06huxa/herbstluftwm/
Short Introduction:
- Herbstluftwm is a manual tiling window manger, the layout is based on frames, which can be split up into subframes and those can be split up again and so on. Each frame can contain one or more clients and can be resized, added and removed freely.
- It's minimalistic and very lightweight: All it gives you is total control over your clients and and a tool to interact with it (herbstclient)
- It uses a bash script as the config file
- The dump/load feature is another cool thing, it dumps the layout of your current tag in a format, you can use to load it at startup or whenever you feel like it.
- It's somewhat early in development, so it still lacks some feature and there are a few bugs (although I only experienced two crashes since I'm using it and the bug responsible for those got fixed the day after.)
So here is my config, based on the default/example one:
#!/bin/bash
# this is an simple config for herbstluftwm
function hc() {
herbstclient "$@"
}
# autostart daemons'n'stuff
nitrogen --restore &
#xcompmgr -c -t-5 -l-5 -r4.2 -o.55 &
xbindkeys &
udiskie &
dzenconky.sh; dzendate.sh
twmnd &
#add padding for dzen2
hc pad 0 14 0 0 0
# keybindings
Mod=Mod4
hc keybind $Mod-q quit
hc keybind $Mod-Shift-r reload
hc keybind $Mod-x close
hc keybind $Mod-Return spawn urxvt
# tags
hc rename default 1 || true
for i in {1..9} ; do
hc add "$i"
hc keybind "$Mod-$i" use "$i"
hc keybind "$Mod-Shift-$i" move "$i"
done
# layouting
hc keybind $Mod-r remove
hc keybind $Mod-space cycle_layout 1
hc keybind $Mod-u split vertical 0.5
hc keybind $Mod-o split horizontal 0.5
hc keybind $Mod-s floating toggle
# mouse
hc mousebind $Mod-Button1 move
hc mousebind $Mod-Button3 resize
hc mousebind $Mod-Button2 zoom
# resizing
RESIZESTEP=0.05
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
# 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-j focus down
hc keybind $Mod-k focus up
hc keybind $Mod-l focus 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
#dmenu
hc keybind $Mod-p spawn dmenu_run -fn -*-terminus-medium-*-*-*-12-*-*-*-*-*-* -nb rgb:00/00/00 -nf rgb:CC/CC/CC -sb rgb:CC/CC/CC -sf rgb:33/33/33
# colors
hc set frame_border_active_color '#000000'
hc set frame_border_normal_color '#2B2B2B'
hc set frame_bg_normal_color '#CCCCCC'
hc set frame_bg_active_color '#666666'
hc set frame_border_width 1
hc set window_border_width 1
hc set window_border_normal_color '#000000'
hc set window_border_active_color '#CCCCCC'
#settings
hc floating 3 on
hc set snap_distance 7
hc set snap_gap 3
hc set window_gap 0
hc set frame_bg_transparent 1
hc set focus_follows_mouse 1
hc set focus_follows_shift 1
hc set tree_style "╾│ ├└╼─┐"
# load layout
hc load "(split horizontal:0.399800:0 (split vertical:0.250000:1 (clients vertical:0 0x2e00006) (split vertical:0.500000:1 (clients vertical:0 0x3000006) (clients vertical:0 0x2c00006))) (split vertical:0.750000:0 (clients vertical:0 0x2800006) (clients vertical:0 0x3200006)))"
#autostart apps
if [ ! $(pidof mpd) ]; then
mpd
fi
hc spawn urxvt
hc spawn urxvt
hc spawn urxvt
hc spawn urxvt -e centerim
hc spawn urxvt -e rangerHere's a screenshot of my usual setup on tag 1
Last edited by Doomicide (2011-09-25 13:43:29)
“From each according to his faculties; to each according to his needs”
Look at the code. Look at the silly code!
Offline
Due to the overwhelming resonse this thread got (HA!) I decided to post some scripts I made:
1. This two scripts give you a scrotwm-like behaviour when switching tags (They only work with numbered tags, but it should be easy enough to change that:
Switch to previous tag:
#!/bin/bash
tagstat=$(herbstclient tag_status)
function checkbusy()
{
case "$tagstat" in
*':'$prevtag*)
busy=1
;;
*)
busy=2
;;
esac
}
# get current tag
for t in {1..9} ; do
case "$tagstat" in
*"#$t"*)
curtag=$t;;
esac
done
# determine if previous tag is busy
### uncomment this for scrotwm-like behaviour (only switch to busy tags)###
if [[ "$tagstat" == *':'* ]]; then
busy=2
prevtag=$curtag
while [ $busy != 1 ] && (( 1 <= $prevtag )); do
prevtag=$(($prevtag-1))
checkbusy
done
herbstclient use $prevtag
else
echo "lol"
exit
fi
# change to previous tag
### comment this for scrotwm-like behaviour (only switch to busy tags)###
# prevtag=$(($curtag-1))
# herbstclient use $prevtagand to the next one:
#!/bin/bash
tagstat=$(herbstclient tag_status)
function checkbusy()
{
case "$tagstat" in
*':'$nextag*)
busy=1
;;
*)
busy=2
;;
esac
}
# get current tag
for t in {1..9} ; do
case "$tagstat" in
*"#$t"*)
curtag=$t;;
esac
done
# determine if previous tag is busy
### uncomment this for scrotwm-like behaviour (only switch to busy tags)###
if [[ "$tagstat" == *':'* ]]; then
busy=2
nextag=$curtag
while [ $busy != 1 ] && (( 9 >= $nextag )); do
nextag=$(($nextag+1))
checkbusy
done
herbstclient use $nextag
else
exit
fi
# change to next tag
### comment this for scrotwm-like behaviour (only switch to busy tags)###
# nextag=$(($curtag+1))
# herbstclient use $nextagNow put them in ~/bin and something like this in your autostart file:
hc keybind $Mod-Right spawn nextag
hc keybind $Mod-Left spawn prevtag--
Plus here's an example of what you can do with herbstclient's new idle command:
(Heavily inspired by the panel.sh that comes with herbstluftwm)
#!/bin/bash
## dzen stuff
FG='#728651'
BG='black'
FONT='-*-terminus-medium-*-*-*-12-*-*-*-*-*-*'
function uniq_linebuffered() {
awk '$0 != l { print ; l=$0 ; fflush(); }' "$@"
}
(
while true ; do
date +'date %a %d/%m/%y %T'
mpcshow="$(mpc status | grep -) $(mpc status | cat -n | grep -E ^*2 | awk {'print $4'})"
echo "mpc $mpcshow"
sleep 1 || break
done | uniq_linebuffered &
herbstclient --idle &
)|(
TAG=$(herbstclient list_monitors | cut -d ' ' -f 5 | tr -d [:punct:])
date=""
mpcshow=""
while true; do
echo -e " ^fg(\#CCCCCC):^fg()^fg(#865C51)$TAG^fg()^fg(#CCCCCC):^fg() $date ^fg(#516086)$mpcshow^fg()"
read line || break
cmd=( $line )
case "$cmd[0]" in
date*)
#echo "reseting date" >&2
date="${cmd[@]:1}"
;;
tag*)
#echo "reseting tag" >&2
TAG=$(herbstclient list_monitors | cut -d ' ' -f 5 | tr -d [:punct:])
;;
mpc*)
mpcshow="${cmd[@]:1}"
;;
esac
done
)|dzen2 -ta l -y 0 -x 0 -w 670 -fg $FG -bg $BG -fn $FONT &Last edited by Doomicide (2011-10-07 09:35:23)
“From each according to his faculties; to each according to his needs”
Look at the code. Look at the silly code!
Offline
Sorry Doom ... I was busy during the first half of last week and overseas during the rest.
I'll give it a try in future. Probably not this week, but soon.
Thanks for sharing, btw. Always appreciated. 
Last edited by gutterslob (2011-10-03 17:19:53)
Point & Squirt
Offline
I have the feeling that there are more tiling WM than floating ones on the market, and they are all based on each other. But this one definitly has the best name of all of them.
I'm so meta, even this acronym
Offline
@ gutterslob: no problem 
@ Awebb: Yeah, if it hadn't been for the name I'd most certainly never tried it
“From each according to his faculties; to each according to his needs”
Look at the code. Look at the silly code!
Offline
I have the feeling that there are more tiling WM than floating ones on the market, and they are all based on each other. But this one definitly has the best name of all of them.
.. and it is hard for beginners to find the difference between them. The documentation of Herbstluftwm explains some of the mechanisms behind the X, that's very interesting for me because now I do understand what a tiling window manager does, how the algorithms work.
Offline
I just discovered ninjaaron's herbstluftwm thread on the arch forums and he posted some really cool hlwm scripts there, so I thought I'd share the link.
Last edited by Doomicide (2011-10-20 16:12:37)
“From each according to his faculties; to each according to his needs”
Look at the code. Look at the silly code!
Offline
I'm not sure what bar this WM uses, but does it happen to have a tray?
We are a nice, friendly community here and I hope we stay that way.
Offline
@Doom
Heh!! ... I figured ninjaaron would start that thread sooner or later.
I think I was the one who first linked him to this thread, which probably got him started on his own stuff for herbstluftwm.
Anyways, props to the both of you. 
Point & Squirt
Offline
Hey, so I've decided to give this WM a go.... anyone know how I could get it configured to look like this screenshot:
http://wwwcip.cs.fau.de/~re06huxa/scree … cons-1.png
So I'm guessing the panel up top is.... dzen? The one at the bottom is conky.. but most of all I want to know what the colour/width settings are for the frames and windows. Looks very nice!
Offline
Hey guys I guess it's time for my config 
dotshare has all my configs. I combined doom's next & prev tag scripts into one, called seektag. I also got the colors from xdefs (using code from crshd on dotshare) and I made a little script to open a new split and move the current window to it. 
Punch all your friends.
Offline
Which version of herbstluftwm are you using? I think since 0.3 my scripts next/prevtag are obsolete as the use_index command now does exactly the same
(except for switching only to busy tags, but it should be alot easier to write a bash-script that does that, now that use_index is available. I'd generally recommend you to use the git-repo, as there are changes ~every week and it's stable anyhow. The opensplit-script is nice, as I'm used to ratpoison's behaviour which is similiar, ty 
“From each according to his faculties; to each according to his needs”
Look at the code. Look at the silly code!
Offline
^ Oh yeah I have the use_index command; I saw that I had it after I wrote the seektag.sh.... I guess I should get around to changing it
Although...if I did that it'd use hc to cycle through each one as it went, as opposed to this script which checks each one before it cycles. AFAIK it's actually faster? I haven't checked it though.
thanks about the opensplit!
Punch all your friends.
Offline
Okay, I want it to look as close as possible to dwm/awesome, but with the manual tiling. I've never used dzen and I've got no idea how to get herbstluft started other than having it actually open up.
any help?
Offline
Okay, I want it to look as close as possible to dwm/awesome, but with the manual tiling. I've never used dzen and I've got no idea how to get herbstluft started other than having it actually open up.
any help?
If you really just need a very basic guide to getting started, you could check out my review in the 30 WMs thread, especially the links at the end.
The herbstluftwm home page has good documention, and "man herbstluftwm" and "man herbstclient" are very useful. Also study the herbstluftwm autostart file (it's just a big bash script).
Last edited by 2ManyDogs (2012-04-26 02:11:25)
Be eggsalad to each other.
Offline
I've got it all pretty much done, just have to set up a few autostart things 
exactly what I've been wanting.
Offline
can you have a system tray with this wm? otherwise how do you know something is running in the background or not?
Just tried Herbst today and so far Guake doesnt work with it (didn't work wih wmfs2 either but worked fine with awesome)
Also what's the keyboard shortcut for minimizing and maximizing?
Troll = not a fanatic
Offline
can you have a system tray with this wm?
Yes, by using an application which displays a tray, like trayer or stalonetray.
Just tried Herbst today and so far Guake doesnt work with it (didn't work wih wmfs2 either but worked fine with awesome)
Hmm, well, it doesn't roll in like you'd expect it to.
You could solve that with a little hack with a second virtual monitor though.
Also what's the keyboard shortcut for minimizing and maximizing?
These concepts don't really exist in a tiling window manager. What do you mean exactly?
Flo
Offline
Thanks for the replies, by minimizing I mean:
When I use Awesome it shows icons on minimized apps so yes you can minimize an app - maybe this is because awesome has a taskbar built in, anyway I am not that bothered about that. I do like a system tray though so I can easily see if an app i tried to lauch - launched successfuly and also to see if an app is still running in the background.
i wonder if FBpanel would run with it? i know it does with musca.
Last edited by ChickenPie4Tea (2012-08-27 18:08:35)
Troll = not a fanatic
Offline
Thanks for the replies, by minimizing I mean:
When I use Awesome it shows icons on minimized apps so yes you can minimize an app - maybe this is because awesome has a taskbar built in, anyway I am not that bothered about that. I do like a system tray though so I can easily see if an app i tried to lauch - launched successfuly and also to see if an app is still running in the background.
i wonder if FBpanel would run with it? i know it does with musca.
Minimizing/maximizing windows doesn't belong to "tiling wm" behaviour. It's not for no reason people consider Awesome to be more than a tiler.
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Github || Deviantart
Offline
i wonder if FBpanel would run with it? i know it does with musca.
I bet it does.
My setup: http://cmpl.cc/img/screenshots/hlwm_2012_06_25.png
On the top there is a conky running, on the top right trayer, started like this:
trayer --edge top --align right --widthtype request --heighttype pixel \
--height 22 --expand true --tint 0x222222 --transparent true \
--alpha 0conky config and scripts are at http://g.cmpl.cc/panel2
Offline
hey guys, we figured out a tweak on the thread over at Arch forums that should make herbstluftwm load faster for anyone with a version of it that includes the "chain" command.
There is a line like this in the default autostart file:
function hc() {
herbstclient "$@"
}Comment it out and/or replace it with this:
hc() {
cmds="$cmds , $@"
}Then, at the end of the file, before the "# find the panel" section, add this line:
herbstclient chain $cmds&This pipes all of your settings to herbstluftwm with a single instance of herbstclient rather than dozens of them. It also forks that process so it can find the panel while it's loading your settings. This should offer a noticeable increase in load speed on most systems. May have to modify some things if your autostart has anything wacky in it (like mine).
Not that herbstluftwm loads slowly by default, but no reason not to squeeze out every ounce of performance, especially if you use an older system.
Last edited by ninjaaron (2012-11-27 22:10:20)
Offline
^That's cool! Mind explaining how it works, so my tired brain can rest for a moment? 
“From each according to his faculties; to each according to his needs”
Look at the code. Look at the silly code!
Offline
Resurrecting this thread as it's almost 6 months old and I'm now using Herbstluftwm on two machines. Not much to add to it yet though...
Offline
I have discovered herbstluftwm recently and I'm using it on #! and Arch.I really like this WM.
Offline
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.