Web lists-archives.com

Re: [kde] strategies for customizing the "K" menu




Jerome Yuzyk posted on Fri, 26 Feb 2016 11:51:27 -0700 as excerpted:

> This is a 2-part question but both are about customizing the "main" or
> "K" menu. I Googled variations on "custom KDE menu" but didn't come up
> with much. So I ask some Knerds. :-)
> 
> 1 - On every machine I set up for myself I copy over a ~/bin of scripts
> I use regularly, and then have to re-create menu items. Back in KDE3
> days I hacked a collection of .desktop files together to give me a
> submenu of things I used most, but I'm not sure if that will work
> anymore in Plasma 5. What do you folks do? I can't be the only one who
> runs KDE on couple or more machines that get replaced over time and need
> rebuilding.

*.desktop files are freedesktop.org (non-formal, de facto, see the links 
below) standardized now, with all compliant DEs using them, tho the way 
the DE may present the "menu" will of course differ.  (Just within 
plasma5, there's several different variants on the traditional menu, as 
well as a full-screen launcher in the iconic touch-based launcher 
style.)  In addition to kde using them, gnome and the various 
"traditional" and "lite" DEs use them.

As a consequence, *.desktop files are the mechanism the various third-
party X-based apps ship with, these days, to integrate into menus/
launchers in general, not just into kde/plasma, but into any 
freedesktop.org compliant DE.

And kde/plasma uses *.desktop files for various service-type tracking and 
related puproses such as plasma container types, kwin desktop effect 
extensions, plasmoids, internet shortcuts (such as "gg:some terms" in 
krunner launching the browser open to google search), so they're 
*heavily* integrated in all sorts of kde/plasma stuff, /far/ more so than 
most users, even those aware of *.desktop files as a /thing/, might 
imagine.

So your collection of custom *.desktop files method should in general 
still work, tho some individual elements/lines have changed since the kde3 
days as the freedesktop.org *.desktop file standard emerged, and you will 
of course need to put them in the new, standardized locations under 
$XDG_DATA_DIRS (default /usr/local/share/:/usr/share/) and $XDG_DATA_HOME 
(default of $HOME/.local/share)

https://www.freedesktop.org/wiki/Specifications/

Of particular interest here will be the first three draft specs linked at 
the top, the desktop base directory (where all the files go), desktop 
entry (the *.desktop file spec itself), and menu specs (with their own xml 
file format, generated from all the *.desktop files).  The autostart spec 
also uses *.desktop files.  Of course once you're there, if you're 
anything like me, you'll find many of the other specs interesting as 
well, and may find yourself spending quite some time there over the 
coming hours/days. =:^)

> 2 - I'm not a fan of the menu layout of a particular spin (Fedora Jam) I
> want to use, and I'd like to create my own submenu tree with the layout
> I want. I could copy/paste from what's there to what I want but there
> must be a way to edit some files and copy some files and run
> kbuildsyscoca5 (sp?) to generate a new menu.

That's all in the specs.  You can even create a *.desktop file at the 
user level (that is, in $XDG_DATA_HOME) with Hidden or NoDisplay entries, 
where "hidden" means "deleted" from a user point of view, and "nodisplay" 
means don't display it in the menu, but still use other elements of the 
file for mimetype association and the like.  Another pair of entries are 
OnlyShowIn and NotShowIn, which allow control over which DEs the entry 
will be shown in (say plasma/kde but not gnome, or the reverse).

So not only can you create your own menu tree branch(es), you can hide 
the branch(es) you don't like, while either still allowing their other 
effects, mimetypes and the like, to remain (using nodisplay), or removing 
them as well (using hidden), and furthermore, do that only for kde/
plasma, or only for other DEs if you like (using onlyshowin/notshowin)! 
=:^)

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