Skip to content

Instantly share code, notes, and snippets.

Created September 13, 2015 13:32
Show Gist options
  • Save anonymous/a42c4087d9be3d8edfff to your computer and use it in GitHub Desktop.
Save anonymous/a42c4087d9be3d8edfff to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
# obmenu-generator - configuration file
# This file will be updated automatically every time when is needed.
# 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 destkop 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 module 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 the item names.
Example: ['Name[fr]', 'GenericName[fr]', 'Name'], # french menu
|| PATHS
| desktop_files_paths : Absolute paths which contains .desktop files.
Example: [
'/usr/share/applications',
"$ENV{HOME}/.local/share/applications",
glob("$ENV{HOME}/.local/share/applications/wine/Programs/*"),
],
|| NOTES
| Regular expressions:
* use qr/RE/ instead of 'RE'
* use qr/RE/i for case insenstive mode
=cut
our $CONFIG = {
"editor" => "leafpad",
"Linux::DesktopFiles" => {
desktop_files_paths => ["/usr/share/applications"],
gtk_rc_filename => "/home/user/.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 => 1,
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" => "lxterminal",
"VERSION" => 0.59,
}
require '/home/user/.config/obmenu-generator/config.pl';
our $SCHEMA = [
{sep => 'Apps :: Menu'},
# COMMAND LABEL ICON
{item => ['pcmanfm', 'File Manager', 'file-manager']},
{item => ['lxterminal --geometry=105x25', 'Terminal', 'terminal']},
{item => ['subl3', 'Editor', 'text-editor']},
{item => ['deadbeef', 'DeadBeeF', 'deadbeef']},
{item => ['pidgin', 'Pidgin', 'pidgin']},
{item => ['/home/user/.telegram-6b3c6d017754f745c6740365d29de1ba/webapprt-stub', 'Telegram', 'telegram']},
{item => ['firefox', 'Web Browser', 'web-browser']},
{item => ['gmrun', 'Run command', 'system-run']},
{sep => undef},
# NAME LABEL ICON
{raw => q(<menu id="Security" label="Security">)},
{raw => q(<item label="Dirbuster"><action name="Execute"><execute>dirbuster</execute></action></item>)},
{raw => q(<item label="ZAP OWASP"><action name="Execute"><execute>zaproxy</execute></action></item>)},
{raw => q(<item label="Radmin"><action name="Execute"><execute>wine /home/user/.wine/drive_c/Program\ Files/Radmin\ Viewer\ 3/Radmin.exe</execute></action></item>)},
{raw => q(</menu>)},
{cat => ['network', 'Network', 'applications-internet']},
{cat => ['development', 'Development', 'applications-development']},
{cat => ['game', 'Games', 'applications-games']},
{cat => ['graphics', 'Graphics', 'applications-graphics']},
{cat => ['audiovideo', 'Multimedia', 'applications-multimedia']},
{cat => ['office', 'Office', 'applications-office']},
{cat => ['settings', 'Settings', 'applications-accessories']},
{cat => ['system', 'System', 'applications-system']},
{cat => ['utility', 'Accessories', 'applications-utilities']},
{cat => ['education', 'Education', 'applications-science']},
{raw => q(<menu execute="~/.config/openbox/pipemenus/obpipemenu-places ~/" id="places" label="Places"/>)},
{raw => q(<menu execute="~/.config/openbox/pipemenus/obrecent.sh ~/" id="recent" label="Recent Files"/>)},
{raw => q(<menu id="Preferences" label="Preferences">)},
{raw => q(<menu id="Screenshot" label="Take Screenshot">)},
{raw => q(<item label="Now"><action name="Execute"><execute>scrot '%Y-%m-%d--%s_$wx$h_scrot.png' -e 'mv $f ~/ &amp; gpicview ~/$f'</execute></action></item>)},
{raw => q(<item label="In 10 Seconds..."><action name="Execute"><execute>scrot -d 10 '%Y-%m-%d--%s_$wx$h_scrot.png' -e 'mv $f ~/Pictures/ &amp; gpicview ~/$f'</execute></action></item>)},
{raw => q(<item label="Selected Area... click &amp; drag mouse"><action name="Execute"><execute>scrot -s '%Y-%m-%d--%s_$wx$h_scrot.png' -e 'mv $f ~/Pictures/Screens/ &amp; gpicview ~/$f'</execute></action></item>)},
{raw => q(</menu>)},
{obgenmenu => 'Openbox Settings'},
{raw => q(</menu>)},
{sep => undef},
{raw => q(<menu id="Exit" label="Exit">)},
# This options uses the default OpenBox action "Exit"
{exit => ['Exit', 'exit']},
{item => ['systemctl reboot', 'Reboot', undef]},
{item => ['systemctl poweroff', 'Shutdown', undef]},
{raw => q(</menu>)},
]
# Backgrounds
# Background 1
rounded = 0
border_width = 1
background_color = #2d2d2d 100
border_color = #484848 100
# Background 2
rounded = 0
border_width = 0
background_color = #d64937 100
border_color = #000000 100
# Panel
panel_items = TSC
panel_size = 100% 30
panel_margin = 0 0
panel_padding = 0 0 10
panel_background_id = 1
wm_menu = 1
panel_dock = 0
panel_position = bottom center horizontal
panel_layer = normal
panel_monitor = all
autohide = 0
autohide_show_timeout = 0.3
autohide_hide_timeout = 0.5
autohide_height = 2
strut_policy = follow_size
panel_window_name = tint2
disable_transparency = 0
font_shadow = 0
# Taskbar
taskbar_mode = single_desktop
taskbar_padding = 0 0 10
taskbar_background_id = 0
taskbar_active_background_id = 0
taskbar_name = 0
taskbar_hide_inactive_tasks = 0
taskbar_hide_different_monitor = 0
taskbar_name_padding = 0 0
taskbar_name_background_id = 0
taskbar_name_active_background_id = 0
taskbar_name_font = Sans 12
taskbar_name_font_color = #000000 100
taskbar_name_active_font_color = #000000 100
taskbar_distribute_size = 0
taskbar_sort_order = none
task_align = left
# Task
task_text = 1
task_icon = 1
task_centered = 0
urgent_nb_of_blink = 20
task_maximum_size = 200 32
task_padding = 10 4 10
task_font = Droid Sans 9
task_tooltip = 0
task_font_color = #dcdcdc 100
task_active_font_color = #ffffff 100
task_urgent_font_color = #ffffff 100
task_iconified_font_color = #dcdcdc 80
task_icon_asb = 100 0 0
task_active_icon_asb = 100 0 0
task_urgent_icon_asb = 100 0 0
task_iconified_icon_asb = 100 0 0
task_background_id = 0
task_active_background_id = 2
task_urgent_background_id = 0
task_iconified_background_id = 0
mouse_left = toggle_iconify
mouse_middle = none
mouse_right = close
mouse_scroll_up = toggle
mouse_scroll_down = iconify
# System tray (notification area)
systray_padding = 0 6 15
systray_background_id = 0
systray_sort = left2right
systray_icon_size = 16
systray_icon_asb = 100 0 0
systray_monitor = 1
# Launcher
launcher_padding = 0 0 0
launcher_background_id = 0
launcher_icon_size = 0
launcher_icon_asb = 0 -100 -100
launcher_icon_theme_override = 0
startup_notifications = 0
launcher_tooltip = 0
# Clock
time1_format = %H:%M
time2_format =
time1_font = Droid Sans 9
time1_timezone =
time2_timezone =
time2_font = Sans 12
clock_font_color = #ffffff 100
clock_padding = 10 6
clock_background_id = 2
clock_tooltip =
clock_tooltip_timezone =
clock_lclick_command = gsimplecal
clock_rclick_command =
clock_mclick_command =
clock_uwheel_command =
clock_dwheel_command =
# Battery
battery_low_status = 20
battery_low_cmd = notify-send "battery low"
bat1_font = Liberation Mono 8
bat2_font = Liberation Mono 8
battery_font_color = #b5b5b5 100
battery_padding = 2 0
battery_background_id = 0
battery_hide = 96
battery_lclick_command =
battery_rclick_command =
battery_mclick_command =
battery_uwheel_command =
battery_dwheel_command =
# Tooltip
tooltip_show_timeout = 0
tooltip_hide_timeout = 0
tooltip_padding = 2 2
tooltip_background_id = 2
tooltip_font_color = #ffffff 100
tooltip_font = Droid Sans 9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment