Sunday, April 28, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 1640  / 3 Years ago, sun, october 10, 2021, 2:17:45

I have a computer hooked up to a television that I am using to show different data. I would like to setup some different programs on different workspaces and have it rotate the workspaces automatically on a timed basis. How would I make this happen?


More From » workspaces

 Answers
0

If you use 4 workspaces as default in Ubuntu (and I suspect that this is your case because you said rotate the workspaces), you can use the following script:



#!/bin/bash

#check if xdotool is installed
if [ ! -n "$(dpkg -s xdotool 2>/dev/null | grep 'Status: install ok installed')" ]; then
echo -e "The package 'xdotool' must to be installed before to run $(basename $0)
Use 'sudo apt-get install xdotool' command in terminal to install it."
exit
fi

delay=5 #change as you wish

echo "Press Ctrl+C to finish"

#start with workspace 0 (top left)
xdotool key Ctrl+Alt+Left
xdotool key Ctrl+Alt+Up

#switch workspaces
while : ; do
workspace_nr=0
until [ $workspace_nr = 4 ]; do
sleep $delay
case $workspace_nr in
0) xdotool key Ctrl+Alt+Right ;;
1) xdotool key Ctrl+Alt+Down ;;
2) xdotool key Ctrl+Alt+Left ;;
3) xdotool key Ctrl+Alt+Up ;;
esac
((workspace_nr++))
done
done

[#28664] Monday, October 11, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
calronze

Total Points: 0
Total Questions: 110
Total Answers: 112

Location: Belarus
Member since Thu, Aug 11, 2022
2 Years ago
calronze questions
Sun, Jan 9, 22, 13:41, 2 Years ago
Wed, Feb 15, 23, 01:41, 1 Year ago
Sat, Jul 23, 22, 21:03, 2 Years ago
Sat, Feb 5, 22, 01:57, 2 Years ago
;