How to add a category to the XDG / JWM menu?
- UncleScrooge
- Posts: 104
- Joined: Tue 07 Apr 2020, 06:07
- Location: Norway
How to add a category to the XDG / JWM menu?
Hello folks,
I'd really like to add a fresh new category to the main menu.
I've made my way to the /etc/xdg/templates/_root_jwmrc and the various /etc/xdg/menus/puppy****.menu.
before I mess up anyone has got some hint on how to proceed to add myCategory to the main menu?
PS: Rummaging through the "HOWTO" forum I found this: http://murga-linux.com/puppy/viewtopic. ... 31&t=93637 but I'm still perplexed on how to proceed when it comes to add a new fresh "Category"
I'd really like to add a fresh new category to the main menu.
I've made my way to the /etc/xdg/templates/_root_jwmrc and the various /etc/xdg/menus/puppy****.menu.
before I mess up anyone has got some hint on how to proceed to add myCategory to the main menu?
PS: Rummaging through the "HOWTO" forum I found this: http://murga-linux.com/puppy/viewtopic. ... 31&t=93637 but I'm still perplexed on how to proceed when it comes to add a new fresh "Category"
If i may ask: What category do you want to add?
And why?
Categories in Puppy's /etc/xdg/menus do not comply to freedesktop.org standards.
So desktop-files from different Linux Distributions/Installs in /usr/share/applications almost always have to be modified to show in jwm menus in the right place...
Of course you can add any Category you want to jwm's menu. But it needs a lot of fiddling with /etc/xdg/menus/myCategory.menu and any related submenus in /usr/share/desktop-directories/myCategory<-sub>.directory files.
Another approach can be to manually add a menu-entry to /etc/xdg/templates/_root_.jwmrc.
As an example let's say you want to add a menu "Office" to your main menu (see screenshot below).
Create a new menu file named office-main in /root/.jwm/root_menus with content:
( all in german, help yourself... )
Just make sure your icons are in jwm's icon-path:
Now in /etc/xdg/templates/_root_.jwmrc add an Include tag at the place, you want your new menu-entry to appear. E.g.:
Open a terminal and type:
This way you can add many other submenus to jwm's menu
[edit]If you don't need the desktop-files in /usr/share/applications, you can remove them from menu either in JWM menu manager or delete them (!).
And why?
Categories in Puppy's /etc/xdg/menus do not comply to freedesktop.org standards.
So desktop-files from different Linux Distributions/Installs in /usr/share/applications almost always have to be modified to show in jwm menus in the right place...
Of course you can add any Category you want to jwm's menu. But it needs a lot of fiddling with /etc/xdg/menus/myCategory.menu and any related submenus in /usr/share/desktop-directories/myCategory<-sub>.directory files.
Another approach can be to manually add a menu-entry to /etc/xdg/templates/_root_.jwmrc.
As an example let's say you want to add a menu "Office" to your main menu (see screenshot below).
Create a new menu file named office-main in /root/.jwm/root_menus with content:
Code: Select all
<JWM>
<Menu label="Office" icon="openoffice4-main.png">
<Program label="Startcenter" icon="openoffice4-main.png">openoffice4</Program>
<Program label="Textverarbeitung" icon="openoffice4-writer.png">openoffice4 -writer</Program>
<Program label="Tabellenkalkulation" icon="openoffice4-calc.png">openoffice4 -calc</Program>
<Program label="Zeichnen" icon="openoffice4-draw.png">openoffice4 -draw</Program>
<Program label="Präsentation" icon="openoffice4-impress.png">openoffice4 -impress</Program>
<Program label="Formeleditor" icon="openoffice4-math.png">openoffice4 -math</Program>
<!-- <Program label="Datenbank" icon="openoffice4-base.png">openoffice4 -base</Program> -->
</Menu>
</JWM>
Just make sure your icons are in jwm's icon-path:
and executables are in $PATH<!-- <Icons> -->
<IconPath>/usr/local/lib/X11/mini-icons</IconPath>
<IconPath>/usr/local/lib/X11/pixmaps</IconPath>
<IconPath>/usr/share/pixmaps</IconPath>
<IconPath>/usr/local/share/pixmaps</IconPath>
<IconPath>/usr/share/pixmaps/puppy</IconPath>
<!-- </Icons> -->
Now in /etc/xdg/templates/_root_.jwmrc add an Include tag at the place, you want your new menu-entry to appear. E.g.:
Code: Select all
...
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-desktop.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-system.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-setup.menu
<Separator/>
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-utility.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-filesystem.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-graphic.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-document.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-calculate.menu
<Include>/root/.jwm/root_menus/office-main</Include>
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-personal.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-network.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-internet.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-multimedia.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-fun.menu
...
Code: Select all
fixmenus
jwm -reload
[edit]If you don't need the desktop-files in /usr/share/applications, you can remove them from menu either in JWM menu manager or delete them (!).
- Attachments
-
- jwm-menu1.jpg
- New menu entry without Category
- (50.38 KiB) Downloaded 175 times
- UncleScrooge
- Posts: 104
- Joined: Tue 07 Apr 2020, 06:07
- Location: Norway
@ HerrBert
thanks!!!!
that's exactly what I was looking for, especially the <include> trick.
What category and why?
this is the project I am working on atm:
http://www.murga-linux.com/puppy/viewtopic.php?t=118610
so the category will be "Service tools" for quick access by our personnel
it will contain proprietary SW as well as other process control common tools.
thanks!!!!
that's exactly what I was looking for, especially the <include> trick.
What category and why?
this is the project I am working on atm:
http://www.murga-linux.com/puppy/viewtopic.php?t=118610
so the category will be "Service tools" for quick access by our personnel
it will contain proprietary SW as well as other process control common tools.
postscript:
I forgot to mention that jwm may play tricks on you...
Editing /etc/xdg/templates/_root_.jwmrc only alters jwm's menu, when opened from the traybutton, keyboard shortcut ALT+F1 or key F12.
But rightclicking the Desktop brings up a different menu.
Forum member gychang mentions to have this issue on bionicpup64 too.
See http://murga-linux.com/puppy/viewtopic.php?t=113784
Though i'm still not familiar with bionicpup64 my guess is, that ptheme still behaves this way.
To make them all refer to jwm's default rc, on my Slacko 6.3.2 i have edited three files:
1) /etc/xdg/templates/_root_.jwmrc
Changed:
to:
2) /root/.jwm/jwmrc-tray2
Changed:
to:
3) /root/.jwm/jwmrc-personal
Changed:
to:
As usual run fixmenus;jwm -reload
I forgot to mention that jwm may play tricks on you...
Editing /etc/xdg/templates/_root_.jwmrc only alters jwm's menu, when opened from the traybutton, keyboard shortcut ALT+F1 or key F12.
But rightclicking the Desktop brings up a different menu.
Forum member gychang mentions to have this issue on bionicpup64 too.
See http://murga-linux.com/puppy/viewtopic.php?t=113784
Though i'm still not familiar with bionicpup64 my guess is, that ptheme still behaves this way.
To make them all refer to jwm's default rc, on my Slacko 6.3.2 i have edited three files:
1) /etc/xdg/templates/_root_.jwmrc
Changed:
Code: Select all
...
<RootMenu label="3" labeled="false" height="MENHEIGHT" onroot="3"><Include>exec:$HOME/.jwm/root_menus/menu3</Include></RootMenu>
...
<RootMenu label="Menu" labeled="false" height="MENHEIGHT" onroot="9">
...
<Key mask="A" key="F1">root:9</Key>
...
Code: Select all
...
<!-- <RootMenu label="3" labeled="false" height="MENHEIGHT" onroot="3"><Include>exec:$HOME/.jwm/root_menus/menu3</Include></RootMenu> -->
...
<RootMenu label="Menu" labeled="false" height="MENHEIGHT" onroot="3">
...
<Key mask="A" key="F1">root:3</Key>
...
Changed:
Code: Select all
...
<TrayButton label="Menu" icon="puppy.svg">root:9</TrayButton>
...
Code: Select all
...
<TrayButton label="Menu" icon="puppy.svg">root:3</TrayButton>
...
Changed:
Code: Select all
...
<Key key="F12">root:9</Key>
...
<Key mask="A" key="F1">root:9</Key>
...
Code: Select all
...
<Key key="F12">root:3</Key>
...
<Key mask="A" key="F1">root:3</Key>
...
- UncleScrooge
- Posts: 104
- Joined: Tue 07 Apr 2020, 06:07
- Location: Norway
Hi again UncleScrooge,
A couple of the challenges faced by those new to Linux in general and Puppy Linux in particular, is what applications are available for various tasks, and where can they be found when you want to start them. Not everyone thinks alike. Adding another menu category can be helpful overcoming that challenge, especially if the newbie is already familiar with what usually shows up in such category.
Another way of overcoming that challenge is Menu>FileSystem>FindnRun, created --I believe-- by SFR, updated by step and included in Bionicpup64.
But personally, I like AppFinder as its display provides a description of the application's purpose, http://murga-linux.com/puppy/viewtopic. ... 914#982914 So, I've made it available for Bionicpup64. http://murga-linux.com/puppy/viewtopic. ... 00#1058900
Either findnrun or AppFinder can be added to the Taskbar (perhaps next to the Start Menu) by opening Desktop>JWMDeskManager, Clicking the Launch Tab, scrolling to their respective listing and clicking them (Up & Down Arrows to adjust location).
A couple of the challenges faced by those new to Linux in general and Puppy Linux in particular, is what applications are available for various tasks, and where can they be found when you want to start them. Not everyone thinks alike. Adding another menu category can be helpful overcoming that challenge, especially if the newbie is already familiar with what usually shows up in such category.
Another way of overcoming that challenge is Menu>FileSystem>FindnRun, created --I believe-- by SFR, updated by step and included in Bionicpup64.
But personally, I like AppFinder as its display provides a description of the application's purpose, http://murga-linux.com/puppy/viewtopic. ... 914#982914 So, I've made it available for Bionicpup64. http://murga-linux.com/puppy/viewtopic. ... 00#1058900
Either findnrun or AppFinder can be added to the Taskbar (perhaps next to the Start Menu) by opening Desktop>JWMDeskManager, Clicking the Launch Tab, scrolling to their respective listing and clicking them (Up & Down Arrows to adjust location).
- UncleScrooge
- Posts: 104
- Joined: Tue 07 Apr 2020, 06:07
- Location: Norway
- UncleScrooge
- Posts: 104
- Joined: Tue 07 Apr 2020, 06:07
- Location: Norway
The <Include> trick suggested by HerrBert didn't work for me.
All I got was a plain replica of the <Include> line in the /root/.jwmrc and not the new menu defined in /root/.jwm/root_menus/myMenu
I triple checked all the syntaxes and everything was ok, but nothing. All I ended up with was this line inserted in /root/.jwmrc.
What worked was to define the whole new menu shabang directly in /etc/xdg/templates/_root_.jwmrc instead of the <Include>
Also nesting submenus works like a charm.
And the customized menu pops up everywhere, even right clicking the desktop.
all in all a good training, thanx again.
I may post something about some tricks I had to use, as I struggled a bit to have some of the executables started when launching from the menus.
All I got was a plain replica of the <Include> line in the /root/.jwmrc and not the new menu defined in /root/.jwm/root_menus/myMenu
I triple checked all the syntaxes and everything was ok, but nothing. All I ended up with was this line inserted in /root/.jwmrc.
Code: Select all
<Include>/root/.jwm/root_menus/myMenu</Include>
Also nesting submenus works like a charm.
And the customized menu pops up everywhere, even right clicking the desktop.
all in all a good training, thanx again.
I may post something about some tricks I had to use, as I struggled a bit to have some of the executables started when launching from the menus.
- UncleScrooge
- Posts: 104
- Joined: Tue 07 Apr 2020, 06:07
- Location: Norway
hi rockedge,rockedge wrote:Hello UncleScrooge!!
Yes! please do. I am working on a jwm rox --pinboard set up from scratch and would appreciate learning what you've discovered!I may post something about some tricks I had to use, as I struggled a bit to have some of the executables started when launching from the menus.
it basically all gets down to the use of the environment variables and their avalability in the shells.
Shell scripts
what I experienced is that no matter where I place the setting, for example:
Code: Select all
export PATH=$PATH:/myPath1:/mypath2:/myPath3 # and so on
I have some scripts residing in sub-directories of /root/my-applications which in turn call child processes, and use subfolders such as ./tmp and ./config and blah blah, so this:
Code: Select all
<Program label="Some Script" icon="someIcon">/root/my-applications/myScript/someScript.sh</Program>
Code: Select all
mySelf="${0##*/}" # must be unique in /root/.../...
mySelf="$(find /root -name ${mySelf})"
localPath="$(dirname ${mySelf})"
cd $localPath
export PATH=$PATH:$localPath
Other executables
have the care to ALWAYS include arguments inside single quotation marks:
Code: Select all
<Program label="windows APP" icon="winIcon">wine '/root/.wine/dos_devices/c:/Program Files/mywindowsApp/winApp.exe'</Program>
<Program label="Some Utility" icon="someIcon">/root/my-applications/bin/myUtility 'arg_1 arg_2 ... arg_n'</Program>
Last comment: unless I want to include my script in the puppy menus standard categories, I gave up creating a myscript.desktop file in the usr/share/applications