Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not an issue but need some focus help #545

Open
h8uthemost opened this issue Dec 14, 2023 · 4 comments
Open

Not an issue but need some focus help #545

h8uthemost opened this issue Dec 14, 2023 · 4 comments

Comments

@h8uthemost
Copy link

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

@LordReg
Copy link
Contributor

LordReg commented Dec 15, 2023

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?

@h8uthemost
Copy link
Author

h8uthemost commented Dec 15, 2023 via email

@c0dev0id
Copy link
Contributor

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.

@h8uthemost
Copy link
Author

h8uthemost commented Dec 30, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants