Xfce Forum

Sub domains
 

You are not logged in.

#1 2025-12-03 10:41:25

sir7seas
Member
Registered: 2025-12-03
Posts: 9
LinuxChrome 142.0

Fixed assignment of program and virtual desktop

Hello XFCE Forum,

First of all, I would like to welcome you all and wish you a pleasant pre-Christmas period.
I'm actually not new to this forum.
However, I have been using Gnome as my desktop environment for the last few years, and I have also lost my login details for this forum.

Perhaps a brief introduction is in order (feel free to skip this):
Beginnings:
Since the end of OS/2 in 2000, I have been trying to switch to Linux.
However, I only succeeded in 2005 with Warty Warthog.
Linux has been my operating system for 20 years now.
I never liked Windows, and after XP, I lost interest completely.
For 15 years, Gnome was my desktop environment and Ubuntu was my distribution.
Then Unity came along and I couldn't get used to it.
I tried and tried, but then I switched to Xubuntu.
I tried Arch with XFCE in the meantime, but returned to Xubuntu.
For the last three years, I've been using Ubuntu (i.e. the Gnome desktop).
I bought an IdeaPad 3, a tablet computer with a touchscreen.
It's supposed to run better with Gnome, but I didn't find that to be the case.
Now I'm coming to the end of my introduction. smile
Last week, I bought a ThinkPad X12. It's a great little detachable. It runs great with Linux.
My first "official act" was to delete Windows 11 Pro from the SSD. I really don't need it, I promise!
This time, Ubuntu (Gnome) didn't make it onto the computer.
I don't like Canonical's push for Snap, and there are also many other issues.
Why bother with Gnome Extensions when you can do it directly in XFCE?
Just think of the panel.
For me, the solution was to use Debian 13 with the XFCE desktop on the new ThinkPad.
End

Now, finally, I come to my question:
Is it possible to assign a program to a specific virtual desktop, as with Gnome or KDE?
Example: When I press the Firefox launcher, Firefox starts on Desktop 1; when I start Thunderbird, it automatically starts on Desktop 2, and so on.
Currently, when I click on a link in Thunderbird on Desktop 2, Firefox switches from Desktop 1 to Desktop 2, which I find really annoying.
I have already read about 'Devilspie2', but I am still unsure how to use it.

Can anyone offer support or alternatives?

Offline

#2 2025-12-03 11:14:36

eriefisher
Wanderer
From: ON, Canada
Registered: 2008-10-25
Posts: 821
LinuxFirefox 145.0

Re: Fixed assignment of program and virtual desktop

I believe devilspie/2 and wmctl can do what you want in combination together. I've never set it up but there are examples here on the forum if you do a search. As for your desktop switching, Goto Setting>>Window-Manager-Tweaks>>Focus>>Switch to window's workspace.


I AM CANADIAN!
Siduction
Debian Sid
Xfce 4.20 with Wayland/Labwc

Offline

#3 2025-12-05 21:32:37

sir7seas
Member
Registered: 2025-12-03
Posts: 9
LinuxChrome 142.0

Re: Fixed assignment of program and virtual desktop

eriefisher wrote:

I believe devilspie/2 and wmctl can do what you want in combination together. I've never set it up but there are examples here on the forum if you do a search. As for your desktop switching, Goto Setting>>Window-Manager-Tweaks>>Focus>>Switch to window's workspace.


Hi eriefisher,

yes develspie2 should do this, already knew it. The problem is how.
Did a lot of investigation on the Net, but no success up to now.

Sometimes, even after 20 years of Linux, I don't understand why everything on Linux has to be so complicated.
I just want to use Linux as my operating system. Don't want to do big investigations why VBox isn't running now on Debian 13. It did before.
Don't want to find out why the actual application of Master-pdf is not starting on my ThinkPad (some QT failure).
And and ...
I tell you, if Windows would not be such a bad bad operating System and M$ such a bad bad company, I don't know if I would have stand it all these years.

