LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   KDE3 : Configuring default K Menu (https://www.linuxquestions.org/questions/linux-software-2/kde3-configuring-default-k-menu-82888/)

iainr 08-17-2003 03:23 PM

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.

jailbait 08-17-2003 04:11 PM

"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.

iainr 08-18-2003 11:12 AM

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.

teval 08-18-2003 12:00 PM

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)

jailbait 08-18-2003 12:49 PM

"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.

iainr 08-18-2003 03:51 PM

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.

jailbait 08-18-2003 04:01 PM

"I tried tracing startkde before, but everything seemed to hit binaries."

The programs which handle inode user data will be binaries.

jailbait 08-18-2003 04:05 PM

"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.

iainr 08-18-2003 04:47 PM

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.


All times are GMT -5. The time now is 06:22 AM.