schema.pl 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. #!/usr/bin/perl
  2. # obmenu-generator - schema file
  3. =for comment
  4. item: add an item inside the menu {item => ["command", "label", "icon"]},
  5. cat: add a category inside the menu {cat => ["name", "label", "icon"]},
  6. sep: horizontal line separator {sep => undef}, {sep => "label"},
  7. pipe: a pipe menu entry {pipe => ["command", "label", "icon"]},
  8. file: include the content of an XML file {file => "/path/to/file.xml"},
  9. raw: any XML data supported by Openbox {raw => q(xml data)},
  10. begin_cat: begin of a category {begin_cat => ["name", "icon"]},
  11. end_cat: end of a category {end_cat => undef},
  12. obgenmenu: generic menu settings {obgenmenu => ["label", "icon"]},
  13. exit: default "Exit" action {exit => ["label", "icon"]},
  14. =cut
  15. # NOTE:
  16. # * Keys and values are case sensitive. Keep all keys lowercase.
  17. # * ICON can be a either a direct path to an icon or a valid icon name
  18. # * Category names are case insensitive. (X-XFCE and x_xfce are equivalent)
  19. require "$ENV{HOME}/.config/obmenu-generator/config.pl";
  20. ## Text editor
  21. my $editor = $CONFIG->{editor};
  22. our $SCHEMA = [
  23. # COMMAND LABEL ICON
  24. {item => ['xdg-open .', 'File Manager', 'file-manager']},
  25. {item => ['xterm', 'Terminal', 'terminal']},
  26. {item => ['xdg-open http://', 'Web Browser', 'web-browser']},
  27. {item => ['gmrun', 'Run command', 'system-run']},
  28. {sep => 'Categories'},
  29. # NAME LABEL ICON
  30. {cat => ['utility', 'Accessories', 'applications-utilities']},
  31. {cat => ['development', 'Development', 'applications-development']},
  32. {cat => ['education', 'Education', 'applications-science']},
  33. {cat => ['game', 'Games', 'applications-games']},
  34. {cat => ['graphics', 'Graphics', 'applications-graphics']},
  35. {cat => ['audiovideo', 'Multimedia', 'applications-multimedia']},
  36. {cat => ['network', 'Network', 'applications-internet']},
  37. {cat => ['office', 'Office', 'applications-office']},
  38. {cat => ['other', 'Other', 'applications-other']},
  39. {cat => ['settings', 'Settings', 'applications-accessories']},
  40. {cat => ['system', 'System', 'applications-system']},
  41. #{cat => ['qt', 'QT Applications', 'qt4logo']},
  42. #{cat => ['gtk', 'GTK Applications', 'gnome-applications']},
  43. #{cat => ['x_xfce', 'XFCE Applications', 'applications-other']},
  44. #{cat => ['gnome', 'GNOME Applications', 'gnome-applications']},
  45. #{cat => ['consoleonly', 'CLI Applications', 'applications-utilities']},
  46. # LABEL ICON
  47. #{begin_cat => ['My category', 'cat-icon']},
  48. # ... some items ...
  49. #{end_cat => undef},
  50. # COMMAND LABEL ICON
  51. #{pipe => ['obbrowser', 'Disk', 'drive-harddisk']},
  52. ## Generic advanced settings
  53. #{sep => undef},
  54. #{obgenmenu => ['Openbox Settings', 'openbox']},
  55. #{sep => undef},
  56. ## Custom advanced settings
  57. {sep => undef},
  58. {begin_cat => ['Advanced Settings', 'gnome-settings']},
  59. # Configuration files
  60. {item => ["$editor ~/.conkyrc", 'Conky RC', 'text-x-source']},
  61. {item => ["$editor ~/.config/tint2/tint2rc", 'Tint2 Panel', 'text-x-source']},
  62. # obmenu-generator category
  63. {begin_cat => ['Obmenu-Generator', 'menu-editor']},
  64. {item => ["$editor ~/.config/obmenu-generator/schema.pl", 'Menu Schema', 'text-x-source']},
  65. {item => ["$editor ~/.config/obmenu-generator/config.pl", 'Menu Config', 'text-x-source']},
  66. {sep => undef},
  67. {item => ['obmenu-generator -p', 'Generate a pipe menu', 'menu-editor']},
  68. {item => ['obmenu-generator -s -c', 'Generate a static menu', 'menu-editor']},
  69. {item => ['obmenu-generator -p -i', 'Generate a pipe menu with icons', 'menu-editor']},
  70. {item => ['obmenu-generator -s -i -c', 'Generate a static menu with icons', 'menu-editor']},
  71. {sep => undef},
  72. {item => ['obmenu-generator -d', 'Refresh Icon Set', 'gtk-refresh']},
  73. {end_cat => undef},
  74. # Openbox category
  75. {begin_cat => ['Openbox', 'openbox']},
  76. {item => ['openbox --reconfigure', 'Reconfigure Openbox', 'openbox']},
  77. {item => ["$editor ~/.config/openbox/autostart", 'Openbox Autostart', 'shellscript']},
  78. {item => ["$editor ~/.config/openbox/rc.xml", 'Openbox RC', 'text-xml']},
  79. {item => ["$editor ~/.config/openbox/menu.xml", 'Openbox Menu', 'text-xml']},
  80. {end_cat => undef},
  81. {end_cat => undef},
  82. {sep => undef},
  83. ## The xscreensaver lock command
  84. {item => ['xscreensaver-command -lock', 'Lock', 'lock']},
  85. ## This option uses the default Openbox's action "Exit"
  86. {exit => ['Exit', 'exit']},
  87. ## This uses the 'oblogout' menu
  88. # {item => ['oblogout', 'Exit', 'exit']},
  89. ]