9menu - creates menus from the command line

Window managers, icon programs, widgets, etc.
Post Reply
Message
Author
stu90

9menu - creates menus from the command line

#1 Post by stu90 »

Here is a .pet for the application 9menu
http://pwet.fr/man/linux/commandes/9menu
9menu is a simple program that accepts a list of menu item and command pairs on the command line. It creates a window that consists of nothing but a menu. When a particular item is selected, the corresponding command is executed.
How to use:
9menu -file "/path/to/menu/file"

In menu file:
menu item : command
menu item : command


example:
Image
Attachments
9menu-1.8.5.pet
(7.99 KiB) Downloaded 646 times

penguinpowerppp
Posts: 5
Joined: Sat 14 Apr 2012, 23:49

#2 Post by penguinpowerppp »


User avatar
harii4
Posts: 448
Joined: Fri 30 Jan 2009, 04:08
Location: La Porte City, IA , U.S.A.
Contact:

#3 Post by harii4 »

@stu90
Hope you don't mind if i post an 9menu example? :)
examples of 9menu are hard to come by and someone might find them useful?

I start mine as scripts.
sample "inet.sh" place in my-applications/bin

Code: Select all

#!/bin/sh 

9menu -geometry 150x66+300+16 -bg "#000000" -fg "#F2EDD7" -font "-*-lucidatypewriter-*-*-*-*-10-*-*-*-*-*-*-*" -popup -label 'Internet' \ 
"links2":"xlinks2 &" \ 
"Dillo Browser":"dillo \"$@\" &" \ 
"Safer Browser":"SafeBrowse &" \ 
"FireFox":"/lib/firefox/firefox \"$@\" &" \ 
----------:inet.sh \ 
"gFTP":"gftp &" \ 
"PMirrorget":"pmwget &" \ 
"VOIP + IM":"psip &" \ 
"Podcast-Grab":"/usr/local/bin/ppg-gui.sh &" \ 
"downloader":"pwsget &" \ 
"Transmission":"transmission &" \ 
----------:inet.sh \ 
Close:exit
\ = line wrap around - system sees it as one long line of text.

thank you for the 9menu pet. :D
3.01 Fat Free / Fire Hydrant featherweight/ TXZ_pup / 431JP2012
----------------------------------------------------------------------------------------
Peace and Justice are two sides of the same coin.

stu90

#4 Post by stu90 »

harii4 wrote:@stu90
Hope you don't mind if i post an 9menu example? :)
examples of 9menu are hard to come by and someone might find them useful?

I start mine as scripts.
sample "inet.sh" place in my-applications/bin

Code: Select all

#!/bin/sh 

9menu -geometry 150x66+300+16 -bg "#000000" -fg "#F2EDD7" -font "-*-lucidatypewriter-*-*-*-*-10-*-*-*-*-*-*-*" -popup -label 'Internet' \ 
"links2":"xlinks2 &" \ 
"Dillo Browser":"dillo "$@" &" \ 
"Safer Browser":"SafeBrowse &" \ 
"FireFox":"/lib/firefox/firefox "$@" &" \ 
----------:inet.sh \ 
"gFTP":"gftp &" \ 
"PMirrorget":"pmwget &" \ 
"VOIP + IM":"psip &" \ 
"Podcast-Grab":"/usr/local/bin/ppg-gui.sh &" \ 
"downloader":"pwsget &" \ 
"Transmission":"transmission &" \ 
----------:inet.sh \ 
Close:exit
\ = line wrap around - system sees it as one long line of text.

thank you for the 9menu pet. :D
Hi harii4,
Yes feel free to post how you use 9menu 8)

I use it like this:

in script 9main located in /usr/bin i have:

Code: Select all

#!/bin/sh 
9menu -label "Main Menu" -warp -popdown -geometry "0+0"  -bg "#5A5A5A" -fg "#D4D4D4" -font "-misc-fixed-medium-r-normal-*-14-*-*-*-*-*-*-*"  -file "$@"  
Then in a plain .txt file menu1.txt i have the menu some thing like this (you dont need to line break or escaped characters):

