From 17c23577b823bced60ff0673d31611a1c7738fdd Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Sat, 9 Jan 2016 22:55:10 +0800 Subject: Rewrite openbox menu.xml; small update to rc.xml --- _config/openbox/menu.xml | 324 ++++++++-------------------- _config/openbox/pipemenus/obpipemenu-places | 102 --------- _config/openbox/rc.xml | 6 +- _config/openbox/scripts/pipemenu-places | 102 +++++++++ _config/openbox/scripts/xdg-menu | 98 ++++----- 5 files changed, 243 insertions(+), 389 deletions(-) delete mode 100755 _config/openbox/pipemenus/obpipemenu-places create mode 100755 _config/openbox/scripts/pipemenu-places diff --git a/_config/openbox/menu.xml b/_config/openbox/menu.xml index c6fd3a7..e13a5a3 100644 --- a/_config/openbox/menu.xml +++ b/_config/openbox/menu.xml @@ -1,236 +1,90 @@ - - - - - - - - dmenu.sh - - - - - - - - urxvtc - - - - - - - firefox - - - - - - - thunar - - - - - - - leafpad - - - - - - - - - xarchiver - - - - - - - gvim - - - - - - - leafpad - - - - - - - lxterminal - - - - - - - - scrot 'ly_%Y%m%d_$wx$h.png' -e 'mv $f ~/ & geeqie ~/$f' - - - - - - - scrot -d 3 'ly_%Y%m%d_$wx$h.png' -e 'mv $f ~/ & geeqie ~/$f' - - - - - - - scrot -d 10 'ly_%Y%m%d_$wx$h.png' -e 'mv $f ~/ & geeqie ~/$f' - - - - - - - scrot -s 'ly_%Y%m%d_$wx$h.png' -e 'mv $f ~/ & geeqie ~/$f' - - - - - - - scrot -bud 3 'ly_%Y%m%d_$wx$h.png' -e 'mv $f ~/ & geeqie ~/$f' - - - - - - - - - - - - - - - ~/.config/openbox/scripts/xcompmgr.sh unset - - - - - - - ~/.config/openbox/scripts/xcompmgr.sh set - - - - - - - ~/.config/openbox/scripts/xcompmgr.sh setshaded - - - - - - - ~/.config/openbox/scripts/xcompmgr.sh setshadowshade - - - - - - - - - gvim ~/.config/openbox/menu.xml - - - - - - - gvim ~/.config/openbox/rc.xml - - - - - - - gvim ~/.config/openbox/autostart.sh - - - - - - - - obconf - - - - - - - - gvim ~/.config/tint2/tint2rc - - - - - - - lxappearance - - - - - - - - - - - - - - - - - - + + + + + + + + + + rofi -show run + + + + + + urxvtc || urxvt || x-terminal-emulator + + + + + x-www-browser + + + + + thunar + + + + + gvim || mousepad + + + + + + + scrot -e 'mv $f ~/pictures' + + + + + scrot -d 3 -e 'mv $f ~/pictures' + + + + + scrot -s -e 'mv $f ~/pictures' + + + + + scrot -bud 2 -e 'mv $f ~/pictures' + + + + + + + + + + obconf + + + + + + + + + + + + + + + + + diff --git a/_config/openbox/pipemenus/obpipemenu-places b/_config/openbox/pipemenus/obpipemenu-places deleted file mode 100755 index 3b73618..0000000 --- a/_config/openbox/pipemenus/obpipemenu-places +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/perl -# Recursively browse filesystem through openbox3 pipe menus -#### Usage: add -# -# to your .config/openbox/menu.xml -#### CAVEAT #### -# This script was hacked on exclusively in stints between the hours of -# 4 and 5 in the morning. Quality may have suffered. -#### -# Script by dircha from ob list on 05/17/04 -# suggested improvements by John Russell on 05/17/04 implemented -# a year later by Kacper Wysocki. -# 05/30/05 - Kacper Wysocki -# - opens files with 'rox', which launches appropriate file handler -# - hidden directories now stay hidden -# - spaces, ampersands in dir- and filenames are escaped -# - newlines at each entry to make output a little readable -# 06/04/05 - Kacper Wysocki -# - use $0 for scriptname -# - use $ENV{'HOME'} as default path -# - now follows symlinks - -use strict; - -# Command to lauch files with -my $cmd = "thunar"; - -my $path = $ARGV[0]; -$path = "$ENV{'HOME'}" if $path eq ""; -my @files = split /\n/, `ls -1p '$path'`; -mk_menu_element($path, @files); - -sub mk_menu_element { - my ($path, @files) = @_; - - print "\n"; - - # "Browse here..." lauches this dir - print "". - "\n\t". - "\n\t\t$cmd '$path'". - "\n\t". - "\n\n". - ""; - - foreach $_ (@files) { - my $length = length $_; - my $last_c = substr $_, $length - 1, 1; - - if ($last_c eq "/") { - print mk_dir_element($path, substr $_, 0, $length - 1); - } elsif ($last_c eq "@") { - print mk_sym_element($path, substr $_, 0, $length - 1); - } else { - print mk_file_element($path, $_); - } - } - print "\n"; -} - -sub mk_dir_element { - my ($path, $name) = @_; - # escape ampersand and space in pathnames - $path =~ s/&/&/g; - $name =~ s/&/&/g; - $path =~ s/ /\\ /g; - $name =~ s/ /\\ /g; - - return "\n"; -} - -sub mk_sym_element { - my ($path, $name) = @_; - # escape ampersand in pathnames - $path =~ s/&/&/g; - $name =~ s/&/&/g; - - # Follow symlinks instead of opening links in rox. - return "\n"; -=cut - return "". - "\n\t". - "\n\t\t$cmd '$path/$name'". - "\n\t" - . "\n\n"; -=cut -} - -sub mk_file_element { - my ($path, $name) = @_; - my $label = $name; - # escape ampersand in pathnames - $path =~ s/&/&/g; - $name =~ s/&/&/g; - - return "". - "\n\t". - "\n\t\t$cmd '$path/$name'". - "\n\t" - . "\n\n"; -} - diff --git a/_config/openbox/rc.xml b/_config/openbox/rc.xml index 5b86ed7..d7398d7 100644 --- a/_config/openbox/rc.xml +++ b/_config/openbox/rc.xml @@ -53,7 +53,7 @@ - Clearlooks + 1977-Black DSLIMC - xrandr --output VGA1 --auto --right-of LVDS1 + arandr - ( sleep 0.5 && xset dpms force off ) + sh -c "sleep 0.5 && xset dpms force off" diff --git a/_config/openbox/scripts/pipemenu-places b/_config/openbox/scripts/pipemenu-places new file mode 100755 index 0000000..812eb27 --- /dev/null +++ b/_config/openbox/scripts/pipemenu-places @@ -0,0 +1,102 @@ +#!/usr/bin/env perl +# Recursively browse filesystem through openbox3 pipe menus +#### Usage: add +# +# to your .config/openbox/menu.xml +#### CAVEAT #### +# This script was hacked on exclusively in stints between the hours of +# 4 and 5 in the morning. Quality may have suffered. +#### +# Script by dircha from ob list on 05/17/04 +# suggested improvements by John Russell on 05/17/04 implemented +# a year later by Kacper Wysocki. +# 05/30/05 - Kacper Wysocki +# - opens files with 'rox', which launches appropriate file handler +# - hidden directories now stay hidden +# - spaces, ampersands in dir- and filenames are escaped +# - newlines at each entry to make output a little readable +# 06/04/05 - Kacper Wysocki +# - use $0 for scriptname +# - use $ENV{'HOME'} as default path +# - now follows symlinks + +use strict; + +# Command to lauch files with +my $cmd = "thunar"; + +my $path = $ARGV[0]; +$path = "$ENV{'HOME'}" if $path eq ""; +my @files = split /\n/, `ls -1p '$path'`; +mk_menu_element($path, @files); + +sub mk_menu_element { + my ($path, @files) = @_; + + print "\n"; + + # "Browse here..." lauches this dir + print "". + "\n\t". + "\n\t\t$cmd '$path'". + "\n\t". + "\n\n". + ""; + + foreach $_ (@files) { + my $length = length $_; + my $last_c = substr $_, $length - 1, 1; + + if ($last_c eq "/") { + print mk_dir_element($path, substr $_, 0, $length - 1); + } elsif ($last_c eq "@") { + print mk_sym_element($path, substr $_, 0, $length - 1); + } else { + print mk_file_element($path, $_); + } + } + print "\n"; +} + +sub mk_dir_element { + my ($path, $name) = @_; + # escape ampersand and space in pathnames + $path =~ s/&/&/g; + $name =~ s/&/&/g; + $path =~ s/ /\\ /g; + $name =~ s/ /\\ /g; + + return "\n"; +} + +sub mk_sym_element { + my ($path, $name) = @_; + # escape ampersand in pathnames + $path =~ s/&/&/g; + $name =~ s/&/&/g; + + # Follow symlinks instead of opening links in rox. + return "\n"; +=cut + return "". + "\n\t". + "\n\t\t$cmd '$path/$name'". + "\n\t" + . "\n\n"; +=cut +} + +sub mk_file_element { + my ($path, $name) = @_; + my $label = $name; + # escape ampersand in pathnames + $path =~ s/&/&/g; + $name =~ s/&/&/g; + + return "". + "\n\t". + "\n\t\t$cmd '$path/$name'". + "\n\t" + . "\n\n"; +} + diff --git a/_config/openbox/scripts/xdg-menu b/_config/openbox/scripts/xdg-menu index 05d6cec..0a8c1bc 100755 --- a/_config/openbox/scripts/xdg-menu +++ b/_config/openbox/scripts/xdg-menu @@ -1,49 +1,49 @@ -#!/usr/bin/env python -# -# Copyright (C) 2008 Red Hat, Inc. -# -# 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 2 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 . -# -# Author(s): Luke Macken -# Miroslav Lichvar - - -import gmenu, re, sys -from xml.sax.saxutils import escape - -def walk_menu(entry): - if entry.get_type() == gmenu.TYPE_DIRECTORY: - print '' \ - % (escape(entry.menu_id), escape(entry.get_name())) - map(walk_menu, entry.get_contents()) - print '' - elif entry.get_type() == gmenu.TYPE_ENTRY and not entry.is_excluded: - print ' ' % escape(entry.get_name()) - command = re.sub(' [^ ]*%[fFuUdDnNickvm]', '', entry.get_exec()) - if entry.launch_in_terminal: - command = 'xterm -title "%s" -e %s' % \ - (entry.get_name(), command) - print ' ' + \ - '%s' % escape(command) - print ' ' - -if len(sys.argv) > 1: - menu = sys.argv[1] + '.menu' -else: - menu = 'applications.menu' - -print '' -print '' -map(walk_menu, gmenu.lookup_tree(menu).root.get_contents()) -print '' +#!/usr/bin/env python +# +# Copyright (C) 2008 Red Hat, Inc. +# +# 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 2 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 . +# +# Author(s): Luke Macken +# Miroslav Lichvar + + +import gmenu, re, sys +from xml.sax.saxutils import escape + +def walk_menu(entry): + if entry.get_type() == gmenu.TYPE_DIRECTORY: + print '' \ + % (escape(entry.menu_id), escape(entry.get_name())) + map(walk_menu, entry.get_contents()) + print '' + elif entry.get_type() == gmenu.TYPE_ENTRY and not entry.is_excluded: + print ' ' % escape(entry.get_name()) + command = re.sub(' [^ ]*%[fFuUdDnNickvm]', '', entry.get_exec()) + if entry.launch_in_terminal: + command = 'xterm -title "%s" -e %s' % \ + (entry.get_name(), command) + print ' ' + \ + '%s' % escape(command) + print ' ' + +if len(sys.argv) > 1: + menu = sys.argv[1] + '.menu' +else: + menu = 'applications.menu' + +print '' +print '' +map(walk_menu, gmenu.lookup_tree(menu).root.get_contents()) +print '' -- cgit v1.2.2