This forum has been archived. All content is frozen. Please use KDE Discuss instead.

How to use KWin window rules for legacy system tray icons?

Tags: None
(comma "," separated)
User avatar
Sudhir Khanger
Registered Member
Posts
237
Karma
0
OS
Hello,

I have recently switched to Plasma 5 on Fedora 20 KDE. Some of the applications like Viber, Dropbox, Skype, Gnome EncFS Manager, etc. use X11 system tray. Martin Grässlin made a post about it suggesting to use wmsystemtray for application that won't support KStatusNotifierItems or libappindicator. He also posted a sample KWin window rule.

I am not sure how to use it and what it will do. I have been able to start wmsystemtray with the command he posted which opens a small window with all legacy systray icons. I saved the KWin window rules in a text file and imported it into SystemSettings>Window mangement>Window Rules but nothing happens. What am I doing wrong?

Code: Select all
Description=Application settings for wmsystemtray
desktop=-1
desktoprule=2
noborder=true
noborderrule=2
skippager=true
skippagerrule=2
skipswitcher=true
skipswitcherrule=2
skiptaskbar=true
skiptaskbarrule=2
type=2
typerule=2
wmclass=wmsystemtray0 wmsystemtray
wmclasscomplete=true
wmclassmatch=1
luebking
Karma
0
The rules should make the systray window undecorated, on all desktops and not in taskbar or window switcher.
If they don't apply, check the window detection, in doubt edit the rule, click the "detect" button and then the wmsystray window
(NOTICE: *NOT* one of the systray icons!)
User avatar
Sudhir Khanger
Registered Member
Posts
237
Karma
0
OS
luebking wrote:The rules should make the systray window undecorated, on all desktops and not in taskbar or window switcher.
If they don't apply, check the window detection, in doubt edit the rule, click the "detect" button and then the wmsystray window
(NOTICE: *NOT* one of the systray icons!)


When I import the rule in form of a text file nothing happens. There is no entry in the Window Behavior. I see wmsystemtray entry in the taskbar which I can click to bring the small applet with all X11 system icons. Is it suppose to look like in this pic?

Image
luebking
Karma
0
No - the rules don't apply.
Do the imported rules show up in the "kcmshell4 kwinrules" dialog?
If not, a rule im/export should actually contain a group header, sth. like
Code: Select all
[ Application settings for wmsystemtray]

Could have got lost in Martin's markdown (I really have markdown ;-)
User avatar
Sudhir Khanger
Registered Member
Posts
237
Karma
0
OS
luebking wrote:No - the rules don't apply.

Did you mean the my screenshot shows that the rules didn't get applied to wmsystemtray.

luebking wrote:Do the imported rules show up in the "kcmshell4 kwinrules" dialog?

Code: Select all
[donnie@fedora ~]$ kcmshell4 kwinrules
Could not find module 'kwinrules'. See kcmshell4 --list for the full list of modules.


luebking wrote:If not, a rule im/export should actually contain a group header, sth. like
Code: Select all
[ Application settings for wmsystemtray]

Could have got lost in Martin's markdown (I really have markdown ;-)


I end up with an empty list of kwin rules however I try to import a rule.

Image
luebking
Karma
0
The valid file should look like

Code: Select all
[Application settings for wmsystemtray]
Description=Application settings for wmsystemtray
desktop=-1
desktoprule=2
noborder=true
noborderrule=2
skippager=true
skippagerrule=2
skipswitcher=true
skipswitcherrule=2
skiptaskbar=true
skiptaskbarrule=2
type=2
typerule=2
wmclass=wmsystemtray0 wmsystemtray
wmclasscomplete=true
wmclassmatch=1
User avatar
Sudhir Khanger
Registered Member
Posts
237
Karma
0
OS
luebking wrote:The valid file should look like


Thanks that made the import work.

The window is stuck in the top left corner in two states as shown in pictures below. It goes below the panel but not below the active window. Is there anything wrong with the kwin rules. Is it possible to dock this in the panel as a widget?

Image
Image
luebking
Karma
0
> Is it possible to dock this in the panel as a widget?
Not, but you could set it "keep below" ("modify" the rule, "arrangement & access" page) - also ensure the window be no dock typed (try enforcing the widnow type in the "appearance & fixes" tab top "normal" - docks are supposed to be above all windows)

You can also adjust the position etc. - the window should (unless a position is enforced) still be movable by Alt+left mouse button
User avatar
Sudhir Khanger
Registered Member
Posts
237
Karma
0
OS
luebking wrote:> Is it possible to dock this in the panel as a widget?
Not, but you could set it "keep below" ("modify" the rule, "arrangement & access" page) - also ensure the window be no dock typed (try enforcing the widnow type in the "appearance & fixes" tab top "normal" - docks are supposed to be above all windows)

You can also adjust the position etc. - the window should (unless a position is enforced) still be movable by Alt+left mouse button


Thanks for saving the day. It was docked that was causing the problem. After I set it to normal everything is working fine.
User avatar
Sudhir Khanger
Registered Member
Posts
237
Karma
0
OS
wmsystemtray is a 4x4 window which usually shows up in top left corner. Is it possible make it 2x2 and make it appear in bottom right corner? Like below.

Image
sL1pKn07
Registered Member
Posts
3
Karma
0
Hi, one question. how you show the chorme systray icon in a kf5 panel? for me only show in the wmsystemtray space

greetings

EDIT: oh, missing libappindicator
emrecio
Registered Member
Posts
13
Karma
0
OS
Is there a widget that implements the old xembed. So I just remove the kde5 system tray widget (or leave if there's room) and add a widget where the system tray would be, which implements xembed. Also note, that I have tried the wmsystemtray method noted above, and it seems to work OK. Now it would be nice if it can look more KDEish. ... hmmm, a project idea ;)
User avatar
Sudhir Khanger
Registered Member
Posts
237
Karma
0
OS
emrecio wrote:Is there a widget that implements the old xembed. So I just remove the kde5 system tray widget (or leave if there's room) and add a widget where the system tray would be, which implements xembed. Also note, that I have tried the wmsystemtray method noted above, and it seems to work OK. Now it would be nice if it can look more KDEish. ... hmmm, a project idea ;)


XEmbed needs to go away. I would highly encourage you to push the app developer of apps that use XEmbed that they support new system tray paradigm by using either latest Qt versions or libappindicator for GTK+ apps.

Edit:- more legible now.

Last edited by Sudhir Khanger on Thu Jun 25, 2015 1:57 pm, edited 1 time in total.
luebking
Karma
0
ftr, donniezazen wanted to say that "We need to stop using XEmbed for the systray" - it's a relevant X11 protocol extension and won't go away as long as X11 is around.
emrecio
Registered Member
Posts
13
Karma
0
OS
Yeah, but my argument is to make it an option... so if people still want to use their (our) legacy applications that we can't/won't want to rewrite then sure, a new system tray widget (implementing xembed) along side the old one is available. By default, distros can keep it out of the default install, and such. So we google it and find out (as I did this article) that there's a KDE Widget which implements xembed. Just saying... I think I will start working on such a widget. I just started Audacious, and I couldn't see it anywhere on my screen, I had to start it again. Same for Pidgin, my Java apps (DavMail), not to mention KDEInit5 crashes everytime I select "Special Window Settings..." from the title bar. I picked a wrong time to upgrade to Fedora 22.


Bookmarks



Who is online

Registered users: Bing [Bot], blue_bullet, Google [Bot], rockscient, Yahoo [Bot]