You are not logged in.

#251 2012-09-10 22:11:29

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

Re: herbstluftwm

It is simpler, but it doesn't allow as much flexibility (aside from modifying the script directly).  My system allows you to use any of the terminal colors for any of the hlwm colors inside of a single file.  That is, there is no need to edit `autostart` if a different setting is desired (not to mention the scripts for my conkyrc).  My system does have fallbacks in the event that I don't want to specify extra colors.  Because it involves an external settings file, there are more parts to break, I suppose, but it saves some work if additional customization is desired, since it can simply be added directly to the settings file that deals exclusively with theme related stuff (no need to navigate a file that takes more than one screen).

Of course, your solution is just as functional if you want to "set it and forget it," and is more elegant in that it just parses .Xdefaults for the values, rather than generating a new file every time it runs (fewer moving parts).

I do like your color scheme from image script.  I might take a poke at it if I ever get around to learning python.

PS: I also don't know awk, which is one reason I tend to turn everything into bash (which I don't even know properly.  I just hack around and google stuff).  I got the O'Reilly book on sed and awk, but I haven't made time to read it yet.  Just finished the "Unix Philosophy," and I'm working through a book on vi and Vim.  After that, I have to decide whether to tackle sed+awk or C or Python.  I feel like if I put in the time with text processing and regex and all that first, I'll be a lot more productive with other programming languages thereafter, so I'll probably go that route.

Last edited by ninjaaron (2012-09-10 22:31:12)

Offline

#252 2012-09-24 01:45:38

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

Re: herbstluftwm

Has anyone tried running herbst across two TwinView displays? i.e., I'm running two nvidia cards each with two heads in TwinView mode. One of the pairs will display herbst and the other pair is dead (the cursor is visible, but I can't get any elements to display on it other than the cursor). This setup works fine with Awesome (which I've never used and don't really plan on using) - any ideas?

EDIT: Man, I always post here too quickly. It works fine with Xinerama which is a real shame as that's the reason I started fiddling with this double TwinView malarkey in the first place - there's a weird GTK2 rendering bug in webkitgtk when there's no RandR extension. Anyway, if someone does have experience with setups like this, I'd still be interested in having my cake and eating it.

Last edited by syngin (2012-09-24 02:03:44)

Offline

#253 2012-09-24 01:51:29

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

Re: herbstluftwm

syngin wrote:

Has anyone tried running herbst across two TwinView displays?

Is it one X screen? I.e. is a window visible on both monitors if you switch the tag to floating and move the window to the monitor border?

Offline

#254 2012-09-24 02:03:11

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

Re: herbstluftwm

thorsten wrote:
syngin wrote:

Has anyone tried running herbst across two TwinView displays?

Is it one X screen? I.e. is a window visible on both monitors if you switch the tag to floating and move the window to the monitor border?

Nope - two screens according to xrandr. Which is to say that each pair of monitors acts like a single screen. Four monitors, two screens. One pair working normally and one pair only displays the cursor.

Last edited by syngin (2012-09-24 02:06:46)

Offline

#255 2012-09-24 02:07:56

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

Re: herbstluftwm

syngin wrote:
thorsten wrote:
syngin wrote:

Has anyone tried running herbst across two TwinView displays?

Is it one X screen? I.e. is a window visible on both monitors if you switch the tag to floating and move the window to the monitor border?

Nope - two screens according to xrandr.

According to xrandr? Please post the output of xrandr. Even if they are two physical screens, they probably are only one X screen.

(The reason I ask is: There are *very old* concepts for creating a multimonitor setup with X11 where you can't even move windows from one monitor to another... and that concept isn't supported. Any other multimonitor concept that only needs one X screen works with hlwm)

EDIT: if you really have two different X screens, then you need to manually setup Xinerma to create one single X screen out of them. Then you can use detect_monitors or set_monitors to setup the multimonitor configuration in herbstluftwm. (Check the man page for the usage of set_monitors)

Last edited by thorsten (2012-09-24 02:14:13)

Offline

#256 2012-09-24 02:19:55

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

Re: herbstluftwm

thorsten wrote:

According to xrandr? Please post the output of xrandr. Even if they are two physical screens, they probably are only one X screen.

