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