skip_cycle attribute suggestion to "remove" monitors from cycle/focus logic

Martin "eto" Misuth et.code at ethome.sk
Wed Jun 22 23:16:07 CEST 2016


Hello fellow hernstluftwmers!

After some embarrasment on irc channel, I got this to work the way I want,
but this is in no way final. Take it as feature suggestion.

I would like to hear leaders and users alike and their opinions.

Although I was told by Thorsten floating layer is planned, I wanted to reuse
great "floatmon hack" and am introducing "monitor monitor" (for
monitoring frames/windows/clients) concept.

Even though herbst's embedded language is pretty powerfull, after lot of
tinkering I concluded this being embedded into wm itself would be much
"proper" approach.

This could be "emulated" by creating new chains and combine them with custom
attribute, but at the end of the day, it's simply too much work.

This patch allows one to have "kinda" floating layer right now, if one setups
their monitors manually like I do. Only requirement is to have "floatmon" as
last/topmost monitor defined.

It also allows quite a lot of freedom and to move things into "floatmon" at
will.

When there is keybind bound to `focus_monitor floatmon` one can switch into
"floating monitor" directly and spawn new things there without need to
create convoluted rules. 

One can also move already existing windows there easily without need of rules as
well, on case by case basis.

I am starting to test this during daily use, but after few hours I am
already really happy with it.

Screenshot of simple setup is attached.

This is based on ebed05c0a3faeed9084bb8355532b4f5cfbf2ca6 commit.

Explanatory text from screenshot:

 So, this is my maybe bit flaky idea, plus suggestions:
 
 - new, per *monitor* skip_cycle attribute,
   - which marks given monitor as "skipped" by cycling and focus operations

 - it essentially "breaks free" monitor from keyboard operated monitor "cycles"
   - clients there can still be focused with mouse 
   - or whole monitor by direct focus_monitor command (by index and name
   (direction is ignored))

 - in my use cases it is useful to implement two types of "hacks":

   - more robust "floatmon" we all know and love
     - with a difference herbst now knows it should skip floatmon from
     cycle/focus tasks
     - this might be done by floating layer in the future i was told
       - compared to floating layer, you can "stack" multiple floatmons for
     arbitrary window groupings and such - should you be so insane

   - "monitor" monitors 
     - small physical monitors, positioned away from from main workstation
     monitor array
     - like when you have 3-way multimon system, with 3 big monitors and with
     one 4th small monitor on the side displaying conky, io graphs or audio
     spectrum visualizations        
     - things like that
     - by setting skip_cycle on any such "monitor" monitor, it is efficiently
     removed from most cycling operators, so you cannot accidentaly "break"
     your painstakingly scripted custom layout there

 - floatmon recipe:

   - there is *tag*: floating
   - there is *monitor*: floatmon
   - there is new *attribute* per monitor: skip_cycle
   
   - monitor 'floatmon' size and position RECT is set in such a way
     - that all actual monitors fit inside it
       - this way windows there can be positioned directly on physical
     inter-monitor splits for example 

   - skip_cycle is set on 'floatmon' 
     - effectively "removing" that monitor from cycling and focus considerations
     - but leaves it focusable directly

   - with skip_cycle=true and monitor switched to "floating mode" (with
     `floating on`)
     - one effectively gets floating layer for "free"
     - as already mentioned, similarly one can get multiple such layers
     "stacked"

   - by locking *tag* 'floating' to *monitor* 'floatmon' (with `lock_tag`) 
     - one binds that tag to 'floatmon' indefinitely
     - without ability to accidentaly switch away

   - one now can then have rules and scripts in place, to put things into
     "floating" layer on top of actual physical monitors

   - I belive this approach offers much more flexibility than single floating
     window layer as most hlwm management window commands work on floatmon as
     expected

   - setups can be achieved like tty-clock + scratchpad example here


 - "monitor" monitor recipe:

   - there is *tag*: monitoring
   - there is *monitor*: monitormon
   - there is new *attribute* per monitor: skip_cycle

   - monitor 'monitormon' size and position RECT is set in such a way
     - it is completely separated from workstations main monitor array
     
   - skip_cycle is set on 'monitormon'
     - effectively removing it from cycling and focus considerations
       leaving it focusable directly 

   - by locking *tag* 'monitoring' to *monitor* 'monitormon' (with `lock_tag`) 
     - one binds that tag to 'monitormon' indefinitely
     - without ability to accidentaly switch away
                           
   - script spawns frameset and desired clients on monitormon for quick visual
     monitoring 

 I belive people can come up with other ways to use this as well.

  eto
-------------- next part --------------
A non-text attachment was scrubbed...
Name: skip_cycle.diff
Type: text/x-patch
Size: 4133 bytes
Desc: not available
URL: <https://listi.jpberlin.de/pipermail/hlwm/attachments/20160622/f7b7f292/attachment.diff>


More information about the hlwm mailing list