How to attach Openbox pipemenu to jgmenu? [SOLVED]

Hello!
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/recentfiles.sh),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…

Thanks!!

Hello @Rhuks ,
Try something like:

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

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

1 Like

Here is jgmenu native pipemenu version of mentioned above recentfiles.sh

#!/bin/sh
files=$(
grep file:/// ~/.local/share/recently-used.xbel | tail -n15 |  cut -d "\"" -f 2 | tac | while read line; 
do  
file=$(echo "$line")
name=$(echo -en "$file" | sed 's,.*/,,' | sed 's/%20/ /g')
echo "$name,xdg-open $line"
done);
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/’.

mainmenu_pipes

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