conformal / spectrwm

A small dynamic tiling window manager for X11.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not an issue but need some focus help

h8uthemost opened this issue · comments

Hey spectrwm devs,

First off. Great wm, been using it for years. And thanks for 3.5.0.

Now I have a question that I can't seem to either find in the manual, or I'm implementing it wrong into my .spectrwm.conf. The feature I'm wanting is for spectrwm to focus another workspace when an app opens on a different workspace than you're currently.

Say I'm on WS[1], and I have a quirk to open a program on WS[3]. When I open that program, spectrwm doesn't hop over to WS[3]. It stays on WS[1]. Is there a universal focus option that I'm not seeing in the manual, that focuses all new apps no matter what workspace they're on?

I'm come to you guys since the spectrwm sub on reddit is dead. So any and all help will be much appreciated.

Thanks for reading

That is currently not possible without EWMH (e.g. wmctrl -a)

Do you want to do it on all new windows or just the ones you quirk?

How are you spawning programs? Using keybindings or dmenu/rofi or something? Then you might be able to add a launcher that does this for you. Something like this:

#!/bin/sh
# current WS if nothing is specified
WS=$_SWM_WS

# specify target WS for some programs
# note: the actual WS is +1 so use 6 for something to spawn on WS 7.
case $1 in
    firefox) WS=6; ;;
    chrome)  WS=1; ;;
esac

# move to desktop
wmctrl -s $WS

# spawn program
_SWM_WS=$WS $@

You can then call ./script.sh firefox --new-window http://github.com and it will jump to WS 7 and open firefox there. If the script is called with something not specified, it will do nothing special and just call the program on the current WS. So technically, it can be a central spawn script.