(The reason I ask is: There are *very old* concepts for creating a multimonitor setup with X11 where you can't even move windows from one monitor to another... and that concept isn't supported. Any other multimonitor concept that only needs one X screen works with hlwm)

Like Zaphod mode? Anyway, sure, here's the output of xrandr:

⚡ xrandr
Screen 0: minimum 8 x 8, current 3360 x 1050, maximum 4096 x 4096
DVI-I-0 disconnected (normal left inverted right x axis y axis)
DVI-I-1 disconnected (normal left inverted right x axis y axis)
DVI-I-2 connected 1680x1050+1680+0 (normal left inverted right x axis y axis) 473mm x 296mm
   1680x1050      60.0*+
   1600x1200      60.0  
   1440x900       59.9  
   1280x1024      60.0  
   1280x960       60.0  
   1024x768       60.0  
   800x600        60.3  
   640x480        59.9  
DVI-I-3 connected 1680x1050+0+0 (normal left inverted right x axis y axis) 433mm x 271mm
   1680x1050      60.0*+
   1280x1024      75.0     60.0  
   1152x864       75.0  
   1024x768       75.0     70.1     60.0  
   800x600        75.0     72.2     60.3  
   640x480        75.0     72.8     59.9  
   640x350        70.1  

And from the other "screen":

⚡ xrandr --screen 1
Screen 1: minimum 8 x 8, current 3360 x 1050, maximum 16384 x 16384
DVI-I-0 disconnected (normal left inverted right x axis y axis)
DVI-I-1 connected 1680x1050+0+0 (normal left inverted right x axis y axis) 473mm x 296mm
   1680x1050      60.0*+
   1600x1200      60.0  
   1440x900       59.9  
   1280x1024      60.0  
   1280x960       60.0  
   1024x768       60.0  
   800x600        60.3  
   640x480        59.9  
DP-0 connected 1680x1050+1680+0 (normal left inverted right x axis y axis) 473mm x 296mm
   1680x1050      60.0*+
   1600x1200      60.0  
   1440x900       59.9  
   1280x1024      60.0  
   1280x960       60.0  
   1024x768       60.0  
   800x600        60.3  
   640x480        59.9  
DP-1 disconnected (normal left inverted right x axis y axis)

For completeness:

⚡ hc list_monitors
0: 1680x1050+0+0 with tag "1"
1: 1680x1050+1680+0 with tag "2" [FOCUS]
2: 1680x1050+3360+0 with tag "3"
3: 1680x1050+5040+0 with tag "x"

Edit: So yeah, as you suggested, it's something crusty and unsupported. Damn these video cards - I can choose between Composite or Xinerama, but I can't have both hmm

Last edited by syngin (2012-09-24 04:53:29)

Offline

#257 2012-10-03 11:16:18

antihero
Member
Registered: 2012-06-18
Posts: 13

Re: herbstluftwm

Anyone had any luck using a compositor? I'm trying compton but when I switch desktops, it still shows windows from the previous desktops underneath. I'd prefer it to just be on top of the wallpaper.

It looks like this: http://i.imgur.com/GMQfR.png

I've now got compositing working, but borders are crazy colours for urxvt windows ?!:

http://files.blackflags.co.uk/screenshots/borders.png

Last edited by antihero (2012-10-03 12:21:57)

Offline

#258 2012-10-04 05:36:23

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

Re: herbstluftwm

antihero wrote:

Anyone had any luck using a compositor? I'm trying compton but when I switch desktops, it still shows windows from the previous desktops underneath. I'd prefer it to just be on top of the wallpaper.

It looks like this: http://i.imgur.com/GMQfR.png

I've now got compositing working, but borders are crazy colours for urxvt windows ?!:

http://files.blackflags.co.uk/screenshots/borders.png

Have you looked at frame_active_opacity?

Offline

#259 2012-10-11 15:52:03

skrite
Member
Registered: 2009-09-07
Posts: 160

Re: herbstluftwm

is there a way (or a hack) for herbstluftwm to allow me to use the mouse to cycle through tags?
one of the things that keep me with awesome wm is that i can click a tag and go there, or, like openbox, cycle through desktops with a mouse wheel.

If someone has a tip, i have found my new wm, everything else about herbstluftwm is such a good fit.
thanks !

Offline

