-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for custom containments / system tray #126
Comments
Here's an example of a config which modifies system tray that I found and use. Notable the panel.nix file above calls a JS script in I'm non-knowledgeable. However, I believe this containment schema in |
That js script works great. Thank you :D |
After experimenting with this a bit, I find that this approach is significantly easier: for (const wid of panel.widgets(["org.kde.plasma.systemtray"])) {
const tray = desktopById(wid.readConfig("SystrayContainmentId"));
if (!tray) continue; // if somehow the containment doesn't exist
tray.writeConfig("hiddenItems", [
"org.kde.plasma.brightness",
"org.kde.plasma.clipboard",
]);
const battery = tray.addWidget("org.kde.plasma.battery");
battery.writeConfig("showPercentage", true);
} Also found out how to customize specific sub-widgets: you literally just create them manually and configure them the normal way, which is good news, since we can reuse the same widget config logic as we'd used for normal widgets. |
Thats way cleaner. Neat :D |
Hello, thank you for your work!
I think it would be a nice feature to be able to configure the system tray the same way it is now possible with the rest of the panel applets. I looked at the module's code but I didn't find a way to do this, so of course you can close this if it's already possible 😅
In order to achieve this, it seems like there would just need to be support for containments of any type, which will probably also allow configuring desktop widgets or maybe even other things.
Unfortunately I'm new to nix so I didn't manage to understand how to change the code to make a PR 😅 But here are some thoughts on what I was looking for to maybe change, in case they help 🤔
panel
module could be renamed/extended/aliased to/fromcontainment
plugin=
{org.kde.panel
/org.kde.plasma.private.systemtray
/org.kde.plasma.folder
}SystrayContainmentId
Here is a minimal example of a system tray configuration to demonstrate the schema for this use case (if I have understood it correctly):
The text was updated successfully, but these errors were encountered: