summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <f-p@gmx.at>2008-11-11 22:10:33 +0100
committerFlorian Pritz <f-p@gmx.at>2008-11-11 22:10:33 +0100
commitda2d0f071e5cd37b6f4f04906b5f2006cec57a70 (patch)
tree932fc5ec2212304f3266229db78ec29a598ef799
parente443ba89d07541516d7bd80f78cb0e16e535e870 (diff)
downloadbin-da2d0f071e5cd37b6f4f04906b5f2006cec57a70.tar.gz
bin-da2d0f071e5cd37b6f4f04906b5f2006cec57a70.tar.xz
updated and added soem things
-rwxr-xr-xbashrun3
-rwxr-xr-xgrank91
-rwxr-xr-xinfo.pl678
-rw-r--r--logos.pl37
-rwxr-xr-xpagerankbin0 -> 8930 bytes
-rwxr-xr-xprank35
-rwxr-xr-xset-background.sh1
-rwxr-xr-xssh-mount.sh4
-rwxr-xr-xssh-unmount.sh1
9 files changed, 425 insertions, 425 deletions
diff --git a/bashrun b/bashrun
index 99e369c..b571a52 100755
--- a/bashrun
+++ b/bashrun
@@ -1,5 +1,4 @@
-
-#!/bin/dash
+#!/bin/bash
#
# usage: bashrun [geometry] (default: 40x1)
#
diff --git a/grank b/grank
new file mode 100755
index 0000000..3127f3c
--- /dev/null
+++ b/grank
@@ -0,0 +1,91 @@
+#!/bin/bash
+
+# grank - find your google rank index
+#
+# 2008 - Mike Golvach - eggi@comcast.net
+#
+# Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
+#
+
+if [ $# -lt 2 -a $# -ne 0 ]
+then
+ echo "Usage: $0 URL Search_Term(s)"
+ echo "URL with or with http(s)://, ftp://, etc"
+ exit 1
+fi
+
+if [ $# -eq 0 ]
+then
+ while read x y
+ do
+ url=$x
+ search_terms=$y
+ $0 $x "$y"
+ done
+ exit 0
+else
+ url=$1
+ shift
+ search_terms=$@
+fi
+
+base=0
+num=1
+start=0
+multiple_search=0
+not_found=0
+
+for x in $search_terms
+do
+ if [ $multiple_search -eq 0 ]
+ then
+ search_string=$x
+ multiple_search=1
+ else
+ search_string="${search_string}+$x"
+ fi
+done
+
+echo "Searching For Google Index For $url With Search Terms: $search_terms..."
+echo
+
+num_results=`wget -q --user-agent=Firefox -O - http://www.google.com/search?q=$search_string\&hl=en\&safe=off\&pwst=1\&start=$start\&sa=N|awk '{ if ( $0 ~ /of about <b>.*<\/b> for/ ) print $0 }'|awk -F"of about" '{print $2}'|awk -F"<b>" '{print $2}'|awk -F"</b>" '{print $1}'`
+
+while :;
+do
+ if [ $not_found -eq 1 ]
+ then
+ break
+ fi
+ wget -q --user-agent=Firefox -O - http://www.google.com/search?q=$search_string\&num=100\&hl=en\&safe=off\&pwst=1\&start=$start\&sa=N|sed 's/<a href=\"\([^\"]*\)\" class=l>/\n\1\n/g'|awk -v num=$num -v base=$base '{ if ( $1 ~ /^http/ ) print base,num++,$NF }'|awk '{ if ( $2 < 10 ) print "Google Index Number " $1 "0" $2 " For Page: " $3; else if ( $2 == 100 ) print "Google Index Number " $1+1 "00 For Page: " $3;else print "Google Index Number " $1 $2 " For Page: " $3 }'|grep -i $url
+ if [ $? -ne 0 ]
+ then
+ let start=$start+100
+ if [ $start -eq 1000 ]
+ then
+ not_found=1
+ if [ $not_found -eq 1 ]
+ then
+ break
+ fi
+ fi
+ let base=$base+1
+ first_page=0
+ else
+ break
+ fi
+
+ let sleep_time=${RANDOM}/600
+ echo "Not In Top $start Results: Sleeping $sleep_time seconds..."
+ sleep $sleep_time
+done
+
+if [ $not_found -eq 1 ]
+then
+ echo "Not Found In First 1,000 Index Results - Google's Hard Limit"
+ echo
+fi
+
+echo "Out Of Approximately $num_results Results"
+echo
+exit 0
diff --git a/info.pl b/info.pl
index 0eb1bb1..d29aa95 100755
--- a/info.pl
+++ b/info.pl
@@ -1,453 +1,285 @@
#!/usr/bin/perl
-# http://bbs.archlinux.org/viewtopic.php?pid=395002
-use Switch;
-use strict;
-use File::Basename;
-
-####################
-## Config options ##
-####################
-
-## What distro logo to use to use, Available "Archlinux Debian Ubuntu None" ##
-my $distro = "Archlinux";
-my $myArchVersion = "ArchLinux (Core Dump)";
-
-## what values to display. Use "OS Kernel DE WM win_theme Theme Font Icons" ##
-my $display = "OS Kernel DE WM Win_theme Theme Icons Font Background";
-
-## Takes a screen shot if set to 0 ##
-my $shot = 0;
-## Command to run to take screen shot ##
-my $command = "scrot -d 10";
-
-## What colors to use for the variables. ##
-my $textcolor = "\e[0m";
-
-## Prints little debugging messages if set to 0 ##
-my $quite = 1;
-
-
+# @title : Theme info script 0.1.2 revisited
+# @author: rab
+# @date : 08/04/08
+# @commnt: Maybe if people quit forking the hell outta this, it would be easier to maintain
+
+## Configurations
+# On = 1. Off = 0
+my %display = (
+ "OS" => 1, # Displays the operating system's name
+ "KL" => 1, # Displays your kernel version
+ "DE" => 0, # Displays your desktop environment, if you have one
+ "WM" => 1, # Displays your window manager
+ "WMT" => 1, # Displays your window manager's theme
+ "IC" => 1, # Displays your icon theme, if you have one
+ "FN" => 1, # Displays your font
+ "UI" => 1 # Displays your UI theme
+ );
+
+# The command to execute for taking a screenshot
+# Escape ' with a backslash, \'
+# Leave blank if you don't want a screenshot taken
+#my $screenshot = 'scrot screen-%H-%M-%S.png -e \'mv $f ~/media/screens/\'';
+my $screenshot = '';
+
+# The Color to use for the variables, needs to be global for logos.pl
+@colors = ( "\e[38;0;33m", "\e[38;1;37m", "\e[m" );
+
+# Debugging
+my $debug = 1;
+## End of configuration
########################
## Script starts here ##
########################
-## Define some thing to work with strict ##
-my @line = ();
-my $found = 0;
-my $DE = "NONE";
-my $WM = "Beryl";
-
-## Hash of WMs and the process they run ##
-my %WMlist = ("Beryl", "beryl",
- "Fluxbox", "fluxbox",
- "Openbox", "openbox",
- "Blackbox", "blackbox",
- "Xfwm4", "xfwm4",
- "Metacity", "metacity",
- "Kwin", "kwin",
- "FVWM", "fvwm",
- "Enlightenment", "enlightenment",
- "IceWM", "icewm",
- "Window Maker", "wmaker",
- "PekWM","pekwm" );
+@distros = ();
+require '/home/flo/bin/logos.pl';
+
+my $nocolor = "\e[0m";
+my @info = ();
+my ($DE,$WM,$theme,$icon,$font,$cscheme) = "";
+my $distro = &distro;
+
+## Hash of WMs and the process they run #
+my %WMlist = ("Beryl" => "beryl",
+ "Fluxbox" => "fluxbox",
+ "Openbox" => "openbox",
+ "Blackbox" => "blackbox",
+ "Xfwm4" => "xfwm4",
+ "Metacity" => "metacity",
+ "Kwin" => "kwin",
+ "FVWM" => "fvwm",
+ "Enlightenment" => "enlightenment",
+ "IceWM" => "icewm",
+ "Window Maker" => "wmaker",
+ "Compiz-Fusion" => "compiz",
+ "PekWM" => "pekwm",
+ "Awesome" => "awesome",
+ "Dwm" => "dwm" );
## Hash of DEs and the process they run ##
-my %DElist = ("Gnome", "gnome-session",
- "Xfce4", "xfce-mcs-manage",
- "KDE", "ksmserver");
+my %DElist = ("Gnome" => "gnome-session",
+ "Xfce4" => "xfce-mcs-manage",
+ "KDE" => "ksmserver");
## Get Kernel version ##
-if ( $display =~ "Kernel"){
- print "\::$textcolor Finding Kernel version\n" unless $quite == 1;
- my $kernel = `uname -r`;
- $kernel =~ s/\s+/ /g;
- $kernel = " Kernel:$textcolor $kernel";
- push(@line, "$kernel");
+if( $display{KL} ) {
+ print "::$colors[0] Finding Kernel version$nocolor\n"
+ if $debug;
+
+ my $kernel = `uname -r`; $kernel =~ s/\s+/ /g;
+ push @info, "$colors[0]Kernel\t\t\t$colors[1]$kernel$nocolor";
}
## Find running processes ##
-print "\::$textcolor Getting processes \n" unless $quite == 1;
+print "::$colors[0] Getting processes$nocolor\n"
+ if $debug;
my $processes = `ps -A | awk {'print \$4'}`;
-## Find DE ##
-while( (my $DEname, my $DEprocess) = each(%DElist) ) {
- print "\::$textcolor Testing $DEname process: $DEprocess \n" unless $quite == 1;
- if ( $processes =~ m/$DEprocess/ ) {
+
+## Find a Desktop Environment ##
+DESKTOP:
+goto WINDOWM if !$display{DE};
+while(my($DEname,$DEprocess) = each(%DElist)) {
+ next if $processes !~ /$DEprocess/s;
+
$DE = $DEname;
- print "\::$textcolor DE found as $DE\n" unless $quite == 1;
- if( $display =~ m/DE/ ) {
- push(@line, " DE:$textcolor $DE");
- }
+ print "::$colors[0] Desktop Environment found as $colors[1]$DEname$nocolor\n"
+ if $debug;
+ push @info, "$colors[0]Desktop Environment\t$colors[1]$DEname$nocolor";
last;
- }
}
-## Find WM ##
-while( (my $WMname, my $WMprocess) = each(%WMlist) ) {
- print "\::$textcolor Testing $WMname process: $WMprocess \n" unless $quite == 1;
- if ( $processes =~ m/$WMprocess/ ) {
+## Find a Window Manager ##
+WINDOWM:
+goto ICON if !$display{WM};
+while(my($WMname,$WMprocess) = each(%WMlist)) {
+ next if $processes !~ /$WMprocess/sg;
+
$WM = $WMname;
- print "\::$textcolor WM found as $WM\n" unless $quite == 1;
- if( $display =~ m/WM/ ) {
- push(@line, " WM:$textcolor $WM");
- }
+ print "::$colors[0] Window Manager found as $colors[1]$WMname$nocolor\n"
+ if $debug;
+ push @info, "$colors[0]Window Manager\t\t$colors[1]$WMname$nocolor";
last;
- }
}
-## Find WM theme ##
-if ( $display =~ m/Win_theme/ ){
- switch($WM) {
- case "Openbox" {
- print "\::$textcolor Finding $WM theme\n" unless $quite == 1;
- open(FILE, "$ENV{HOME}/.config/openbox/rc.xml")
- || die "\e[0;31m<Failed>\n";
- while( <FILE> ) {
- if( /<name>(.+)<\/name>/ ) {
- while ( $found == 0 ) {
- print "\::$textcolor $WM theme found as $1\n" unless $quite == 1;
- push(@line, " WM Theme:$textcolor $1");
- $found = 1;
- }
- }
- }
- close(FILE);
- }
- case "Metacity" {
- print "\::$textcolor Finding $WM theme\n" unless $quite == 1;
- my $gconf = `gconftool-2 -g /apps/metacity/general/theme`;
- print "\::$textcolor $WM theme found as $gconf\n" unless $quite == 1;
- chomp ($gconf);
- push(@line, " WM Theme:$textcolor $gconf");
- }
- case "Fluxbox" {
- print "\::$textcolor Finding $WM theme\n" unless $quite == 1;
- open(FILE, "$ENV{HOME}/.fluxbox/init")
- || die "\e[0;31m<Failed>\n";
- while( <FILE> ) {
- if( /session.styleFile:.*\/(.+)/ ) {
- print "\::$textcolor $WM theme found as $1\n" unless $quite == 1;
- push(@line, " WM Theme:$textcolor $1");
- }
- }
- close(FILE);
- }
- case "Blackbox" {
- print "\::$textcolor Finding $WM theme\n" unless $quite == 1;
- open(FILE, "$ENV{HOME}/.blackboxrc")
- || die "\e[0;31m<Failed>\n";
- while( <FILE> ) {
- if( /session.styleFile:.*\/(.+)/ ) {
- print "\::$textcolor $WM theme found as $1\n" unless $quite == 1;
- push(@line, " WM Theme:$textcolor $1");
- }
- }
- close(FILE);
- }
- case "Xfwm4" {
- print "\::$textcolor Finding $WM theme\n" unless $quite == 1;
- open(FILE, "$ENV{HOME}/.config/xfce4/mcs_settings/xfwm4.xml")
- || die "\e[0;31m<Failed>\n";
- while( <FILE> ) {
- if( /<option name="Xfwm\/ThemeName" type="string" value="(.+)"\/>/ ) {
- print "\::$textcolor $WM theme found as $1\n" unless $quite == 1;
- push(@line, " WM Theme:$textcolor $1");
- }
- }
- close(FILE);
- }
- case "Kwin" {
- print "\::$textcolor Finding $WM theme\n" unless $quite == 1;
- open(FILE, "$ENV{HOME}/.kde/share/config/kwinrc")
- || die "\e[0;31m<Failed>\n";
- while( <FILE> ) {
- if( /PluginLib=kwin3_(.+)/ ) {
- print "\::$textcolor $WM theme found as $1\n" unless $quite == 1;
- push(@line, " WM Theme:$textcolor $1");
- }
- }
- close(FILE);
- }
- case "Enlightenment" {
- print "\::$textcolor Finding $WM theme\n" unless $quite == 1;
- my $remote = `enlightenment_remote -theme-get theme` ;
- if( $remote =~ m/.*FILE="(.+).edj"/ ) {
- print "\::$textcolor $WM theme found as $1\n" unless $quite == 1;
- push(@line, " WM Theme:$textcolor $1");
- }
- }
- case "IceWM" {
- print "\::$textcolor Finding $WM theme\n" unless $quite == 1;
- open(FILE, "$ENV{HOME}/.icewm/theme")
- || die "\e[0;31m<Failed>\n";
- while( <FILE> ) {
- if( /Theme="(.+)\/.*.theme/ ) {
- while( $found == 0 ) {
- print "\::$textcolor $WM theme found as $1\n" unless $quite == 1;
- push(@line, " WM Theme:$textcolor $1");
- $found = 1;
- }
- }
- }
- close(FILE);
- }
- case "PekWM" {
- print "\::$textcolor Finding $WM theme\n" unless $quite == 1;
- open(FILE, "$ENV{HOME}/.pekwm/config")
- || die "\e[0;31m<Failed>\n";
- while( <FILE> ) {
- if( /Theme.*\/(.*)"/ ) {
- print "\::$textcolor $WM theme found as $1\n" unless $quite == 1;
- push(@line, " WM Theme:$textcolor $1");
- }
- }
- close(FILE);
- }
- }
-}
-
-## Find Theme Icon and Font ##
-if ( $display =~ m/[Theme, Icons, Font, Background]/) {
- switch($DE) {
- case "Gnome" {
- print "\::$textcolor Finding $DE variables\n" unless $quite == 1;
- if ( $display =~ m/Theme/ ) {
- my $gconf = `gconftool-2 -g /desktop/gnome/interface/gtk_theme`;
- chomp ($gconf);
- print "\::$textcolor GTK Theme found as $1\n" unless $quite == 1;
- push(@line, " GTK Theme:$textcolor $gconf");
- }
- if ( $display =~ m/Icons/ ) {
- my $gconf = `gconftool-2 -g /desktop/gnome/interface/icon_theme`;
- chomp ($gconf);
- push(@line, " Icons:$textcolor $gconf");
- }
- if ( $display =~ m/Font/ ) {
- my $gconf = `gconftool-2 -g /desktop/gnome/interface/font_name`;
- chomp ($gconf);
- push(@line, " Font:$textcolor $gconf");
- }
- if ( $display =~ m/Background/ ) {
- my $gconf = `gconftool-2 -g /desktop/gnome/background/picture_filename`;
- chomp ($gconf);
- my $bname = basename($gconf);
- push(@line, " Background:$textcolor $bname");
- }
-
- }
- case "Xfce4" {
- my @sort = ();
- print "\::$textcolor Finding $DE variables\n" unless $quite == 1;
- open(FILE, "$ENV{HOME}/.config/xfce4/mcs_settings/gtk.xml")
- || die "\e[0;31m<Failed>\n";
- while( <FILE> ) {
- if ( $display =~ m/Theme/ ) {
- if (/<option name="Net\/ThemeName" type="string" value="(.+)"\/>/ ) {
- print "\::$textcolor GTK Theme found as $1\n" unless $quite == 1;
- unshift(@sort, " GTK Theme:$textcolor $1");
- }
- }
- if ( $display =~ m/Icons/ ) {
- if (/<option name="Net\/IconThemeName" type="string" value="(.+)"\/>/ ) {
- print "\::$textcolor Icons found as $1\n" unless $quite == 1;
- unshift(@sort, " Icons:$textcolor $1");
- }
- }
- if ( $display =~ m/Font/ ) {
- if ( /<option name="Gtk\/FontName" type="string" value="(.+)"\/>/ ) {
- print "\::$textcolor Font found as $1\n" unless $quite == 1;
- unshift(@sort, " Font:$textcolor $1");
- }
- }
- }
- close(FILE);
- ## Sort variables so they're ordered "Theme Icon Font" ##
- foreach my $i (@sort) {
- push(@line, "$i");
- }
- }
- case "KDE" {
- print "\::$textcolor Finding $DE variables\n" unless $quite == 1;
- open(FILE, "$ENV{HOME}/.kde/share/config/kdeglobals")
- || die "\e[0;31m<Failed>\n";
- while( <FILE> ) {
- if ( $display =~ m/Theme/ ) {
- if ( /widgetStyle=(.+)/ ) {
- print "\::$textcolor Wiget Style found as $1\n" unless $quite == 1;
- push(@line, " Wiget Style:$textcolor $1");
- }
- if (/colorScheme=(.+).kcsrc/ ) {
- print "\::$textcolor Color Scheme found as $1\n" unless $quite == 1;
- push(@line, " Color Scheme:$textcolor $1");
- }
- }
- if ( $display =~ m/Icons/ ) {
- if ( /Theme=(.+)/ ) {
- print "\::$textcolor Icons found as $1\n" unless $quite == 1;
- push(@line, " Icons:$textcolor $1");
- }
- }
- if ( $display =~ m/Font/ ) {
- if ( /font=(.+)/ ) {
- my $font = (split/,/, $1)[0];
- print "\::$textcolor Font found as $font\n" unless $quite == 1;
- push(@line, " Font:$textcolor $font");
- }
- }
- }
- close(FILE);
-
- }
- else {
- my @files = ("$ENV{HOME}/.gtkrc-2.0", "$ENV{HOME}/.gtkrc.mine",);
- foreach my $file (@files) {
- if ( -e $file ) {
- print "\::$textcolor Opening $file\n" unless $quite == 1;
- open(FILE, $file)
- || die "\e[0;31m<Failed>\n";
- while( <FILE> ) {
- if ( $display =~ m/Theme/ ) {
- if( /include ".*themes\/(.+)\/gtk-(1|2)\.0\/gtkrc"/ ){
- print "\::$textcolor GTK theme found as $1\n" unless $quite == 1;
- push(@line, " GTK Theme:$textcolor $1");
- }
- }
- if ( $display =~ m/Icons/ ) {
- if( /.*gtk-icon-theme-name.*"(.+)"/ ) {
- print "\::$textcolor Icons found as $1\n" unless $quite == 1;
- push(@line, " Icons:$textcolor $1");
- }
- }
- if ( $display =~ m/Font/ ) {
- if( /.*gtk-font-name.*"(.+)"/ ) {
- print "\::$textcolor Font found as $1\n" unless $quite == 1;
- push(@line, " Font:$textcolor $1");
- }
- }
- }
- close(FILE);
- }
- }
- }
- }
-}
-
-## Display the system info ##
-
-if ( $distro =~ m/Archlinux/ ) {
-
-## Get Archlinux version ##
-if ( $display =~ "OS"){
- print "\::$textcolor Finding Archlinux version\n" unless $quite == 1;
- my $version = $myArchVersion;
- $version =~ s/\s+/ /g;
- $version = " OS:$textcolor $version";
- unshift(@line, "$version");
-}
-
-#my $c1 = "\e[38;5;47m";
-#my $c3 = "\e[38;5;26m";
-#my $c2 = "\e[1m";
-
-my $c1 = "\e[1;34m";
-my $c3 = "\e[0;34m";
-my $c2 = "\e[1m";
-
-print "$c1
-$c1 +
-$c1 #
-$c1 ### $c2@line[0]
-$c1 ##### $c2@line[1]
-$c1 ###### $c2@line[2]
-$c1 ; #####; $c2@line[3]
-$c1 +##.##### $c2@line[4]
-$c1 +########## $c2@line[5]
-$c1 ######$c3#####$c1##; $c2@line[6]
-$c1 ###$c3############$c1+ $c2@line[7]
-$c1 #$c3###### ####### $c2@line[8]
-$c3 .######; ;###;`\".
-$c3 .#######; ;#####.
-$c3 #########. .########`
-$c3 ######' '######
-$c3 ;#### ####;
-$c3 ##' '##
-$c3 #' `#
-$c3' `
-\e[0m";
+## Find a Window Manager Theme ##
+WINDOWMT:
+goto ICON if !$display{WMT} || !$display{WM} || $WM eq "";
+print "::$colors[0] Finding $WM theme$nocolor\n"
+ if $debug;
+
+$WM eq "Openbox" && do {
+ ($theme) = fgrep(["$ENV{HOME}/.config/openbox/rc.xml"], ["<name>(.+?)</name>"]);
+ goto ICON;
+};
+
+$WM eq "Beryl" && do {
+ ($theme) = fgrep(["$ENV{HOME}/.emerald/theme/theme.ini"], ["description=(.*?)$/"]);
+ goto ICON;
+};
+
+$WM eq "Metacity" && do {
+ $theme = `gconftool-2 -g /apps/metacity/general/theme`;
+ chomp $theme;
+ goto ICON;
+};
+
+$WM eq "Fluxbox" && do {
+ ($theme) = fgrep(["$ENV{HOME}/.fluxbox/init"], ["session.styleFile:\s*/.*?/(.+?)"]);
+ goto ICON;
+};
+
+$WM eq "Blackbox" && do {
+ ($theme) = fgrep(["$ENV{HOME}/.blackboxrc"], ["session.styleFile:\s*/.*?/(.+?)"]);
+ goto ICON;
+};
+
+$WM eq "Xfwm4" && do {
+ ($theme) = fgrep(["$ENV{HOME}/.config/xfce4/mcs_settings/xfwm4.xml"], ["<option name=\"Xfwm/ThemeName\" type=\"string\" value=\"(.+?)\"/>"]);
+ goto ICON;
+};
+
+$WM eq "Kwin" && do {
+ ($theme) = fgrep(["$ENV{HOME}/.kde/share/config/kwinrc"], ['PluginLib=kwin[34]_(.+?)\s']);
+ goto ICON;
+};
+
+$WM eq "Enlightenment" && do {
+ my $remote = `enlightenment_remote -theme-get theme`;
+ ($theme) = $remote =~ /FILE="(.+?)\\.edj"/sg;
+ goto ICON;
+};
+
+$WM eq "IceWM" && do {
+ ($theme) = fgrep(["$ENV{HOME}/.icewm/theme"], ["Theme=\"(.+?)/.*?\\.theme"]);
+ goto ICON;
+};
+
+$WM eq "PekWM" && do {
+ ($theme) = fgrep(["$ENV{HOME}/.pekwm/config"], ["Theme.*?/(.*?)"]);
+ goto ICON;
+};
+
+$WM eq "Dwm" && do {
+ undef $theme; ## Unless you want to grab some values from the binary?
+ goto ICON;
+};
+
+$WM eq "Awesome" && do {
+ undef $theme;
+ goto ICON;
+};
+
+ICON:
+if( $theme ne "" ) {
+ print "::$colors[0] $WM Theme found as $colors[1]$theme$nocolor\n"
+ if $debug;
+ push @info, "$colors[0]$WM Theme $colors[1]\t\t$theme$nocolor";
}
+$DE eq "Gnome" && do {
+ $icon = `gconftool-2 -g /desktop/gnome/interface/icon_theme`;
+ $font = `gconftool-2 -g /desktop/gnome/interface/font_name`;
+ $theme = `gconftool-2 -g /desktop/gnome/interface/gtk_theme`;
+ chomp $icon; chomp $font; chomp $theme;
+ goto PRINT;
+};
+
+$DE eq "Xfce4" && do {
+ ($icon,$font,$theme) = fgrep(["$ENV{HOME}/.config/xfce4/mcs_settings/gtk.xml"],
+ ['<option name="Net/IconThemeName" type="string" value="(.+?)"/>',
+ '<option name="Gtk/FontName" type="string" value="(.+?)"/>',
+ '<option name="Net/ThemeName" type="string" value="(.+?)"/>']);
+ goto PRINT;
+};
+
+$DE eq "KDE" && do {
+ ($theme,$cscheme,$icon,$font) = fgrep(["$ENV{HOME}/.kde/share/config/kdeglobals"],
+ ['widgetStyle=(.+?)\s',
+ 'colorScheme=(.+?)\.kcsrc\s',
+ 'Theme=(.+?)\s',
+ 'font=(.+?)\s']);
+ $font = (split /,/, $font)[0];
+ goto PRINT;
+};
+
+@vars = fgrep(["$ENV{HOME}/.gtkrc-2.0",
+ "$ENV{HOME}/.gtkrc.mine"],
+ ['include ".*?themes/(.+?)/gtk-[12]\.0/gtkrc',
+ '.*?gtk-icon-theme-name.*?"(.+?)"',
+ '.*?gtk-font-name.*?"(.+?)"']);
+
+$theme = $vars[0] ? $vars[0] : $vars[3] ? $vars[3] : "";
+$icon = $vars[1] ? $vars[1] : $vars[4] ? $vars[4] : "";
+$font = $vars[2] ? $vars[2] : $vars[5] ? $vars[5] : "";
+
+## Lets print this bitch ##
+PRINT:
+push @info, $colors[0].($DE ? $DE : "GTK")." Theme \t\t$colors[1]".($DE eq "KDE" ? "$theme/$cscheme" : $theme).$nocolor
+ if $display{UI} && $theme ne "";
+
+push @info, "$colors[0]Icons\t\t\t$colors[1]$icon$nocolor"
+ if $display{IC} && $icon ne "";
+
+push @info, "$colors[0]Font\t\t\t$colors[1]$font$nocolor"
+ if $display{FN} && $font ne "";
+
+printf $distro, @info; sleep 3;
+exec $screenshot
+ if $screenshot ne "";
+
+sub fgrep(\@\@) {
+ my($files,$regexps) = @_;
+ my @retvals = ();
+ my $slurp = $/; undef $/;
+
+ foreach my $file (@$files) {
+ next if !(-e $file);
+
+ open FILE, "<", $file || die "$colors[0]Error opening $colors[1]'$file', $colors[0]$!$nocolor\n";
+ $content = <FILE>;
+ close FILE;
+
+ foreach my $regexp (@$regexps) {
+ my $expg = 0; $expg++ while( $regexp =~ /\(.*?\)/g );
+ my @tmp = $content =~ /$regexp/sg;
+ push @tmp, "" while( scalar @tmp < $expg );
+ @retvals = (@retvals,@tmp);
+ }
+ }
-if ( $distro =~ m/None/ ) {
-my $color = "\e[0;34m";
- foreach my $filled ( @line ) {
- print "$color $filled\n"
- }
+ $/ = $slurp;
+ @retvals;
}
-if ( $distro =~ m/Debian/ ) {
-
-## Get Debian version ##
-if ( $display =~ "OS"){
- print "\::$textcolor Finding Debian version\n" unless $quite == 1;
- my $version = `cat /etc/Debian_release`;
- $version =~ s/\s+/ /g;
- $version = " OS:$textcolor $version";
- unshift(@line, "$version");
-}
+sub distro {
+ my $distro = "";
+ my $slurp = $/; undef $/;
+
+ foreach $ops (@distros) {
+ next if !(-e @$ops[1]);
+
+ $fdistro = $distro = @$ops[0];
+ open FILE, "<", @$ops[1] || die "$colors[0]Error opening $colors[1]'@$ops[1]', $colors[0]$!$nocolor\n";
+ $content = <FILE>;
+ close FILE;
+
+ if( defined @$ops[2] ) {
+ $content =~ /@$ops[2]/sg;
+ $fdistro .= " ($1)";
+ }
+
+ chomp $distro; chomp $fdistro;
+ last;
+ }
-my $c1 = "\e[0;31m";
-
-print "
-$c1 _,met\$\$\$\$\$gg.
-$c1 ,g\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$P.
-$c1 ,g\$\$P\"\" \"\"\"Y\$\$.\". @line[0]
-$c1 ,\$\$P' \`\$\$\$. @line[1]
-$c1',\$\$P ,ggs. \`\$\$b: @line[2]
-$c1\`d\$\$' ,\$P\"' . \$\$\$ @line[3]
-$c1 \$\$P d\$' , \$\$P @line[4]
-$c1 \$\$: \$\$. - ,d\$\$' @line[5]
-$c1 \$\$\; Y\$b._ _,d\$P' @line[6]
-$c1 Y\$\$. \`.\`\"Y\$\$\$\$P\"' @line[7]
-$c1 \`\$\$b \"-.__ @line[8]
-$c1 \`Y\$\$
-$c1 \`Y\$\$.
-$c1 \`\$\$b.
-$c1 \`Y\$\$b.
-$c1 \`\"Y\$b._
-$c1 \`\"\"\"\"
-\e[0m";
-}
-
-if ( $distro =~ m/Ubuntu/ ) {
-
-## Get Ubuntu version ##
-if ( $display =~ "OS"){
- print "\::$textcolor Finding Ubuntu version\n" unless $quite == 1;
- my $version = `head -3 /etc/lsb-release |cut -d"=" -f2`;
- $version =~ s/\s+/ /g;
- $version = " OS:$textcolor $version";
- unshift(@line, "$version");
-}
+ return ""
+ if $distro eq "";
-my $c1 = "\e[0;31m";
-my $c2 = "\e[0;33m";
-my $c3 = "\e[0;35m";
-
-print "
- $c1.-.
- $c3.-'``$c1( ) @line[0]
- $c2,` $c3 $c1`-'$c3.$c1 @line[1]
- $c2/ $c3'``-. `$c1 @line[2]
- $c3.-. $c2, $c3`___:$c1 @line[3]
- $c3( )$c2: $c1 ___ @line[4]
- $c3`-' $c2` $c1, : @line[5]
- $c2` $c1`..-` , @line[6]
- $c2`./ $c1 $c2.-.$c1` @line[7]
- $c1`-..-$c2( )$c1 @line[8]
- $c2`-'
-\e[0m";
+ $/ = $slurp; $distro = lc $distro;
+ eval "\$distro = \$$distro;";
+ push @info, "$colors[0]Distro\t\t\t$colors[1]$fdistro$nocolor";
+ $distro;
}
-
-#return 0;
-## Run screen shot graper ##
-`$command` unless $shot != 0;
diff --git a/logos.pl b/logos.pl
new file mode 100644
index 0000000..9739ed2
--- /dev/null
+++ b/logos.pl
@@ -0,0 +1,37 @@
+## Put your distrobutions logos here
+#
+# Format::
+# For a new distro
+# push @distros, ["DistroShowName", "/path/to/current/version", "Optional regexp to get & append to the DistroShowName"];
+# $distroname = "..distros logo..";
+#
+# The logo variable should be a lower-cased version of the DistroShowName.
+# With in the logo, Please escape unused %.
+#
+#
+
+
+push @distros, ["ArchLinux", "/etc/issue", "Arch Linux \\((.*?)\\)"];
+$archlinux = "
+$colors[1]
+$colors[1]
+$colors[1]
+$colors[1] __ $colors[0]___
+$colors[1] /\\ \\ $colors[0] /\\_ \\ __
+$colors[1] __ _ __ ___\\ \\ \\___ $colors[0]\\//\\ \\ /\\_\\ ___ __ __ __ _
+$colors[1] /'__`\\ /\\`'__\\/'___\\ \\ _ `\\ $colors[0]\\ \\ \\ \\/\\ \\ /' _ `\\/\\ \\/\\ \\/\\ \\/'\\
+$colors[1] /\\ \\L\\.\\_\\ \\ \\//\\ \\__/\\ \\ \\ \\ \\ $colors[0]\\_\\ \\_\\ \\ \\/\\ \\/\\ \\ \\ \\_\\ \\/> </
+$colors[1] \\ \\__/.\\_\\\\ \\_\\\\ \\____\\\\ \\_\\ \\_\\$colors[0]/\\____\\\\ \\_\\ \\_\\ \\_\\ \\____//\\_/\\_\\
+$colors[1] \\/__/\\/_/ \\/_/ \\/____/ \\/_/\\/_/$colors[0]\\/____/ \\/_/\\/_/\\/_/\\/___/ \\//\\/_/
+$colors[0]
+$colors[0] $colors[2]%s
+$colors[0] $colors[2]%s
+$colors[0] $colors[2]%s
+$colors[0] $colors[2]%s
+$colors[0] $colors[2]%s
+$colors[0] $colors[2]%s
+$colors[0] $colors[2]%s
+$colors[0] $colors[2]%s
+$colors[0] $colors[2]%s
+$colors[1]
+$colors[1]"
diff --git a/pagerank b/pagerank
new file mode 100755
index 0000000..c2d0892
--- /dev/null
+++ b/pagerank
Binary files differ
diff --git a/prank b/prank
new file mode 100755
index 0000000..125e9d2
--- /dev/null
+++ b/prank
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+#
+# prank.sh - Find any URL's Google Page Rank (PR)
+#
+# 2008 - Mike Golvach - eggi@comcast.net
+#
+# Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
+#
+
+if [ $# -ne 1 ]
+then
+ echo "Usage: $0 HttpOrHttpsURL\n"
+ exit 1
+fi
+
+pr_checksum_prog="pagerank"
+
+if [ ! -x $pr_checksum_prog ]
+then
+ echo "Cannot Find Checksum Program: $pr_checksum_prog !"
+ exit 2
+fi
+
+wget=/usr/bin/wget
+prank_url=$1
+mod_prank_url=`echo $prank_url|sed -e 's/:/%3A/g' -e 's/\//%2F/g'`
+prank_checksum=`$pr_checksum_prog $prank_url|sed 's/Checksum=//'`
+
+prank_qurl="http://toolbarqueries.google.com/search?client=navclient-auto&ch=${prank_checksum}&ie=UTF-8&oe=UTF-8&features=Rank&q=info:${mod_prank_url}"
+
+echo -n "Google PR For $prank_url = "
+
+$wget -nv -O - "$prank_qurl" 2>&1|grep "Rank_"|sed 's/Rank_[0-9]:[0-9]://'
+exit 0
diff --git a/set-background.sh b/set-background.sh
index 3b2a234..ea3e069 100755
--- a/set-background.sh
+++ b/set-background.sh
@@ -34,6 +34,7 @@ fi
FILE=$1
if [ -f $FILE ]; then
echo "feh --bg-center ${FILE}" > "/home/flo/.fehbg";
+ rm "/home/flo/backgrounds/current_bg";
ln -sf "${FILE}" "/home/flo/backgrounds/current_bg";
source /home/flo/.fehbg
else
diff --git a/ssh-mount.sh b/ssh-mount.sh
index 77ed92c..91d324c 100755
--- a/ssh-mount.sh
+++ b/ssh-mount.sh
@@ -11,6 +11,10 @@ else
sshfs web0@nevera: -p 22222 ${HOME}/workspace/ipx_ssh &&
echo -e "${GREEN}IPX mounted.$NC"
;;
+ wf)
+ sshfs stem47@stem47.loomes.net: -p 22 ${HOME}/workspace/wf_ssh &&
+ echo -e "${GREEN}WF mounted.$NC"
+ ;;
*) echo -e "${RED}Error:$NC Unknown Server" ;;
esac
diff --git a/ssh-unmount.sh b/ssh-unmount.sh
index 50d3c2b..fca1868 100755
--- a/ssh-unmount.sh
+++ b/ssh-unmount.sh
@@ -1,5 +1,6 @@
#!/bin/sh
fusermount -uq ${HOME}/workspace/ipx_ssh
+fusermount -uq ${HOME}/workspace/wf_ssh
echo -e "${GREEN}Unmounted.";