I would like to write a simple shells script that would do the following
1. switch to workspace #N
2. run some app.[/list]
I can't seem to get xdotools to work, and in any case a script seems to be a more straightforward solution.
Back in the DOS days I had dozens of startup scripts (batch files), so this approach is nothing new.
[Solved] What is the shell command to change workspace?
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Topics in this forum are automatically closed 6 months after creation.
[Solved] What is the shell command to change workspace?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
sabbe sattā bhavantu sukhitattā. LM 21.2-64 Cinn 5.8.4
Re: What is the shell command to change workspace?
Try wmctrl instead. To switch to workspace N, you give the command `wmctrl -s N-1`. So to switch to your second workspace that would be:
To switch back to your first workspace:
You don't really need a script for this though. Say you are on the first workspace and want to switch to the second workspace and open Firefox there, the command to use would be:
If you want to use this as a launcher in your menu you need to change the command to be:
Code: Select all
wmctrl -s 1
Code: Select all
wmctrl -s 0
Code: Select all
wmctrl -s 1 && firefox
Code: Select all
bash -c "wmctrl -s 1 && firefox"
Re: What is the shell command to change workspace?
Works beautifully!
TYVM
TYVM
sabbe sattā bhavantu sukhitattā. LM 21.2-64 Cinn 5.8.4
Re: [Solved] What is the shell command to change workspace?
In case you wanted the xdotool solution, I use
0 being the first workspace.
I only use 2 workspaces, so I made a script that toggles between both
The first line is the sound effect from Cinnamon to switch workspaces you can find here:
/usr/share/mint-artwork-cinnamon/sounds/switch.oga
I had to convert it to .wav for aplay to play though
Code: Select all
xdotool set_desktop 0
I only use 2 workspaces, so I made a script that toggles between both
Code: Select all
#!/bin/bash
aplay ~/notifications/workspace.wav &
if [ $(xdotool get_desktop) = 1 ]
then
xdotool set_desktop 0
else
xdotool set_desktop 1
fi
/usr/share/mint-artwork-cinnamon/sounds/switch.oga
I had to convert it to .wav for aplay to play though