schema.pl 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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(...)},
  10. beg: begin of a category {beg => ["name", "icon"]},
  11. end: end of a category {end => 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', 'system-file-manager']},
  25. {item => ['xterm', 'Terminal', 'utilities-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. # LABEL ICON
  42. #{beg => ['My category', 'cat-icon']},
  43. # ... some items ...
  44. #{end => undef},
  45. # COMMAND LABEL ICON
  46. #{pipe => ['obbrowser', 'Disk', 'drive-harddisk']},
  47. ## Generic advanced settings
  48. #{sep => undef},
  49. #{obgenmenu => ['Openbox Settings', 'applications-engineering']},
  50. #{sep => undef},
  51. ## Custom advanced settings
  52. {sep => undef},
  53. {beg => ['Advanced Settings', 'applications-engineering']},
  54. # Configuration files
  55. {item => ["$editor ~/.conkyrc", 'Conky RC', 'text-x-generic']},
  56. {item => ["$editor ~/.config/tint2/tint2rc", 'Tint2 Panel', 'text-x-generic']},
  57. # obmenu-generator category
  58. {beg => ['Obmenu-Generator', 'accessories-text-editor']},
  59. {item => ["$editor ~/.config/obmenu-generator/schema.pl", 'Menu Schema', 'text-x-generic']},
  60. {item => ["$editor ~/.config/obmenu-generator/config.pl", 'Menu Config', 'text-x-generic']},
  61. {sep => undef},
  62. {item => ['obmenu-generator -s -c', 'Generate a static menu', 'accessories-text-editor']},
  63. {item => ['obmenu-generator -s -i -c', 'Generate a static menu with icons', 'accessories-text-editor']},
  64. {sep => undef},
  65. {item => ['obmenu-generator -p', 'Generate a dynamic menu', 'accessories-text-editor']},
  66. {item => ['obmenu-generator -p -i', 'Generate a dynamic menu with icons', 'accessories-text-editor']},
  67. {sep => undef},
  68. {item => ['obmenu-generator -d', 'Refresh cache', 'view-refresh']},
  69. {end => undef},
  70. # Openbox category
  71. {beg => ['Openbox', 'openbox']},
  72. {item => ["$editor ~/.config/openbox/autostart", 'Openbox Autostart', 'text-x-generic']},
  73. {item => ["$editor ~/.config/openbox/rc.xml", 'Openbox RC', 'text-x-generic']},
  74. {item => ["$editor ~/.config/openbox/menu.xml", 'Openbox Menu', 'text-x-generic']},
  75. {item => ['openbox --reconfigure', 'Reconfigure Openbox', 'openbox']},
  76. {end => undef},
  77. {end => undef},
  78. {sep => undef},
  79. ## The xscreensaver lock command
  80. {item => ['xscreensaver-command -lock', 'Lock', 'system-lock-screen']},
  81. ## This option uses the default Openbox's "Exit" action
  82. {exit => ['Exit', 'application-exit']},
  83. ## This uses the 'oblogout' menu
  84. # {item => ['oblogout', 'Exit', 'application-exit']},
  85. ]