You are not logged in.

#1 2024-09-04 18:24:17

r.chaffee53
Member
Registered: 2023-08-02
Posts: 123

Update for "Basic Introduction to jgmenu on BL Lithium" Work Thread

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

#2 2024-09-04 18:25:24

r.chaffee53
Member
Registered: 2023-08-02
Posts: 123

Re: Update for "Basic Introduction to jgmenu on BL Lithium" Work Thread

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. smile

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!

LOOK AT ME!

:~ $ ----------------

@damo's image for a divider:

1pQMS1K.png

___________₁____________₂____________₃____________₄____________₅____________₆____________₇____________₈_______
12345678901234567890123456789012345678901234567890123456789012345678901234567890
ABCDEFGHIJKLMNOPQRUSTUVWXYZABCDEFGHIJKLMNOPQRUSTUVWXYZABCDEFGHIJKLMNOPQRUSTUVWXYZ

₁ ₂ ₃ ₄ ₅ ₆ ₇ ₈ ₉ ₀

cyan light long
6ArGxOD.png

transparent spacer & cyan light
mQuLxBg.pngz4u06CM.png

cyan dark
mQuLxBg.pnggdf7khR.png

white
mQuLxBg.png95m5etO.png

transparency

90x1
-->MfM2yti.png<---

50x1
-->mQuLxBg.png<---

Colors

https://absitomen.com/index.php?topic=331.0

Part 1 - Basic Introduction White | FFFFFF
Part 1 - Basic Introduction Lightcyan | C0FFFF
Part 1 - Basic Introduction Cayn | 00FFFF
Part 1 - Basic Introduction Turquoise | 40E0D0
Part 1 - Basic Introduction Aquamarine | 7FFFD4
Part 1 - Basic Introduction Darkcyan | 008B8B
Part 1 - Basic Introduction Deepskyblue | 00BFFF
Part 1 - Basic Introduction damo | CC6666
Part 1 - Basic Introduction Test
Part 1 - Basic Introduction Test

#! theme
A pic of the colors on dark background.

MfM2yti.png6NV3iQom.png]


Air theme & forum width.
Colors on a light background.

MfM2yti.pngXcuFH1sm.png

Last edited by r.chaffee53 (2024-09-11 15:11:04)

Offline

#3 2024-09-04 18:26:28

r.chaffee53
Member
Registered: 2023-08-02
Posts: 123

Re: Update for "Basic Introduction to jgmenu on BL Lithium" Work Thread

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.

MfM2yti.pngTLUmHbcm.png

MfM2yti.pngRLesJE9m.png

MfM2yti.pngXBcUPpym.png

MfM2yti.png7aZyhncm.png

MfM2yti.pngHr18W9sm.png

edit; please, what's the trick with posting imgur images?
Add a letter to the image name...

Edit: I made the images with this:

MfM2yti.pngSZ4cbvem.png

Activate the terminal, minimize it, activate the shooter, wait. wink

Edit: Re-linked the images.

Last edited by r.chaffee53 (2024-09-11 15:00:09)

Offline

#4 2024-09-04 18:31:24

r.chaffee53
Member
Registered: 2023-08-02
Posts: 123

Re: Update for "Basic Introduction to jgmenu on BL Lithium" Work Thread

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

#5 2024-09-04 18:34:58

r.chaffee53
Member
Registered: 2023-08-02
Posts: 123

Re: Update for "Basic Introduction to jgmenu on BL Lithium" Work Thread

Part 1 - Basic Introduction

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-menus

It has UTF-8 search support.

It is packaged for Bunsenlabs, but the sourcecode can be found here: https://github.com/johanmalm/jgmenu

aaB0MgP.png

Tutorials and manpages

The manpages are some of the best you will see, and have pretty much everything you need.
Kudos to @malm smile

The main ones needed are:

man jgmenu
man jgmenututorial

A full list of Tutorials can also read here:

aaB0MgP.png

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

                            B7bUhMom.jpg

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 uhcsMphm.jpg

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

aaB0MgP.png


Part 2 - A dynamic menu

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

                            rAWUDPXm.jpg

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)

                            G9gl8j8m.jpg

Try adding those lines to ~/.config/jgmenu/prepend.csv, to show in the main menu wink

This now looks like hCYUklom.jpg

