Initial commit
This commit is contained in:
102
home/.config/obmenu-generator/config.pl
Normal file
102
home/.config/obmenu-generator/config.pl
Normal file
@ -0,0 +1,102 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
# obmenu-generator - configuration file
|
||||
# This file will be updated automatically.
|
||||
# Any additional comment and/or indentation will be lost.
|
||||
|
||||
=for comment
|
||||
|
||||
|| FILTERING
|
||||
| skip_filename_re : Skip a .desktop file if its name matches the regex.
|
||||
Name is from the last slash to the end. (filename.desktop)
|
||||
Example: qr/^(?:gimp|xterm)\b/, # skips 'gimp' and 'xterm'
|
||||
|
||||
| skip_entry : Skip a desktop file if the value from a given key matches the regex.
|
||||
Example: [
|
||||
{key => 'Name', re => qr/(?:about|terminal)/i},
|
||||
{key => 'Exec', re => qr/^xterm/},
|
||||
],
|
||||
|
||||
| substitutions : Substitute, by using a regex, in the values of the desktop files.
|
||||
Example: [
|
||||
{key => 'Exec', re => qr/xterm/, value => 'sakura'},
|
||||
{key => 'Exec', re => qr/\\\\/, value => '\\', global => 1}, # for wine apps
|
||||
],
|
||||
|
||||
|
||||
|| ICON SETTINGS
|
||||
| icon_dirs_first : When looking for icons, look in this directories first,
|
||||
before looking in the directories of the current icon theme.
|
||||
Example: [
|
||||
"$ENV{HOME}/My icons",
|
||||
],
|
||||
|
||||
| icon_dirs_second : Look in this directories after looked in the directories of the
|
||||
current icon theme. (Before /usr/share/pixmaps)
|
||||
Example: [
|
||||
"/usr/share/icons/gnome",
|
||||
],
|
||||
|
||||
| icon_dirs_last : Look in this directories at the very last, after looked in
|
||||
/usr/share/pixmaps, /usr/share/icons/hicolor and some other
|
||||
directories.
|
||||
Example: [
|
||||
"/usr/share/icons/Tango",
|
||||
],
|
||||
|
||||
| strict_icon_dirs : A true value will make the script to look only inside the directories
|
||||
specified by you in either one of the above three options.
|
||||
|
||||
| gtk_rc_filename : Absolute path to the GTK configuration file.
|
||||
| missing_image : Use this icon for missing icons (default: gtk-missing-image)
|
||||
|
||||
|
||||
|| KEYS
|
||||
| name_keys : Valid keys for application name.
|
||||
Example: ['Name[fr]', 'GenericName[fr]', 'Name'], # french menu
|
||||
|
||||
|
||||
|| PATHS
|
||||
| desktop_files_paths : Absolute paths which contain .desktop files.
|
||||
Example: [
|
||||
'/usr/share/applications',
|
||||
"$ENV{HOME}/.local/share/applications",
|
||||
glob("$ENV{HOME}/.local/share/applications/wine/Programs/*"),
|
||||
],
|
||||
|
||||
|
||||
|| NOTES
|
||||
| Regular expressions:
|
||||
* use qr/.../ instead of '...'
|
||||
* use qr/.../i for case insensitive mode
|
||||
|
||||
=cut
|
||||
|
||||
our $CONFIG = {
|
||||
"editor" => "exo-open",
|
||||
"Linux::DesktopFiles" => {
|
||||
desktop_files_paths => [
|
||||
"/usr/share/applications",
|
||||
"/usr/local/share/applications",
|
||||
"/usr/share/applications/kde4",
|
||||
"$ENV{HOME}/.local/share/applications",
|
||||
],
|
||||
gtk_rc_filename => "$ENV{HOME}/.gtkrc-2.0",
|
||||
icon_dirs_first => undef,
|
||||
icon_dirs_last => undef,
|
||||
icon_dirs_second => undef,
|
||||
keep_unknown_categories => 1,
|
||||
skip_entry => undef,
|
||||
skip_filename_re => undef,
|
||||
skip_svg_icons => 0,
|
||||
strict_icon_dirs => undef,
|
||||
substitutions => undef,
|
||||
terminalization_format => "%s -e '%s'",
|
||||
terminalize => 1,
|
||||
unknown_category_key => "other",
|
||||
},
|
||||
"missing_icon" => "gtk-missing-image",
|
||||
"name_keys" => ["Name"],
|
||||
"terminal" => "termite",
|
||||
"VERSION" => 0.71,
|
||||
}
|
88
home/.config/obmenu-generator/schema.pl
Normal file
88
home/.config/obmenu-generator/schema.pl
Normal file
@ -0,0 +1,88 @@
|
||||
#!/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"]},
|
||||
file: include the content of an XML file {file => "/path/to/file.xml"},
|
||||
raw: any XML data supported by Openbox {raw => q(xml data)},
|
||||
begin_cat: beginning of a category {begin_cat => ["name", "icon"]},
|
||||
end_cat: end of a category {end_cat => undef},
|
||||
obgenmenu: generic menu settings {obgenmenu => ["label", "icon"]},
|
||||
exit: default "Exit" action {exit => ["label", "icon"]},
|
||||
|
||||
=cut
|
||||
|
||||
require "$ENV{HOME}/.config/obmenu-generator/config.pl";
|
||||
|
||||
## Text editor
|
||||
my $editor = $CONFIG->{editor};
|
||||
|
||||
our $SCHEMA = [
|
||||
{sep => "ArchLabs"},
|
||||
{item => ['exo-open --launch TerminalEmulator', 'Terminal', 'terminal']},
|
||||
{item => ['exo-open --launch WebBrowser ', 'Web Browser', 'firefox']},
|
||||
{item => ['exo-open --launch FileManager', 'File Manager', 'file-manager']},
|
||||
{sep => undef},
|
||||
# NAME LABEL ICON
|
||||
{cat => ['utility', 'Accessories', 'applications-utilities']},
|
||||
{cat => ['development', 'Development', 'applications-development']},
|
||||
{cat => ['education', 'Education', 'applications-science']},
|
||||
{cat => ['game', 'Games', 'applications-games']},
|
||||
{cat => ['graphics', 'Graphics', 'applications-graphics']},
|
||||
{cat => ['audiovideo', 'Multimedia', 'applications-multimedia']},
|
||||
{cat => ['network', 'Network', 'applications-internet']},
|
||||
{cat => ['office', 'Office', 'applications-office']},
|
||||
{cat => ['other', 'Other', 'applications-other']},
|
||||
{cat => ['settings', 'Settings', 'gnome-settings']},
|
||||
{cat => ['system', 'System', 'applications-system']},
|
||||
{sep => undef},
|
||||
{pipe => ['al-places-pipemenu', 'Places', 'folder']},
|
||||
{pipe => ['al-recent-files-pipemenu', 'Recent Files', 'folder-recent']},
|
||||
{sep => undef},
|
||||
{begin_cat => ['Preferences', 'theme']},
|
||||
{begin_cat => ['Openbox', 'openbox']},
|
||||
{item => ['obconf', 'Settings Editor', 'theme']},
|
||||
{item => ['kickshaw', 'Menu Editor', 'openbox']},
|
||||
{item => ['obkey', 'Keybind Editor', 'openbox']},
|
||||
{item => ['ob-autostart', 'Autostart Editor', 'openbox']},
|
||||
{sep => undef},
|
||||
{item => ["exo-open ~/.config/openbox/menu.xml", 'Edit menu.xml', 'text-xml']},
|
||||
{item => ["exo-open ~/.config/openbox/rc.xml", 'Edit rc.xml', 'text-xml']},
|
||||
{item => ["exo-open ~/.config/openbox/autostart", 'Edit autostart', 'text-xml']},
|
||||
{sep => undef},
|
||||
{item => ['openbox --restart', 'Openbox Restart', 'openbox']},
|
||||
{item => ['openbox --reconfigure', 'Openbox Reconfigure', 'openbox']},
|
||||
{end_cat => undef},
|
||||
{item => ['xfce4-appearance-settings', 'GTK Appearance', 'preferences-desktop-theme']},
|
||||
{item => ['nitrogen', 'Change Wallpaper', 'nitrogen']},
|
||||
{sep => undef},
|
||||
{pipe => ['al-compositor', 'Compositor', 'compton']},
|
||||
{pipe => ['al-polybar-pipemenu', 'Polybar', 'polybar']},
|
||||
{pipe => ['al-conky-pipemenu', 'Conky', 'conky']},
|
||||
{pipe => ['al-tint2-pipemenu', 'Tint2', 'tint2']},
|
||||
{item => ['rofi-theme-selector', 'Rofi Theme', 'theme']},
|
||||
{sep => undef},
|
||||
{item => ['xfce4-settings-manager', 'Xfce4 Settings Manager', 'preferences-desktop']},
|
||||
{item => ['pavucontrol', 'Pulseaudio Preferences', 'multimedia-volume-control']},
|
||||
{item => ['exo-preferred-applications', 'Preferred Applications', 'preferred-applications']},
|
||||
{item => ['arandr', 'Screen Layout Editor', 'display']},
|
||||
{end_cat => undef},
|
||||
{sep => undef},
|
||||
{begin_cat => ['Menu Generator', 'menu-editor']},
|
||||
{item => ["$editor ~/.config/obmenu-generator/schema.pl", 'Menu Layout', 'text-x-source']},
|
||||
{sep => undef},
|
||||
{item => ['obmenu-generator -p', 'Generate a pipe menu', 'menu-editor']},
|
||||
{item => ['obmenu-generator -s -c', 'Generate a static menu', 'menu-editor']},
|
||||
{end_cat => undef},
|
||||
{item => ["switchmenu -static", 'Switch Menu', 'menu-editor']},
|
||||
{pipe => ['al-kb-pipemenu', 'Display Keybinds', 'cs-keyboard']},
|
||||
{pipe => ['al-help-pipemenu', 'Help and Info', 'info']},
|
||||
{sep => undef},
|
||||
{item => ['i3lock-fancy -p', 'Lock Screen', 'lock']},
|
||||
{item => ['oblogout', 'Exit Openbox', 'exit']},
|
||||
]
|
Reference in New Issue
Block a user