Reply to topic

Programmed new panel gets ActivityManager just the same

User avatar Schoelje
Registered Member
Posts
31
Karma
0
OS
For each new user that has no .kde directory, a new panel is created and this script is executed:
/usr/share/solydxk/default-settings/kde4-profile/default/share/apps/plasma-desktop/init/00-defaultLayout.js
Code: http://pastebin.com/NHNW98j9

This works, but since KDE 4.10, the ActivityManager widget is added after the Kickoff menu.

I have tried to put this line in that script, and in a separate script, but to no avail:
Code: Select all
panel.widgets("org.kde.showActivityManager").remove()

How can I prevent this from happening?
wolfi323
Registered Member
Posts
230
Karma
0
OS
Change /usr/share/kde4/apps/plasma/layout-templates/org.kde.plasma-desktop.defaultPanel/contents/layout.js (at least that's the path on openSUSE, don't know about Debian but it should be similar).

Maybe you have to remove /usr/share/kde4/apps/plasma-desktop/updates/addShowActivitiesManagerPlasmoid.js as well.
User avatar Schoelje
Registered Member
Posts
31
Karma
0
OS
Thanks, wolfi323, that was really quick!

wolfi323 wrote:Change /usr/share/kde4/apps/plasma/layout-templates/org.kde.plasma-desktop.defaultPanel/contents/layout.js (at least that's the path on openSUSE, don't know about Debian but it should be similar).

Maybe you have to remove /usr/share/kde4/apps/plasma-desktop/updates/addShowActivitiesManagerPlasmoid.js as well.

Unfortunately, these would be re-created with the next update of plasma-desktop, and that's not something I wish for our users to solve themselves.
My script is correctly executed, but somewhere later in the process, another script adds the activities manager.

I'm looking for a more sustainable solution.

[EDIT]
In the above mentioned layout.js, more widgets are added, but in my panel only the activity manager is added.
So, I suppose the layout.js script is not executed.
User avatar google01103
Manager
Posts
4960
Karma
17
OS
what if you populate the new users ~/.kde/config with pre-defined plasma-destop*rc files w/o the activities widget when you create the user, maybe using /etc/skel? or create a first run script that replaces those files when the user first logs in?


OpenSuse 13.1 x64, KDE 4.12.x

Problem solved? Please click on Image below the post with the best answer to mark your topic as solved.
User avatar Schoelje
Registered Member
Posts
31
Karma
0
OS
google01103 wrote:what if you populate the new users ~/.kde/config with pre-defined plasma-destop*rc files w/o the activities widget when you create the user, maybe using /etc/skel? or create a first run script that replaces those files when the user first logs in?

Let's say it's my last resort: I like to keep my packages as clean as possible - less preconfigured config files is something I try to aim for, but I need to be realistic. If it can't be done with the existing script, I'll add the rc file to /etc/skel
wolfi323
Registered Member
Posts
230
Karma
0
OS
See here: http://techbase.kde.org/KDE_System_Admi ... pScripting
on update: when plasma-desktop is started, it will check in`kde4-config --path data`/plasma-desktop/updates/
with a ".js" suffix for scripts that have not yet been run. If there is more than one script which has not been run yet they will be executed serially in the alphabetical order of the file names.
A record of which update scripts have been run is kept in the application's config file in the [Updates] group. This means that if the plasma-desktop configuraiton file is removed, all the update scripts will be run again.


So it should help to create a file .kde/share/config/plasma-desktoprc in /etc/skel with an [Updates] group like this:
Code: Select all
[Updates]
performed=/usr/share/kde4/apps/plasma-desktop/updates/addShowActivitiesManagerPlasmoid.js

This should prevent the execution of that script.

Or try to create such a file as default configuration in `kde4-config --path config` (would be /etc/kde4/share/config/plasma-desktoprc on openSUSE).
wolfi323
Registered Member
Posts
230
Karma
0
OS
Oh, and according to that page, something like this should work for removing the ActivityManager:
Code: Select all
removeWidget = function(widget, containment)
{
  widget.remove()
}
 
var template = loadTemplate('org.kde.plasma-desktop.findWidgets')
template.findWidgets('org.kde.showActivityManager', removeWidget)

But the question of course is, which script is run first...
User avatar Schoelje
Registered Member
Posts
31
Karma
0
OS
Thanks for the help!
This should be enough to get me started.

Today is the day I have to synchronize and test the updated repositories, and tomorrow I'll start building the new iso's.
I'll post the outcome of this issue in one or two days.
User avatar Schoelje
Registered Member
Posts
31
Karma
0
OS
I've adapted the postinst script of the package that sets the system configuration for each distribution separately.
By diverting /usr/share/kde4/apps/plasma-desktop/updates/addShowActivitiesManagerPlasmoid.js I successfully prevent the creation of the activity manager widget in the panel, and future updates will not have an effect on this either.

It's a pragmatic, but not very aesthetic solution to the problem.

Thanks again for your help!

 
Reply to topic

Bookmarks



Who is online

Registered users: AGB, anli, Baidu [Spider], bilbo, Bing [Bot], bshah, Exabot [Bot], garthecho, Google [Bot], google01103, Hans, jensreuterberg, jsirek, jstaniek, koriun, metzman, MiceAreVeryNice, MSNbot Media, paulus3005, pedrorodriguez, Sentynel, vascobasque, Yahoo [Bot]