Back to my question. It is strange, that XFCE User don't take care about such important items.
Is there anyone how don't use different workspaces?
- Can't believe.
Is there none, which like to have a certain application on a certain workspace?
Is there none which feels upset, when you click on a link in Thunderbird (workspace 2) that Firefox will move from workspace 1 to 2?

Offline

#4 2025-12-05 22:36:02

eriefisher
Wanderer
From: ON, Canada
Registered: 2008-10-25
Posts: 821
LinuxFirefox 145.0

Re: Fixed assignment of program and virtual desktop

As for workspace switching it's in the settings.

There are several Devilspie examples on the forum as the topic has come up many times. I just handle it manually after I log in. Browser on 1 Email on 2 etc. I only need the one time so automation just never interested me. You may have good reason to automate so it's worth looking into.

I've been running linux for 25 years or so but mostly just a simple desktop user. I encounter things all the time that need some time and research to figure out. I enjoy the challenge. I don't know how windows does things, I haven't sat in front of a windows desktop since XP SP2 was released.

https://imgur.com/VRoiklk.png


I AM CANADIAN!
Siduction
Debian Sid
Xfce 4.20 with Wayland/Labwc

Offline

#5 2025-12-05 22:48:19

sir7seas
Member
Registered: 2025-12-03
Posts: 9
LinuxChrome 142.0

Re: Fixed assignment of program and virtual desktop

eriefisher wrote:

As for workspace switching it's in the settings.

There are several Devilspie examples on the forum as the topic has come up many times. I just handle it manually after I log in. Browser on 1 Email on 2 etc. I only need the one time so automation just never interested me. You may have good reason to automate so it's worth looking into.

I've been running linux for 25 years or so but mostly just a simple desktop user. I encounter things all the time that need some time and research to figure out. I enjoy the challenge. I don't know how windows does things, I haven't sat in front of a windows desktop since XP SP2 was released.

https://imgur.com/VRoiklk.png

Hi eriefisher,
I couldn't find a search function on this forum. Sorry.

Yes. It might be fun and a challange to find out why some stupid things are not working.
I agree. But in my opinion the real fun is, they are working and later you can modify.

Windows does every thing bad. It is just a pain in the a.s operating system.
But to some things work without hours  / dqays of investigation.

Added later 03 min 11 s:
Anyway I have no doubts to return back to Windows after 20 years.
Maybe I should just return bacj to Gnome and ...

Added later 04 min 20 s:
Anyway I have no doubts to return back to Windows after 20 years.
Maybe I should just return bacj to Gnome and ...

Added later 06 min 01 s:
Anyway, I have no doubts to return back to Windows after 20 years.
Maybe I should just return back to Gnome and ...

Offline

#6 2025-12-05 22:56:38

eriefisher
Wanderer
From: ON, Canada
Registered: 2008-10-25
Posts: 821
LinuxFirefox 145.0

Re: Fixed assignment of program and virtual desktop

The search function is at the top left of the page.

I wish I knew more about Devilspie. Maybe one day.


I AM CANADIAN!
Siduction
Debian Sid
Xfce 4.20 with Wayland/Labwc

Offline

#7 2025-12-05 23:08:03

sir7seas
Member
Registered: 2025-12-03
Posts: 9
LinuxChrome 142.0

Re: Fixed assignment of program and virtual desktop

No search icon / possibility on my page  smile
Doesn't matter. Maybe it is just the best to switch back to Gnome.

You know, I like to do some investigation, but if I found out (here in the forum) that my idea of different workspaces is total unknown, than better to move on

Offline

#8 2025-12-05 23:12:04

eriefisher
Wanderer
From: ON, Canada
Registered: 2008-10-25
Posts: 821
LinuxFirefox 145.0

Re: Fixed assignment of program and virtual desktop


I AM CANADIAN!
Siduction
Debian Sid
Xfce 4.20 with Wayland/Labwc

Offline

#9 2025-12-05 23:28:41

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 12,367
LinuxFirefox 145.0

Re: Fixed assignment of program and virtual desktop

Here is how you can achieve this with devilspie2:

  1. Create the file ~/.config/devilspie2/devilspie2.lua (create the directory if it doesn't exist) and add the following content to the file:

    if (get_application_name() == "Firefox") then
    	set_window_workspace(1)
    end
    
    if (get_application_name() == "Thunderbird") then
    	set_window_workspace(2)
    end

    ...and save the file.

  2. in a terminal window, run:

    devilspie2
  3. Start a fresh instance of firefox - it should open on the first workspace.

  4. Start a fresh instance of thunderbird - it should open on the second workspace.

If this works, add a new entry in Settings Manager > Session and Startup > Application Autostart, to start "devilspie2" on login


Mark solved threads as [SOLVED] to make it easier for others to find solutions.
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#10 2025-12-05 23:33:03

eriefisher
Wanderer
From: ON, Canada
Registered: 2008-10-25
Posts: 821
AndroidChrome 143.0

Re: Fixed assignment of program and virtual desktop

Toz to the rescue.


I AM CANADIAN!
Siduction
Debian Sid
Xfce 4.20 with Wayland/Labwc

Offline

#11 2025-12-06 10:22:34

sir7seas
Member
Registered: 2025-12-03
Posts: 9
LinuxChrome 142.0

Re: Fixed assignment of program and virtual desktop

Hi Toz,
your example is exactly how I thought it should be, but it doesn't work on my ThinkPad.

My operating system is Debian 13 Trixi. Desktop XFCE of course. smile
- devilspie2 installed (sudo apt install devilspie2)
- Version (0.43-5+b1).
- ~/.config/devilspie2
- ~/.config/devilspie2/devilspie2.lua (your example)
- devilspie2 started in terminal
- devilspie2 running

I am on workspace 4 for example
- start Firefox
-> opens on workspace 4 (and not on1)
- start Thunderbird
-> opens on workspace 4 (and not on 2)

 $ devilspie2 --debug
Running devilspie2 in debug mode.

Using scripts from folder: /home/xxxx/.config/devilspie2
------------
List of Lua files handling "window_open" events in folder:
/home/xxxx/.config/devilspie2/devilspie2.lua
List of Lua files handling "window_close" events in folder:
List of Lua files handling "window_focus" events in folder:
List of Lua files handling "window_blur" events in folder:
------------ 

I am sure that I am doing something wrong.
I just started Firefox with a starter from my panel (command /usr/lib/firefox-esr/firefox-esr %u)
and Thunderbird with a starter as well (command /usr/bin/thunderbird %u)

Added later 16 min 56 s:
Hi eriefisher,

thank you. I found the search, wasn't that difficult  smile I should use glasses working on my ThinkPad

eriefisher wrote:

As for workspace switching it's in the settings.

I don't understand. My desktop (XFCE, Gnome) is always configured with 4 virtual desktops.
- Firefox on desktop 1
- Thunderbird on desktop 2
- LibreOffice on desktop 3
- VBox and other stuff on desktop 4

To switch between the desktops I have the virtual desktop element (?) in my panel on the top.
Just click with the mouse on the desktop I want to use.

I would like to use such a tool as devilspie2 to have some automation (got used for this functionality by gnome)
Button Firefox will start the application on desktop 1, Thunderbird on 2 etc.

What is really annoying (in my opinion) is these moving to a "wrong" desktop.
I click on a link in Thunderbird (which is on desktop 2) -> Firefox opens on desktop 2 as well.
OK. I complain at a high level.

Offline

#12 2025-12-06 11:01:47

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 12,367
LinuxFirefox 145.0

Re: Fixed assignment of program and virtual desktop

Change your ~/.config/devilspie2/devilspie2.lua file to read:

debug_print("Window name: " .. get_window_name());
debug_print("Application name: " .. get_application_name());

...and then run "devilspi2 --debug" again.

Open Firefox and Thunderbird and post back the output that the debug parameter generates.


Mark solved threads as [SOLVED] to make it easier for others to find solutions.
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#13 2025-12-06 23:39:08

sir7seas
Member
Registered: 2025-12-03
Posts: 9
LinuxChrome 142.0

Re: Fixed assignment of program and virtual desktop

Hello ToZ,

your "debug_print" was the important move forwards to see how devilspie2 interprets the applications. Thanks.
Application name was a bit different. So something works now.

Unfortunately my problem isn't resoved yet. Brave or Firefox start on the virtual workspace. I want (1).
Thunderbird as well (which has a password before starting) on 2. Perfect!

So far not bad. Sorry, for my requests, but I really got too much used to this Gnome feature. Can't miss now.
Still not solved (maybe develspie2 cannot do this).

(1) I would like that the focus (?) is automatically changed to the new virtual desktop when I start Thunderbird / Firefox / Brave ...
Specially the password window of Thunderbird. I have to click on this desktop.

(2) More important. I am on virtual workspace 2 "Thunderbird". Firefox / Brave is on virtual workspace 1.
I open a link in Thunderbird and Firefox / Brave is move to workspace 2.
This behavior is completely unacceptable to me.
What's the point of having virtual desktops if everything ends up in one place (virtual desktop)?

Is there an option devilspie2 can solve this?

Offline

#14 2025-12-07 00:53:22

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 12,367
LinuxFirefox 145.0

Re: Fixed assignment of program and virtual desktop

(1) I would like that the focus (?) is automatically changed to the new virtual desktop when I start Thunderbird / Firefox / Brave ...
Specially the password window of Thunderbird. I have to click on this desktop.

(2) More important. I am on virtual workspace 2 "Thunderbird". Firefox / Brave is on virtual workspace 1.
I open a link in Thunderbird and Firefox / Brave is move to workspace 2.
This behavior is completely unacceptable to me.
What's the point of having virtual desktops if everything ends up in one place (virtual desktop)?

Settings Manager > Window Manager Tweaks > Focus tab > When a window raises itself -- change this to "Switch to the window's workspace".


Mark solved threads as [SOLVED] to make it easier for others to find solutions.
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#15 2025-12-07 10:11:32

sir7seas
Member
Registered: 2025-12-03
Posts: 9
LinuxChrome 143.0

Re: Fixed assignment of program and virtual desktop

Hi ToZ
hi eriefisher,

thanks for your help. Problems solved. Now I will experiment with devilspie2. Seems to be a nice tool.

Offline

#16 Yesterday 23:58:51

sir7seas
Member
Registered: 2025-12-03
Posts: 9
LinuxChrome 143.0

Re: Fixed assignment of program and virtual desktop

Folks,
I would like to write soem final statements.
I used the weekend to experiment.

1. Thanks ToZ and Eriefisher for your support.
2. I was suprised, that nobody (?) else got involved.
3. My issue was solved. How can I close this threat?
4. How is it possible that none (?) uses deveilspie2 on XFCE?
   In my opinion the XFCE desktop isn't usable without devilspie2.
5. With this tool it is much better than the gnome shell extension. Very much better!
6. Folks. Give it a try!

Offline

#17 Today 00:15:34

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 12,367
LinuxFirefox 145.0

Re: Fixed assignment of program and virtual desktop

To mark a thread as solved, edit your first post in this thread and prepend "[SOLVED]" to the subject line.

Alot of people use devilspie, myself included, to add additional window management functionality to Xfce. This is an example of what I like about Xfce. At its core, it is lean and simple (for those that want lean and simple), but it is easy to extend its functionality using tools like this for those looking for more functionality.


Mark solved threads as [SOLVED] to make it easier for others to find solutions.
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.018 seconds, 8 queries executed - Memory usage: 660.39 KiB (Peak: 693.23 KiB) ]