Advertisement
edps

obmenu-generator-schema.pl

Apr 15th, 2015
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 5.42 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3. # obmenu-generator - schema file
  4.  
  5. =for comment
  6.  
  7.     item:      add an item inside the menu               {item => ["command", "label", "icon"]},
  8.     cat:       add a category inside the menu             {cat => ["name", "label", "icon"]},
  9.     sep:       horizontal line separator                  {sep => undef}, {sep => "label"},
  10.     pipe:      a pipe menu entry                         {pipe => ["command", "label", "icon"]},
  11.     raw:       any valid Openbox XML string               {raw => q(xml string)},
  12.     begin_cat: begin of a category                  {begin_cat => ["name", "icon"]},
  13.     end_cat:   end of a category                      {end_cat => undef},
  14.     obgenmenu: generic menu settings                {obgenmenu => ["label", "icon"]},
  15.     exit:      default "Exit" action                     {exit => ["label", "icon"]},
  16.  
  17. =cut
  18.  
  19. # NOTE:
  20. #    * Keys and values are case sensitive. Keep all keys lowercase.
  21. #    * ICON can be a either a direct path to an icon or a valid icon name
  22. #    * Category names are case insensitive. (X-XFCE and x_xfce are equivalent)
  23.  
  24. require "$ENV{HOME}/.config/obmenu-generator/config.pl";
  25.  
  26. ## Text editor
  27. my $editor = $CONFIG->{editor};
  28.  
  29. our $SCHEMA = [
  30.     #          COMMAND                 LABEL                ICON
  31.     {item => ['xfce4-screenshooter',             'Captura de tela',          '/usr/share/icons/Moka/48x48/apps/applets-screenshooter.png']},
  32.     {item => ['leafpad',             'Editor de Texto',          'leafpad']},
  33.     {item => ['thunar',        'Gerenciador de Arquivos',      'file-manager']},
  34.     {item => ['opera',    'Navegador Web',       'web-browser']},
  35.     {item => ['sakura',             'Terminal',          'terminal']},
  36.     {sep => undef},
  37.     {item => ['gmrun',             'Executar comando...',       'system-run']},
  38.     {sep => undef},
  39.     #{sep => 'Aplicativos'},
  40.    
  41. #          NAME            LABEL                ICON
  42.     {cat => ['utility',     'Acessórios', 'applications-utilities']},
  43.     {cat => ['settings',    'Configurações',    'applications-accessories']},
  44.     #{cat => ['development', 'Desenvolvimento', 'applications-development']},
  45.     #{cat => ['education',   'Educativos',   'applications-science']},
  46.     {cat => ['office',      'Escritório',      'applications-office']},
  47.     {cat => ['graphics',    'Gráficos',    'applications-graphics']},
  48.     {cat => ['network',     'Internet',     'applications-internet']},
  49.     #{cat => ['game',        'Jogos',       'applications-games']},
  50.     {cat => ['audiovideo',  'Multimídia',  'applications-multimedia']},
  51.     {cat => ['other',       'Outros',       'applications-other']},
  52.     {cat => ['system',      'Sistema',      'applications-system']},
  53.  
  54.     #            COMMAND     LABEL        ICON
  55.     {sep => undef},
  56.     {pipe => ['obbrowser', 'Pasta Pessoal', 'drive-harddisk']},
  57.  
  58.     ## Generic advanced settings
  59.     #{sep       => undef},
  60.     #{obgenmenu => ['Openbox Settings', 'applications-engineering']},
  61.     #{sep       => undef},
  62.  
  63.     ## Custom advanced settings.
  64.     {sep => undef},
  65.     {begin_cat => ['Configurações Avançadas', 'gnome-settings']},
  66.  
  67.         # obmenu-generator category.
  68.         {begin_cat => ['Obmenu-Generator', 'menu-editor']},
  69.             {item      => ["$editor ~/.config/obmenu-generator/schema.pl", 'Menu Schema', $editor]},
  70.             {item      => ["$editor ~/.config/obmenu-generator/config.pl", 'Menu Config', $editor]},
  71.  
  72.             {sep  => undef},
  73.             {item => ['obmenu-generator -p',    'Generate a pipe menu',              'menu-editor']},
  74.             {item => ['obmenu-generator -s',    'Generate a static menu',            'menu-editor']},
  75.             {item => ['obmenu-generator -p -i', 'Generate a pipe menu with icons',   'menu-editor']},
  76.             {item => ['obmenu-generator -s -i', 'Generate a static menu with icons', 'menu-editor']},
  77.             {sep  => undef},
  78.  
  79.             {item    => ['obmenu-generator -d', 'Refresh Icon Set', 'gtk-refresh']},
  80.         {end_cat => undef},
  81.  
  82.         # Openbox category.
  83.         {begin_cat => ['Openbox', 'openbox']},
  84.             {item      => ["$editor ~/.config/openbox/autostart", 'Editar autostart',    $editor]},
  85.             {item      => ["$editor ~/.config/openbox/menu.xml",  'Editar menu.xml',         $editor]},
  86.             {item      => ["$editor ~/.config/openbox/rc.xml",    'Editar rc.xml',           $editor]},
  87.             {item      => ['openbox --reconfigure',               'Reconfigurar Openbox', 'openbox']},
  88.         {end_cat => undef},
  89.  
  90.         # Configuration files.
  91.         {item      => ["lxappearance",              'Alterar Aparência',    'preferences-desktop-theme']},
  92.         {item      => ["$editor ~/.conkyrc",              'Editar conkyrc',    $editor]},
  93.         {item      => ["$editor ~/.config/tint2/tint2rc", 'Editar tint2rc', $editor]},
  94.         {item      => ['obconf',               'OpenBox Configuration Manager', 'obconf']},
  95.         {item      => ['obmenu',               'OpenBox Menu Configurator', 'obmenu']},
  96.         {item      => ['nitrogen ~/Imagens',               'Trocar Wallpaper', 'nitrogen']},
  97.  
  98.     {end_cat => undef},
  99.     {sep => undef},
  100.  
  101.     ## The xscreensaver lock command.
  102.     {item => ['xscreensaver-command -lock', 'Bloquear tela', 'lock']},
  103.  
  104.     # Replace the standard Openbox's action "Exit" with "obsession" script.
  105.     #{exit => ['Exit', 'exit']},
  106.     {item => ['obsession-logout', 'Sair',          'exit']},
  107. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement