Costumizing the menu

Hello Friends of Nomad BSD,
is there a way to customize the menu?
I try to change it in ~/.config/openbox/menu.xml. But after using the update_obmenu it’s the same like before.
I have a command line for my teatime message:

bash -c (sleep 180; sh -c “/usr/local/bin/feh -F /home/nomad/Bilder/teefertig.png & /usr/local/bin/mpv /home/nomad/Musik/Pausengong.mp3”)&

With sakura it’s working well.
I want to add it to the menu as item. I try. But I failed.
So is there a way to add it to the menu ?
Thanks for your help.

Hi @noob-like-nomadbsd,

create ~/bin/teatimer with the following content, and make it executable (chmod u+x ~/bin/teatimer):

#!/bin/sh
sleep 180
/usr/local/bin/feh -F /home/nomad/Bilder/teefertig.png &
/usr/local/bin/mpv /home/nomad/Musik/Pausengong.mp3

Then create ~/.local/share/applications/teatimer.desktop with the following content:

[Desktop Entry]
Name=Tea Timer
Exec=sh -c '~/bin/teatimer'
Terminal=false
Type=Application
Icon=timer
Categories=Utility

You can then execute it via Openbox menu->Utility->Tea Timer

Btw, you can use dunstify for displaying messages near the system tray:

$ dunstify 'Your tea is ready!'

II followed your instructions.
I have the item in the menu. But it doesn’t work after excuting.
If i do the command line sh -c ‘~/bin/teatimer’ then I got the error: no permission.
If i do the command line sudo sh -c ‘~/bin/teatimer’ then it works fine.
I changed the teatimer.desktop Exec=sudo sh -c ‘~/bin/teatimer’ but that doesn’t work.

Did you set execute permission on ~/bin/teatimer (chmod u+x ~/bin/teatimer)?
Check its permission with ls -l ~/bin/teatimer

i did sudo chmod u+x /bin/teatimer
nomad@NomadBSD ~> ls -l /bin/teatimer
-rwxr–r-- 1 root wheel 146 16 Apr. 18:39 /bin/teatimer

Oh, I see. You created that file as root. There is no need to do that, and you shouldn’t. /bin is for the system only. As user nomad create the directory /home/nomad/bin (or ~/bin which the short form. ~ is resolved by the shell to the current user’s home dir) with ´mkdir ~/bin. Then copy the script from /bin/teatimerto/home/nomad/bin` and make it executable for nomad:

$ cp /bin/teatimer /home/nomad/bin/
$ chmod ~/bin/teatimer

Now its working fine! Thank you very much.
Well, I see, I am still a newby.
Today I learned , that i don’t need to use sudo for nano inside my own /home/user path and that I can do a /bin in my /home/user path.
In the next Step, I try to create a Update Item in the menu. Lets see, if Iam able to use, waht I learned today.
Have a nice evening.

1 Like

On the new NomadBSD 130 version there is on the Thunar file manager on the side panel a bookmark to /usr/local/share/applications.
So its easier to create a new .desktop file and costumize the menu.

costumizing the menu means to make the computer to your own computer. I think this the spirit of Freebsd or Linux and of course - NomadBSD!
So I wrote a small shell skript for creating .desktop files.

#!/bin/sh
echo "Name der Desktopdatei ?"
read dateiname
echo "Name der Anwendung?"
read "desktopname"
echo "Befehl ?"
read Befehl
echo "Pfad zum Icon"
read Icon
echo "Welche Kategorie?"
read kategorie
touch /home/nomad/.local/share/applications/$dateiname.desktop
echo "[Desktop Entry]" > /home/nomad/.local/share/applications/$dateiname.desktop 
echo "Name=$desktopname" >> /home/nomad/.local/share/applications/$dateiname.desktop 
echo "Exec=$Befehl" >> /home/nomad/.local/share/applications/$dateiname.desktop 
echo "Terminal=false" >> /home/nomad/.local/share/applications/$dateiname.desktop 
echo "Type=Application" >> /home/nomad/.local/share/applications/$dateiname.desktop
echo "Icon=$Icon" >>  /home/nomad/.local/share/applications/$dateiname.desktop
echo "Categories=$kategorie" >> /home/nomad/.local/share/applications/$dateiname.desktop

And so guess: what was the first .desktop file I created with my new skript?
Of course this:

[Desktop Entry]
Name=mkdeskfile
Exec=xfce4-terminal --hold -x /home/nomad/.bin/./mkdeskfile
Terminal=false
Type=Application
Icon=/home/nomad/Bilder/mkdeskfile.png
Categories=Development

Well there is a newbie proud of his skript :smiley:

Is there any way to create a new category for the menu ? For example Places.