From 47c0bafc27e0d6dd72d8931236d69df61438d589 Mon Sep 17 00:00:00 2001 From: onekk Date: Wed, 8 Oct 2014 22:14:05 +0200 Subject: [PATCH 1/4] New Package: obmenu-generator perl script to auto generate openbox menu (expecially applications menu) --- srcpkgs/obmenu-generator/INSTALL.msg | 4 ++ srcpkgs/obmenu-generator/files/README.void | 81 ++++++++++++++++++++++ srcpkgs/obmenu-generator/template | 22 ++++++ 3 files changed, 107 insertions(+) create mode 100644 srcpkgs/obmenu-generator/INSTALL.msg create mode 100644 srcpkgs/obmenu-generator/files/README.void create mode 100644 srcpkgs/obmenu-generator/template diff --git a/srcpkgs/obmenu-generator/INSTALL.msg b/srcpkgs/obmenu-generator/INSTALL.msg new file mode 100644 index 00000000000..1dedbac677c --- /dev/null +++ b/srcpkgs/obmenu-generator/INSTALL.msg @@ -0,0 +1,4 @@ + + See README.void in /usr/share/doc/obmenu-generator + + Void Mantainers \ No newline at end of file diff --git a/srcpkgs/obmenu-generator/files/README.void b/srcpkgs/obmenu-generator/files/README.void new file mode 100644 index 00000000000..89886d71a54 --- /dev/null +++ b/srcpkgs/obmenu-generator/files/README.void @@ -0,0 +1,81 @@ +README.void + + To properly use obmenu-generator in void linux you have to tweak + two files: + + A config file, auto generated by obmenu-generator: + + ~/.config/obmenu-generator/config.pl + + + The Schema file that you have to copy from: + + /etc/xdg/obmenu-generator/schema.pl + + in: + + ~/.config/obmenu-generator/schema.pl + + + Both files are well documentend into the code. + + Read also the comments in the code of + + /usr/bin/obmenu-generator + + (it's a perl script) for more advanced use. + + Modify ~/.config/obmenu-generator/schema.pl according to your + needs to adapt the categories names to your language after theese lines + + {sep => "desidered name of the submenu"}, (see below for the default). + + + {sep => 'Applications'}, + + # NAME LABEL ICON + {cat => ['utility', 'Accessories', 'applications-utilities']}, + {cat => ['development', 'Development', 'applications-development']}, + + + The LABEL column is the place where you localize the names. + + If you use it as a submenu it's better to commentig out the lines from: + + ## Custom advanced settings + + till: + + {exit => ['Exit', 'exit']}, + + prior the closing ] + + The config.pl is created by obmenu-generator but you may want to customize + the language of the auto generated names, for that you have to modify a line + near the end, modifying the "name_keys" key to read as follow (substituing + the [it] to your preferred language code). + + "name_keys" => ['Name[it]', 'GenericName[it]', 'Name'], + + Accordig to the comment in the script the modifications you have done + do in the config.pl may be overridden by the program itself, so be + prepared to rewrite every line you modify in the config.pl file from time to + time (it is better to copy the config.pl file say to config.pl.mine). + + After you have done the desired modification, insert this line in your + menu.xml where you want the menu will be: + + + + Then do openbox -reconfigure (or use the menu entry that usually come with + openbox) and enjoy your new application menu. + + The script is very powerful and has many other use even to autogenerate a + menu.xml, read the documentation and better the comments that are more up to + date at: + + http://trizenx.blogspot.ro/2012/02/obmenu-generator.html + + Happy obmenu-generator! + + The Void Mantainers diff --git a/srcpkgs/obmenu-generator/template b/srcpkgs/obmenu-generator/template new file mode 100644 index 00000000000..d39566d630d --- /dev/null +++ b/srcpkgs/obmenu-generator/template @@ -0,0 +1,22 @@ +# Template file for 'obmenu-generator' +pkgname=obmenu-generator +version=0.60 +revision=1 +maintainer="Carlo Dormeletti " +homepage="http://trizenx.blogspot.ro/2012/02/obmenu-generator.html" +license="GPL-3" +short_desc="Perl Script to generate Openbox menu" +depends="perl>=5.20 perl-Linux-DesktopFiles" +distfiles="https://github.com/trizen/${pkgname}/archive/${version}.tar.gz" +checksum="437cca97b3225b0dc5dc642c797ad30b7f1fe6024b9c6272fb6c6ed6c84c9643" + +do_install() { + vbin obmenu-generator + vmkdir /etc/xdg/${pkgname} + vinstall schema.pl 644 /etc/xdg/${pkgname} + vdoc README.md + vdoc ${FILESDIR}/README.void + vdoc schema.pl +} + +# vim: set ts=4 sw=4 sts=4 et: From 3dc2c95b565a22c0ccac34a5212bf7995ed38f56 Mon Sep 17 00:00:00 2001 From: onekk Date: Wed, 8 Oct 2014 22:17:25 +0200 Subject: [PATCH 2/4] obmenu-generator: added a missing newline in INSTALL.msg --- srcpkgs/obmenu-generator/INSTALL.msg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srcpkgs/obmenu-generator/INSTALL.msg b/srcpkgs/obmenu-generator/INSTALL.msg index 1dedbac677c..d67c50da37a 100644 --- a/srcpkgs/obmenu-generator/INSTALL.msg +++ b/srcpkgs/obmenu-generator/INSTALL.msg @@ -1,4 +1,4 @@ See README.void in /usr/share/doc/obmenu-generator - Void Mantainers \ No newline at end of file + The Void Mantainers From 6a42699a3549bce5007c545f73d8b4c3b9185faf Mon Sep 17 00:00:00 2001 From: onekk Date: Thu, 9 Oct 2014 18:25:16 +0200 Subject: [PATCH 3/4] obmenu-generator: added schema.pl.app already tailored for submenu usage in the doc dir, deleted INSTALL.msg and adpated README.void and the template file to reflect the modifications Regards Carlo D. --- srcpkgs/obmenu-generator/INSTALL.msg | 4 -- srcpkgs/obmenu-generator/files/README.void | 23 ++++----- srcpkgs/obmenu-generator/files/schema.pl.app | 51 ++++++++++++++++++++ srcpkgs/obmenu-generator/template | 2 +- 4 files changed, 61 insertions(+), 19 deletions(-) delete mode 100644 srcpkgs/obmenu-generator/INSTALL.msg create mode 100644 srcpkgs/obmenu-generator/files/schema.pl.app diff --git a/srcpkgs/obmenu-generator/INSTALL.msg b/srcpkgs/obmenu-generator/INSTALL.msg deleted file mode 100644 index d67c50da37a..00000000000 --- a/srcpkgs/obmenu-generator/INSTALL.msg +++ /dev/null @@ -1,4 +0,0 @@ - - See README.void in /usr/share/doc/obmenu-generator - - The Void Mantainers diff --git a/srcpkgs/obmenu-generator/files/README.void b/srcpkgs/obmenu-generator/files/README.void index 89886d71a54..b0424bb659a 100644 --- a/srcpkgs/obmenu-generator/files/README.void +++ b/srcpkgs/obmenu-generator/files/README.void @@ -40,15 +40,9 @@ README.void The LABEL column is the place where you localize the names. - If you use it as a submenu it's better to commentig out the lines from: - - ## Custom advanced settings - - till: - - {exit => ['Exit', 'exit']}, - - prior the closing ] + If you want to use a schema to provide only an application submenu, in + the doc dir you will find tje file "schema.pl.app" already tailored for + this use. The config.pl is created by obmenu-generator but you may want to customize the language of the auto generated names, for that you have to modify a line @@ -57,12 +51,13 @@ README.void "name_keys" => ['Name[it]', 'GenericName[it]', 'Name'], - Accordig to the comment in the script the modifications you have done - do in the config.pl may be overridden by the program itself, so be - prepared to rewrite every line you modify in the config.pl file from time to - time (it is better to copy the config.pl file say to config.pl.mine). + Accordig to the criptic comment in the script the modifications you have done + do in the config.pl may be overridden by the program itself, so be prepared + to rewrite every line you modify in the config.pl file from time to time + (it is better to copy the config.pl in the ~/.config/obmenu-generator dir + config.pl.mine as a backup copy when you have done the personalisations). - After you have done the desired modification, insert this line in your + After you have done all your modification, insert this line in your Openbox menu.xml where you want the menu will be: diff --git a/srcpkgs/obmenu-generator/files/schema.pl.app b/srcpkgs/obmenu-generator/files/schema.pl.app new file mode 100644 index 00000000000..f72e5f88067 --- /dev/null +++ b/srcpkgs/obmenu-generator/files/schema.pl.app @@ -0,0 +1,51 @@ +#!/usr/bin/perl + +# obmenu-generator - schema file + +=for comment + + item: add an item inside the menu {item => ["command", "label", "icon"]}, + cat: add a category inside the menu {cat => ["name", "label", "icon"]}, + sep: horizontal line separator {sep => undef}, {sep => "label"}, + pipe: a pipe menu entry {pipe => ["command", "label", "icon"]}, + raw: any valid Openbox XML string {raw => q(xml string)}, + begin_cat: begin of a category {begin_cat => ["name", "icon"]}, + end_cat: end of a category {end_cat => undef}, + obgenmenu: generic menu settings {obgenmenu => ["label", "icon"]}, + exit: default "Exit" action {exit => ["label", "icon"]}, + +=cut + +# NOTE: +# * Keys and values are case sensitive. Keep all keys lowercase. +# * ICON can be a either a direct path to an icon or a valid icon name +# * Category names are case insensitive. (X-XFCE and x_xfce are equivalent) + +require "$ENV{HOME}/.config/obmenu-generator/config.pl"; + +## Text editor +my $editor = $CONFIG->{editor}; + +our $SCHEMA = [ + {sep => 'Applications'}, + + # NAME LABEL ICON + {cat => ['utility', 'Accessories', 'applications-utilities']}, + {cat => ['development', 'Development', 'applications-development']}, + {cat => ['education', 'Education', 'applications-science']}, + {cat => ['game', 'Games', 'applications-games']}, + {cat => ['graphics', 'Graphics', 'applications-graphics']}, + {cat => ['audiovideo', 'Multimedia', 'applications-multimedia']}, + {cat => ['network', 'Network', 'applications-internet']}, + {cat => ['office', 'Office', 'applications-office']}, + {cat => ['other', 'Other', 'applications-other']}, + {cat => ['settings', 'Settings', 'applications-accessories']}, + {cat => ['system', 'System', 'applications-system']}, + + #{cat => ['qt', 'QT Applications', 'qtlogo']}, + #{cat => ['gtk', 'GTK Applications', 'gnome-applications']}, + #{cat => ['x_xfce', 'XFCE Applications', 'applications-other']}, + #{cat => ['gnome', 'GNOME Applications', 'gnome-applications']}, + #{cat => ['consoleonly', 'CLI Applications', 'applications-utilities']}, + +] diff --git a/srcpkgs/obmenu-generator/template b/srcpkgs/obmenu-generator/template index d39566d630d..2bbd31e9f5f 100644 --- a/srcpkgs/obmenu-generator/template +++ b/srcpkgs/obmenu-generator/template @@ -16,7 +16,7 @@ do_install() { vinstall schema.pl 644 /etc/xdg/${pkgname} vdoc README.md vdoc ${FILESDIR}/README.void - vdoc schema.pl + vdoc ${FILESDIR}/schema.pl.app } # vim: set ts=4 sw=4 sts=4 et: From 490a827075714cc68aa509ba744fc586a3261f7d Mon Sep 17 00:00:00 2001 From: onekk Date: Fri, 10 Oct 2014 16:03:14 +0200 Subject: [PATCH 4/4] obmenu-generator: modified package added missing noarch=yes --- srcpkgs/obmenu-generator/template | 1 + 1 file changed, 1 insertion(+) diff --git a/srcpkgs/obmenu-generator/template b/srcpkgs/obmenu-generator/template index 2bbd31e9f5f..ce7f83b8190 100644 --- a/srcpkgs/obmenu-generator/template +++ b/srcpkgs/obmenu-generator/template @@ -2,6 +2,7 @@ pkgname=obmenu-generator version=0.60 revision=1 +noarch=yes maintainer="Carlo Dormeletti " homepage="http://trizenx.blogspot.ro/2012/02/obmenu-generator.html" license="GPL-3"