LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-17-2003, 03:23 PM   #1
iainr
Member
 
Registered: Nov 2002
Location: England
Distribution: Ubuntu 9.04
Posts: 631

Rep: Reputation: 30
KDE3 : Configuring default K Menu


I want to be able to set up a default K Menu for multiple users; for example
- removing applications I know they won't use
- reorganising the placement of items to work better for these users
- renaming items to make it clearer what they are.

I can just about do some of this for a single user or machine, but I want to have a default setup which I can rollout as the default for all users on all machines.

I've been trying to figure out which files hold the default configuration so I can edit them and push out the edited files.

Can anyone help?

Iain.
 
Old 08-17-2003, 04:11 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,334

Rep: Reputation: 547Reputation: 547Reputation: 547Reputation: 547Reputation: 547Reputation: 547
"I've been trying to figure out which files hold the default configuration so I can edit them and push out the edited files."

What happens in KDE desktop configuration is highly distribution dependant so what I am describing probably applies only to SuSE.

I don't think that there is a complete template of files which is copied to a new KDE user. I think that there is a partial template at /opt/kde3/share/applnk.

Most of the work of building the menus is done on the fly. /opt/kde3/bin/startkde checks for the existance of /home/user/.skel/kdebase3. If it does not exist then startkde calls /opt/kde3/bin/startkde.theme to build the menus on the fly.

You can change startkde to call your own script and then write your script patterned after startkde.theme.

I think.

Last edited by jailbait; 08-17-2003 at 04:13 PM.
 
Old 08-18-2003, 11:12 AM   #3
iainr
Member
 
Registered: Nov 2002
Location: England
Distribution: Ubuntu 9.04
Posts: 631

Original Poster
Rep: Reputation: 30
I think I've got a partial solution to my question. The following is for Mandrake 9.1 :

The master directory structure for the K Menu is held under /usr/share/applnk-mdk. It is organised as directories and files.

Locally there is ~/.kde/share/applnk-mdk. This is created on the fly from the master copy : if you delete it and then open the menu, the menu items you open are recreated as you go along.

Within each *.desktop file you can specify the command to be run, icon, name and Generic Name (which appears after the name in brackets).

You can add in new files or delete/edit existing files and it will take effect on the next desktop refresh.

However, there are still some things I don't understand - if anyone can throw light on them :
1. When I create a new directory it doesn't appear - why?
2. How does KDE know which icon goes with which directory?
3. Why are things copied locally at all (maybe its for the situation where the master files are on NFS/Samba mounts, to maximise performance)?
4. There is another directory called applnk-mdk-simplified which is quite a neat presentation of the K Menu in a task-based rather than application-based format. Sometimes it appears in the K Menu and sometimes it doesn't. Why?

Iain.
 
Old 08-18-2003, 12:00 PM   #4
teval
Member
 
Registered: Jul 2003
Location: Toronto, Canada
Distribution: Gentoo
Posts: 720

Rep: Reputation: 30
Go into a kconsole and type in:
kmenuedit
Happy editing
Also if you rightclick the K icon, there should be an entry saying Menu editor.. (Not sure if it was there before or if I enabled it)
 
Old 08-18-2003, 12:49 PM   #5
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,334

Rep: Reputation: 547Reputation: 547Reputation: 547Reputation: 547Reputation: 547Reputation: 547
"1. When I create a new directory it doesn't appear - why?
2. How does KDE know which icon goes with which directory?"

I have an explanation of which I am reasonably confident but not absolutely certain. The information about a directory or file is kept in an inode control block on disk. When a program opens the file or directory it is presented with an in-core copy of the inode. When a program closes the file or directory the inode is written back to the disk if it has been altered. The inode contains a small user data area. A few specialized programs use this data area for their own purposes. I think that the "hidden" information in the menu tree is in the inode data area.

There are no utility programs that I know of which manipulate the user data area in the inode. mkdir and text editors are not programmed to access this data. Once the inode user data area is set up then copying the inode preserves the user data. I can see two things for you to try to manipulate the menu's inode data area.

1. Use kmenuedit, as teval suggests, to set up the menu entry the way that you want and then copy the result to your menu tree template.

2. Find the specialized Mandrake programs that create these menu entries on the fly and see if you can use them for your own purposes. You can probably find the names of these programs by starting with the startkde script, finding the Mandrake script that initializes the menu, and looking for the program(s) that build individual entries.
 
Old 08-18-2003, 03:51 PM   #6
iainr
Member
 
Registered: Nov 2002
Location: England
Distribution: Ubuntu 9.04
Posts: 631

Original Poster
Rep: Reputation: 30
Funnily enough, even using kmenuedit (only single user so not quite what I'm trying to achieve) is inconsistent. I try creating a new "submenu" and it creates a directory in the applnk-mdk directory - so far so good. Having tried it a few times, it sometimes shows up in the K menu and sometimes doesn't. Sometimes it doesn't even show up in kmenuedit!

Having created the new submenu, renaming the directory seems to confuse it completely. I'll play some more and see if I can figure out what its doing.

I tried tracing startkde before, but everything seemed to hit binaries. I guess I can try using truss (anyone know which package truss is in?).

Iain.
 
Old 08-18-2003, 04:01 PM   #7
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,334

Rep: Reputation: 547Reputation: 547Reputation: 547Reputation: 547Reputation: 547Reputation: 547
"I tried tracing startkde before, but everything seemed to hit binaries."

The programs which handle inode user data will be binaries.
 
Old 08-18-2003, 04:05 PM   #8
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,334

Rep: Reputation: 547Reputation: 547Reputation: 547Reputation: 547Reputation: 547Reputation: 547
"Having created the new submenu, renaming the directory seems to confuse it completely."

You could try copying the new submenu from one place on the menu tree to another without changing its name.
 
Old 08-18-2003, 04:47 PM   #9
iainr
Member
 
Registered: Nov 2002
Location: England
Distribution: Ubuntu 9.04
Posts: 631

Original Poster
Rep: Reputation: 30
I think I've solved the directory issue : each directory has a file called .directory in it which defines the name, icon and other attributes.

However, whether a newly created directory (whether via kmenuedit or manually) shows up on the K menu still seems fairly hit and miss to me. Sometimes it does and sometimes it doesn't & I haven't been able to spot any consistent indicator.

As for the inode issue, I think that you can see the information by editing the directory (e.g. with vi).

Curiously, when I create new directories, they always show up in kmenuedit even they don't show in K menu. File changes do seem to be reflected in K menu far more consistently.

This probably gives me enough to do what I need to do, but it would be nice to figure out what is going on under the covers.

Iain.

Last edited by iainr; 08-18-2003 at 04:49 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can not find menu editor for kde3.3 TitaniumTaz SUSE / openSUSE 2 03-03-2005 01:14 PM
Crossover Office 3 & KDE3.2 menu Egbert Linux - Software 0 05-26-2004 04:40 PM
KDE3.2 - KDM session menu ??? Waldi Slackware 1 03-07-2004 07:24 PM
Change default browser in KDE3 dominik81 Linux - Software 1 02-10-2004 08:39 AM
Right-click menu in KDE3 Slakje Linux - Software 5 08-26-2003 01:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration