Assigning a specific xfce virtual desktop to a VM-program pair

61 views
Skip to first unread message

daltong defourne

unread,
Apr 12, 2017, 1:16:36 PM4/12/17
to qubes-users
I know this (and similar matters) has been discussed in different places, on and off

For example here:
https://groups.google.com/forum/#!topic/qubes-users/jtjyq8N6bY0/discussion
https://groups.google.com/forum/#!topic/qubes-users/gCklOzk9xYg
https://github.com/QubesOS/qubes-issues/issues/2627

However, now I am solidly confused and don't know what to do and how.

What I want

have firefox running in RedAppVM-One start on xfce desktop 1

have firefox running in RedAppVM-Two start on xfce desktop 6

Ideally, I'd also like to make ~all~ software from RedAppVM-One to start on desktop 1 , but even "solving for firefox" would be an okay start for me.

Hack

unread,
Apr 12, 2017, 1:44:52 PM4/12/17
to qubes...@googlegroups.com
If I am not mistaken :

1) Install DevilSpie2,
2) then, write some lua scipt like this :


For workspace 1, on $HOME/.config/devilspie2/RedAppVM-One.lua

dom = 'RedAppVM-One';
class = get_class_instance_name();
workspace = 1;

if (string.match(class, dom)) then
set_windows_workspace(workspace)
end


For workspace 6 on $HOME/.config/devilspie2/RedAppVM-Two.lua

dom = 'RedAppVM-Two';
class = get_class_instance_name();
workspace = 6;

if (string.match(class, dom)) then
set_windows_workspace(workspace)
end

cooloutac

unread,
Apr 12, 2017, 1:48:30 PM4/12/17
to qubes-users

I think you can do this on KDE, for xfce you probably have to install a 3rd party tool to dom0.

daltong defourne

unread,
Apr 12, 2017, 2:35:57 PM4/12/17
to qubes-users

Devilspie2 does not seem to play nice with qubes (ref: https://github.com/QubesOS/qubes-issues/issues/2627 ) but if there is a "low bloodshed" way to make it work with qubes it would be nice.

And yes, I'm on xfce...

Hack

unread,
Apr 12, 2017, 3:08:20 PM4/12/17
to qubes...@googlegroups.com
Where do you read that Devilspie2 does not play nice with Qubes? I am
using both of them, and it works nicely, since months! (And I was the
one who started this tread…)

daltong defourne

unread,
Apr 12, 2017, 4:26:08 PM4/12/17
to qubes-users, mister...@outlook.com
Hi Hack!

I have linked to the qubes-issues thread where it seemingly came up.
The full problem quote is:

"I tried to install devilspie2 for testing purposes on Qubes. Currently, it's not work on Qubes.
Devilspie2 function get_window_name() return Windows names without AppVM labels. Therefore, it's not possible to sort windows on desktops by AppVM name."

I reckon it is not actually correct and the lua scripts you provided work in Qubes 3.2 "as is"?

If so, if I may ask a few questions:
1) do the lua provided "stick" the window to a given desktop (as in, I won't be able to send a window to a different virtual desktop even if I try) ?
2) if no, does devilspie2 provide a way to do that ?
3) if yes, is there a way to avoid sticking (as in, always start in desktop 1, but can be sent to any other desktop) ?
4) could you please write up a quick primer on using devilspie2 with qubes (any caveats, etc?)

Thank you very much

Hack

unread,
Apr 13, 2017, 2:18:19 AM4/13/17
to qubes...@googlegroups.com
Hi!

> I have linked to the qubes-issues thread where it seemingly came up.
> The full problem quote is:
>
> "I tried to install devilspie2 for testing purposes on Qubes.
Currently, it's not work on Qubes.
> Devilspie2 function get_window_name() return Windows names without
AppVM labels. Therefore, it's not possible to sort windows on desktops
by AppVM name."
>
> I reckon it is not actually correct and the lua scripts you provided
work in Qubes 3.2 "as is"?
>

Yes, because those who failed to make it works used get_window_name()
instead of get_class_instance_name()!!!

> If so, if I may ask a few questions:
> 1) do the lua provided "stick" the window to a given desktop (as in,
I won't be able to send a window to a different virtual desktop even if
I try) ?

Well, every time you launch a program, it will be automatically send to
the chosen virtual desktop. But you can then send this program where you
want.

With the script I provided, every program from "RedAppVM-One" will be
send to workspace 1. But after that, if you want to send this program to
workspace 6, you can.

You can customize it easily:
Change only these values:
dom = 'RedAppVM-One';
workspace = 1


> 2) if no, does devilspie2 provide a way to do that ?

See above.

> 3) if yes, is there a way to avoid sticking (as in, always start in
desktop 1, but can be sent to any other desktop) ?

See 1)

But I repeat, once you have launched a program, you can then move it
where you want.

> 4) could you please write up a quick primer on using devilspie2 with
qubes (any caveats, etc?)
>

It works like a charm!

Devilspie2 is even quite flexible, but be careful, because if you write
something like "RedAppVM" in dom variable, and 1 for workspace, without
adding "-One", and so one to the name "RedAppVM", every new windows
starting with 'RedAppVM*' will be send to the same workspace, here 1.


> Thank you very much
>

You are welcome.

Reply all
Reply to author
Forward
0 new messages