Clients Don't Remember Workspace #1526
-
Note: This was originally posted on r/herbstluftwm on reddit. I got recommended to post it here. I recently switched from AwesomeWM to HerbstluftWM mainly because I didn't like automatic tiling. However, I'm facing an annoying issue with HerbstluftWM. Let's say I have a Chrome window (call it X) open on workspace 1, and another Chrome window (call it Y) open on workspace 2. I reboot/shutdown, then open Chrome. On AwesomeWM, X opens on workspace 1, and Y opens on workspace 2. However, on HerbstluftWM both X and Y open on workspace 1. Of course, I can just move Y to workspace 2 and live my life. The problem is, I have exactly 51 such open windows, spread across 10 workspaces. So putting everything in place after each reboot/shutdown is so annoying. I looked on the internet and in the documentation, but didn't get anywhere... I would appreciate any help with this. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
Here from the Reddit post... You can somewhat achieve this with rules. It will take a little effort and it's not a perfect match to what you are after, but it should get you close. You can chain a one time use rule with
Once the terminal launches on tag X, the rule is gone. So you could add rules like these at the end of your
You can also set this to a keybinding if you don't want it to start at login. You can also just have general rules loaded all the time. Let's say we have the following rule for
This rule says anytime a window with class "
If you use separate profiles for Chrome X and Y, you could pick which one to launch where by adding the None of this will make HLWM remember what is open at the time of logout and put it all back when you log back in. I personally don't like things auto-starting at login, so I use the rule once with keybinds or craft a general rule to target specific programs as I need them. |
Beta Was this translation helpful? Give feedback.
-
I'd be interested if you know how awesome was identifying each windows to be able to place them back in the correct tags 🤔 |
Beta Was this translation helpful? Give feedback.
-
Can't we achieve this with script?
Though It won't be able to handle positions of more than one similar instances. |
Beta Was this translation helpful? Give feedback.
Here from the Reddit post...
You can somewhat achieve this with rules. It will take a little effort and it's not a perfect match to what you are after, but it should get you close.
You can chain a one time use rule with
spawn
. Let's say you want to launch a terminal on tag X. You could do so with (where "terminal" is your terminal of choice):herbstclient chain . rule once tag=X . spawn terminal
Once the terminal launches on tag X, the rule is gone. So you could add rules like these at the end of your
autostart
to load stuff when you login. You can even add thefocus=on
and/orswitchtag=on
parameters to the rule to automatically switch to tag X, launch the program and then focus it. The p…