So, I usually do the same thing on startup:
1. Load email in workspace 1
2. Start Browser in workspace 2
3. Start an alternate browser in workspace 3
Is this something that can be automated with a script? I think it's a bit beyond the capabilities of "launcher."
Thanks.
Startup Script
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.
Startup Script
Last edited by LockBot on Thu Feb 16, 2023 11:00 pm, 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.
Re: Startup Script
Hi and welcome to the forum.
https://unix.stackexchange.com/question ... -workspace
Forget about devils pie for the moment and try wmctrl.
Probably not. Start with this and tell us where it goes wrong:I think it's a bit beyond the capabilities of "launcher."
https://unix.stackexchange.com/question ... -workspace
Forget about devils pie for the moment and try wmctrl.
Re: Startup Script
For single-time autostart on a specific workspace, use wmctrl indeed to first switch to the desktop where you want the application to appear (e.g. wmctrl -s 1 to switch to the second desktop (counting starts at 0), then launch the application. Launchers only support a single command. You can, however, use the construct "sh -c" to combine multiple commands in a launcher if you do not want to work with a separate script. The "Exec=" line thus could read something like
to start your browser on Workspace 2.
This will happen automatically after login if your launcher is located in ~/.config/autostart.
If you have multiple programs starting this way, it will be advised to load them all sequentially using a single script instead. That avoids that one launcher moves to workspace 1, while another one a split second later moves to workspace 2.
If you want this to happen anytime you launch the application, copy the systemwide launcher of the application to ~/.local/share/applications and edit the copy the same way. Then, each time you launch Firefox from the menu, it will automatically be placed in Workspace 2.
devilspie or devilspie2 comes in more handy when you want a certain type of window to be placed in a certain way anytime it is created.
Code: Select all
Exec=sh -c "wmctrl -s 1 && firefox %u"
This will happen automatically after login if your launcher is located in ~/.config/autostart.
If you have multiple programs starting this way, it will be advised to load them all sequentially using a single script instead. That avoids that one launcher moves to workspace 1, while another one a split second later moves to workspace 2.
If you want this to happen anytime you launch the application, copy the systemwide launcher of the application to ~/.local/share/applications and edit the copy the same way. Then, each time you launch Firefox from the menu, it will automatically be placed in Workspace 2.
devilspie or devilspie2 comes in more handy when you want a certain type of window to be placed in a certain way anytime it is created.
Re: Startup Script
But that single command can be a shell script, a Perl script, a python script, etc.Launchers only support a single command