Lubuntu; switch between screens on a time loop

0

Im going to a conference and I want to set my laptop to cycle between the four standard workspaces/screens on an automated time loop.

I can do a bit of python, so thats a good answer for me, I guess it will be something like

#!/usr/bin/env python

import subprocess
import time

while True:
    subprocess.call()
    time.sleep(10)

I just dont know what to have that subprocess.call() to actually do to cycle through screens.

Thanks.

Scalextrix

Posted 2018-07-04T13:59:18.683

Reputation: 1

Answers

0

OK then 'wmctrl' was my answer, if you dont have it already

apt-get install wmctrl

To see your workspace setup

wmctrl -d  

So my little python script looks like:

#!/usr/bin/env python

import subprocess
import time

while True:
    subprocess.call(['wmctrl', '-s', '0'])
    time.sleep(10)
    subprocess.call(['wmctrl', '-s', '1'])
    time.sleep(10)
    subprocess.call(['wmctrl', '-s', '2'])
    time.sleep(10)
    subprocess.call(['wmctrl', '-s', '3'])
    time.sleep(10)

'-s' tells wmctrl to go to a workspace and 0-3 are my available workspaces.

Scalextrix

Posted 2018-07-04T13:59:18.683

Reputation: 1