#260 2012-10-11 16:00:32

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

Re: herbstluftwm

skrite wrote:

is there a way (or a hack) for herbstluftwm to allow me to use the mouse to cycle through tags?
one of the things that keep me with awesome wm is that i can click a tag and go there, or, like openbox, cycle through desktops with a mouse wheel.

If someone has a tip, i have found my new wm, everything else about herbstluftwm is such a good fit.
thanks !

You can use the default panel.sh which handles clicks (but not the mouse wheel) if you have dzen2-svn installed.

But you also can use your favourite pager (workspace switcher) from openbox with herbstluftwm (both window managers provide the EWMH interface)

Offline

#261 2012-10-11 16:10:54

skrite
Member
Registered: 2009-09-07
Posts: 160

Re: herbstluftwm

thorsten wrote:

But you also can use your favourite pager (workspace switcher) from openbox with herbstluftwm (both window managers provide the EWMH interface)

awesome, thanks !

Offline

#262 2012-10-11 21:07:54

skrite
Member
Registered: 2009-09-07
Posts: 160

Re: herbstluftwm

i tried using tint2, but it only loads on one tag.
is there a way around that?

thanks.

Offline

#263 2012-10-11 21:27:32

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

Re: herbstluftwm

skrite wrote:

i tried using tint2, but it only loads on one tag.
is there a way around that?

