How to add some widgets/activities to user default environment?

Duncan 1i5t5.duncan at cox.net
Sun Aug 19 07:49:01 BST 2012


Franklin Weng posted on Sun, 19 Aug 2012 10:31:54 +0800 as excerpted:

> Oh, I'm using kubuntu 12.04 .  When I used kubuntu 11.04 it was okay to
> just change /usr/share/kde4/share/config/plasma-desktop-appletsrc.
> 
> Thanks,
> Franklin 2012-8-19 AM10:29 於 "Franklin Weng" <franklin at goodhorse.idv.tw>
> 寫道:
> 
>> Hi list,
>>
>> I'd like to setup a default kde environment for all newly added users.
>> That is, I wish to let users have the same desktop widgets like
>> folderview or fuzzy clock on their desktop activity.
>>
>> I tried to customize a desktop and put my
>> .kde/share/config/plasma-desktop-appletsrc into
>> /usr/share/kde4/share/config,and even /etc/skel/.kde/share/config.
>>
>> When I added a user the plasma-desktop-appletsrc was copied to the
>> correct path however when the user logged in, it seemed to get rid of
>> my setting and created a new activity with its default setting.
>>
>> Could anyone please tell me how to control the behavior for a new user
>> login?  i.e. how to avoid it creating a new default setting and use my
>> setting instead?

FWIW, most longtime list regulars will prefer quote, reply-in-context, to 
"top posting".  Given that answering questions takes time and there's 
often more questions in a regular's normal groups/lists than time, they 
often have to pick who they reply to, and if you make it difficult for 
them due to "top posting", they may simply skip replying to you...

Also, thanks for mentioning kubuntu and version, but this is a kde list 
not a kubuntu specific list, with regulars running all sorts of distros 
(I personally run gentoo) and who often have little idea what kde version 
some random distro and distro version that they don't run shipped with.  
Mentioning distro and distro version is good, as sometimes distros 
override upstream kde settings, but knowing the kde version is more 
important.  So please mention kde version, too. =:^)


I don't have a specific answer to your question, but here's what I'd do 
to find the answer, were I lookign for it.  My first instinct is to 
wonder if there's a first-time-wizard that runs and sets up the defaults 
if it doesn't find some particular setting, obviously located in a 
different file, already set.  So I'd try experimenting with copying some 
of the other config files over as well, starting with the other plasma 
files, and see if you can figure out what file and then what setting in 
that file it's looking for, and doing a reset if it doesn't find.

Do you know what the (targeted) bisect method is?  Since we suspect the 
file is in ~/.kde, try creating a new test user and copying that entire 
directory over, then starting kde as that user.  If that keeps the 
settings, we've verified it's in ~/.kde.  Since we suspect it's in the 
share/config/ subdir, try that next.  Logout your test user, delete all 
of ~/.kde but the share/config subdir, and try again.

Assuming that too keeps the settings, try all the plasma* files in that 
dir next.

At any level where you don't have an educated guess, or if one of your 
guesses turns out wrong, then simply bisect the problem space roughly in 
half, so you know which half it's in, then based on the results, test 
half of either the half you just tested, or half of the other half (so a 
quarter, then an eighth, then 1/16, etc), narrowing down to a specific 
dir, then a specific file within the dir, etc.

Once you reach a specific file, you can either continue testing with a 
text editor (most kde config files are plain-text ini-style so a text 
editor works, narrowing down to section and then individual line, altho 
as you've likely discovered, plasma-desktop-appletsrc is an exceedingly 
complex ini file not particularly amenable to manual editing, tho it 
/is/ possible with an extra dose of patience and carefulness), or just 
use the entire file.


Alternatively, use the strace method to see what files plasma-desktop 
opens as it starts.  Open a konsole, kquitapp/killall plasma-desktop, and 
restart it using something like (of course check the strace and grep 
manpages if you need command details, blindly running random commands 
some guy posted, without understanding at least the general idea of what 
they do, isn't something I'd recommend):

strace -feopen plasma-desktop 2>&1 | grep /home/user | grep -v 'font\|
cursor\|whatever'

That should dump (to STDOUT so to the konsole if you don't redirect to a 
file) a list of all the opened files with paths that match the first grep 
and don't match the second.  Modify as necessary to filter out the noise, 
and take a look at the remaining list of files.  Since we know plasma-
desktop doesn't reset the config for a user once setup, and the user can 
only (reliably) write to files in $HOME for a setting that needs to be 
stored over multiple sessions, the setting MUST be found in a file in 
$HOME.  Of course it's /possible/ that something in the kde session 
before plasma-desktop starts checks it, and plasma-desktop gets its info 
from that, but I don't consider it likely, so expect the strace method to 
list the culprit file so all you need to do is find it in that list, then 
if necessary, bisect within that specific file to get the specific 
setting.

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman

___________________________________________________
This message is from the kde mailing list.
Account management:  https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.


More information about the kde mailing list