How can I remove KDE Plasma widgets from Sway desktop?

Hi, I installed the community edition of EOS Sway. I was happy with it, but I also wanted an alternative. I installed KDE Plasma wayland edition off of the AUR. Everything is working fine, except for the fact that the KDE “task bar” is sitting in the middle of my Sway screen.

How can I remove it? How can I check what processes are being started when sway is launched?

I would like my Sway install and KDE install to be completely separate from each other.

Thanks!

Edit org.kde.plasmashell.desktop in /etc/xdg/autostart

Add a line OnlyShowIn=KDE;

I’m having a very similar issue (Sway seems to copy Plasma’s virtual desktop configuration as well as have the task bar in the middle of the screen) and that line is already in my org.kde.plasmashell.desktop, it does not fix the issue.

Are there dotfile conflicts between Plasma and Sway?

Nope, I run both, no problems. There is a really annoying program that runs autostarts, can’t remember it’s name :frowning:

dex - is dex running? Get rid and launch startup programs individually in your config.

1 Like

Different users would a recommendation.

Although I have never had the issue you are explaining unfortunately.

Then you should install them separately on their own. Desktops installed together are always going to have some overlap of software. That’s why i don’t install them together as a normal practice. The only desktop that i will use that way is i3 with xfce because they work well together without issue.

if you use dex is always possible it autostart from somewhere put bit configuring you can run perefectly abc desktops and wm’s :slight_smile: as long they dont fight over same space

Do you know of anywhere I can read up on getting dex to cooperate and not start Plasma’s taskbar and virtual desktops when I log in under Sway? I don’t want to hijack this thread more than I already have; I’m ok with software overlap as long as the UI is distinct between Plasma and Sway.

The only thing I know about dex is regarding i3 wm.

Edit: Not sure If this is helpful or not.

This is how I did it:

# Auth with polkit-gnome:
exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1

# Desktop notifications
exec swaync

# Network Applet
exec nm-applet --indicator

# GTK3 applications take a long time to start
exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK
exec hash dbus-update-activation-environment 2>/dev/null && \
     dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK
     
# Welcome App
#exec dex -a -s /etc/xdg/autostart/:~/.config/autostart/  

# Sway Fader
# exec python3 ~/.config/sway/scripts/swayfader.py      

exec albert&
exec variety&
#exec package-update-indicator
exec ~/scripts/mount-wd.sh
exec indicator-kdeconnect
exec ~/.config/sway/config.d/autostart.sh
exec blueman-applet
#exec sfwbar

exec /opt/Simplenote/simplenote --no-sandbox %U
for_window [title="^Simplenote$"] {
    move to scratchpad
}

# https://www.reddit.com/r/swaywm/comments/y7ak2k/set_up_wlclipboard/
exec wl-paste -t text --watch clipman store

exec sov

#exec_always --no-startup-id workstyle &> /tmp/workstyle.log

Most things are in exec ~/.config/sway/config.d/autostart.sh

1 Like

dex and similar utilities use XDG_CURRENT_DESKTOP to determine which apps to autostart. In Wayland, no usual (i.e. xprofile) dot files are sourced/executed, so you need to check if this env var is empty and try to import it with relevant systemd/dbus commands, or use systemd --user targets and systemd autostart generator (for window managers, as KDE and other major DEs have their own mechanisms).

So I’m working under the assumption that I’m not actually derailing the thread since my issue is very similar to OPs. @ricklinux if you feel otherwise I can start a new one, but I’m going to lay out my troubleshooting so far.

I followed rick’s link and ran dex -ad -e KDE which gave the output:

Executing command: /usr/lib/baloo_file
Executing command: eos-update-notifier -init
Executing command: /usr/bin/firewall-applet
Executing command: /usr/lib/geoclue-2.0/demos/agent
Executing command: gmenudbusmenuproxy
Executing command: kaccess
Executing command: klipper
Executing command: /usr/lib/kdeconnectd
Executing command: /usr/bin/plasmashell
Executing command: /usr/lib/pam_kwallet_init
Executing command: /usr/lib/polkit-kde-authentication-agent-1
Executing command: /usr/lib/org_kde_powerdevil
Executing command: sh /usr/share/endeavouros/scripts/wallpaper-once
Executing command: sh /usr/share/endeavouros/scripts/welcome --startdelay=3
Executing command: /usr/lib/xapps/xapp-sn-watcher
Executing command: xembedsniproxy

dex -ad -e sway yields:

