Hi I need to switch focus between two windows periodically and automatically (with software or w/e). Can this be achieved on linux?
Asked
Active
Viewed 1,479 times
3
-
3What is your system, your desktop (Gnome, KDE, ...)? What are you trying to achieve? – lgeorget Apr 14 '14 at 07:41
-
There isn't anything generic? I think it runs ubuntu, I don't know about the desktop environment – Robert Apr 14 '14 at 08:26
1 Answers
6
Most modern dekstops are EMWH compliant. You can use wmctrl to control those and the windows on them, e.g.:
wmctrl -a <WIN>
to activate a window by switching to its desktop and raising it (<WIN> can be various things, by default a string match on the window title, see the wmctrl man page).
Anthon
- 78,313
- 42
- 165
- 222
-
Thanks. Do you know any software to automatize the process at predefined time intervals? – Robert Apr 14 '14 at 08:25
-
1@Robert I would either use a cron job for that (if they should always be running), or a small python program in a tmux script that starts the two windows process in the background and then sleeps and switches. – Anthon Apr 14 '14 at 09:01