#!/usr/bin/perl # Copyright (C) 2011-2016 Daniel "Trizen" Șuteu . # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # Openbox Menu Generator # A fast pipe/static menu generator for the Openbox Window Manager. # Edited on 07 December 2014 by Bob Currey # added cmd line option -t "Menu Label Text" with default of "Applications" # Program: obmenu-generator # License: GPLv3 # Created on: 25 March 2011 # Latest edit on: 09 February 2016 # Website: https://github.com/trizen/obmenu-generator #use 5.014; #use strict; #use warnings; require Linux::DesktopFiles; # >= 0.09 my $pkgname = 'obmenu-generator'; my $version = 0.66; our ($CONFIG, $SCHEMA); my $output_h = \*STDOUT; my ($pipe, $static, $icons, $reconfigure, $update_config, $reconf_openbox); my $home_dir = $ENV{HOME} || $ENV{LOGDIR} || (getpwuid($<))[7] || `echo -n ~`; my $xdg_config_home = "$home_dir/.config"; my $menu_id = "root-menu"; my $menu_label_text = "Applications"; my $config_dir = "$xdg_config_home/$pkgname"; my $schema_file = "$config_dir/schema.pl"; my $config_file = "$config_dir/config.pl"; my $openbox_conf = "$xdg_config_home/openbox"; my $menufile = "$openbox_conf/menu.xml"; my $icons_db = "$config_dir/icons.db"; my $cache_db = "$config_dir/cache.db"; sub usage { print <<"HELP"; usage: $0 [options] options: -p : (re)generate a pipe menu -s : (re)generate a static menu -i : include icons in menus -m : menu id (default: 'root-menu') -t