Executing command: eos-update-notifier -init
Executing command: /usr/bin/firewall-applet
Executing command: /usr/lib/geoclue-2.0/demos/agent
Executing command: nm-applet
Executing command: /usr/lib/kdeconnectd
Executing command: /usr/lib/pam_kwallet_init
Executing command: system-config-printer-applet
Executing command: sh /usr/share/endeavouros/scripts/wallpaper-once
Executing command: sh /usr/share/endeavouros/scripts/welcome --startdelay=3
Executing command: /usr/lib/xapps/xapp-sn-watcher

To my eye I don’t see anything that would result in all my Plasma virtual desktops starting on my main monitor or the taskbar splitting the middle of the screen under Sway, but I don’t know enough about the guts of either UI to say for certain.

So following your lead, petsam, I started looking into the $XDG_CURRENT_DESKTOP env variable.

Under Plasma my $XDG_CURRENT_DESKTOP is, predictably, set to KDE.

Under Sway it was not set to anything, and wasn’t included if I ran systemctl --user show-environment under Sway. According to this Arch wiki entry Sway provides the configuration file /etc/sway/config.d/50-systemd-user.conf that, among other things, should set the env variable to sway. In my case it did not, so I changed the line dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP to dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP=sway and included it in my sway configuration file.

The output of systemctl --user show-environment under Sway is now:

[aristocrat@the-tower ~]$ systemctl --user show-environment
BROWSER=firefox
EDITOR=nano
HOME=/home/aristocrat
LANG=en_US.UTF-8
LC_ADDRESS=en_US.UTF-8
LC_IDENTIFICATION=en_US.UTF-8
LC_MEASUREMENT=en_US.UTF-8
LC_MONETARY=en_US.UTF-8
LC_NAME=en_US.UTF-8
LC_NUMERIC=en_US.UTF-8
LC_PAPER=en_US.UTF-8
LC_TELEPHONE=en_US.UTF-8
LC_TIME=en_US.UTF-8
LOGNAME=aristocrat
MAIL=/var/spool/mail/aristocrat
PATH=/usr/local/bin:/usr/bin
SHELL=/bin/bash
SYSTEMD_EXEC_PID=2050
USER=aristocrat
XDG_RUNTIME_DIR=/run/user/1000
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
DISPLAY=:1
SWAYSOCK=/run/user/1000/sway-ipc.1000.69224.sock
WAYLAND_DISPLAY=wayland-1
XDG_CURRENT_DESKTOP=sway

So I now have the correct environment variable, but the problem remains. I suspect it’s too far down on the list to be processed early enough on login to fix the issue. I’m now thoroughly stumped.

Launches most of plasma.

Ok, but unless I’m misunderstanding what petsam wrote plasmashell not being executed unless the relevant environment variable is KDE, which it is not when I log into Sway.

Well open a terminal and run:

ps aux | grep -i plasma

If it returns anything, then plasma is running. e.g.:

 ps aux | grep -i plasma
root        1020  0.0  0.1  67844 17856 ?        S    Jun06   0:00 /usr/lib/sddm/sddm-helper --socket /tmp/sddm-autha5aac212-e6ec-4692-ab45-c5737e0dc8fd --id 1 --start /usr/lib/plasma-dbus-run-session-if-needed /usr/bin/startplasma-wayland --user xircon
xircon      1039  0.0  0.1 192792 31532 tty2     Ssl+ Jun06   0:00 /usr/bin/startplasma-wayland
xircon      2693  0.0  0.3 512632 60960 ?        Sl   Jun06   0:00 /usr/bin/plasma-browser-integration-host chrome-extension://cimiefiiaegbelhefglklhhakcgmhkai/
xircon     19732  0.2  2.2 4547924 357492 ?      Ssl  Jun06   3:45 /usr/bin/plasmashell --no-respawn
xircon     53843  0.0  0.0   6588  2664 pts/2    S+   20:06   0:00 grep -i plasma

from a plasma wayland session.

You should investigate this reading the logs (journalctl).
Each desktop session provider may use their own method for session init (multiple ways).
Upstream sway should know better about it. Also Wayland sessions are different from usual Xorg sessions.
I am sorry I had no time to research upstream for such info.
Busy with coding :grin: . You may want to test my latest project, which is BTW a dex alternative, among other things.

1 Like

Sure enough, plasma was being run regardless of environment variable. A simple killall plasmashell fixes my Sway instance right up! I’ll implement a script to run on login to Sway so I don’t have to do it manually every time, but that’s good enough for me. Thanks for your patience and help everyone.