RT Cunningham

Blogging For As Long As I'm Able

← Previous Article

An Effective Use of Linux Workspaces

Tagged with cinnamon, code, linux, workspaces on February 22, 2025

Window list applets If you’re someone who’s organized enough to use Linux workspaces effectively without needing specialized applets, widgets, or scripts, more power to you. Perhaps you instinctively know that workspace number 2 is for games and workspace number three is for music. Sorry, but I’m not like you. I have difficulty remembering where things are on any given day of the week.

I’m using the Cinnamon desktop environment on Linux Mint. It works pretty much the same on every distribution that offers it. I’ve been trying to learn how to use workspaces as effectively as some authors I’ve been following. I think I’ve found a solution that works for me.

Shell Commands

I can move to any existing workspace, and start any application after moving, by using a command line automation tool called “xdotool”. To make it as effective as possible, I have to assign direct navigation shortcuts for each workspace in advance. They’re unassigned by default. I use “Ctrl+Alt+1”, “Ctrl+Alt+2”, and so forth. Let’s use one of the games I play as an example:

#!/bin/bash
xdotool key Ctrl+Alt+2
quadrapassel &

I saved it as a file called “quadrapassel.sh” in a folder named “sh” in my home directory, making it executable with chmod +x. I then used the Cinnamon Menu Editor to replace the original command to launch the application with “nohup” and then the full path of that file:

nohup /home/username/sh/quadrapassel.sh

It took several tries to get things right. I didn’t use the “&” character (ampersand) to begin with, and I didn’t tick the “Launch in Terminal” checkbox in the launcher. When I ran it, I moved to workspace 2, but the game ran in workspace 1. When I ticked the checkbox in the launcher, the game launched in the right place, but the terminal remained open.

Adding the ampersand in the script caused the game to quit. Putting “nohup” before the command solved that problem, and the terminal closed after the game launched. I was ready to give up until I read about the “nohup” command somewhere. Now I know what to do for all the applications I want to run on specific workspaces.

The Window List Applet

Using this approach, I only need one window list applet, “Window list”. I configured it to show windows from all workspaces. That way, I’ll automatically be sent to the appropriate workspace for an application when I click on the icon for it without having to know exactly where it is.

The only applets I use for navigation is the main menu, of course, along with the “Expo” applet. I only use that one when I’m too lazy to press the Ctrl+Alt+Up key combination.

This Is the Better Idea

This is a much better idea than using a dialog to list the applications I want to run on specific workspaces. It would be even better if it was a built in feature. There’s an extension called “Desktop icons per workspace” that would work pretty well if it still worked. It would allow me to select an application just by viewing workspaces. Unfortunately, the author doesn’t seem to care that it no longer works.

Image by Cinnamon developer, LGPL, via Wikimedia Commons

← Previous Article