3

Hi I need to switch focus between two windows periodically and automatically (with software or w/e). Can this be achieved on linux?

Ondra Žižka
  • 879
  • 9
  • 16
Robert
  • 31
  • 2

1 Answers1

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