You are not logged in.
Hello again,
I've been working on updating the Basic Introduction to jgmenu on BL Lithium by @demo. here
A couple of reasons, some missing images and put BL in the best light. I also have some personal reasons, like getting more familiar with Openbox and BL.
Let's start with some testing.
Last edited by r.chaffee53 (2024-09-04 19:44:23)
Offline
Some testing for colors, sizes and forum characteristics.
@damo's original color, which is the highlight color from BL Lithium, I believe; works with dark or light forum themes. The cyan works somewhat and the blue works well. IMHO, the other colors don't.
Also the column width varies with different forum themes. At the end of this post is a comparison with the #! theme and the theme named Air. @johnraff The spacing of bootshot seems less important now.
Colored dividers have issues too. Use an "_" (underline) to make the divider and the forum will render it in the appropriate color. My opinion is to leave out the color this time.
Here's a look in your (Dear Reader) forum's colors. Then a sample in both dark and light backgrounds.
LOOK AT ME!
:~ $ ----------------
@damo's image for a divider:
___________₁____________₂____________₃____________₄____________₅____________₆____________₇____________₈_______
12345678901234567890123456789012345678901234567890123456789012345678901234567890
ABCDEFGHIJKLMNOPQRUSTUVWXYZABCDEFGHIJKLMNOPQRUSTUVWXYZABCDEFGHIJKLMNOPQRUSTUVWXYZ
₁ ₂ ₃ ₄ ₅ ₆ ₇ ₈ ₉ ₀
cyan light long
transparent spacer & cyan light
cyan dark
white
transparency
90x1
--><---
50x1
--><---
Colors
https://absitomen.com/index.php?topic=331.0
#! theme
A pic of the colors on dark background.
Air theme & forum width.
Colors on a light background.
Last edited by r.chaffee53 (2024-09-11 15:11:04)
Offline
Images I have ready.
All the images could be cropped as needed like the original thread.
The first two replace the equivalent images in the original. The third image is new. It's also part of Part 1.
edit; please, what's the trick with posting imgur images?
Add a letter to the image name...
Edit: I made the images with this:
Activate the terminal, minimize it, activate the shooter, wait.
Edit: Re-linked the images.
Last edited by r.chaffee53 (2024-09-11 15:00:09)
Offline
Where to go from here.
Some discssuion on aesthetics; colors, dividers, and such.
@johnraff You might agree to copy/paste an edit mode version of @damo's post, in code tags, (in the following post I can edit) so I don't need to create it from scratch. TIA
It had been a while since I worked with BB Code. I knew there was a header tag but couldn't remember it; kept thinking of 'title'. I meant to go back and fix it but things dragged on and...here. It will be much less work this time. Part of the problem was creating it from scratch, introduced some noise.
Currently trying to get an image for Part 4 of the intro. I'm having a little trouble figuring it out.
Thanks for reading.
Bob
Last edited by r.chaffee53 (2024-09-04 19:51:24)
Offline
A very basic introduction to jgmenu, and Creating a new menu
A simple, independent and contemporary-looking X11 menu, designed for scripting, ricing and tweaking.
It is hackable and has a simple code base. It does not depend on any toolkits such as GTK and Qt, but uses cairo and pango to render the menu.
It can optionally use some appearance settings from XSettings, tint2 and GTK.
It can display the following types of menu (or any combination of):
bespoke menu using a jgmenu flavoured CSV format
application menu (XDG compatible) with localisation support
pipe menus
openbox XML menu including openbox pipe-menusIt has UTF-8 search support.
It is packaged for Bunsenlabs, but the sourcecode can be found here: https://github.com/johanmalm/jgmenu
The manpages are some of the best you will see, and have pretty much everything you need.
Kudos to @malm
The main ones needed are:
man jgmenu
man jgmenututorial
A full list of Tutorials can also read here:
jgmenututorial - A step-by-step tutorial to jgmenu
jgmenu - A simple X11 menu
jgmenu_run - A wrapper for jgmenu
jgmenu-apps - generate jgmenu flavoured CSV menu data
jgmenu-i18n - support translation of jgmenu flavoured CSV menu data
jgmenu-lx - generate jgmenu flavoured CSV menu data
jgmenu-ob - convert openbox menu data to jgmenu flavoured CSV
jgmenu-pmenu - generate jgmenu flavoured CSV menu data
jgmenuunicode - An overview of jgmenu unicode usage
The elementary structure is comma-separated, and can be piped into jgmenu, via a command, heredoc, or from file. Each entry consists of one or more of:
Description,command,icon,working directory,metadata
Heredoc syntax and use is covered in man jgmenututorial, so I will concentrate on using a csv file here, with jgmenu --simple to read menu items from stdin.
Create mymenu.csv, containing
Menu
Terminal,x-terminal-emulator
Web Browser,x-www-browser
File Manager,bl-file-manager
Text Editor,bl-text-editor
Media Player,bl-media-player
Show the menu in the centre of the desktop with:
cat mymenu.csv | jgmenu --simple --center
Notice that "Menu" doesn't run a command when clicked, but the items do.
You can have some fun with icons as well, by using the third field. Either set the size in the config file (see later) or use --icon-size=<size> in the command. Try changing the first item in mymenu.csv to
Menu,,system-file-manager
and run it with
cat mymenu.csv | jgmenu --simple --center --icon-size=16
To build submenus we use mainly ^sep, ^checkout and ^tag markup syntax.
sep() Define a separator. If an inner value is provided, the separator will appear as a title. If no inner value is provided, the separator will simply be a horizontal line.
^tag() Define the beginning of a new menu structure node.
^checkout() Open the tag specified by the inner value as a submenu in a new window.
Edit mymenu.csv to look like:
^sep(Menu)
Terminal Emulators,^checkout(terminal)
Text Editors,^checkout(editors)
^tag(terminal)
Terminal,x-terminal-emulator
lxterminal,lxterminal
terminator,terminator
^tag(editors)
Geany,geany
Medit,medit
Gedit,gedit
You can feed the output of a pipemenu directly to jgmenu. This example parses an example .xbindkeysrc, and sends the run commands keybinds to be displayed by jgmenu:
#!/bin/bash
##
## xkb-pipemenu
KBINDS="$HOME/.xbindkeysrc"
declare -a KB_ARR
declare -a CMD_ARR
echo "^sep(Keybinds for running commands)"
echo "Run commands,^checkout(run_commands)"
echo "^tag(run_commands)"
while read -r line;do
if [[ -n $line ]];then # line isn't empty
if [[ ${line} = \#* ]];then # skip lines starting with '#'
continue
elif [[ ${line} = \"* ]];then
CMD=$(echo "${line}" | sed -e 's/"//g') # remove double-quotes
CMD_ARR+=("${line}")
else # swap 'Mod4' for 'Super'
KB=$(echo "${line}" | sed -e 's/Mod4/Super/' -e 's/ //g')
KB_ARR+=("${KB}")
fi
fi
done < "${KBINDS}"
i=0
for c in "${KB_ARR[@]}";do
curr_item=$(printf "%-18s %s" "${KB_ARR[$i]}" "${CMD_ARR[$i]}")
echo "${curr_item}"
i=$((i+1))
done
Run it with:
xkb-pipemenu | jgmenu --simple
.
or
.
jgmenu --simple --csv-cmd=xkb-pipemenu
Let's add it to mymenu, using the ^pipe() syntax:
First, comment out these lines in xkb-pipemenu
#echo "Run commands,^checkout(run_commands)"
#echo "^tag(run_commands)"
And add these lines to your menu, before the "^tags" sections:
^sep(Keybinds)
Keybinds,^pipe(xkb-pipemenu)
Try adding those lines to ~/.config/jgmenu/prepend.csv, to show in the main menu
BL helpfully provides some functions which can be sourced by scripts. These include some shorthand for jgmenu code, and can be utilised by adding this to any script that sends output to jgmenu:
BL_COMMON_LIBDIR="/usr/lib/bunsen/common" # source jgmenu helper functions
if ! . "$BL_COMMON_LIBDIR/bl-include.cfg" 2> /dev/null; then
echo $"Error: Failed to locate bl-include.cfg in $BL_COMMON_LIBDIR" >&2
exit 1
fi
/usr/lib/bunsen/common/bl-include.cfg has...
# Put an item in the root menu or any submenu.
# Usage: jgmenuItem tag label command
# Tag 'root' indicates root menu item.
# Add a separator.
# Usage: jgmenuSeparator tag [label]
# Put a checkout() for a submenu in the root menu or any submenu.
# Usage jgmenuSubmenu tag(parentmenu) tag(submenu) label
# Print root menu, then submenus.
# jgmenuEnd
So, my-pipemenu might look like this:
#!/bin/bash
##
## my-pipemenu
BL_COMMON_LIBDIR="/usr/lib/bunsen/common" # source jgmenu helper functions
if ! . "$BL_COMMON_LIBDIR/bl-include.cfg" 2> /dev/null; then
echo $"Error: Failed to locate bl-include.cfg in $BL_COMMON_LIBDIR" >&2
exit 1
fi
jgmenuSeparator 'root' "Main Menu"
jgmenuSubmenu 'root' "terminal" "Terminal Emulators"
jgmenuSubmenu 'root' "editor" "Text Editors"
jgmenuSeparator 'root' "Keybinds"
jgmenuItem 'root' "Run commands" "^pipe(xkb-pipemenu)"
jgmenuItem "terminal" "x-terminal-emulator" "x-terminal-emulator"
jgmenuItem "terminal" "Terminator" "terminator"
jgmenuItem "terminal" "lxterminal" "lxterminal"
jgmenuItem "editor" "Geany" "geany"
jgmenuItem "editor" "Medit" "medit"
jgmenuItem "editor" "Gedit" "gedit"
jgmenuEnd
This is the equivalent of directing the following textfile to jgmenu.
(See Part 4 - jgmenu Configs later)
^sep(Main Menu)
Terminal Emulators,^checkout(terminal)
Text Editors,^checkout(editor)
^sep(Keybinds)
Run commands,^pipe(xkb-pipemenu)
^tag(terminal)
x-terminal-emulator,x-terminal-emulator
Terminator,terminator
lxterminal,lxterminal
^tag(editor)
Geany,geany
Medit,medit
Gedit,gedit
Run it with the command...
jgmenu --simple --csv-cmd=xkb-pipemenu
One big advantage of using this approach is that I find it makes it easier to use variables in the script. See the first script in Part 5 for an example of a dynamic menu using variables, as well as the dynamic menu in Part 2 earlier.
The main menu settings are in ~/.config/jgmenu/jgmenurc, and any jgmenu will use it by default unless othewise specified. This means that you can set a different font or colours, for example, either in jgmenurc, or have a specific rc file for your menu.
For our menu, we can copy jgmenurc and call it eg my-jgmenurc
Let's change the font, separator colour and position for our bespoke menu:
#position_mode = center
position_mode = pointer
...
#font = Sans 10
font = Monospace 10
...
#color_title_fg = #d3dae3 100
color_title_fg = #cc666a 100
Run this with
my-pipemenu | jgmenu --simple --config-file='~/.config/jgmenu/my-jgmenurc'
jgmenu can populate a menu from a csv file:
jgmenu --simple --csv-file='/path/to/csv-file.csv'
So you can run the main menu with:
jgmenu --simple --csv-file='~/.config/jgmenu/prepend.csv'
(The jgmenu_run command does all that automatically of course )
Converting the pipemenu output to a csv file
The pipemenu output contains a bunch of '"""' characters to be parsed by jgmenu, but they can be got rid of with a sed command. Redirect the script output to a csv file using:
my-pipemenu | sed 's/"""//g' > ~/.config/jgmenu/mymenu.csv
Now the personalised menu can be run using the --csv-file= script arg:
jgmenu --simple --csv-file='~/.config/jgmenu/mymenu.csv' \ --config-file='~/.config/jgmenu/my-jgmenurc'
Sourcing csv files
Existing csv files containing all the necessary markup can be sourced by a menu. This avoids code duplication, and means that any future edits will apply anywhere that the markup is used.
The main menu displays markup from prepend.csv, which contains the line
. /usr/share/bunsen/configs/menu-includes/help-menu
If you open that file you see all the code which is displayed in the main menu called by ^checkout(bl-help-menu), ie everything that would be shown under '^tag(bl-help-menu)'.
NB A .csv filename ending isn't strictly necessary, but helps human eyes to keep track of things
A note about indenting and layout
Position:
The submenu ^tag(name) sections can be in any order, as long as they follow the higher menu ^checkout()'s. They will be displayed in the order of ^checkout(), not their order in the file.
Empty lines are also allowed, as are commented lines. A '#' must be the first character on a commented line.
Indenting:
The csv generators and helper commands output csv like this:
^tag(terminal)
^sep(Terminal commands)
Default,x-terminal-emulator
Terminator,terminator
lxterminal,lxterminal
However, jgmenu can cope with indenting to improve readability. Whitespace at left/right of all fields is removed, which allows CSV data to be indented or aligned without affecting the content.
For example, indented and commented as I prefer, keeping each section together:
### TERMINALS submenu ##################################################
^tag(terminal)
^sep(Terminal commands)
Default,x-terminal-emulator
Terminator,terminator
lxterminal,lxterminal
### END TERMINALS ######################################################
And even this works
^tag(terminal)
^sep(Terminal commands)
Default, x-terminal-emulator
Terminator, terminator
lxterminal, lxterminal
The menu csv file used by jgmenu is ~/.config/jgmenu/prepend.csv. This is also accessible from Menu -> Preferences -> jgmenu -> Edit Menu Content.
Let's say you like tweaking Conky, Tint2 and various Openbox settings, and would like to quickly refresh after editing a config. You could add often-used commands directly to the main menu as follows:
Add this line where you want it to appear:
Reloads,^checkout(reloads)
Add this section in the '^tags' area of prepend.csv.
^tag(reloads)
^sep(Reloads)
Openbox,openbox --reconfigure
Conky,bl-conky-session
Tint2,bl-tint2restart
Perhaps you want a favorite app to appear at the top of your Applications submenu, or you have something that doesn't have a .desktop file, so it doesn't show up in the list. Add the command to the lx-apps tag:
^tag(lx-apps)
My_App,~/bin/my-app
Scripts, Tutorials & Tips > jgmenu for bash_aliases
The script parses your .bash_aliases, and outputs each section into a submenu. It can be run from a Tint2 executor or button.
Screenshots menu, attached to PrintScreen key
In .xbindkeysrc, add:
# Screenshots menu
"jgmenu --simple --csv-file='.config/jgmenu/scrots.csv'"
Print
#scrots.csv
^sep(Screenshots)
scrot,^checkout(scrot)
xfce4-screenshooter
^sep()
Screenshots directory,^pipe(jgmenu_run ob --cmd="bl-places-pipemenu ~/Pictures/screenshots")
^tag(scrot)
scrot Now,scrot ~/Pictures/screenshots/%F-%H-%M-%S_scrot.png -e 'bl-image-viewer ~/Pictures/screenshots/%F-%H-%M-%S_scrot.png'
scrot In 5 secs...,scrot -d 5 ~/Pictures/screenshots/%F-%H-%M-%S_scrot.png -e 'bl-image-viewer ~/Pictures/screenshots/%F-%H-%M-%S_scrot.png'
scrot In 10 secs...,scrot -d 10 ~/Pictures/screenshots/%F-%H-%M-%S_scrot.png -e 'bl-image-viewer ~/Pictures/screenshots/%F-%H-%M-%S_scrot.png'
scrot Select Area,scrot -s ~/Pictures/screenshots/%F-%H-%M-%S_scrot.png -e 'bl-image-viewer ~/Pictures/screenshots/%F-%H-%M-%S_scrot.png'
scrot Current Focus,scrot -u ~/Pictures/screenshots/%F-%H-%M-%S_scrot.png -e 'bl-image-viewer ~/Pictures/screenshots/%F-%H-%M-%S_scrot.png'
scrot Multi-Monitor,scrot -m ~/Pictures/screenshots/%F-%H-%M-%S_scrot.png -e 'bl-image-viewer ~/Pictures/screenshots/%F-%H-%M-%S_scrot.png'
Last edited by r.chaffee53 (2024-09-08 09:04:53)
Offline
please, what's the trick with posting imgur images?
Add a letter to the image name...
The extra letter goes at the end of the image name, before the dot and the extension.
So here's the image you posted above, thumbnail size:
[img]https://i.imgur.com/z7mBLGYt.png[/img]
The other sizes are m and l:
I'm not sure exactly what the relationship is with the size of the original image though. From the above, it looks as if t, m and l might be pixel-defined. If you use those you can upload a full-sized image and link to it from a smaller one in the forum post.
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
@ johnraff Thanks, everything looks good to go.
Would anyone like to comment on the color/divider questions? If not, I'll put Frank on to play and do it my way.
Bob
Last edited by r.chaffee53 (2024-09-08 09:12:02)
Offline
A very basic introduction to jgmenu, and Creating a new menu
A simple, independent and contemporary-looking X11 menu, designed for scripting, ricing and tweaking.
---
A very basic introduction to jgmenu, and Creating a new menu
A simple, independent and contemporary-looking X11 menu, designed for scripting, ricing and tweaking.
---
A very basic introduction to jgmenu, and Creating a new menu
A simple, independent and contemporary-looking X11 menu, designed for scripting, ricing and tweaking.
---
A very basic introduction to jgmenu, and Creating a new menu
A simple, independent and contemporary-looking X11 menu, designed for scripting, ricing and tweaking.
---
No color, forum will render the appropriate color.
A very basic introduction to jgmenu, and Creating a new menu
A simple, independent and contemporary-looking X11 menu, designed for scripting, ricing and tweaking.
Bob
Last edited by r.chaffee53 (2024-09-08 18:13:58)
Offline
Testing. Testing. Is this thing on?
A very basic introduction to jgmenu.
A simple, independent and contemporary-looking X11 menu, designed for scripting, ricing and tweaking.
It is hackable and has a simple code base. It does not depend on any toolkits such as GTK and Qt, but uses cairo and pango to render the menu.
It can optionally use some appearance settings from XSettings, tint2 and GTK.
It can display the following types of menu (or any combination of):
bespoke menu using a jgmenu flavoured CSV format
application menu (XDG compatible) with localisation support
pipe menus
openbox XML menu including openbox pipe-menusIt has UTF-8 search support.
The included version is packaged for Bunsenlabs, and the sourcecode can be found here.
The manpages are some of the best you will see, and have pretty much everything you need.
Kudos to @malm
The main ones needed are:
man jgmenu
man jgmenututorial
A full list of Tutorials can also read here:
jgmenututorial - A step-by-step tutorial to jgmenu
jgmenu - A simple X11 menu
jgmenu_run - A wrapper for jgmenu
jgmenu-apps - generate jgmenu flavoured CSV menu data
jgmenu-i18n - support translation of jgmenu flavoured CSV menu data
jgmenu-lx - generate jgmenu flavoured CSV menu data
jgmenu-ob - convert openbox menu data to jgmenu flavoured CSV
jgmenu-pmenu - generate jgmenu flavoured CSV menu data
jgmenuunicode - An overview of jgmenu unicode usage
___________________________________ _ ___________________________________
Simple Static Menu
The elementary structure is comma-separated, and can be piped into jgmenu, via a command, heredoc, or from file. Each entry consists of one or more of:
Description,command,icon,working directory,metadata
Heredoc syntax and use is covered in man jgmenututorial, so I will concentrate on using a csv file here, with jgmenu --simple to read menu items from stdin.
Create mymenu.csv, containing
Menu
Terminal,x-terminal-emulator
Web Browser,x-www-browser
File Manager,bl-file-manager
Text Editor,bl-text-editor
Media Player,bl-media-player
Show the menu in the centre of the desktop with:
cat mymenu.csv | jgmenu --simple --center
Notice that "Menu" doesn't run a command when clicked, but the items do.
You can have some fun with icons as well, by using the third field. Either set the size in the config file (see later) or use --icon-size=<size> in the command. Try changing the first item in mymenu.csv to
Menu,,system-file-manager
and run it with
cat mymenu.csv | jgmenu --simple --center --icon-size=16
Now it looks like:
Add Sub Menus
To build submenus we use mainly ^sep, ^checkout and ^tag markup syntax.
sep() Define a separator. If an inner value is provided, the separator will appear as a title. If no inner value is provided, the separator will simply be a horizontal line.
^tag() Define the beginning of a new menu structure node.
^checkout() Open the tag specified by the inner value as a submenu in a new window.
Edit mymenu.csv to look like:
^sep(Menu)
Terminal Emulators,^checkout(terminal)
Text Editors,^checkout(editors)
^tag(terminal)
Terminal,x-terminal-emulator
lxterminal,lxterminal
terminator,terminator
^tag(editors)
Geany,geany
Medit,medit
Gedit,gedit
And you get this:
___________________________________ _ ___________________________________
Last edited by r.chaffee53 (2024-09-09 00:09:16)
Offline
So you're suggestion changing the highlight colour from that brick-red to deepskyblue?
I'd be OK either way. Anyone else?
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
It's between deepskyblue 00BFFF and cyan 00FFFF, 0CFFFF. S̶e̶e̶ ̶p̶o̶s̶t̶ ̶#̶9̶
00cfff pops better than cyan on a light background
I was just going to do one with no color to compare.
Edit: followed by one in 00EFFF
Bob
Last edited by r.chaffee53 (2024-09-09 18:31:07)
Offline
Testing. Testing. Is this thing on?
A very basic introduction to jgmenu.
A simple, independent and contemporary-looking X11 menu, designed for scripting, ricing and tweaking.
It is hackable and has a simple code base. It does not depend on any toolkits such as GTK and Qt, but uses cairo and pango to render the menu.
It can optionally use some appearance settings from XSettings, tint2 and GTK.
It can display the following types of menu (or any combination of):
bespoke menu using a jgmenu flavoured CSV format
application menu (XDG compatible) with localisation support
pipe menus
openbox XML menu including openbox pipe-menusIt has UTF-8 search support.
The included version is packaged for Bunsenlabs, and the sourcecode can be found here.
The manpages are some of the best you will see, and have pretty much everything you need.
Kudos to @malm
The main ones needed are:
man jgmenu
man jgmenututorial
A full list of Tutorials can also read here:
jgmenututorial - A step-by-step tutorial to jgmenu
jgmenu - A simple X11 menu
jgmenu_run - A wrapper for jgmenu
jgmenu-apps - generate jgmenu flavoured CSV menu data
jgmenu-i18n - support translation of jgmenu flavoured CSV menu data
jgmenu-lx - generate jgmenu flavoured CSV menu data
jgmenu-ob - convert openbox menu data to jgmenu flavoured CSV
jgmenu-pmenu - generate jgmenu flavoured CSV menu data
jgmenuunicode - An overview of jgmenu unicode usage
___________________________________ _ ___________________________________
Simple Static Menu
The elementary structure is comma-separated, and can be piped into jgmenu, via a command, heredoc, or from file. Each entry consists of one or more of:
Description,command,icon,working directory,metadata
Heredoc syntax and use is covered in man jgmenututorial, so I will concentrate on using a csv file here, with jgmenu --simple to read menu items from stdin.
Create mymenu.csv, containing
Menu
Terminal,x-terminal-emulator
Web Browser,x-www-browser
File Manager,bl-file-manager
Text Editor,bl-text-editor
Media Player,bl-media-player
Show the menu in the centre of the desktop with:
cat mymenu.csv | jgmenu --simple --center
Notice that "Menu" doesn't run a command when clicked, but the items do.
You can have some fun with icons as well, by using the third field. Either set the size in the config file (see later) or use --icon-size=<size> in the command. Try changing the first item in mymenu.csv to
Menu,,system-file-manager
and run it with
cat mymenu.csv | jgmenu --simple --center --icon-size=16
Now it looks like:
Add Sub Menus
To build submenus we use mainly ^sep, ^checkout and ^tag markup syntax.
sep() Define a separator. If an inner value is provided, the separator will appear as a title. If no inner value is provided, the separator will simply be a horizontal line.
^tag() Define the beginning of a new menu structure node.
^checkout() Open the tag specified by the inner value as a submenu in a new window.
Edit mymenu.csv to look like:
^sep(Menu)
Terminal Emulators,^checkout(terminal)
Text Editors,^checkout(editors)
^tag(terminal)
Terminal,x-terminal-emulator
lxterminal,lxterminal
terminator,terminator
^tag(editors)
Geany,geany
Medit,medit
Gedit,gedit
And you get this:
___________________________________ _ ___________________________________
Offline
00EFFF
A very basic introduction to jgmenu.
A simple, independent and contemporary-looking X11 menu, designed for scripting, ricing and tweaking.
It is hackable and has a simple code base. It does not depend on any toolkits such as GTK and Qt, but uses cairo and pango to render the menu.
It can optionally use some appearance settings from XSettings, tint2 and GTK.
It can display the following types of menu (or any combination of):
bespoke menu using a jgmenu flavoured CSV format
application menu (XDG compatible) with localisation support
pipe menus
openbox XML menu including openbox pipe-menusIt has UTF-8 search support.
The included version is packaged for Bunsenlabs, and the sourcecode can be found here.
The manpages are some of the best you will see, and have pretty much everything you need.
Kudos to @malm
The main ones needed are:
man jgmenu
man jgmenututorial
A full list of Tutorials can also read here:
jgmenututorial - A step-by-step tutorial to jgmenu
jgmenu - A simple X11 menu
jgmenu_run - A wrapper for jgmenu
jgmenu-apps - generate jgmenu flavoured CSV menu data
jgmenu-i18n - support translation of jgmenu flavoured CSV menu data
jgmenu-lx - generate jgmenu flavoured CSV menu data
jgmenu-ob - convert openbox menu data to jgmenu flavoured CSV
jgmenu-pmenu - generate jgmenu flavoured CSV menu data
jgmenuunicode - An overview of jgmenu unicode usage
___________________________________ _ ___________________________________
Simple Static Menu
The elementary structure is comma-separated, and can be piped into jgmenu, via a command, heredoc, or from file. Each entry consists of one or more of:
Description,command,icon,working directory,metadata
Heredoc syntax and use is covered in man jgmenututorial, so I will concentrate on using a csv file here, with jgmenu --simple to read menu items from stdin.
Create mymenu.csv, containing
Menu
Terminal,x-terminal-emulator
Web Browser,x-www-browser
File Manager,bl-file-manager
Text Editor,bl-text-editor
Media Player,bl-media-player
Show the menu in the centre of the desktop with:
cat mymenu.csv | jgmenu --simple --center
Notice that "Menu" doesn't run a command when clicked, but the items do.
You can have some fun with icons as well, by using the third field. Either set the size in the config file (see later) or use --icon-size=<size> in the command. Try changing the first item in mymenu.csv to
Menu,,system-file-manager
and run it with
cat mymenu.csv | jgmenu --simple --center --icon-size=16
Now it looks like:
Add Sub Menus
To build submenus we use mainly ^sep, ^checkout and ^tag markup syntax.
sep() Define a separator. If an inner value is provided, the separator will appear as a title. If no inner value is provided, the separator will simply be a horizontal line.
^tag() Define the beginning of a new menu structure node.
^checkout() Open the tag specified by the inner value as a submenu in a new window.
Edit mymenu.csv to look like:
^sep(Menu)
Terminal Emulators,^checkout(terminal)
Text Editors,^checkout(editors)
^tag(terminal)
Terminal,x-terminal-emulator
lxterminal,lxterminal
terminator,terminator
^tag(editors)
Geany,geany
Medit,medit
Gedit,gedit
And you get this:
___________________________________ _ ___________________________________
Offline
I chose to use the whole desktop rather than cropping; like @damo did. Some of the output is three quarters of the desktop anyway. A uniform image size leaves the smaller output lost in a sea of desktop. The color versions are nicer on the eyes than the mono-color one, I'd say. @johnraff thanks for the help and interest.
I'm flexible either way.
Bob
Last edited by r.chaffee53 (2024-09-09 18:27:35)
Offline
Testing. Testing. Is this thing on?
A very basic introduction to jgmenu.
A simple, independent and contemporary-looking X11 menu, designed for scripting, ricing and tweaking.
It is hackable and has a simple code base. It does not depend on any toolkits such as GTK and Qt, but uses cairo and pango to render the menu.
It can optionally use some appearance settings from XSettings, tint2 and GTK.
It can display the following types of menu (or any combination of):
bespoke menu using a jgmenu flavoured CSV format
application menu (XDG compatible) with localisation support
pipe menus
openbox XML menu including openbox pipe-menusIt has UTF-8 search support.
The included version is packaged for Bunsenlabs, and the sourcecode can be found here.
The manpages are some of the best you will see, and have pretty much everything you need.
Kudos to @malm
The main ones needed are:
man jgmenu
man jgmenututorial
A full list of Tutorials can also read here:
jgmenututorial - A step-by-step tutorial to jgmenu
jgmenu - A simple X11 menu
jgmenu_run - A wrapper for jgmenu
jgmenu-apps - generate jgmenu flavoured CSV menu data
jgmenu-i18n - support translation of jgmenu flavoured CSV menu data
jgmenu-lx - generate jgmenu flavoured CSV menu data
jgmenu-ob - convert openbox menu data to jgmenu flavoured CSV
jgmenu-pmenu - generate jgmenu flavoured CSV menu data
jgmenuunicode - An overview of jgmenu unicode usage
___________________________________ _ ___________________________________
Simple Static Menu
The elementary structure is comma-separated, and can be piped into jgmenu, via a command, heredoc, or from file. Each entry consists of one or more of:
Description,command,icon,working directory,metadata
Heredoc syntax and use is covered in man jgmenututorial, so I will concentrate on using a csv file here, with jgmenu --simple to read menu items from stdin.
Create mymenu.csv, containing
Menu
Terminal,x-terminal-emulator
Web Browser,x-www-browser
File Manager,bl-file-manager
Text Editor,bl-text-editor
Media Player,bl-media-player
Show the menu in the centre of the desktop with:
cat mymenu.csv | jgmenu --simple --center
Notice that "Menu" doesn't run a command when clicked, but the items do.
You can have some fun with icons as well, by using the third field. Either set the size in the config file (see later) or use --icon-size=<size> in the command. Try changing the first item in mymenu.csv to
Menu,,system-file-manager
and run it with
cat mymenu.csv | jgmenu --simple --center --icon-size=16
Now it looks like:
Add Sub Menus
To build submenus we use mainly ^sep, ^checkout and ^tag markup syntax.
sep() Define a separator. If an inner value is provided, the separator will appear as a title. If no inner value is provided, the separator will simply be a horizontal line.
^tag() Define the beginning of a new menu structure node.
^checkout() Open the tag specified by the inner value as a submenu in a new window.
Edit mymenu.csv to look like:
^sep(Menu)
Terminal Emulators,^checkout(terminal)
Text Editors,^checkout(editors)
^tag(terminal)
Terminal,x-terminal-emulator
lxterminal,lxterminal
terminator,terminator
^tag(editors)
Geany,geany
Medit,medit
Gedit,gedit
And you get this:
___________________________________ _ ___________________________________
Offline
You can feed the output of a pipemenu directly to jgmenu. This example parses an example .xbindkeysrc, and sends the run commands keybinds to be displayed by jgmenu:
#!/bin/bash
##
## xkb-pipemenu
KBINDS="$HOME/.xbindkeysrc"
declare -a KB_ARR
declare -a CMD_ARR
echo "^sep(Keybinds for running commands)"
echo "Run commands,^checkout(run_commands)"
echo "^tag(run_commands)"
while read -r line;do
if [[ -n $line ]];then # line isn't empty
if [[ ${line} = \#* ]];then # skip lines starting with '#'
continue
elif [[ ${line} = \"* ]];then
CMD=$(echo "${line}" | sed -e 's/"//g') # remove double-quotes
CMD_ARR+=("${line}")
else # swap 'Mod4' for 'Super'
KB=$(echo "${line}" | sed -e 's/Mod4/Super/' -e 's/ //g')
KB_ARR+=("${KB}")
fi
fi
done < "${KBINDS}"
i=0
for c in "${KB_ARR[@]}";do
curr_item=$(printf "%-18s %s" "${KB_ARR[$i]}" "${CMD_ARR[$i]}")
echo "${curr_item}"
i=$((i+1))
done
Run it with:
xkb-pipemenu | jgmenu --simple
.
or
.
jgmenu --simple --csv-cmd=xkb-pipemenu
Let's add it to mymenu, using the ^pipe() syntax:
First, comment out these lines in xkb-pipemenu
#echo "Run commands,^checkout(run_commands)"
#echo "^tag(run_commands)"
And add these lines to your menu, before the "^tags" sections:
^sep(Keybinds)
Keybinds,^pipe(xkb-pipemenu)
Try adding those lines to ~/.config/jgmenu/prepend.csv, to show in the main menu
This now looks like:
___________________________________ _ ___________________________________
Offline
As I said above, I'm OK with the original red too, but think the blue shades look a bit nicer, and match the Aqua theming.
For best readability with light backgrounds, my vote would be for the darker blue 00BFFF.
To my eyes, on a dark background the various blue shades all look nice.
The plain uncoloured version is alright, but maybe a little bit drab by comparison.
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
Anyone else?
Bob
Offline
Just pick a color. You could use the Boron-aqua selected-background color, or a shade of it...
I don't care what you do at home. Would you care to explain?
Offline