-
Notifications
You must be signed in to change notification settings - Fork 73
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
Move desktop options to desktop
module and add desktop widgets option
#332
Move desktop options to desktop
module and add desktop widgets option
#332
Conversation
Using a fork of panel widgets lib for desktop widgets would be the best solution I think |
Example script for desktop widget: let allDesktops = desktops();
for (let i = 0; i < allDesktops.length; i++) {
let desktop = allDesktops[i];
// Add the widget to the desktop
// x = horizontal pos
// y = vertical pos
// w = width
// h = height
let widget = desktop.addWidget("org.kde.plasma.digitalclock", x, y, w, h);
} |
I will continue working on this tomorrow, and I think I can finish it by then. |
This is good to go now, |
Tested with: programs.plasma.workspace.desktop.widgets = [
{
name = "org.kde.plasma.digitalclock";
position = { horizontal = 51; vertical = 100; };
size = { width = 250; height = 250; };
config.Appearance.showDate = false;
}
{
name = "plasmusic-toolbar";
position = { horizontal = 51; vertical = 300; };
size = { width = 250; height = 400; };
config.General.desktopWidgetBg = 4;
}
]; |
Yeah I think that makes sense to do |
desktop
module and add desktop widgets option
I think this PR is good to merge, I will just wait for you to test. From my testing it is working perfectly fine. |
It is not necessary apparently
Looks good. I'll test on saturday probably :) |
I've noticed that desktop widgets can be misplaced sometimes on startup. But that is a plasma issue, since it happened sometimes when I was testing the script with |
It actually places in the right place, but jump to a random place after it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested a bit and this looks good, very impressive! I'll let you merge if you for some reason want to make some more adjustments, but all looks good to me :)
…get" This reverts commit f733349. It would add unnecessary complexity to the code, because it would require builtins.toString to be used in the apply function of every widget.
Thanks for testing! |
Help would be really appreciated.
Desktop widgets use basically the same API as panel widgets, so widgets lib can be reused, but they need to have position and size set in
ItemGeometries
andItemGeometriesHorizontal
with their respective IDs, so we will have to adapt it.