#!/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)},
    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};
my $browser = $CONFIG->{wwwbrowser};
my $terminal = $CONFIG->{terminal};
our $SCHEMA = [
	{sep => 'Mabox Menu'},
    #          COMMAND                 LABEL                ICON
    #{item => ["calamares_polkit", 'Zainstaluj Mabox', 'distributor-logo-mabox']},
    #{beg => ['Narzędzia dyskowe', 'gparted']},
	#		{item => ["gksu gparted", 'GParted', 'gparted']},
	#		{item => ["exo-open --launch TerminalEmulator sudo clonezilla", 'Clonezilla', 'drive-harddisk']},
	#		{item => ["exo-open --launch TerminalEmulator sudo testdisk", 'Testdisk', 'drive-harddisk']},
	#{end => undef},
      
    #{sep => undef},
    {item => ['exo-open --launch TerminalEmulator',        'Terminal',         'lxterminal']},
    {item => ['exo-open --launch WebBrowser',	'Przeglądarka WWW', 'web-browser']},
    {item => ['exo-open --launch FileManager',           'Menedżer plików',      'file-manager']},
    {item => ["dmenu_extended_run", 'Uruchom', 'go-next']},
    {sep => undef},
	
    #          NAME            LABEL                ICON
    {cat => ['utility',     'Akcesoria', 'applications-utilities']},
    {cat => ['development', 'Programowanie', 'applications-development']},
    {cat => ['education',   'Edukacja',   'applications-science']},
    {cat => ['game',        'Gry',       'applications-games']},
    {cat => ['graphics',    'Grafika',    'applications-graphics']},
    {cat => ['audiovideo',  'Multimedia',  'applications-multimedia']},
    {cat => ['network',     'Sieć',     'applications-internet']},
    {cat => ['office',      'Biuro',      'applications-office']},
    {cat => ['other',       'Inne',       'applications-other']},
    {cat => ['settings',    'Ustawienia',    'applications-accessories']},
    {cat => ['system',      'System',      'applications-system']},

    #{cat => ['qt',          'QT Applications',    'qt4logo']},
    #{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']},

    #                  LABEL          ICON
    #{beg => ['My category',  'cat-icon']},
    #             ... some items ...
    #{end   => undef},

    #            COMMAND     LABEL        ICON
    #{pipe => ['obbrowser', 'Disk', 'drive-harddisk']},

    ## Generic advanced settings
    #{sep       => undef},
    #{obgenmenu => ['Openbox Settings', 'openbox']},
    #{sep       => undef},

    ## Custom advanced settings
    
    {sep => undef},
    {beg => ['Miejsca (S-p)', 'drive-harddisk']},
    {sep => 'Szybka nawigacja'},
    {pipe => ['obbrowser', 'Domowy', 'folder_home']},
    {pipe => ['obbrowser /', '/', 'folder']},
    {sep => undef},
    {item => ["$editor ~/.config/obbrowser/config.pl", 'Konfiguracja', 'geany']},
    {item => ['rm ~/.config/obbrowser/cache.db', 'Odśwież zestaw ikon', 'gtk-refresh']},
    {end => undef},
    #{pipe => ["mabox-places-pipemenu", "Miejsca", "file-manager"]},
	{pipe => ["mabox-recent-files-pipemenu", "Ostatnie pliki", "centrejust"]},
	{sep => undef},
	{pipe => ["mabox-software-pipemenu", "Oprogramowanie", "rpmdrake"]},
	{sep => undef},
	{beg => ['Zrzut ekranu', 'emblem-camera']},
            {item => ['mb-scrot -d',        'scrot - Pełny ekran',         'emblem-camera']},
            {item => ['mb-scrot -w',        'scrot - Aktywne okno',         'emblem-camera']},
            {item => ['mb-scrot -s',        'scrot - Zaznaczony obszar',         'emblem-camera']},
	{end => undef},
	{sep => undef},
	{beg => ['Ustawienia', 'gnome-settings']},
	    {item => ['mbcc',        'Centrum Sterowania Mabox',         'mbcc']},
	    {item => ['mbstyler',        'Mabox Styler',         '/usr/share/icons/mbs_trans_32.png']},
		{sep => 'Pulpit'},
		{item => ['lxappearance',          'Wystrój i ikony',         'preferences-desktop-theme']},
		{item => ['nitrogen',          'Tapeta',         'nitrogen']},
		{item => ['xfce4-notifyd-config',          'Powiadomienia',         'xfce4-notifyd']},
		{pipe => ["mabox-conky-pipemenu", "Conky", "desktop-effects"]},
		{pipe => ["mabox-tint2-pipemenu", "Panel Tint2", "tint2conf"]},
		{sep => 'Ustawienia'},
		{item => ['exo-preferred-applications',          'Preferowane aplikacje',         'preferences-desktop-default-applications']},
		{item => ['pkexec lightdm-settings', 'Menedżer logowania', 'lightdm-settings']},
		{item => ['xfce4-power-manager-settings ', 'Ustawienia zasilania', 'xfce4-power-manager-settings']},
		{sep => 'Openbox'},
		# Openbox category
        {beg => ['Openbox', 'openbox']},
            {item => ['openbox --reconfigure',               'Rekonfiguruj Openbox', 'openbox']},
            {item => ["$editor ~/.config/openbox/autostart", 'Openbox Autostart',   'geany']},
            {item => ["$editor ~/.config/openbox/rc.xml",    'Openbox RC',          'geany']},
            {item => ["$editor ~/.config/openbox/menu.xml",  'Openbox Menu',        'geany']},
        {end => undef},
        {pipe => ["mabox-kb-pipemenu", "Klawisze skrótu", "keyboard"]},
        # obmenu-generator category
        {beg => ['Menu', 'menu-editor']},
            {item => ["$editor ~/.config/obmenu-generator/schema.pl", 'Schemat Menu', 'geany']},
            {item => ["$editor ~/.config/obmenu-generator/config.pl", 'Konfiguracja Menu', 'geany']},

            {sep  => undef},
            {item => ['obmenu-generator -p',       'Generuj pipe menu',              'menu-editor']},
            {item => ['obmenu-generator -s -c',    'Generuj statyczne menu',            'menu-editor']},
            {item => ['obmenu-generator -p -i',    'Generuj pipe menu z ikonami',   'menu-editor']},
            {item => ['obmenu-generator -s -i -c', 'Generuj statyczne menu z ikonami', 'menu-editor']},
            {sep  => undef},

            {item => ['obmenu-generator -d', 'Odśwież zestaw ikon', 'gtk-refresh']},
        {end => undef},
        {pipe => ["mabox-compositor", "Kompozytor", "compton"]},
        {sep  => "Motywy Mabox"},
        {item => ['mb-obthemes',          'Predefiniowane schematy',         'preferences-desktop-theme']},
       
   

    {end => undef},
     {beg => ['Pomoc', 'help']},
		{sep => 'Pomoc online'},
		{item => ["exo-open --launch WebBrowser https://pl.maboxlinux.org/przewodnik-uzytkownika/", 'Mabox - pierwsze kroki', 'applications-internet']},
		{item => ["exo-open --launch WebBrowser https://pl.maboxlinux.org/forums/", 'Mabox - forum', 'applications-internet']},

		{beg => ['Manjaro', 'help']},
		{item => ["exo-open --launch WebBrowser https://manjaro.org", 'Strona domowa', 'applications-internet']},
		{item => ["exo-open --launch WebBrowser https://wiki.manjaro.org", 'Wiki', 'applications-internet']},
		{item => ["exo-open --launch WebBrowser https://forum.manjaro.org", 'Forum', 'applications-internet']},
		{item => ["exo-open --launch WebBrowser https://manjaro.pl", 'Manjaro PL', 'applications-internet']},
		{end => undef},
		{beg => ['OpenBox', 'help']},
        {item => ["exo-open --launch WebBrowser http://openbox.org/wiki/Main_Page", 'Strona domowa', 'applications-internet']},
        {item => ["exo-open --launch WebBrowser http://openbox.org/wiki/Help:Contents", 'Dokumentacja', 'applications-internet']},
        {item => ["exo-open --launch WebBrowser http://openbox.org/wiki/Help:FAQ", 'FAQ', 'applications-internet']},
        {item => ["exo-open --launch WebBrowser http://openbox.org/wiki/Help:Getting_started", 'Jak zacząć?', 'applications-internet']},
        {end => undef},
		{beg => ['Dokumentacja Tint2', 'help']},
		{item => ["exo-open --launch WebBrowser https://gitlab.com/o9000/tint2/wikis/FAQ", 'Tint2: FAQ', 'applications-internet']},
		{item => ["exo-open --launch WebBrowser https://gitlab.com/o9000/tint2/wikis/Configure", 'Tint2: konfiguracja', 'applications-internet']},
		{end => undef},
		{beg => ['Dokumentacja Conky', 'help']},
		{item => ["exo-open --launch WebBrowser http://conky.sourceforge.net/config_settings.html", 'Ustawienia konfiguracyjne', 'applications-internet']},
		{item => ["exo-open --launch WebBrowser http://conky.sourceforge.net/variables.html", 'Zmienne', 'applications-internet']},
		{end => undef},
		{sep => undef},
		{beg => ['Motywy', 'help']},
		{item => ["exo-open --launch WebBrowser http://www.box-look.org", 'Box-look.org', 'applications-internet']},
		{item => ["exo-open --launch WebBrowser http://www.deviantart.com/browse/all/", 'DeviantArt', 'applications-internet']},
		{end => undef},
     {end => undef},
    {sep => undef},
        
    ## The lock command
    {item => ['betterlockscreen -l', 'Zablokuj ekran', 'lock']},

    # This option uses the default Openbox's action "Exit"
    # {exit => ['Exit', 'exit']},

    # This uses the 'oblogout' menu
    {item => ['rofr.sh -l', 'Wyjście', 'boot']},
]
