You are not logged in.

#426 2015-08-11 09:03:04

chickenPie4tea
Member
Registered: 2012-08-21
Posts: 309

Re: herbstluftwm

Wow thanks for a super quick reply- you don't miss anything smile  switchtag is exactly what I was looking for.


You can like linux without becoming a fanatic!

Offline

#427 2015-11-14 21:39:17

Shinryuu
Member
From: /dev/urandom
Registered: 2010-02-27
Posts: 339

Re: herbstluftwm

Hey! I'm interested to know if it is possible to use symbols from a font as tag names through herbstluftwm's autostart file? At least I haven't had any success yet with siji or stlarch fonts at all. I'm trying to achieve something like this:
8e67b3.png

Offline

#428 2015-11-14 23:48:00

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

Re: herbstluftwm

Shinryuu wrote:

I'm interested to know if it is possible to use symbols from a font as tag names through herbstluftwm's autostart file?

The tag names are just ordinary texts without font information (for good reasons). What you can (and should) do is configuring your panel in such a way, that it shows the icons/symbols/pictures instead of tag names. To accomplish that, copy any panel.sh you like to your home and adjust it the way you like. You could either use the one that is shipped with hlwm or any other panel-script out there, e.g. mine which uses lemonbar.

Offline

#429 2015-11-14 23:55:45

Shinryuu
Member
From: /dev/urandom
Registered: 2010-02-27
Posts: 339

Re: herbstluftwm

Thanks for the reply. I've been on lemonbar for quite a while but I'm not that experienced with scripting and stuff. I'll try to look what I can do with this smile

Offline

#430 2016-01-13 18:14:14

pjhalsli
Member
From: Trondheim, Norway
Registered: 2014-10-17
Posts: 7

Re: herbstluftwm

Hi.

I'm completely new to herbstluftwm and I have a noob question about the way it tiles.
Say I open 3 terminals - they will open one at bottom half and 2 on top half (a quarter each)
I now want to move the one at top left so it occupies my left half of the screen and the others two take a quarter screen each on the right side.
The logical way to do this would be to mod+shift+h on the top left one but that just doesn't work. So if someone could tell me how I'd be really grateful?

Edit:
What I'm wondering about is within the first frame. With a second frame I know how

Last edited by pjhalsli (2016-01-14 04:17:33)


Too old to know better
Still too young to care

Offline

#431 2016-01-15 11:47:48

wirr
Member
Registered: 2009-10-25
Posts: 70

Re: herbstluftwm

pjhalsli wrote:

Edit:
What I'm wondering about is within the first frame. With a second frame I know how

You can't do that within one frame, thats why there are frames in the first place.

Use $Mod-space to cycle through the four available layouts within a frame, or use:

$ herbstclient herbstclient cycle_layout

Offline

#432 2016-01-15 15:55:03

pjhalsli
Member
From: Trondheim, Norway
Registered: 2014-10-17
Posts: 7

Re: herbstluftwm

@ wirr

Thanks for clarifying  - it's the only thing I couldn't figure out.
My 5th day on Herbstluft now and I'm loving it more and more each day. Been using i3 for the last 14+ months so there are some new things to get used to but it's all good


Too old to know better
Still too young to care

Offline

#433 2017-08-04 20:28:17

mouseman
Member
From: Outta nowhere
Registered: 2014-04-04
Posts: 291

Re: herbstluftwm

From Awesome to i3 back to Awesome, to i3 again and now Herbstluftwm. My most important feature was so hard if not impossible on the other ones (persistent layout even after closing the last program in a tile) and Hlwm does it out of the box. The config is pretty easy to understand.

I'm new to Hlwm (fresh since a couple of hours) but I'm a fan already.

One question. I copy/pasted the gimp config example from the website and after a reload I get a cool new gimp tag next to the 1-9. I see the block where the tag_names and keys are set with their hotkeys, but I'm not sure how to change that to set one for gimp (let's say, 0).

I tried:

# tags
tag_names=( "One" "Two" "Three" "Four" "Five" "Six" "Seven" "Eight" "Nine" )
tag_keys=( {1..9} 0 )

hc rename default "${tag_names[0]}" || true
for i in ${!tag_names[@]} ; do
    hc add "${tag_names[$i]}"
    key="${tag_keys[$i]}"
    if ! [ -z "$key" ] ; then
        hc keybind "$Mod-$key" use_index "$i"
        hc keybind "$Mod-Shift-$key" move_index "$i"
    fi
done

Then below the Gimp code from the website:

hc keybind $Mod-0 use_index Gimp
hc keybind $Mod-Shift-0 move_index Gimp

Mod-0 switches to tag 1 and instead of replacing the "1" "2" "3" tags with "One" "Two" "Three", it has added them. -> a reload didn't help, but quit/restart fixed the double tags. Mod-0 is still not switching to gimp though.

What am I doing wrong?

Last edited by mouseman (2017-08-04 20:56:07)

Offline

#434 2017-08-07 08:40:06

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

Re: herbstluftwm

mouseman wrote:

Then below the Gimp code from the website:

hc keybind $Mod-0 use_index Gimp
hc keybind $Mod-Shift-0 move_index Gimp

Mod-0 switches to tag 1 and instead of replacing the "1" "2" "3" tags with "One" "Two" "Three", it has added them. -> a reload didn't help, but quit/restart fixed the double tags. Mod-0 is still not switching to gimp though.

What am I doing wrong?

for gimp, you need to use the use and move command, because use_index expects a tag index, whereas gimp is the name of the tag. Tag names are case sensitive, so you need to spell it consistently (e.g. Gimp everywhere or gimp everywhere).

Offline

#435 2017-08-07 09:16:09

mouseman
Member
From: Outta nowhere
Registered: 2014-04-04
Posts: 291

Re: herbstluftwm

thorsten wrote:
mouseman wrote:

Then below the Gimp code from the website:

hc keybind $Mod-0 use_index Gimp
hc keybind $Mod-Shift-0 move_index Gimp

Mod-0 switches to tag 1 and instead of replacing the "1" "2" "3" tags with "One" "Two" "Three", it has added them. -> a reload didn't help, but quit/restart fixed the double tags. Mod-0 is still not switching to gimp though.

What am I doing wrong?

for gimp, you need to use the use and move command, because use_index expects a tag index, whereas gimp is the name of the tag. Tag names are case sensitive, so you need to spell it consistently (e.g. Gimp everywhere or gimp everywhere).

Thanks! That worked!

One more Q if you don't mind smile.

Sometimes when I am moving/reordering windows, a window gets placed on top of another, sharing the tile they are in. Using mod-tab, I cycle through all the windows/tiles and that brings the window in the back to the top. But this is happening accidentally and I have idea how I am doing it. It's like the tabs in i3 but without the tabs tongue.

How are windows placed on top of each other on the same tile? And is there a way to cycle through windows within a tile only, instead of having to go through all of them with mod-tab?

Thanks again!

Offline

#436 2017-08-07 09:19:47

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

Re: herbstluftwm

mouseman wrote:

Sometimes when I am moving/reordering windows, a window gets placed on top of another, sharing the tile they are in. Using mod-tab, I cycle through all the windows/tiles and that brings the window in the back to the top. But this is happening accidentally and I have idea how I am doing it. It's like the tabs in i3 but without the tabs tongue.

How are windows placed on top of each other on the same tile? And is there a way to cycle through windows within a tile only, instead of having to go through all of them with mod-tab?

Thanks again!

The layout of the windows within a tile is changed using the cycle_layout command, it's bound to Mod-Space per default; if you do not need all of those layouts, you can modify the cycle_layout line in your autostart. You can switch between windows within a tile with the cycle command, bound to Mod-c per default.

Offline

#437 2017-08-07 09:31:23

mouseman
Member
From: Outta nowhere
Registered: 2014-04-04
Posts: 291

Re: herbstluftwm

thorsten wrote:
mouseman wrote:

Sometimes when I am moving/reordering windows, a window gets placed on top of another, sharing the tile they are in. Using mod-tab, I cycle through all the windows/tiles and that brings the window in the back to the top. But this is happening accidentally and I have idea how I am doing it. It's like the tabs in i3 but without the tabs tongue.

How are windows placed on top of each other on the same tile? And is there a way to cycle through windows within a tile only, instead of having to go through all of them with mod-tab?

Thanks again!

The layout of the windows within a tile is changed using the cycle_layout command, it's bound to Mod-Space per default; if you do not need all of those layouts, you can modify the cycle_layout line in your autostart. You can switch between windows within a tile with the cycle command, bound to Mod-c per default.

Thanks!

I'm really happy with hlwm, and I hope you'll continue developing it.

Offline

#438 2017-09-02 01:46:55

Zar Marco
Member
From: Colle Umberto, Italy
Registered: 2017-07-31
Posts: 35

Re: herbstluftwm

Hi guys, I did not read the whole thread because I don't have a good English.I've seen some screenshots to this wm, it's very pretty and it's wonderful that all settings are scripts.I've an question, very noob, can I do make these scripts if I use zsh instead bash?

