You are not logged in.
Pages: 1
The idea is to have a "database" like this, where each line will represent a new executable entrie in generated openbox submenu. First item is label name and comma separated 2nd is optional path to the executable. Which should be a lot easier to edit/handle than editing menu.xml or even starting appropriate editor, for example adding a new entrie could be just: echo "chess" >> ~/bin/misc
A script should generate a singlelevel submenu like:
For more info and how to call it from menu.xml read the script.
benchmark
While this is quite fast, static menu would be at least 10 times faster (guessing a bit)
time pipeMisc >/dev/null
real 0m0.023s
user 0m0.004s
sys 0m0.000s
changelog
- use --- in database to echo separator.
- remove whitespace at the beginning/end of $vars (database can be more sloppy then)
- entries started with # are skipped as well.
^ Tested now on two machines and this is actually quite useful due to simplicity (No more 2nd thoughts before editing an entrie, just do it).
Last edited by brontosaurusrex (2017-10-15 10:32:13)
Offline
Interesting.
Did you know about the BL bash functions for generating Openbox menus? They are in /usr/lib/bunsen/common/bl-include.cfg, and can be sourced by a script to save you a lot of typing. See the bl pipemenus for examples.
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
@damo: I did not, this one?
Last edited by brontosaurusrex (2017-07-06 15:55:31)
Offline
@damo: I did not, this one?
Yep. Source the functions with
. /path/to/bl-include.cfg
Build a menu with, for example
menuStart
menuItem "label" "command"
menuSeparator
menuSubmenu
menuItem "label" "command"
menuSubmenuEnd
menuEnd
All the xml is written to the output automatically
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
^ Should be useful for something more complex, this one is all about simplicity/as little code as possible.
Offline
Pages: 1