aaB0MgP.png


Part 3 -Bunsenlabs helper functions for scripting menus

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.

aaB0MgP.png


Part 4 - jgmenu Configs

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'

                            55kYrU2m.jpg



jgmenu csv files

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 wink )


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 wink

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 smile

    ^tag(terminal)
        ^sep(Terminal commands)
            Default,        x-terminal-emulator
            Terminator,     terminator
            lxterminal,     lxterminal
Editing the Main menu

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

                                jLnrM6Wm.jpg

  • 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

                                sEvuJSXm.jpg

aaB0MgP.png


Part 5 - Example menus in use
  • 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.
    3DXbZxBm.jpg

  • 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'

aaB0MgP.png

Last edited by r.chaffee53 (2024-09-08 09:04:53)

Offline

#6 2024-09-06 15:20:50

r.chaffee53
Member
Registered: 2023-08-02
Posts: 123

Re: Update for "Basic Introduction to jgmenu on BL Lithium" Work Thread

Another image ready.

MfM2yti.pngz7mBLGYm.png

Bob

Last edited by r.chaffee53 (2024-09-11 15:12:56)

Offline

#7 2024-09-07 02:46:43

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,666
Website

Re: Update for "Basic Introduction to jgmenu on BL Lithium" Work Thread

r.chaffee53 wrote:

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]

z7mBLGYt.png

The other sizes are m and l:
z7mBLGYm.png

z7mBLGYl.png

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 )

Introduction to the Bunsenlabs Boron Desktop

Offline

#8 2024-09-08 09:06:35

r.chaffee53
Member
Registered: 2023-08-02
Posts: 123

Re: Update for "Basic Introduction to jgmenu on BL Lithium" Work Thread

@ johnraff Thanks, everything looks good to go. smile

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

#9 2024-09-08 09:26:00

r.chaffee53
Member
Registered: 2023-08-02
Posts: 123

Re: Update for "Basic Introduction to jgmenu on BL Lithium" Work Thread

Part 1 - Basic Introduction Cyan

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.

---

Part 1 - Basic Introduction 00CFFF

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.

---


Part 1 - Basic Introduction Deepskyblue

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.

---


Part 1 - Basic Introduction

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.

Part 1 - Basic Introduction

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.


4M5GVYUm.png


Bob

Last edited by r.chaffee53 (2024-09-08 18:13:58)

Offline

#10 2024-09-08 23:13:54

r.chaffee53
Member
Registered: 2023-08-02
Posts: 123

Re: Update for "Basic Introduction to jgmenu on BL Lithium" Work Thread

Testing. Testing. Is this thing on?

Part 1 - Basic Introduction

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-menus

It has UTF-8 search support.

The included version is packaged for Bunsenlabs, and the sourcecode can be found here.


Tutorials and manpages

The manpages are some of the best you will see, and have pretty much everything you need.
Kudos to @malm smile

The main ones needed are:

man jgmenu
man jgmenututorial

A full list of Tutorials can also read here:

___________________________________ _ ___________________________________


Creating New Menus

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

MfM2yti.pngTLUmHbcm.png

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:

MfM2yti.pngRLesJE9m.png


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:

MfM2yti.pngXBcUPpym.png


___________________________________ _ ___________________________________

Last edited by r.chaffee53 (2024-09-09 00:09:16)

Offline

#11 2024-09-09 09:07:38

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,666
Website

Re: Update for "Basic Introduction to jgmenu on BL Lithium" Work Thread

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 )

Introduction to the Bunsenlabs Boron Desktop

Offline

#12 2024-09-09 10:42:44

r.chaffee53
Member
Registered: 2023-08-02
Posts: 123

Re: Update for "Basic Introduction to jgmenu on BL Lithium" Work Thread

It's between deepskyblue 00BFFF and cyan 00FFFF,  0CFFFF. S̶e̶e̶ ̶p̶o̶s̶t̶ ̶#̶9̶

Part 1 - Basic Introduction Cyan
Part 1 - Basic Introduction 00EFFF
Part 1 - Basic Introduction 00DFFF
Part 1 - Basic Introduction 00CFFF
Part 1 - Basic Introduction Deepskyblue

00cfff pops better than cyan on a light background

MdvIlV7.png

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

#13 2024-09-09 11:29:47

r.chaffee53
Member
Registered: 2023-08-02
Posts: 123

Re: Update for "Basic Introduction to jgmenu on BL Lithium" Work Thread

Testing. Testing. Is this thing on?

Part 1 - Basic Introduction

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-menus

It has UTF-8 search support.

The included version is packaged for Bunsenlabs, and the sourcecode can be found here.


Tutorials and manpages

The manpages are some of the best you will see, and have pretty much everything you need.
Kudos to @malm smile

The main ones needed are:

man jgmenu
man jgmenututorial

A full list of Tutorials can also read here:

___________________________________ _ ___________________________________


Creating New Menus

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

MfM2yti.pngTLUmHbcm.png

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:

MfM2yti.pngRLesJE9m.png


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:

MfM2yti.pngXBcUPpym.png


___________________________________ _ ___________________________________

Offline

#14 2024-09-09 11:36:00

r.chaffee53
Member
Registered: 2023-08-02
Posts: 123

Re: Update for "Basic Introduction to jgmenu on BL Lithium" Work Thread

00EFFF

Part 1 - Basic Introduction

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-menus

It has UTF-8 search support.

The included version is packaged for Bunsenlabs, and the sourcecode can be found here.


Tutorials and manpages

The manpages are some of the best you will see, and have pretty much everything you need.
Kudos to @malm smile

The main ones needed are:

man jgmenu
man jgmenututorial

A full list of Tutorials can also read here:

___________________________________ _ ___________________________________


Creating New Menus

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

MfM2yti.pngTLUmHbcm.png

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:

MfM2yti.pngRLesJE9m.png


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:

MfM2yti.pngXBcUPpym.png


___________________________________ _ ___________________________________

Offline

#15 2024-09-09 18:21:44

r.chaffee53
Member
Registered: 2023-08-02
Posts: 123

Re: Update for "Basic Introduction to jgmenu on BL Lithium" Work Thread

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

#16 2024-09-09 18:49:26

r.chaffee53
Member
Registered: 2023-08-02
Posts: 123

Re: Update for "Basic Introduction to jgmenu on BL Lithium" Work Thread

Testing. Testing. Is this thing on?

Part 1 - Basic Introduction

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-menus

It has UTF-8 search support.

The included version is packaged for Bunsenlabs, and the sourcecode can be found here.


Tutorials and manpages

The manpages are some of the best you will see, and have pretty much everything you need.
Kudos to @malm smile

The main ones needed are:

man jgmenu
man jgmenututorial

A full list of Tutorials can also read here:

___________________________________ _ ___________________________________


Creating New Menus

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

MfM2yti.pngTLUmHbcm.png

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:

MfM2yti.pngRLesJE9m.png


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:

MfM2yti.pngXBcUPpym.png


___________________________________ _ ___________________________________

Offline

#17 2024-09-10 02:42:20

r.chaffee53
Member
Registered: 2023-08-02
Posts: 123

Re: Update for "Basic Introduction to jgmenu on BL Lithium" Work Thread

Part 2 - A dynamic menu

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

MfM2yti.png7aZyhncm.png

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)

MfM2yti.pngkDgbTGIm.png

Try adding those lines to ~/.config/jgmenu/prepend.csv, to show in the main menu wink

This now looks like:

MfM2yti.pngHr18W9sm.png


___________________________________ _ ___________________________________

Offline

#18 2024-09-10 02:43:16

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,666
Website

Re: Update for "Basic Introduction to jgmenu on BL Lithium" Work Thread

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 )

Introduction to the Bunsenlabs Boron Desktop

Offline

#19 2024-09-10 12:00:00

r.chaffee53
Member
Registered: 2023-08-02
Posts: 123

Re: Update for "Basic Introduction to jgmenu on BL Lithium" Work Thread

johnraff wrote:

Anyone else?

Bob

Offline

#20 2024-09-10 13:51:57

hhh
Gaucho
From: High in the Custerdome
Registered: 2015-09-17
Posts: 16,169
Website

Re: Update for "Basic Introduction to jgmenu on BL Lithium" Work Thread

Just pick a color. You could use the Boron-aqua selected-background color, or a shade of it...

https://color-hex.org/color/53a0b3


I don't care what you do at home. Would you care to explain?

Offline

Board footer

Powered by FluxBB