Offline

#439 2017-09-02 09:58:23

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

Re: herbstluftwm

Zar Marco wrote:

Hi guys, I did not read the whole thread because I don't have a good English.I've seen some screenshots to this wm, it's very pretty and it's wonderful that all settings are scripts.I've an question, very noob, can I do make these scripts if I use zsh instead bash?

Hey,

yes, you can use all those scripts if you use zsh: the first line of all files contain a shebang #!/usr/bin/env bash telling that the script has to be interpreted by bash. So even if you call a script from your zsh, the script itself is executed with bash.

Offline

#440 2017-09-02 10:37:32

Zar Marco
Member
From: Colle Umberto, Italy
Registered: 2017-07-31
Posts: 35

Re: herbstluftwm

Hi, very well. In next days I will try herbstluftwm. Thanks

Offline

#441 2017-10-28 07:28:31

Hund
Member
From: Sweden
Registered: 2010-03-22
Posts: 479
Website

Re: herbstluftwm

Does anyone know how to move the focused tag to the next/previous monitor? With i3 you have `move workspace to output right/left`. But it seems a bit more complicated for hlwm.

Offline

#442 2017-10-29 07:02:45

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

Re: herbstluftwm

Hund wrote:

Does anyone know how to move the focused tag to the next/previous monitor? With i3 you have `move workspace to output right/left`. But it seems a bit more complicated for hlwm.

If you have swap_monitors_to_get_tag enabled, then simply hit the key of the desired tag on the desired monitor. If not or if you really request a single command for it, then it is:

herbstclient \
  substitute OLD_SETTING settings.swap_monitors_to_get_tag \
    substitute TAG tags.focus.index \
      chain \
        , focus_monitor -right \
        , set swap_monitors_to_get_tag 1 \
        , use_index TAG \
        , set swap_monitors_to_get_tag OLD_SETTING

This command first saves your setting of swap_monitors_to_get_tag and the focused tag in OLD_SETTING and TAG respectively. Then switches to the monitor/output on the right, temporarily actives swap_monitors_to_get_tag in order to let use_index bring TAG to this output, and finaly restores the old setting of swap_monitors_to_get_tag.

If you are interested why there are commads after chain and why there is no chain before the substitute's, then look up the description of substitute in the man page :-)

If you want to bind this action to the arrow keys, e.g. Alt-Control-Shift-direction, then the respective lines in the autostart are:

for i in right,Right left,Left up,Up down,Down ; do
    herbstclient keybind Alt-Control-Shift-${i##*,} \
      substitute OLD_SETTING settings.swap_monitors_to_get_tag \
        substitute TAG tags.focus.index \
          chain \
            , focus_monitor -${i%%,*} \
            , set swap_monitors_to_get_tag 1 \
            , use_index TAG \
            , set swap_monitors_to_get_tag OLD_SETTING
done

A further comment: focus_monitor may fail (e.g. if you are on the outermost monitor/output). In this case use_index does not change anything and so your tag setup stays unchanged.

Offline

#443 2018-04-23 00:50:19

halocaridina
Member
From: US
Registered: 2014-07-21
Posts: 77

Re: herbstluftwm

Hi thorsten (and others subscribed to this thread),

Apologies in advance if this is considered a necrobump but it is the definitive thread for herbstluftwm on the 'net.

I currently have a rule where Luakit-git is launched from a keybinding to a specific tag followed by focus switching to that tag if not already there like so:

hc rule class=Luakit tag=8 focus=on switchtag=on

Instead of the above, I would like focus to stay on the current tag when the keybinding is hit and not be switched (so drop switchtag=on) BUT for the newly opened Luakit-git window to be marked urgent so that I can focus directly to it when ready by using a keybinding for "jumpto urgent" (which is a similar workflow I utilize in i3 on one of my other laptops). This is where my problem comes up.

I've looked over the example scripts that come with the package, searched the 'net, and gone over the documentation at:

https://www.herbstluftwm.org/index.html

and haven't identified a solution for accomplishing the above. Some things I've tried include modifying the above rule by removing

switchtag=on

and adding

hook=luakit_urgent_open

where the custom hook is:

            luakit_urgent_open)
                luakit_winid=$(hc dump 8 | awk '{print $3}' | sed 's/)//')
                hc emit_hook urgent on ${luakit_winid}
                ;;

which doesn't work. I've also tried various interations of trying the built-in

urgent

hook with no success.

Any suggestions?  I have a feeling its something simple that I've overlooked/misread and will be seriously embarrassed when a solution is provided.

Thanks in advance and for this great WM!!

Last edited by halocaridina (2018-04-23 00:50:43)


4X Intel(R) Xeon(R) CPU E7-8870 @ 2.40GHz; 256GiB; 11TB EXT4; SL6.8
2X Intel(R) Xeon(R) CPU E5-2680 @ 2.70GHz; 256GiB; 3.4TB EXT4; SL6.8
Thinkpad X250; Broadwell-ULT Core i5; 8GiB, 525GB Crucial_CT525MX3; Arch
Thinkpad T440S; Haswell-ULT Core i7; 12GiB, 512GB SanDisk X210; Arch

Offline

#444 2018-04-23 01:46:02

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

Re: herbstluftwm

Hi halocaridina,

Don't worry, this is what the thread is for smile

There are several issues in your code snipped: first, the urgent on hook does nothing, because this is the public announcement that some window has been marked urgent, but it is not the directive to mark a window as urgent. The second issue is your procedure to find out luakit's pid: your looking for something on the workspace named 8, and this can be anyting. The much safer way is to get the pid directly from the hook. Long story short: save the following script to a file, mark it as executable and fork it from your autostart, i.e. by the line /path/to/script.sh & to avoid that your autostart gets blocked.

#!/usr/bin/env bash

hook_name=luakit_urgent_open
herbstclient rule label=$0  class=Luakit tag=8 focus=on hook=$hook_name
# so whenever Luakit shows up, a hook of the following form appears:
#     rule $hook_name ID
# where ID is luakits window id.

{
herbstclient --idle '(bla|reload|rule)' &
hc_pid=$!
echo $hc_pid # pass pid to other subshell
wait $hc_pid
} | {
    read hc_pid # get pid from other subshell
    while read hook p1 p2 ; do
        case "$hook" in
            reload)
                break
                ;;
            rule)
                if [[ "$p1" == "$hook_name" ]] ; then
                    echo "Making $p2 urgent"
                    herbstclient attr clients."$p2".urgent on
                fi
                ;;
        esac
    done
    kill $hc_pid # kill hc immediatly
}

If you have any questions/suggestions/trouble, feel free to ask.

Offline

#445 2018-04-23 04:02:50

halocaridina
Member
From: US
Registered: 2014-07-21
Posts: 77

Re: herbstluftwm

Hi thorsten,

Thank you for the quick and helpful reply. I followed your instructions in post #444 and luakit is marked as urgent on tag 8 when opened, as wanted. Many thanks for the solution, its much appreciated!!

I looked over the script and realize that I need to go and RTFM for herbstluftwm more closely when it comes to leveraging many of the features in this outstanding WM.  No doubt that the script and info you provided will be most helpful with this.

Cheers and thanks again. Really appreciate the time and effort you have put into herbstluftwm!

Last edited by halocaridina (2018-04-23 04:03:12)


4X Intel(R) Xeon(R) CPU E7-8870 @ 2.40GHz; 256GiB; 11TB EXT4; SL6.8
2X Intel(R) Xeon(R) CPU E5-2680 @ 2.70GHz; 256GiB; 3.4TB EXT4; SL6.8
Thinkpad X250; Broadwell-ULT Core i5; 8GiB, 525GB Crucial_CT525MX3; Arch
Thinkpad T440S; Haswell-ULT Core i7; 12GiB, 512GB SanDisk X210; Arch

Offline

#446 2018-10-14 17:24:35

mouseman
Member
From: Outta nowhere
Registered: 2014-04-04
Posts: 291

Re: herbstluftwm

Hey,

Had to reinstall recently and restored config files from backup. Herbst works fine as it did before, except my panel is just a green bar.

In autostart, I have this block (I think its default?):

# find the panel
panel=~/.config/herbstluftwm/panel.sh
[ -x "$panel" ] || panel=/etc/xdg/herbstluftwm/panel.sh
for monitor in $(herbstclient list_monitors | cut -d: -f1) ; do
    # start it on each monitor
    "$panel" $monitor &
done

I'm not sure where my panel.sh came from (thorsten's github?) or whether that's just default from the pkg install. It's unchanged. At the bottom it has the -fg parameter which is the foreground color right?

} 2> /dev/null | dzen2 -w $panel_width -x $x -y $y -fn "$font" -h $panel_height \
    -e 'button3=;button4=exec:herbstclient use_index -1;button5=exec:herbstclient use_index +1' \
    -ta l -bg "$bgcolor" -fg '#efefef'

I changed that to #00000 or #ffffff but it makes no difference.

I think after going over everything, I am missing some dependency. I did install dzen2 and i3status (not even sure I needed that i3). Is there anything that I need for dependencies?

Thanks!

Last edited by mouseman (2018-10-14 17:25:11)

Offline

#447 2018-10-14 17:30:28

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: herbstluftwm

Just to confirm that those appear to be the defaults, you can check /usr/xdg/herbstluftwm/ to make sure. AFAIK dzen2 is the only dependency needed.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#448 2018-10-14 17:52:16

mouseman
Member
From: Outta nowhere
Registered: 2014-04-04
Posts: 291

Re: herbstluftwm

Slithery wrote:

Just to confirm that those appear to be the defaults, you can check /usr/xdg/herbstluftwm/ to make sure. AFAIK dzen2 is the only dependency needed.

/etc/xdg/herbstluftwm ;-)

Thanks! I forgot about that. I compared the files and even just copied those defaults to ~/.config/herbstluftwm and restarted. Same issue, just a green bar.

It's gotta be something simple ... lol.

Offline

#449 2018-10-14 20:37:21

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

Re: herbstluftwm

Hi Mouseman,
What happens when you run the panel from your terminal?

~/.config/herbstluftwm/panel.sh

Is there any error message? Maybe you need an xft-version of dzen2, but this is just a guess.

when you see the green bar, is there a process named dzen2? (You can check this by running ps aux|grep dzen2 from another terminal)

Offline

#450 2018-10-15 17:16:18

mouseman
Member
From: Outta nowhere
Registered: 2014-04-04
Posts: 291

Re: herbstluftwm

thorsten wrote:

Hi Mouseman,
What happens when you run the panel from your terminal?

~/.config/herbstluftwm/panel.sh

Is there any error message? Maybe you need an xft-version of dzen2, but this is just a guess.

when you see the green bar, is there a process named dzen2? (You can check this by running ps aux|grep dzen2 from another terminal)

Thanks Thorsten, I've done some tests.

When I run panel.sh, nothing happens, it doesn't return the prompt immediately, it takes ~20 seconds but outputs nothing. I ran this line in another terminal:

$ for i in {1..10000}; do ps aux|grep [d]zen2;done

It does actually output 2 lines:

mouseman  13923  0.0  0.0  42536  8620 pts/0    R+   19:08   0:00 dzen2 -w 3440 -x 0 -y 0 -fn -*-fixed-medium-*-*-*-12-*-*-*-*-*-*-* -h 16 -e button3  button4 exec herbstclient use_index -1 button5 exec herbstclient use_index +1 -ta l -bg #101010 -fg #efefef
mouseman  13923  0.0  0.0  42748 12316 pts/0    S+   19:08   0:00 dzen2 -w 3440 -x 0 -y 0 -fn -*-fixed-medium-*-*-*-12-*-*-*-*-*-*-* -h 16 -e button3  button4 exec herbstclient use_index -1 button5 exec herbstclient use_index +1 -ta l -bg #101010 -fg #efefef

When I run:

$ bash -x .config/herbstluftwm/panel.sh

It outputs:

++ quote herbstclient
+++ printf '%q ' herbstclient
++ local 'q=herbstclient '
++ printf %s herbstclient
+ hc_quoted=herbstclient
+ monitor=0
+ geometry=($(hc monitor_rect "$monitor"))
++ hc monitor_rect 0
++ herbstclient monitor_rect 0
+ '[' -z 0 ']'
+ x=0
+ y=0
+ panel_width=3440
+ panel_height=16
+ font='-*-fixed-medium-*-*-*-12-*-*-*-*-*-*-*'
++ hc get frame_border_normal_color
++ herbstclient get frame_border_normal_color
+ bgcolor='#101010'
++ hc get window_border_active_color
++ herbstclient get window_border_active_color
+ selbg='#9fbc00'
+ selfg='#101010'
+ which textwidth
+ textwidth=textwidth
+ dzen2 -v
+ grep -q '^dzen-\([^,]*-svn\|\),'
+ head -n 1
+ dzen2_svn=true
+ awk -Wv
+ head -1
+ grep -q '^mawk'
+ hc pad 0 16
+ herbstclient pad 0 16
+ dzen2 -w 3440 -x 0 -y 0 -fn '-*-fixed-medium-*-*-*-12-*-*-*-*-*-*-*' -h 16 -e 'button3=;button4=exec:herbstclient use_index -1;button5=exec:herbstclient use_index +1' -ta l -bg '#101010' -fg '#efefef'

I'm not sure but that looks alright to me?

Maybe its missing a proper font?

Thanks again!

Offline

Board footer

Powered by FluxBB