You are not logged in.

#1 2017-07-06 14:30:05

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,746

pipeMisc

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:
pipeMisc image should be here

For more info and how to call it from menu.xml read the script.

scrot
scrot17326.th.png

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

#2 2017-07-06 15:45:42

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: pipeMisc

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

#3 2017-07-06 15:50:36

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,746

Re: pipeMisc

@damo: I did not, this one?

Last edited by brontosaurusrex (2017-07-06 15:55:31)

Offline

#4 2017-07-06 16:24:44

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: pipeMisc

brontosaurusrex wrote:

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


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

#5 2017-07-06 16:49:51

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,746

Re: pipeMisc

^ Should be useful for something more complex, this one is all about simplicity/as little code as possible.

Offline

Board footer

Powered by FluxBB