On Mon, Oct 04, 2010 at 10:54:51PM +0200, Will Stephenson wrote:
On Monday 04 October 2010 18:01:50 Giacomo Comes wrote:
Hi all, I'm a system administrator and I will soon upgrade our systems running opensuse_11.1/kde_3.5 to opensuse_11.3/kde_4.4. I order to satisfy our users requests, I make several changes to the default configuration of the kde desktop. In this way I don't have to explain over and over again how to do this and how to change that.
For several changes, it was quite easy to find the corresponding file to modify in kde4.4. Unfortunately, there are some things that I was able to setup in kde3.5 but I cannot find the right equivalent in kde 4.4.
1), 2), 3'), 4) can be established by modifying the desktop scripts that run on login as described at
http://techbase.kde.org/KDE_System_Administration/PlasmaDesktopScripting
Thanks for the reply. Your answer is exactly what I was looking for. In the past weeks, when I was looking around for a way to configure the desktop I did find this web page, but the files and directories referenced in it (.js files in plasma-desktop/init/) do not exist in opensuse_11.3/kde_4.4 so I (wrongly) assumed that the information contained in the web page didn't aply to the version of kde I'm using.
However I would recommend KDE 4.5 from KDE:Release:45 instead of KDE 4.4 from vanilla 11.3, since the scripting there is much more mature.
I think I will stick to kde 4.4 for the moment. I have monitored the packages in KDE:Release:45 and they are changing almost on daily basis. Once that repository shows a more stable behavior I may consider to switch.
Scripts mentioned below may only exist in a 4.5 based system, but the architecture for desktop scripting is the same in 4.4.
Here is the list of what I would like to change:
1) With kde3.5 putting: [General] LegacyKMenu=true in /etc/opt/kde3/share/config/kickerrc I was able to make the Classic Menu Style the default instead of the Kickoff Menu Style. What's the equivalent for kde4.4?
2) How can I add or replace a default widget/icon in the panel? I would like to add a couple of buttons right of the firefox and dolphin icons in the panel.
See /usr/share/kde4/apps/plasma-desktop/init/00-defaultLayout.js The layout org.kde.plasma-desktop.defaultPanel referenced at the end of the script is found at /usr/share/kde4/apps/plasma/layout- templates/org.kde.plasma-desktop.defaultPanel/contents/layout.js
3) How can I add another default applet running in the System Tray? like KRandRTray for example?
Copy its .desktop file to /usr/share/autostart/ (or individual users' ~/.config/autostart/). Add OnlyShowIn=KDE if you have users on other desktops who should not have it running.
3) How to add another default widget in the right side of the panel?
As per 2)
4) How to change the default configuration of a widget (Digital Clock for example)?
You can modify config in the init scripts too. As an example, consider this update script /usr/share/kde4/apps/plasma-desktop/updates/systray-to- notifications-widget.js which modifies the system tray widget from 4.4 to the notification widget in 4.5. (Update scripts are run to modify existing config, init scripts run to create new config).
So, what I have done is to create in openSUSE 11.3 the directory /usr/share/kde4/apps/plasma-desktop/init and create there the file 00-defaultLayout.js. Its content is mostly cut and past from 00-defaultLayout.js and plasma/layout-templates/ork.kde.plasma-desktop.defaultPanel/contents/layout.js from kde4.5 with some modification in order to have exactly the same look of the default kde4.4 desktop. ################# BEGIN 00-defaultLayout.js ################### var topLeftScreen = 0 var rect = screenGeometry(0) // find our "top left" screen to put the folderview on it for (var i = 1; i < screenCount; ++i) { var g = screenGeometry(i) if (g.x <= rect.x && g.top >= rect.top) { rect = g topLeftScreen = i } } for (var i = 0; i < screenCount; ++i) { var desktop = new Activity desktop.screen = i desktop.wallpaperPlugin = 'image' desktop.wallpaperMode = 'SingleImage' print("for screen " + i) if (i == topLeftScreen) { var folderview = desktop.addWidget("folderview") folderview.writeConfig("url", "desktop:/") folderview.reloadConfig() } } var panel = new Panel if (panelIds.length == 1) { // we are the only panel, so set the location for the user panel.location = 'bottom' } panel.height = 28 var widget = panel.addWidget("launcher") widget.globalShortcut = "Alt+F1" panel.addWidget("showdashboard") var widget = panel.addWidget("icon") widget.writeConfig("Url", "file:///usr/share/applications/MozillaFirefox.desktop") var widget = panel.addWidget("icon") widget.writeConfig("Url", "file:///usr/share/applications/kde4/dolphin.desktop") panel.addWidget("pager") panel.addWidget("tasks") panel.addWidget("systemtray") panel.addWidget("digital-clock") panel.addWidget("lockout") ################# END 00-defaultLayout.js ################### The script works, but it has one problem. On the first login (or after erasing ~/.kde4/share/config/plasma-desktop-appletsrc) it creates the panel as expected, but the desktop is totally black (no wallpaper or folderview widget). After logout and login, the desktop is there and everithing is ok. How can I avoid the black desktop on the first login? Giacomo -- To unsubscribe, e-mail: opensuse-kde+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-kde+help@opensuse.org