LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Create a custom user profile for KDE4 (http://www.linuxquestions.org/questions/slackware-14/create-a-custom-user-profile-for-kde4-4175473773/)

kikinovak 08-18-2013 01:00 AM

Create a custom user profile for KDE4
 
1 Attachment(s)
Hi,

My custom "lightweight" KDE 4.10.5 desktop for Slackware 14.0 is currently being finished and polished up. I have yet to sand down some rough edges and add a few missing bits. Right now I'm creating the default user profile for the KDE desktop, e. g. the desktop's default configuration when a user is created. I'm encountering a few problems with that.

Compared to the vanilla KDE configuration, the custom user profile here includes a few sensible defaults. Here's what I got so far to make KDE4 more Joe-Sixpack-friendly (see screenshot below to get a rough idea):
  • Increase kicker panel height.
  • Replace default quickstart buttons on the kicker panel by a handful of custom ones for Firefox, Thunderbird and Open Office.
  • Add these same applications to Favourites in the Kickoff menu.
  • Add a shutdown button to the lower right side of the kicker.
  • Deactivate graphic effects (for low-spec hardware).
  • Deactivate semantic desktop and file indexation (for low-spec hardware).
  • Change mouse cursor theme and enable double-click.
  • Define Firefox and Thunderbird as default web browser and mail client.
  • Change desktop default to "Folder View" with ~/Desktop as default folder.
  • Choose a neutral wallpaper.

Creating a custom profile for a desktop environment like Xfce is dead simple. All you have to do is create a template user, configure the desktop, then copy all of /home/template/.config to /etc/skel (make a package eventually), and that's it. With KDE, things are more complicated, as it seems.

Application settings are stored in ~/.kde/share/config, in a series of files. Now of course I could grab all these files and copy them over to /etc/skel. Here's a summary of the problems that arise.

Some configuration defaults in plasma-desktop-appletsrc, for example, use hardcoded geometry, like this:

Code:

[Containments][1]
activity=
activityId=
desktop=-1
formfactor=2
geometry=0,-40,1280,34
immutability=1
lastDesktop=-1
lastScreen=0
location=4
plugin=panel
screen=0
zvalue=0

This is on a PC with a 19" screen, with 1280x1024 resolution. Now if I package this profile and move it to another computer with a different (smaller or bigger) resolution, the new user's default panel will be either too wide or too small. Hmmmmm.

Some configuration details seem to hardcode the user, like here for example:

Code:

[Containments][1][Applets][27][Configuration]
Url=file:///home/kikinovak

When I configure Thunderbird as a default mail client, this gets reflected in ~/.kde/share/config/emaildefaults, which looks like this:

Code:

[Defaults]
Profile=Par défaut

[PROFILE_Par défaut]
EmailClient[$e]=thunderbird
ServerType=
TerminalClient=false

Now my system is in french, hence the profile name. But my users are not all french, they also use english and german on their desktops.

I'm a little bit stuck on this one, and I'd be grateful for any help and/or suggestion.

Cheers,

Niki

kikinovak 08-18-2013 02:06 PM

1 Attachment(s)
I spent the best part of a sunny summer Sunday on this, and I'm just starting to get anything near a result. Which is quite unexpected actually, because the correct way to do things is to script the default profile. See attached screenshot.

Thanks to pprkut and AlienBob on #slackbuilds for the precious help.

solarfields 08-18-2013 03:15 PM

Hi and thanks for your work on trimming down KDE! Have you considered making a repository for it that could be used with slackpkg plus?

Alien Bob 08-18-2013 03:20 PM

Quote:

Originally Posted by solarfields (Post 5011526)
Hi and thanks for your work on trimming down KDE! Have you considered making a repository for it that could be used with slackpkg plus?

His repository _is_ compatible with slackpkg+ . In fact, slackpkgplus.conf already has a commented-out example of the MLES/MLED repositories, it will be easy to add MLWS as well. See https://github.com/zuno/slackpkgplus....x86_64.sample .

kikinovak 08-19-2013 04:45 AM

I did a lot of experimenting yesterday evening and this morning. So far I have a quite usable default configuration. Here's my 00-defaultLayout.js:

Code:

loadTemplate("org.kde.plasma-desktop.defaultPanel")

for (var i = 0; i < screenCount; ++i) {
    var desktop = new Activity
    desktop.name = i18n("Workstation")
    desktop.screen = i
    desktop.wallpaperPlugin = 'image'
    desktop.wallpaperMode = 'SingleImage'
    var wallpaper = "Ethais"
    desktop.currentConfigGroup = new Array("Wallpaper", "image")
    desktop.writeConfig("wallpaper", wallpaper)
    desktop.writeConfig("userswallpaper", wallpaper)

    //Create more panels for other screens
    if (i > 0){
        var panel = new Panel
        panel.screen = i
        panel.location = 'bottom'
        panel.height = panels()[i].height = screenGeometry(0).height > 1024 ? 35 : 27
        var tasks = panel.addWidget("tasks")
        tasks.writeConfig("showOnlyCurrentScreen", true);
    }
}

And here's the corresponding layout.js:

Code:

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 = screenGeometry(panel.screen).height > 1024 ? 70 : 54
panel.addWidget("launcher")
tasks = panel.addWidget("tasks")
panel.addWidget("systemtray")
panel.addWidget("digital-clock")
panel.addWidget("lockout")

tasks.currentConfigGroup = new Array("Launchers")
tasks.writeConfig("browser", "preferred://browser, , , ")
tasks.writeConfig("filemanager", "preferred://filemanager, , , ")

What I could manage so far:
  • Have a bigger panel (some of the users complain about small icons)
  • Don't show the activity button next to the Kickoff menu
  • Define a more "corporate" default wallpaper (Ethais is perfect)
  • Add a default shutdown button on the lower right side of the panel

I did this mainly by looking at other folks' mods on the web, and trying to figure out how I can adapt them for my own needs. I'm moving in very small steps, with a lot of trial and error.

Now here's some more things I'd like to do this way (e. g. by scripting), but I don't know how to go about it, in terms of mere syntax. I'll describe them in plain english:
  • Add some custom launchers to the Kickoff menu ("Favoris").
  • Deactivate all graphical effects (for low-spec hardware).
  • Deactivate the semantic desktop and file indexation (for the same reason).
  • Change mouse cursor to Whiteglass theme
  • Default to double click.
  • Default the desktop to "Folder View" for ~/Desktop.
  • Define Firefox as the default web browser.
  • Define Thunderbird as the default mail client.
  • Plasma widgets are locked by default.
  • Kiosk mode would be even better, e. g. most things become immutable.

If you have one or more suggestions for any of the points above, I'd be grateful. For now, "I've reached the end of my latin", as we say in my native Austria.

Cheers,

Niki

kikinovak 08-19-2013 05:54 AM

OK, I managed to go further in my default configuration. I edited a series of small files in /etc/skel/.kde/share/config to alter KDE's default configuration.

emaildefaults:

Code:

[Defaults]
Profile=Default

[PROFILE_Default]
EmailClient[$e]=thunderbird


kcminputrc:

Code:

[Mouse]
cursorTheme=whiteglass


kdeglobals:

Code:

[KDE]
SingleClick=false

[General]
BrowserApplication[$e]=mozilla-firefox.desktop
EmailClient[$e]=thunderbird


kickoffrc:

Code:

[Favorites]
FavoriteURLs=/usr/share/applications/mozilla-firefox.desktop,/usr/share/applications/mozilla-thunderbird.desktop,/opt/openoffice4/share/xdg/startcenter.desktop,/usr/share/applications/audacious.desktop,/usr/share/applications/kde4/dolphin.desktop


kwinrc:

Code:

[Compositing]
Enabled=false


nepomukserverrc:

Code:

[Basic Settings]
Start Nepomuk=false

[Service-nepomukfileindexer]
autostart=false


Everything works now as expected (again, after lots of trial & error). Which means I only have one last thing to configure, and I don't know how to figure that out:

How can I have widgets default to locked? Users can unlock them afterwards eventually, though I'd like to know how I can theoretically lock everything down for good.

I'd be really grateful to know that, as it would allow to wrap this up.

Cheers,

Niki

sardinha 08-19-2013 09:04 AM

immutability=2
 
kikinovak,

Maybe you can find an answer seeing what's changing when "block" or "unblock" the widgets in this file .kde/share/config/plasma-desktop-appletsrc (the key are the immutability options from 1 to 2):

Code:

# diff -U 3 -dHrN -- plasma-desktop-appletsrc_blocked_widgets plasma-desktop-appletsrc_unblocked_widgets
--- plasma-desktop-appletsrc_blocked_widgets    2013-08-19 14:53:18.096440828 +0100                                                                                                                       
+++ plasma-desktop-appletsrc_unblocked_widgets  2013-08-19 14:53:39.070178620 +0100                                                                                                                       
@@ -21,8 +21,8 @@                                                                                                                                                           
RightButton;NoModifier=contextmenu                                                                                                                           

 [Containments][1][Applets][14]                                                                                                                                                                           
-geometry=1390,2,50,25                                                                                                                                                                                   
-immutability=2                                                                                                                                                                                           
+geometry=1366,2,50,25                                                                                                                                                                                   
+immutability=1                                                                                                                                                                                           
 plugin=lockout                                                                                                                                                                                           
 zvalue=0                                                                                                                                                                                                 
                                                                                                                                                                                                         
@@ -63,8 +63,8 @@                                                                                                                                                                                         
 Order=2                                                                                                                                                                                                 
                                                                                                                                                                                                         
 [Containments][1][Applets][5]                                                                                                                                                                           
-geometry=62,2,1132,25                                                                                                                                                                                   
-immutability=2                                                                                                                                                                                           
+geometry=62,2,1108,25                                                                                                                                                                                   
+immutability=1                                                                                                                                                                                           
 plugin=tasks
 zvalue=0
 
@@ -76,8 +76,8 @@
 Order=3
 
 [Containments][1][Applets][6]
-geometry=1198,2,134,25
-immutability=2
+geometry=1174,2,134,25
+immutability=1
 plugin=systemtray
 zvalue=0
 
@@ -134,8 +134,8 @@
 Order=4
 
 [Containments][1][Applets][7]
-geometry=1336,2,50,25
-immutability=2
+geometry=1312,2,50,25
+immutability=1
 plugin=digital-clock
 zvalue=0
 
@@ -220,4 +220,4 @@
 wallpaperposition=0
 
 [General]
-immutability=2
+immutability=1


kikinovak 08-19-2013 11:20 AM

Quote:

Originally Posted by sardinha (Post 5011883)
kikinovak,

Maybe you can find an answer seeing what's changing when "block" or "unblock" the widgets in this file .kde/share/config/plasma-desktop-appletsrc (the key are the immutability options from 1 to 2):

Nah, I just found it. It's actually just a one-liner, to be put in 00-defaultLayout.js.

The KDE mailing list is actually very helpful with this.

kikinovak 08-19-2013 05:57 PM

[Much later...]

One more nut cracked.

Code:

Mon Aug 19 19:15:33 CEST 2013
microlinux-wallpapers-1.0-noarch-1_microlinux.txz: Added.
kde-wallpapers-4.10.5-i486-2_microlinux.txz: Rebuilt.
kde-base-artwork-4.10.5-i486-2_microlinux.txz: Rebuilt.
        Added a dirty hack to both packages which allows a consistent background
        image for the login manager, the splash screen and the main desktop.
kde-workspace-4.10.5-i486-2_microlinux.txz: Rebuilt.
  Added the system-wide part of a custom Joe-Sixpack-friendly user profile.
user-settings-kde-4.10.5-noarch-1_microlinux.txz: Added.
  The userspace part of our custom user profile.
+--------------------------+

Only a few to go.

emgee_1 08-20-2013 04:38 AM

Did you ever consider recoll as a desktop search tool?
 
Hi Niki,

Did you ever consider recoll as a desktop search tool?

It has xapian-core as dependency, which is useful if you also use mutt with notmuch or even notmuch in emacs.

recoll can run as a daemon and index your specific desktop search needs flawlessly.

It even can be used as a helper app in dolphin.

Just an idea.

Thank you for your great contributions.

Greetings

Marcel Geijsberts

kikinovak 08-20-2013 05:50 AM

1 Attachment(s)
Quote:

Originally Posted by emgee_1 (Post 5012360)
Hi Niki,

Did you ever consider recoll as a desktop search tool?

Not really, but thanks for the suggestion. I doubt my average user will use Mutt and/or Emacs. They already have a hard time figuring out Thunderbird. :(

The file search tools shipping with KDE already work quite well, at least in version 4.10.5. Only I decided to deactivate them in the default configuration - as I did with all the graphics effects - so folks can run the whole desktop even on low-spec hardware. Of course, everything can be (re)activated on more recent PCs. BTW, I tested everything on a battered 13 year old NEC Powermate (PIV 2.4 GHz, 512 MB RAM), and it runs correctly, using 175 MB RAM with the KDE desktop started. I'm also already running it on my main workhorse PC, and I love it. Feeling is similar to driving my old Mercedes.

Cheers,

Niki


All times are GMT -5. The time now is 02:16 AM.