You are not logged in.

#201 2012-04-29 11:56:49

thorsten
Member
From: Germany
Registered: 2010-02-24
Posts: 151

Re: herbstluftwm

Doomcide wrote:

I think I've found a bug: raise_on_click doesn't work.
From my autostart:

hc set focus_follows_mouse 1
hc set raise_on_click 1
hc set raise_on_focus 0
hc set focus_follows_shift 1

I can't raise a window in floating mode with this settings.

I fixed that issue in the raise_on_click branch. I'll merge it to the master-branch after I tested it on a thin-client-setup tomorrow which often behaves different at those mouse-grabbing-things.

I also added many planned features to the BUGS-file:

diff --git a/BUGS b/BUGS
+    - or: chain commands like: cmdchain 4 cmd1 arg1a arg1b arg1c cmd2 arg2a arg2b
+    - alias commands: alias shortcmd = cmd default arg, alias shortcmd --delete
+    - undo command which undos the last layout changes on a certain tag
+    - load frame without changing it's properties to just change the
+      child-frames. Something like: (split unchanged $child1 child2)
+    - a more verbose tag_status: list_tags with one line per tag
+    - cycle through all "invisible" (or non-focused) frames

Offline

#202 2012-04-29 12:17:04

Doomcide
Member
Registered: 2011-08-22
Posts: 221

Re: herbstluftwm

Thanks, looking forward to it.

Edit: I just patched and it works flawlessly. smile

Last edited by Doomcide (2012-04-30 16:04:40)

Offline

#203 2012-05-07 18:45:08

ibrunton
Member
From: Canada
Registered: 2011-05-05
Posts: 270

Re: herbstluftwm

I don't know if this is a bug, or if I've missed something in the docs, but I'm having a peculiar issue with the image-viewing programs geeqie and sxiv.  Both have the feature of resizing their own window based on the dimensions of the image, but in herbstluftwm floating mode, the windows will not resize.  Is there something I could put in the autostart file, or in a script, that would take care of this?

Other than that, I'm really enjoying herbstluftwm, and I'm even getting used to typing the name of it!  Thank you for your hard work, thorsten!

Offline

#204 2012-05-08 14:29:22

thorsten
Member
From: Germany
Registered: 2010-02-24
Posts: 151

Re: herbstluftwm

ibrunton wrote:

I don't know if this is a bug, or if I've missed something in the docs, but I'm having a peculiar issue with the image-viewing programs geeqie and sxiv.  Both have the feature of resizing their own window based on the dimensions of the image, but in herbstluftwm floating mode, the windows will not resize.  Is there something I could put in the autostart file, or in a script, that would take care of this?

It's not documented and not configurable: It just is not possible in old versions (0.3 or older). And exactly this is working in floating and pseudotile-mode in the current git-version (It was added by commit 1dfddc9)

ibrunton wrote:

Other than that, I'm really enjoying herbstluftwm, and I'm even getting used to typing the name of it!  Thank you for your hard work, thorsten!

Thanks. You're welcome to join #herbstluftwm on freenode.

Offline

#205 2012-05-08 15:10:21

ibrunton
Member
From: Canada
Registered: 2011-05-05
Posts: 270

Re: herbstluftwm

thorsten wrote:

It's not documented and not configurable: It just is not possible in old versions (0.3 or older). And exactly this is working in floating and pseudotile-mode in the current git-version (It was added by commit 1dfddc9)

Sweet!  Thanks again!

Offline

#206 2012-05-12 13:38:53

Yannick_LM
Member
Registered: 2008-12-22
Posts: 142

Re: herbstluftwm

Just an other thank you.

Just switched from wmii. I was quickly able to get almost the same behavior as wmii, with less bugs, and more features.

Config files in plain bash is really a great idea !

EDIT: or you can just write them in Python3, as I did after a few tries smile

BTW, here is my config on github if anyone is curious

Last edited by Yannick_LM (2012-05-12 17:02:45)

Offline

#207 2012-05-21 23:03:25

measure
Member
Registered: 2009-07-17
Posts: 62

Re: herbstluftwm

I've been a dwm user for a long time.  For whatever reason (mostly that the flextile patch doesn't seem to work with dwm 6+), I decided to start again a journey for a new WM.  I almost settled on WMII, but it just didn't feel quite right.  What it did teach me is that I really wanted a more manual tiling WM which uses the frames concept.  As with many other anal-retentive people, what I really wanted was a WM which I could configure to work EXACTLY as I want.  Hence I've quite happily settled with Herbstluftwm.  With this WM it seems that as long as you're willing to write a script for it, you can achieve any behavior you want.

