schema.pl 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. raw: any valid Openbox XML string {raw => q(xml string)},
  9. begin_cat: begin of a category {begin_cat => ["name", "icon"]},
  10. end_cat: end of a category {end_cat => undef},
  11. obgenmenu: generic menu settings {obgenmenu => ["label", "icon"]},
  12. exit: default "Exit" action {exit => ["label", "icon"]},
  13. =cut
  14. # NOTE:
  15. # * Keys and values are case sensitive. Keep all keys lowercase.
  16. # * ICON can be a either a direct path to an icon or a valid icon name
  17. # * Category names are case insensitive. (X-XFCE and x_xfce are equivalent)
  18. require "$ENV{HOME}/.config/obmenu-generator/config.pl";
  19. ## Text editor
  20. my $editor = $CONFIG->{editor};
  21. our $SCHEMA = [
  22. # COMMAND LABEL ICON
  23. {item => ['lxterminal', 'Terminal', 'lxterminal']},
  24. {item => ['firefox', 'Web Browser', 'firefox']},
  25. {sep => 'Applications'},
  26. # NAME LABEL ICON
  27. {cat => ['utility', 'Accessories', 'applications-utilities']},
  28. {cat => ['development', 'Development', 'applications-development']},
  29. {cat => ['education', 'Education', 'applications-science']},
  30. {cat => ['game', 'Games', 'applications-games']},
  31. {cat => ['graphics', 'Graphics', 'applications-graphics']},
  32. {cat => ['audiovideo', 'Multimedia', 'applications-multimedia']},
  33. {cat => ['network', 'Network', 'applications-internet']},
  34. {cat => ['office', 'Office', 'applications-office']},
  35. {cat => ['other', 'Other', 'applications-other']},
  36. {cat => ['settings', 'Settings', 'applications-accessories']},
  37. {cat => ['system', 'System', 'applications-system']},
  38. #{cat => ['qt', 'QT Applications', 'qtlogo']},
  39. #{cat => ['gtk', 'GTK Applications', 'gnome-applications']},
  40. #{cat => ['x_xfce', 'XFCE Applications', 'applications-other']},
  41. #{cat => ['gnome', 'GNOME Applications', 'gnome-applications']},
  42. #{cat => ['consoleonly', 'CLI Applications', 'applications-utilities']},
  43. # LABEL ICON
  44. #{begin_cat => ['My category', 'cat-icon']},
  45. # ... some items ...
  46. #{end_cat => undef},
  47. # COMMAND LABEL ICON
  48. #{pipe => ['obbrowser', 'Disk', 'drive-harddisk']},
  49. ## Generic advanced settings
  50. #{sep => undef},
  51. #{obgenmenu => ['Openbox Settings', 'applications-engineering']},
  52. #{sep => undef},
  53. ## Custom advanced settings
  54. {sep => undef},
  55. {begin_cat => ['Advanced Settings', 'gnome-settings']},
  56. # Configuration files
  57. {item => ["$editor ~/.conkyrc", 'Conky RC', $editor]},
  58. {item => ["$editor ~/.config/tint2/tint2rc", 'Tint2 Panel', $editor]},
  59. # obmenu-generator category
  60. {begin_cat => ['Obmenu-Generator', 'menu-editor']},
  61. {item => ["$editor ~/.config/obmenu-generator/schema.pl", 'Menu Schema', $editor]},
  62. {item => ["$editor ~/.config/obmenu-generator/config.pl", 'Menu Config', $editor]},
  63. {sep => undef},
  64. {item => ['obmenu-generator -p', 'Generate a pipe menu', 'menu-editor']},
  65. {item => ['obmenu-generator -s', 'Generate a static menu', 'menu-editor']},
  66. {item => ['obmenu-generator -p -i', 'Generate a pipe menu with icons', 'menu-editor']},
  67. {item => ['obmenu-generator -s -i', 'Generate a static menu with icons', 'menu-editor']},
  68. {sep => undef},
  69. {item => ['obmenu-generator -d', 'Refresh Icon Set', 'gtk-refresh']},
  70. {end_cat => undef},
  71. # Openbox category
  72. {begin_cat => ['Openbox', 'openbox']},
  73. {item => ['openbox --reconfigure', 'Reconfigure Openbox', 'openbox']},
  74. {item => ["$editor ~/.config/openbox/autostart", 'Openbox Autostart', $editor]},
  75. {item => ["$editor ~/.config/openbox/rc.xml", 'Openbox RC', $editor]},
  76. {item => ["$editor ~/.config/openbox/menu.xml", 'Openbox Menu', $editor]},
  77. {end_cat => undef},
  78. {end_cat => undef},
  79. {sep => undef},
  80. # This options uses the default Openbox's action "Exit"
  81. {item => ['oblogout', 'Exit', 'exit']},
  82. ]