How to attach Openbox pipemenu to jgmenu? [SOLVED]

I’m trying to add a “recent documents” menu entry in jgmenu through a shell script.
The script is from Openbox:Pipemenus:recentfilesxbel - Openbox, and it is running smoothly on a terminal.
My issue here is how to run it in jgmenu.

In the favorites.csv, I’ve added this line:
Recent,^pipe(jgmenu_run pmenu | /home/$USER/.config/jgmenu/,system-file-manager (a random icon :upside_down_face:)

The generated menu does not show the script output, just a blank menu box.
Not a big deal, but for two days I’ve tried to figure out a solution…


Hello @Rhuks ,
Try something like:

Recent Files,^pipe(jgmenu_run ob --cmd=~/.config/jgmenu/

The above syntax can be used to add OpenBox pipemenus to jgmenu.

1 Like

Here is jgmenu native pipemenu version of mentioned above

grep file:/// ~/.local/share/recently-used.xbel | tail -n15 |  cut -d "\"" -f 2 | tac | while read line; 
file=$(echo "$line")
name=$(echo -en "$file" | sed 's,.*/,,' | sed 's/%20/ /g')
echo "$name,xdg-open $line"
echo "$files"
echo "^sep()"
echo "Clear Recent Documents,rm ~/.local/share/recently-used.xbel"

Save it as ~/bin/jgmenu_recentfiles
Make it executable:

chmod +x ~/bin/jgmenu_recentfiles

And attach it to menu by adding line:

Recent files,^pipe(jgmenu_recentfiles)
1 Like

Thank you @napcok! I picked the native version and It works perfectly.

1 Like

Also maybe it is worth to mention here…
If somebody needs “directory browser” (used in Left sidepanel for Quick Navigation) in Main menu.
It is also pipemenu (dynamically generated menu) …
It can be added easily, for example home directory:

echo "Home Directory,^pipe(jgbrowser ~),folder-home" >> ~/.config/mabox/favorites.csv
echo "^sep()" >> ~/.config/mabox/favorites.csv

You can attach any directory of course. Use ‘jgbrowser /path/to/dir/’.


And yad-icon-browser may be helpfull when searching for icon names.

#yad-icon-browser THEME
yad-icon-browser Numix-Square
yad-icon-browser Numix-Circle