I haven't got it completely where I want it, but I'm not too far way.  Essentially I have it configured to work with one or two horizontally split frames (much like dwm without the notion of a "master" frame).  I haven't yet found a satisfactory way of detecting when a frame is empty (checking each frame each time focus changes seems inelegant and sloppy to me).  Also my method of having have Mod-Tab go to the last used tag is a bit ugly, but it's not so awful.  Anyway, here are my configs:

autostart

#!/bin/bash

export HLWM_PATH=~/.config/herbstluftwm
export FONT='-*-terminus-*-r-normal-*-12-*-*-*-*-*-iso8859-*'

function hc() { herbstclient "$@"; }

hc emit_hook reload

# remove all existing keybindings
hc keyunbind --all

# general settings
hc set focus_follows_mouse 1

# exterior
hc set frame_border_width 0
hc set always_show_frame 0
hc set window_gap 0
hc set window_border_width 1
hc set frame_bg_normal_color '#000000'
hc set frame_bg_active_color '#222222'
hc set window_border_normal_color '#333333'
hc set window_border_active_color '#cc0000'
hc pad 0 15

# status
exec $HLWM_PATH/hlwm_status &

# run hooks
hc emit_hook kill_hooks
for hook in $HLWM_PATH/hooks/*; do
	 exec $hook &
done

# keybindings
Mod=Mod1
hc keybind $Mod-Shift-q spawn $HLWM_PATH/quit
hc keybind $Mod-Shift-r reload
hc keybind $Mod-Shift-c close
hc keybind $Mod-Shift-Return spawn urxvt
hc keybind $Mod-p spawn dmenu_run \
	 -i -fn "$FONT" -nb "#222222" -nf "#cccccc" -sb "#444444" -sf "#ffffff"

# 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
# dwm style alt-tab
hc keybind $Mod-Tab spawn $HLWM_PATH/use_last_tag

# layouting
hc keybind $Mod-w remove
hc keybind $Mod-space cycle_layout 2

# resizing
RESIZESTEP=0.05
hc keybind $Mod-u resize left +$RESIZESTEP
hc keybind $Mod-o resize right +$RESIZESTEP

# focus
hc keybind $Mod-h focus left
hc keybind $Mod-j cycle 1
hc keybind $Mod-k cycle -1
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 spawn $HLWM_PATH/shift_right

# rules
hc unrule -F
#hc rule class=XTerm tag=3 # move all xterms to tag 3
hc rule focus=off # normally do not focus new clients
hc rule class~'(Firefox.*|Vimperator.*)' tag=2
hc rule class~'(.*[Rr]xvt.*|.*[Tt]erm|Konsole)' focus=on
hc rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' pseudotile=on
hc rule windowtype='_NET_WM_WINDOW_TYPE_DIALOG' focus=on
hc rule windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK)' manage=off

# unlock, just to be sure
hc unlock

My panel script is potentially quite different from the usual panel.sh, though I didn't really look at it too closely

#!/bin/bash
# kill existing panels
killall conky dzen2
herbstclient emit_hook close_panel
# note $FONT is defined in autostart
conky | dzen2 -w 900 -x 540 -ta r -fn "$FONT" &
herbstclient --idle 'close_panel|tag_flags|tag_changed.*' | \
	 while read -r; do
		  [ "$REPLY" == "close_panel" ] && exit $?
		  herbstclient tag_status | sed -e 's/\t\.[0-9a-Z]*//g' -e 's/\t/ /g'
	 done | dzen2 -w 540 -ta l -fn "$FONT"

Here's an example of a hook.  In particular, this is what I use to have Mod-Tab change to the previously viewed tag

#!/bin/bash
herbstclient --idle 'kill_hooks|tag_changed.*' | while read -r; do
		  if [ "$REPLY" == "kill_hooks" ]; then
				echo "last_tag hook closing!"
				exit $?
		  fi
		  cat $HLWM_PATH/.current_tag > $HLWM_PATH/.last_tag
		  echo "$REPLY" | cut -f2 > $HLWM_PATH/.current_tag
	 done

I've tried to make the hooks I use trigger as infrequently as possible to avoid scripts running too frequently.  All in all I'm quite happy.  I was getting especially restless with my system and this gave me a project to work on to waste time (we of course always need such a thing).

Anyway, many thanks for an excellent WM!


Thanks,
Ryan

Offline

#208 2012-05-22 09:20:01

bloom
Member
Registered: 2010-08-18
Posts: 749
Website

Re: herbstluftwm

measure wrote:
cat $HLWM_PATH/.current_tag > $HLWM_PATH/.last_tag

You could just write:

mv $HLWM_PATH/.current_tag $HLWM_PATH/.last_tag

instead.


gh · da · ds · cr · ab · fkr

Offline

#209 2012-05-22 14:52:48

measure
Member
Registered: 2009-07-17
Posts: 62

Re: herbstluftwm

bloom wrote:

[
You could just write:

mv $HLWM_PATH/.current_tag $HLWM_PATH/.last_tag

instead.

I considered this, but somewhat arbitrarily decided that overwriting the file was the better option (my potentially misled reasoning was that the creation of  a new file is more costly than writing to an existing file), though I agree the mv command looks better aesthetically.  Do you know which is more costly?   Obviously no one is pressing Mod-Tab all over the place, so it doesn't really matter, but there's something to be said for little tweaks here and there once you make enough of them.

To keep this response somewhat on topic, I'll reiterate that this is an instance where it'd be quite nice to be able to set variables from within herbstluftwm.


Thanks,
Ryan

Offline

#210 2012-05-23 11:40:39

syngin
Member
From: Melbourne
Registered: 2011-03-29
Posts: 39

Re: herbstluftwm

measure wrote:

I considered this, but somewhat arbitrarily decided that overwriting the file was the better option (my potentially misled reasoning was that the creation of  a new file is more costly than writing to an existing file), though I agree the mv command looks better aesthetically.  Do you know which is more costly?

The mv operation should be cheaper as it's a filesystem operation whereas cat opens, reads, pipes, etc.

Offline

#211 2012-05-24 00:32:27

syngin
Member
From: Melbourne
Registered: 2011-03-29
Posts: 39

Re: herbstluftwm

Has anyone had any problems running Herbst over three heads? I've noticed some weirdness happening on my third screen (windows staying "stuck" when I switch tags, other windows popping in and out when I change tags, my panel's "current tag" highlight not working properly, etc).

Offline

#212 2012-05-24 12:07:28

thorsten
Member
From: Germany
Registered: 2010-02-24
Posts: 151

Re: herbstluftwm

syngin wrote:

Has anyone had any problems running Herbst over three heads? I've noticed some weirdness happening on my third screen (windows staying "stuck" when I switch tags,

I just tested it with this configuration:

w=1440
h=900
herbstclient set_monitors $((w/2))x${h}+0+0 $((w/2))x$((h/2))+$((w/2))+{0,$((h/2))}

And I can't notice any problems.

syngin wrote:

other windows popping in and out when I change tags,

This sounds like you have one window in fullscreen mode and another window not in fullscreen on the same tag. If yes, then this is a known bug.

syngin wrote:

my panel's "current tag" highlight not working properly, etc).

Are you using a current panel.sh version (the flags listed by tag_status changed some weeks ago)

Offline

#213 2012-05-25 01:06:51

syngin
Member
From: Melbourne
Registered: 2011-03-29
Posts: 39

Re: herbstluftwm

thorsten wrote:

snip

Thanks, all sorted now. Sick WM.

Offline

#214 2012-05-26 02:10:45

ninjaaron
Member
Registered: 2010-12-10
Posts: 284

Re: herbstluftwm

I had gotten so used to hlwm that I had forgotten about how wonderful it was.  I got a new monitor the other day.  My appreciation is renewed.  This WM friggin' rules.

Offline

#215 2012-05-28 00:17:16

syngin
Member
From: Melbourne
Registered: 2011-03-29
Posts: 39

Re: herbstluftwm

I've got Opera (this happens with all GUI browsers and Libreoffice as well) running and if I switch to float, the application window shunts off to the right side of the monitor (about 20px are visible on the monitor where the app was started) and it takes a lot of left dragging to bring it back. This also happens with dialogs created by the application. Is this known?

Offline

#216 2012-05-29 16:00:24

ibrunton
Member
From: Canada
Registered: 2011-05-05
Posts: 270

Re: herbstluftwm

I'm working on a status bar dzen2 script, based on the default one, but I've run into a bizarre problem.

I have the following code, taken verbatim from the default panel:

	TAGS=( $(herbstclient tag_status $monitor) )
	while true ; do
		for i in "${TAGS[@]}" ; do
			echo -n "^ca(1,herbstclient focus_monitor $monitor && "'herbstclient use "'${i:1}'") '${i:2}" ^ca()"
		done
	done

But for some reason, rather than getting clickable tags, I get this:

	1[]#2[]:3[]:4[]:5[].6	

(where [] is actually a single box character).  Obviously what's happening is that the $TAGS variable is a single string, not an array; the '#' is getting discarded from the front of the string by ${i:1}.  The same issue shows up if I run the default panel /etc/xdg/herbstluftwm/panel.sh.  I also get the same result of I replace the 'echo' line with