Code: Select all

==============
| Terminal   |: urxvt
| Browser    |: defaultbrowser
| Links      |: urxvt -e links
| Editor     |: geany
| MOCP       |: urxvt -e mocp
| Streams    |: urxvt -e tradio
| Media      |: urxvt -e tmedia    
==============
 
to use i add an Alt + key bindings to openbox which is: 9main /path/to/menu1.txt

I do it this way so i can have different menus but with the same set up and colours.

thanks.

User avatar
harii4
Posts: 448
Joined: Fri 30 Jan 2009, 04:08
Location: La Porte City, IA , U.S.A.
Contact:

#5 Post by harii4 »

when -popdown option is used the script keeps running in the background long after it launches the picked app. to run?
when using -popup the script closes itself after launching the app.

Just an reminder for window managers that don't "iconify the menu"
- popdown
like evilwm and cwm

Code: Select all

)    (( Archive  ))    (:file-roller %U
)    (( Calc.    ))    (:xcalc
)    (( Calendar ))    (:osmo
)    (( CLI apps ))    (:gedit ./cliapps
)    (( Clock    ))    (:xclock -digital -fg "#000000" -bg "#00ffff" -hl "#000000" -bd "#00ffff" -update 1 -twentyfour -padding 6 
)    (( Education))    (:tuxtype
)    (( Files M  ))    (:nautilus
)    (( Image V  ))    (:mirage
)    (( Internet ))    (:./firefox/firefox
)    (( Media    ))    (:vlc
)    (( Search   ))    (:gnome-search-tool
)    (( prtScrn  ))    (:./pic
)    (( Sys Mon  ))    (:xterm -fn "-*-fixed-*-r-*-*-14-*-*-*-*-*-*-*" -fg cyan  -bg black -geometry 100x42+49+23 htop
)    (( Terminal ))    (:gnome-terminal
)    (( Text     ))    (:gedit
)    (( charact  ))    (:gucharmap
========================
)(Extra Browsers)(
========================
)    (( Chromium ))    (:chromium-browser
)    (( ChromiumI))    (:chromium-browser -incognito
)    (( Elinks   ))    (:xterm -fn "-*-fixed-*-r-*-*-14-*-*-*-*-*-*-*" -fg cyan  -bg black -geometry 100x42+49+23 elinks 
)    (( Links2   ))    (:xlinks2
========================
)(Systems Tools)(
========================
)    (( Conky    ))    (:./conky
)    (( Ccsm     ))    (:ccsm
)    (( Disk Utl.))    (:gksu palimpsest
)    (( Gdmsetup ))    (:gksu gdmsetup
)    (( Gconf    ))    (:gconf-editor
)    (( Icons    ))    (:MagIcons
)    (( Synaptic ))    (:gksudo synaptic
)    (( Theme ch ))    (:/usr/bin/gtk-chtheme
========================
)(  LogOut  )(:killall compiz
)(  Wifi  )(:gksudo ./wifi
)(  Shutdown  )(:gdmflexiserver
========================
   ( Close )  :exit
you can really dress the 9menu up
from:
http://www.necopost.com/2011/11/awesome ... linux.html
3.01 Fat Free / Fire Hydrant featherweight/ TXZ_pup / 431JP2012
----------------------------------------------------------------------------------------
Peace and Justice are two sides of the same coin.

stu90

#6 Post by stu90 »

Hi harii4,
Yes with the -popdown option after a menu item is selected the menu is minimized but not closed.
Also the -warp option will move the mouse into the menu over the last menu selection.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#7 Post by technosaurus »

here is a static build against musl libc and tinyx11 with latest debian patches (The binary may be larger, but the resource usage is much lower)
Attachments
9menu-1.8.tar.gz
(54.62 KiB) Downloaded 575 times
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

Gnuxo
Posts: 365
Joined: Thu 09 Feb 2012, 19:01

#8 Post by Gnuxo »

I love this program.

The menus look so cool. I usually use it with oroborus.

Haven't installed any other WMs in a long time though.

Post Reply