If you have multiple monitors, it will only show the windows on the active monitor. That's because EWMH doesn't support showing multiple tags (or virtual desktops) simultaneously. (So it won't work with any other window-manager-independent panel on any window manager)

As a workaround, you can configure tint2 to show the windows of all workspaces (then you also see the windows of you unfocused monitor)

Offline

#264 2012-10-23 01:48:51

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

Re: herbstluftwm

Probably premature to ask, but any thoughts on the future of hlwm as Wayland progresses (having just hit 1.0) and all that?  Probably premature to ask since nobody is really supporting Wayland yet, but it's been on my mind.

Offline

#265 2012-10-24 18:09:17

Supplantr
Member
From: a state of sunshine
Registered: 2011-12-12
Posts: 149
Website

Re: herbstluftwm

I just started using herbstluftwm and so far it's quite awesome. However, I have some questions/feature requests/possible bug reports:

  • using chromium, when opening a link in a new tab, this happens to the borders: http://i.imgur.com/ODZU4.png on all open tabs. The issue is resolved when a website is manually opened in a new tab, i.e. a new tab is opened then the website is navigated to; when the chromium window is refocused after focusing a different client (but not an empty frame); and when switching to the tag containing chromium from another tag. I've only changed keybindings in my autostart file, so I imagine this would happen with the default config.

  • is it possible to automatically focus a new frame when it is created? Similarly, I read in an early post in this thread that it's not currently possible to have clients spawn in empty frames, but is this still planned?

  • would it be viable to add a clockwise rotation to the rotate function, and perhaps call it via rotate +1 and rotate -1?


I use linux and I dont understand nothing in this post.

Offline

#266 2012-10-25 05:16:27

mentat
Member
From: France
Registered: 2009-01-13
Posts: 138
Website

Re: herbstluftwm

Supplantr wrote:

I just started using herbstluftwm and so far it's quite awesome. However, I have some questions/feature requests/possible bug reports:

  • is it possible to automatically focus a new frame when it is created? Similarly, I read in an early post in this thread that it's not currently possible to have clients spawn in empty frames, but is this still planned?

Maybe this ?:

herbstclient split horizontal 0.5 && herbstclient focus right

or this

herbstclient split vertical 0.5 && herbstclient focus down

Offline

#267 2012-10-25 20:18:52

scoobertron
Member
Registered: 2012-10-25
Posts: 1

Re: herbstluftwm

I have noticed the bug you describe with Chromium when using a Virtualbox machine.  There it is very noticable, because the window flashes as the vm resolution changes.  For focusing a new frame automatically, I have not had much luck with chaining bash commands with &&.  I have it in my config as:

hc keybind $Mod-u chain , split vertical 0.5 , focus down
hc keybind $Mod-o chain , split horizontal 0.5 , focus right

(running 0.4.1)

Offline

#268 2012-10-26 16:53:20

Supplantr
Member
From: a state of sunshine
Registered: 2011-12-12
Posts: 149
Website

Re: herbstluftwm

@mentat/scoobertron: thanks for those suggestions; they work, but obviously only when the newly created frame is exactly adjacent to the window that has focus when it's created. It would still be useful to have a focus_follows_frames setting, or something similar. And I suppose it's a good thing that someone else has encountered the issue with chromium.
Upon reading the documentation for the chain command, I came across the "rotate clockwise" example, so I guess the final point in my previous post is void.

Last edited by Supplantr (2012-10-26 22:49:47)


I use linux and I dont understand nothing in this post.

Offline

#269 2012-11-04 01:47:21

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

Re: herbstluftwm

I updated my script for adding swap master/stack functionality (kinda like a dynamic tiling window manger, but not) to herbstluftwm. It's nice. Documentation is now in the comments before the script really begins.
[edit] Ok, this script basically has the functions to do everything most dynamic tiling window managers do now, without taking away any of the hlwm-manual-tiling awesomeness.

#!/bin/bash

  #     ####### 
 ##  ####     ##
 ## # swap! # ## 
 ##     ####  ##
  #######     # 

# Copyright 2012 Aaron "ninjaaron" Christianson <ninjaaron@gmail.com>
# This "software" is licensed under the "Simplified BSD License" that comes with
# herbslutftwm.

# functions to let herbstluftwm emulate dynamic tiling window manager behavior.

# Usage #
### auto
#    Swaps window in and out of "master" or "stack". If there is only one frame,
#    "auto" splits the frame. You may want a keybinding for it in herbstluftwm's
#    autostart file:
#        hc keybind $Mod-semicolon spawn /PATH/TO/swap auto
### stack_spawn
#    focuses stack and spawns command. good wrapper for terminal (xterm here):
#        hc keybind $Mod-period spawn /PATH/TO/swap stack_spawn xterm
### master_spawn
#    moves all windows in master to stack and spawns command in its place.
#    possible wrapper for dmenu_run, like so:
#        hc keybind $Mod-comma spawn /PATH/TO/swap master_spawn dmenu_run
### close
#    If window in master frame is closed, it is replaced by a window from the
#    stack. If stack is empty, it's removed. used like hlwm "close" command:
#        hc keybind $Mod-slash spawn /PATH/TO/swap close

# CONFIG #
# split_direction = frame split's orientation. "horizontal" or "vertical"
# split_ratio determines split's location. value between 0.1 and 0.9
# stack_layout = stack's hlwm layout. "horizontal" "vertical" "max" "grid"
# stack_frame = frame used as stack. 0=top/left, 1=bottom/right, d= use smaller
#   frame as stack. If blank, calculated by split_ratio.
split_direction="horizontal"
split_ratio="0.6667" 
stack_layout="vertical" 
stack_frame=
# Here ends the section for users #

command="$@"
hc() { herbstclient $@; }
# Set $stack if not user defined.
[[ -z "$stack_frame" && ${split_ratio:2:1} -ge 5 ]] && stack=1 || stack=0
set_vars() { ### some vars need to be set more than once.
  dump=( $(hc dump) ); Ratio=${dump[1]#*.}; Orientation=${dump[1]%%:*}
  Frame=${dump[1]##*:}; Empty0=${dump[3]: -1} # empty frames =')'
  Empty1=${dump[${#dump[@]}-1]##*:};Empty1=${Empty1:1:1}
  EmptyAll=${dump[1]#*:};EmptyAll=${EmptyAll:1:1}
  [ $Frame = "0" ] && EmptyInact=$Empty1 || EmptyInact=$Empty0
  # $stack reset if $Orientation != $split_direction or $stack_frame = 'd'
  if [[ $stack_frame = "d" || "$split_direction" != "$Orientation" ]]
  then [ ${Ratio:0:1} -ge 5 ] && stack=1 || stack=0
  fi
  # from $stack and $Orientation, set relative values.
  if [[ $Orientation = "horizontal" && $stack = "1" ]]
    then stackD=r; masterD=l; EmptyStack="$Empty1"; EmptyMaster="$Empty0"
  elif [[ $Orientation = "vertical" && $stack = "1" ]]
    then stackD=d; masterD=u; EmptyStack="$Empty1"; EmptyMaster="$Empty0"
  elif [[ $Orientation = "horizontal" && $stack = "0" ]]
    then stackD=l; masterD=r; EmptyStack="$Empty0"; EmptyMaster="$Empty1"
  elif [[ $Orientation = "vertical" && $stack = "0" ]]
    then stackD=u; masterD=d; EmptyStack="$Empty0"; EmptyMaster="$Empty1"
  fi
  if [ $Frame = $stack ]
  then origin=$stackD; target=$masterD # $origin = active frame
  else origin=$masterD; target=$stackD # $target = inactive frame
  fi
};set_vars # do all that stuff I just said

auto() { ### swap out of the current frame into the other.
  if [ -n "$EmptyAll" ] # two frames? swap the window.
  then hc shift -e $target
    if [ "$EmptyInact" != ')' ]
    then hc cycle -1; hc shift -e $origin; hc focus -e $target
      [ $Orientation = "horizontal" ] && hc focus -i d || hc focus -i r
    fi # one frame? split it. move window to new frame, set stack layout.
  else hc split $split_direction $split_ratio; set_vars
    [ "$split_direction" = "horizontal" ] && hc shift -e r || hc shift -e d
    hc focus -e $stackD; hc set_layout $stack_layout
    [ $stack = 0 ] && hc focus -e $masterD
  fi
}
stack_spawn() { ### spawn applications in the stack.
  [ "$EmptyAll" = ')' ] && $@ ||
    if [ -z "$EmptyAll" ]; then $@; auto; else hc focus -e $stackD; $@; fi
}
master_spawn() { ### spawn applications in the master.
  if [ "$EmptyAll" =  ')' ];then $@;else
    [ -z "$EmptyAll" ] && auto
    while [ "$EmptyMaster" != ')' ]; do
      hc focus -e $masterD; hc shift -e $stackD; hc focus -e $masterD; set_vars
    done;"$@" 
  fi
}
close() { ### replace master window on close. removes stack if empty.
  hc close; set_vars
  [ $EmptyMaster = ')' ] &&hc focus -e $stackD&&hc shift -e $masterD&&set_vars
  [ $EmptyStack = ')' ] && (hc focus -e $stackD; hc remove)
}

$command;exit # do something and exit

Hope this is useful to somebody else. Makes me happy, at least.

Last edited by ninjaaron (2012-11-21 10:07:05)

Offline

#270 2012-11-19 00:51:54

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

Re: herbstluftwm

There are major changes to the above script since it was originally posted. Pretty much nothing is the same.
I thought you guys would want to know, since the original posting generated so much excitement. tongue

Last edited by ninjaaron (2012-11-19 00:53:04)

Offline

#271 2012-11-20 18:39:18

mentat
Member
From: France
Registered: 2009-01-13
Posts: 138
Website

Re: herbstluftwm

Thx nonjaaron, very interesting and useful.

Offline

#272 2012-11-21 09:32:56

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

Re: herbstluftwm

Glad you like it. I just made it much more efficient by replacing every instance of "echo" and "cut" with bash's own string manipulation, so now it's just bash talking to herbstclient without any other procs getting in the way. It's noticeably faster on my machine.

Offline

#273 2012-11-21 09:53:12

mentat
Member
From: France
Registered: 2009-01-13
Posts: 138
Website

Re: herbstluftwm

Yes, It's fast. Good refactoring and optimisation. It's for that I said very interesting too.
All the time I just choose the "worst is better" solution and realize need to learn deep more the bash internal functions.

Offline

#274 2012-11-21 10:25:23

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

Re: herbstluftwm

I'm in the same boat. I'm just figuring out string manipulation today and started messing with arrays yesterday. Bash string manipulation is quite poor (compared with other programming languages or `sed`), and I had to do some weird, hacky stuff to make it all work, but it really did provide a major speed boost, not to mention the learning experience.

Offline

#275 2012-11-21 10:34:48

mentat
Member
From: France
Registered: 2009-01-13
Posts: 138
Website

Re: herbstluftwm

Right, speed is the objectif but IMHO, not the dependencies of external commands.
Use of internal functions for portability is not so good because they broke descendant compatibility with older bash versions.
But it's not the topic here.

Offline

Board footer

Powered by FluxBB