Contents

Persist Always on Visible Workspace

Contents

| Ubuntu 22.04

It doesn’t work on Wayland, only on Xorg

Install devilspie2 an create test config for Mozilla Firefox

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
sudo apt install devilspie2
mkdir -pv ~/.config/devilspie2

cat <<EOF > /home/goto/.config/devilspie2/firefox.lua
if (string.match(get_window_name(), "Mozilla Firefox")) then
    stick_window();
--  maximize();
end
EOF

devilspie2 --debug

Mozilla Firefox should open in maximize and be visible on all workspaces

Find name of the windows:

1
2
xwininfo -tree -root
xwininfo -tree -root | grep -i 1password

Use names you’ve got to create config for apps:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
cat <<EOF > /home/goto/.config/devilspie2/myapps.lua 
-- To debug add:
-- debug_print("Window Name: " .. get_window_name());
-- debug_print("Application name: " .. get_application_name())
-- and run devilspie2 --debug

if (string.match(get_window_name(), "Telegram")) then
    stick_window();
end

if (string.match(get_window_name(), "Mail")) then
    stick_window();
end

if (string.match(get_window_name(), "Postman")) then
    stick_window();
end

if (string.match(get_window_name(), "1Password")) then
    stick_window();
--  set_window_workspace(3)
end

if (string.match(get_window_name(), "Slack")) then
    stick_window();
--  maximize();
end
EOF

More options in README.md

1
gzip --decompress /usr/share/doc/devilspie2/README.gz --stdout | less

Create systemd-unit for user

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
cat << EOF > /home/goto/.config/systemd/user/devilspie2.service
[Unit]
Description=devilspie2
Wants=display-manager.service
After=display-manager.service

[Service]
Type=simple
# Next line is only required for Xorg, should be removed for Wayland
Environment=XAUTHORITY=%h/.Xauthority
ExecStart=/usr/bin/devilspie2
ExecStop=/usr/bin/pkill devilspie2
RemainAfterExit=yes

[Install]
WantedBy=graphical-session.target
EOF

Enable it to run everytime

1
2
systemctl enable --now devilspie2.service --user
systemctl status devilspie2.service --user