echo -n ${i:1}

I'm running herbstluftwm-git and dzen2-svn.

Any ideas what could be the problem here?  I swear it was working briefly yesterday.  I've looked up the bash array syntax, and I'm pretty sure I've got it right.

Offline

#217 2012-05-29 18:07:18

bootleg
Member
Registered: 2010-12-08
Posts: 38

Re: herbstluftwm

Well with herbstluftwm-git and dzen2-svn your code works as expected for me hmm

I tried with this script:

#!/bin/bash

monitor=0
TAGS=( $(herbstclient tag_status $monitor) )
while true ; do
    for i in "${TAGS[@]}" ; do
        echo -n "^ca(1,herbstclient focus_monitor $monitor && "'herbstclient use "'${i:1}'") '${i:2}" ^ca()"
    done
    echo
    sleep 1                                                                                                                                                                                                                       
done

and running it with

./test | dzen2

Offline

#218 2012-05-29 18:54:30

ibrunton
Member
From: Canada
Registered: 2011-05-05
Posts: 270

Re: herbstluftwm

bootleg wrote:

Well with herbstluftwm-git and dzen2-svn your code works as expected for me hmm

I tried with this script:

#!/bin/bash

monitor=0
TAGS=( $(herbstclient tag_status $monitor) )
while true ; do
    for i in "${TAGS[@]}" ; do
        echo -n "^ca(1,herbstclient focus_monitor $monitor && "'herbstclient use "'${i:1}'") '${i:2}" ^ca()"
    done
    echo
    sleep 1                                                                                                                                                                                                                       
done

and running it with

./test | dzen2

That works for me as well.  But my own script doesn't.

Offline

#219 2012-05-29 22:07:36

thorsten
Member
From: Germany
Registered: 2010-02-24
Posts: 151

Re: herbstluftwm

syngin wrote:

I've got Opera (this happens with all GUI browsers and Libreoffice as well) running and if I switch to float, the application window shunts off to the right side of the monitor (about 20px are visible on the monitor where the app was started) and it takes a lot of left dragging to bring it back. This also happens with dialogs created by the application. Is this known?

Are you using multiple monitors? If yes, then the problem is: some applications try to place themself in the center of *both* screens or even on the second monitor. But hlwm interpretes these coordinates as coordinates relative to the monitor, so they are that far on the right. The problem is, that most applications don't do that, so I didn't find a good solution for both applications yet.

ibrunton wrote:

That works for me as well.  But my own script doesn't.

I guess that your shebang line (the first line of your script) maybe isn't correct. (maybe you used /bin/sh or /bin/zsh instead of /bin/bash?)

Offline

#220 2012-05-30 00:10:51

syngin
Member
From: Melbourne
Registered: 2011-03-29
Posts: 39

Re: herbstluftwm

thorsten wrote:
syngin wrote:

I've got Opera (this happens with all GUI browsers and Libreoffice as well) running and if I switch to float, the application window shunts off to the right side of the monitor (about 20px are visible on the monitor where the app was started) and it takes a lot of left dragging to bring it back. This also happens with dialogs created by the application. Is this known?

Are you using multiple monitors? If yes, then the problem is: some applications try to place themself in the center of *both* screens or even on the second monitor. But hlwm interpretes these coordinates as coordinates relative to the monitor, so they are that far on the right. The problem is, that most applications don't do that, so I didn't find a good solution for both applications yet.


Yeah, I am. Thanks again, Thorsten.

Offline

#221 2012-05-30 11:30:06

ibrunton
Member
From: Canada
Registered: 2011-05-05
Posts: 270

Re: herbstluftwm

thorsten wrote:
ibrunton wrote:

That works for me as well.  But my own script doesn't.

I guess that your shebang line (the first line of your script) maybe isn't correct. (maybe you used /bin/sh or /bin/zsh instead of /bin/bash?)

No, definitely /bin/bash.

I got it working last night, but it seems that the TAGS=( ... ) line only works outside of a { } block.  No idea why, but if I put it outside a block, it works, and if I put it back inside, it doesn't work.  Like I said before, even the default panel.sh script has the same problem (on my machine, at least).

Offline

#222 2012-06-09 17:10:12

bloom
Member
Registered: 2010-08-18
Posts: 749
Website

Re: herbstluftwm

I made a patch wich provides an option (smart_surroundings) to remove window/frame borders/gaps whenever possible:

hlwm-smart_surroundings.patch

Last edited by bloom (2012-06-17 12:10:55)


gh · da · ds · cr · ab · fkr

Offline

#223 2012-06-29 06:42:44

insanum
Member
Registered: 2007-01-15
Posts: 26
Website

