SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2011-09-25 11:04:05

Doomicide
#! Junkie
From: the Nightosphere
Registered: 2011-06-24
Posts: 434
Website

Herbstluftwm thread? - Herbstluftwm thread!

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 wink) 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 ranger

Here's a screenshot of my usual setup on tag 1
tYWl0dQ

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

Help fund CrunchBang, donate to the project!

#2 2011-10-03 16:15:27

Doomicide
#! Junkie
From: the Nightosphere
Registered: 2011-06-24
Posts: 434
Website

Re: Herbstluftwm thread? - Herbstluftwm thread!

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  $prevtag

and 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  $nextag

Now 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

#3 2011-10-03 17:19:43

gutterslob
#! Resident Bum
Registered: 2009-11-03
Posts: 2,646

Re: Herbstluftwm thread? - Herbstluftwm thread!

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. smile

Last edited by gutterslob (2011-10-03 17:19:53)


Point & Squirt

Offline

#4 2011-10-03 17:23:50

Awebb
The Singularity
Registered: 2009-07-23
Posts: 2,812

Re: Herbstluftwm thread? - Herbstluftwm thread!

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

#5 2011-10-03 17:54:44

Doomicide
#! Junkie
From: the Nightosphere
Registered: 2011-06-24
Posts: 434
Website

Re: Herbstluftwm thread? - Herbstluftwm thread!

@ gutterslob: no problem wink
@ 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

#6 2011-10-05 07:25:19

.not
#! Junkie
Registered: 2011-09-03
Posts: 340

Re: Herbstluftwm thread? - Herbstluftwm thread!

Awebb wrote:

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

#7 2011-10-20 16:12:16

Doomicide
#! Junkie
From: the Nightosphere
Registered: 2011-06-24
Posts: 434
Website

Re: Herbstluftwm thread? - Herbstluftwm thread!

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

#8 2011-10-21 17:33:39

h8uthemost
#! Junkie
Registered: 2011-08-09
Posts: 286

Re: Herbstluftwm thread? - Herbstluftwm thread!

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

#9 2011-10-21 18:17:56

gutterslob
#! Resident Bum
Registered: 2009-11-03
Posts: 2,646

Re: Herbstluftwm thread? - Herbstluftwm thread!

@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. smile


Point & Squirt

Offline

#10 2012-02-29 13:33:26

Vixus
New Member
Registered: 2011-08-29
Posts: 5

Re: Herbstluftwm thread? - Herbstluftwm thread!

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

#11 2012-04-11 18:54:54

mahatman2
#! Die Hard
From: Chattanooga TN
Registered: 2009-09-13
Posts: 550

Re: Herbstluftwm thread? - Herbstluftwm thread!

Hey guys I guess it's time for my config smile

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. cool


Punch all your friends.

Offline

#12 2012-04-13 18:04:09

Doomicide
#! Junkie
From: the Nightosphere
Registered: 2011-06-24
Posts: 434
Website

Re: Herbstluftwm thread? - Herbstluftwm thread!

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 wink (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 smile


“From each according to his faculties; to each according to his needs”
Look at the code. Look at the silly code!

Offline

#13 2012-04-14 02:53:12

mahatman2
#! Die Hard
From: Chattanooga TN
Registered: 2009-09-13
Posts: 550

Re: Herbstluftwm thread? - Herbstluftwm thread!

^ 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 tongue

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

#14 2012-04-26 01:31:21

thevdude
#! Junkie
From: Pittsburgh, PA
Registered: 2011-09-01
Posts: 469

Re: Herbstluftwm thread? - Herbstluftwm thread!

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.

hmm any help?

Offline

#15 2012-04-26 02:07:19

2ManyDogs
dv#!
From: elsewhere
Registered: 2011-11-22
Posts: 1,346

Re: Herbstluftwm thread? - Herbstluftwm thread!

thevdude wrote:

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.

hmm 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

#16 2012-04-26 04:12:20

thevdude
#! Junkie
From: Pittsburgh, PA
Registered: 2011-09-01
Posts: 469

Re: Herbstluftwm thread? - Herbstluftwm thread!

I've got it all pretty much done, just have to set up a few autostart things big_smile

http://i.imgur.com/e3OE7.png

big_smile exactly what I've been wanting.

Offline

#17 2012-08-27 17:31:31

ChickenPie4Tea
#! Junkie
Registered: 2012-02-17
Posts: 338

Re: Herbstluftwm thread? - Herbstluftwm thread!

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

#18 2012-08-27 17:51:26

The Compiler
New Member
Registered: 2012-08-27
Posts: 3

Re: Herbstluftwm thread? - Herbstluftwm thread!

ChickenPie4Tea wrote:

can you have a system tray with this wm?

Yes, by using an application which displays a tray, like trayer or stalonetray.

ChickenPie4Tea wrote:

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.

ChickenPie4Tea wrote:

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

#19 2012-08-27 18:08:05

ChickenPie4Tea
#! Junkie
Registered: 2012-02-17
Posts: 338

Re: Herbstluftwm thread? - Herbstluftwm thread!

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

#20 2012-08-27 18:23:49

Unia
#! Die Hard
From: The Netherlands
Registered: 2010-07-17
Posts: 3,113

Re: Herbstluftwm thread? - Herbstluftwm thread!

ChickenPie4Tea wrote:

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

#21 2012-08-27 19:55:10

The Compiler
New Member
Registered: 2012-08-27
Posts: 3

Re: Herbstluftwm thread? - Herbstluftwm thread!

ChickenPie4Tea wrote:

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 0

conky config and scripts are at http://g.cmpl.cc/panel2

Offline

#22 2012-11-27 22:09:32

ninjaaron
#! CrunchBanger
From: userland
Registered: 2011-10-22
Posts: 212
Website

Re: Herbstluftwm thread? - Herbstluftwm thread!

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

#23 2012-11-28 12:07:37

Doomicide
#! Junkie
From: the Nightosphere
Registered: 2011-06-24
Posts: 434
Website

Re: Herbstluftwm thread? - Herbstluftwm thread!

^That's cool! Mind explaining how it works, so my tired brain can rest for a moment? big_smile


“From each according to his faculties; to each according to his needs”
Look at the code. Look at the silly code!

Offline

#24 2013-04-05 16:50:44

dura
Bloated Gimp
From: interzone
Registered: 2012-09-15
Posts: 2,081

Re: Herbstluftwm thread? - Herbstluftwm thread!

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

Be excellent to each other!

#25 2013-04-05 16:56:19

PinkPanther
Member
From: inferno
Registered: 2013-04-03
Posts: 29

Re: Herbstluftwm thread? - Herbstluftwm thread!

I have discovered herbstluftwm recently and I'm using it on #! and Arch.I really like this WM.

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo