Is there any way to control what workspace a program starts in?
Can a program start visible in all workspaces?
I have things set so that programs are only visible in the workspace they start in.
I would like the file manager (caja) to be visible in all workspaces so I do not have to always right-click (left for some of us).
And if possible I would like to control what workspace a program starts in.
ws1 Chromium (left mon)
ws2 VirtualBox (left mon)
ws3 whatever, maybe geany (left mon)
ws4 Terminal (left mon)
all filemanager (right mon)
A bit off topic but can you also control what monitor a program is visible in?
On the left is the BIG external monitor, the right is the laptop.
Workspace Control
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Workspace Control
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time 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.
Re: Workspace Control
You can right-click any running program on the task bar and check the box to make it active on all workspaces.
Could be easily scripted using the toolCaltrop wrote: ⤴Wed Sep 19, 2018 3:05 pm And if possible I would like to control what workspace a program starts in.
ws1 Chromium (left mon)
ws2 VirtualBox (left mon)
ws3 whatever, maybe geany (left mon)
ws4 Terminal (left mon)
all filemanager (right mon)
A bit off topic but can you also control what monitor a program is visible in?
wmctrl
. The -t
parameter moves the window to the specified workspace, the -e
parameter lets you set window size and location. wmctrl can modify specific windows, groups or classes of windows but the lazy way is just specify -r :ACTIVE:
to make it modify the currently active window. So take this example: Code: Select all
caja & sleep 1; wmctrl -r :ACTIVE: -e 0,2000,100,1200,600; wmctrl -r :ACTIVE: -t 1
To run multiple commands like above directly from a launcher you have to format the command line like this (
sh -c "<commands>"
)
Code: Select all
sh -c "caja & sleep 1; wmctrl -r :ACTIVE: -e 0,2000,100,1200,600; wmctrl -r :ACTIVE: -t 1"
Re: Workspace Control
I will research wmctrl
as I asked...
but there is no way to automate visible in all workspaces?
I know about right-clicking
I want the program to start visible in all workspaces
well...
wmctrl issue
the -r option grabs the first 'user-name' 'user-name@system-name ~' not 'user-name'
it is the later 'user-name' that I want to manipulate
I need to be able to reference the window by name since I do not know the ID
I am trying to automate visible in all workspaces for a single application
caja &; sleep 3; wmctrl -r "window-name" -b add,sticky
that way my file browser will be in all workspaces
if I have a terminal ope at the time the terminal will be modified not the file browser
terminals & browsers also have variable window names
this is a problem...
going to have to brush off the C compiler for this one...
something to launch caja then manipulate the x-win properties
another issue is I use dual monitors
that caused all kinds of headaches with the primary touchscreen
so I expect this to be a mess as well as it already is
why does everything in Linux have to be so complicated...
as I asked...
but there is no way to automate visible in all workspaces?
I know about right-clicking
I want the program to start visible in all workspaces
well...
wmctrl issue
Code: Select all
user-name@system-name ~
$ wmctrl -l
0x00e00003 -1 system-name Bottom Panel
0x00e0001f -1 system-name Top Panel
0x00e00031 -1 system-name Right Panel
0x01c00006 -1 system-name x-caja-desktop
0x05400001 0 system-name scripts - Start every window on all workspaces, with a few exclusions - Ask Ubuntu - Chromium
0x04e00007 3 system-name user-name@system-name ~ <<<<< grabs this, terminal
0x01c01004 3 system-name user-name <<<<< not this, file browser
user-name@system-name ~
$ wmctrl -r "user-name" -b add,sticky
user-name@system-name ~
$
it is the later 'user-name' that I want to manipulate
I need to be able to reference the window by name since I do not know the ID
I am trying to automate visible in all workspaces for a single application
caja &; sleep 3; wmctrl -r "window-name" -b add,sticky
that way my file browser will be in all workspaces
if I have a terminal ope at the time the terminal will be modified not the file browser
terminals & browsers also have variable window names
this is a problem...
going to have to brush off the C compiler for this one...
something to launch caja then manipulate the x-win properties
another issue is I use dual monitors
that caused all kinds of headaches with the primary touchscreen
so I expect this to be a mess as well as it already is
why does everything in Linux have to be so complicated...
- smurphos
- Level 18
- Posts: 8498
- Joined: Fri Sep 05, 2014 12:18 am
- Location: Irish Brit in Portugal
- Contact:
Re: Workspace Control
wmctrl -lx
gives more useful output.I used to use this script on startup to open a couple of applications and move them around - the awk extracts the WINDOW_ID from the WM_CLASS returned by
wmctrl -lx
Code: Select all
#!/bin/bash
#Description: A script to set up applications is specific workspaces - run as start up task
cd
#open inbox
/opt/google/chrome/google-chrome --profile-directory=Default --app-id=pkclgpgponpjmpfokoepglboejdobkpl
#wait until the inbox window opens
until wmctrl -lx | awk '$3~/crx_pkclgpgponpjmpfokoepglboejdobkpl.Google-chrome/ {print $1}'; do
sleep 0.1
done
#move inbox from workspace 0 to workspace 1
INBOX=$(wmctrl -lx | awk '$3~/crx_pkclgpgponpjmpfokoepglboejdobkpl.Google-chrome/ {print $1}')
wmctrl -i -r $INBOX -t 1
#open sync in held terminal
wake_sync_script_auto.sh
#wait until the sync window opens
until wmctrl -lx | awk '$3~/gnome-terminal-server.Gnome-terminal/ {print $1}'; do
sleep 0.1
done
#move sync from workspace 0 to workspace 1
TERM=$(wmctrl -lx | awk '$3~/gnome-terminal-server.Gnome-terminal/ {print $1}')
wmctrl -i -r $TERM -t 2
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.