Re: herbstluftwm

Been using herbstluftwm for a couple weeks now.  Loving it.  Only gripe is not being able to float a single window, but I understand that is being thought about and on the todo list.  smile

I enhanced the layout.sh example to include window titles.  Also made an example that pipes the output to xosd.  See OSD overlay text in upper left of screenshot.  Being able to script/hack these things is so much fun.

5fd317199126247.jpg

#!/bin/bash

source /etc/bash_completion.d/herbstclient-completion

# alias hc and add completion for it
function _hc_complete() {
    COMPREPLY=(
        $(herbstclient -q complete "$((COMP_CWORD-1))" "${COMP_WORDS[@]:1}")
    )
}
complete -F _hc_complete hc
alias hc=herbstclient

function hcs() # dump current herbstluftwm settings
{
    for s in `herbstclient complete 1 set`; do
        echo "$s = `herbstclient get $s`"
    done
}

function hc_cur_tag()
{
    herbstclient tag_status | /bin/grep -oP "\t#[^\t]*" | cut -b 3
}

function hcl() # dump current herbstluftwm layout for all tags
{
    local TAGC="${1:+`tput setaf 5`}"
    local WINDOWC="${1:+`tput setaf 3`}"
    local TITLEC="${1:+`tput setaf 4`}"
    local CLEAR="${1:+`tput sgr0`}"

    herbstclient complete 1 use |
    while read t; do
        TAG="$t: "
        indent=$(echo -n "$TAG" | sed 's/./ /g')
        TAG="${TAGC}${TAG}${CLEAR}"

        LAYOUT=`herbstclient layout $t`

        echo -e "${TAG}${LAYOUT}" \
            | sed "2,\$ s/^/$indent/" \
            | sed "s/\(0x[0-9a-f]\{1,\}\)/${WINDOWC}\1${CLEAR}/g"

        echo -e "$LAYOUT" | /bin/grep -oE "0x[0-9a-f]{1,}" |
        while read w; do
            echo -n "$indent${WINDOWC}$w${CLEAR} - "
            echo    "${TITLEC}`xdotool getwindowname $w`${CLEAR}"
        done
    done
}

function hcosd()
{
    local FGCLR=white
    local OLCLR=blue
    local OUTL=2
    local DELAY=10
    local FONT='-*-terminus-bold-r-*-*-22-*-*-*-*-*-*-*'

    echo -e "$1"                            \
        | osd_cat -A left                   \
                  -i 0                      \
                  -o 5                      \
                  -d $DELAY                 \
                  -O $OUTL                  \
                  -c $FGCLR                 \
                  -u $OLCLR                 \
                  -l `echo -e "$1" | wc -l` \
                  -f $FONT
}

function hclo()
{
    local TS=`herbstclient get tree_style`
    herbstclient set tree_style '*| +`--.'
    local TXT=`hcl`
    herbstclient set tree_style "$TS"
    hcosd "$TXT"
}

Keybinding:

hc keybind $Mod-Shift-o spawn bash -c hclo

Last edited by insanum (2012-06-29 07:02:57)

Offline

#224 2012-07-04 19:24:30

andmars
Member
Registered: 2012-03-13
Posts: 153

Re: herbstluftwm

hi, I'm new to herbstluftwm and I noticed that hlwm won't let me play minecraft. When I start the game through dmenu it loads but when I hit F11 (default in minecraft) for fullscreen it flickers to fullscreen for a second and then goes back to window mode. hlwm won't even let me play in window mode since it always throws me back to the minecraft menu. I tried pseudo-float ($MOD+s in my case) and hlwm window fullscreen ($MOD+f) but nothing worked. In dwm or monsterwm this is not a problem. The game starts in window mode there, too, but with F11 it goes fullscreen and I can play.

Thanks in advance and here's a screenshot;
2012_07_04_211605_1920x1080_scrot.jpg

EDIT: I added this line to my autostart file which let's me start the game in a fullscreen window but won't let me go really fullscreen and play:

hc rule class='net-minecraft-LauncherFrame' fullscreen=on

2012_07_05_094249_1920x1080_scrot.jpg

EDIT 2: ok, Problem solved with this line in .xinitrc

export _JAVA_AWT_WM_NONREPARENTING=1 &

http://awesome.naquadah.org/wiki/Problems_with_Java

Last edited by andmars (2012-07-05 21:36:44)

Offline

#225 2012-07-04 19:34:17

andmars
Member
Registered: 2012-03-13
Posts: 153

Re: herbstluftwm

...

Last edited by andmars (2012-07-04 21:01:05)

Offline

Board footer

Powered by FluxBB