From 7f8c7c8b0f8bcb62f6da5b6dbb48b1547e9a4f76 Mon Sep 17 00:00:00 2001 From: Archos Date: Sun, 24 Jul 2022 06:07:03 +0000 Subject: [PATCH] addmenu schema.pl --- schema.pl | 118 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 schema.pl diff --git a/schema.pl b/schema.pl new file mode 100644 index 0000000..81cbe7d --- /dev/null +++ b/schema.pl @@ -0,0 +1,118 @@ +#!/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"]}, + file: include the content of an XML file {file => "/path/to/file.xml"}, + raw: any XML data supported by Openbox {raw => q(...)}, + beg: begin of a category {beg => ["name", "icon"]}, + end: end of a category {end => 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 => "Arch Linux"}, + # COMMAND LABEL ICON + {item => ['thunar', 'Správce souborů', 'system-file-manager']}, + {item => ['catfish', 'vyhledávač souborů', 'catfish']}, + {item => ['xfce4-terminal', 'Terminál', 'terminal']}, + {item => ['xdg-open http://', 'Webový prohlížeč', 'web-browser']}, + {item => ['chromium', 'Chromium', 'chromium']}, + {item => ['pluma', 'Pluma', 'pluma']}, + {item => ['gajim', 'XMPP klient', 'gajim']}, + {item => ['thunderbird', 'E-mailový klient', 'thunderbird']}, + {item => ['evolution', 'Evolution', 'evolution']}, + {item => ['element-desktop', 'Element', 'element']}, + {item => ['flatpak run org.cznic.Datovka', 'Datovka', 'datovka']}, + {item => ['flatpak run net.cozic.joplin_desktop', 'Joplin', 'joplin']}, + + + {sep => undef}, + + + {sep => 'Aplikace'}, + + # NAME LABEL ICON + {cat => ['utility', 'Příslušenství', 'applications-utilities']}, + {cat => ['development', 'Vývoj', 'applications-development']}, + {cat => ['education', 'Vzdělání', 'applications-science']}, + {cat => ['game', 'Hry', 'applications-games']}, + {cat => ['graphics', 'Grafika', 'applications-graphics']}, + {cat => ['audiovideo', 'Multimedia', 'applications-multimedia']}, + {cat => ['network', 'Internet', 'applications-internet']}, + {cat => ['office', 'Kancelář', 'applications-office']}, + {cat => ['other', 'Ostatní', 'applications-other']}, + {cat => ['settings', 'Nastavení', 'applications-accessories']}, + {cat => ['system', 'Systém', 'applications-system']}, + # LABEL ICON + #{beg => ['My category', 'cat-icon']}, + # ... some items ... + #{end => undef}, + + + ## Generic advanced settings + #{sep => undef}, + #{obgenmenu => ['Openbox Settings', 'applications-engineering']}, + #{sep => undef}, + + ## Custom advanced settings + {sep => undef}, + {beg => ['Openbox nastavení', 'applications-engineering']}, + + #Configuration files + {item => ["$editor ~/.conkyrc", 'Conky RC', 'text-x-generic']}, + {item => ["$editor ~/.config/tint2/tint2rc", 'Tint2 Panel', 'text-x-generic']}, + # obmenu-generator category + {beg => ['Obmenu-Generator', 'accessories-text-editor']}, + {item => ["$editor ~/.config/obmenu-generator/schema.pl", 'Menu Schema', 'text-x-generic']}, + {item => ["$editor ~/.config/obmenu-generator/config.pl", 'Menu Config', 'text-x-generic']}, + + {sep => undef}, + {item => ['obmenu-generator -s -c', 'Generate a static menu', 'accessories-text-editor']}, + {item => ['obmenu-generator -s -i -c', 'Generate a static menu with icons', 'accessories-text-editor']}, + {sep => undef}, + {item => ['obmenu-generator -p', 'Generate a dynamic menu', 'accessories-text-editor']}, + {item => ['obmenu-generator -p -i', 'Generate a dynamic menu with icons', 'accessories-text-editor']}, + {sep => undef}, + + {item => ['obmenu-generator -d', 'Refresh cache', 'view-refresh']}, + {end => undef}, + # Openbox category + {beg => ['Openbox', 'openbox']}, + {item => ["$editor ~/.config/openbox/autostart", 'Openbox Autostart', 'text-x-generic']}, + {item => ["$editor ~/.config/openbox/rc.xml", 'Openbox RC', 'text-x-generic']}, + {item => ["$editor ~/.config/openbox/menu.xml", 'Openbox Menu', 'text-x-generic']}, + {item => ['openbox --reconfigure', 'Reconfigure Openbox', 'openbox']}, + {end => undef}, + {end => undef}, + + {sep =>"Home Archos" }, + #{pipe => ['obbrowser', 'Disk', 'drive-harddisk']}, + {pipe => ['am-places-pipemenu', 'Místa', 'folder']}, + {pipe => ['am-recent-files-pipemenu', 'Poslední soubory', 'folder-recent']}, + ##The xscreensaver lock command + {item => ['xscreensaver-command -lock', 'Lock', 'system-lock-screen']}, + ## This option uses the default Openbox's "Exit" action + #{exit => ['Vypnout počítáč', 'application-exit']}, + + + ## This uses the 'oblogout' menu + {item => ['oblogout', 'Vypnout počítač', 'application-exit']}, +]