You are not logged in.
I would be happy to help with a re-write.
Arch Linux since 2006
Python Web Developer + Sys Admin (Gentoo/BSD)
Offline
What about making an indevelopment script package and put it in AUR so everybody could use it to verify his system screenshots
Offline
EDIT: Nevermind.
Last edited by A.I. BOT (2007-07-11 22:10:22)
Offline
WHat happened to this did it ever get working ok, doesnt seem to work no more>'?
Offline
The version I got works...
This thread is so messed up, I don't even know who the original author was or whose version I got.
Anyways I tried to add compiz-fusion in my scripts with little or no succes...
(so it would detect DE, WM, and WM theme or)
Maybe some pro could tweak this to a final already ^^
Offline
Hello, Im using this info.pl to make a screenshot with all the systeminfo and stuff that u see in the monthly screenshot threads. It makes a screenshot just fine but it doesn't show all the info+archlinux logo in terminal.
#!/usr/bin/perl
use Switch;
use strict;
####################
## Config options ##
####################
## What distro logo to use to use, Available "Archlinux Debian None" ##
my $distro = "ArchLinux";
## 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";
## Takes a screen shot if set to 0 ##
my $shot = 0;
## Command to run to take screen shot ##
my $command = "scrot";
## What colors to use for the variables. ##
my $textcolor = "\e[0m";
## Prints little debugging messages if set to 0 ##
my $quite = 1;
########################
## Script starts here ##
########################
## Define some thing to work with strict ##
my @line = ();
my $found = 0;
my $DE = "NONE";
my $WM = "NONE";
## 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" );
## Hash of DEs and the process they run ##
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");
}
## Find running processes ##
print "\::$textcolor Getting processes \n" unless $quite == 1;
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/ ) {
$DE = $DEname;
print "\::$textcolor DE found as $DE\n" unless $quite == 1;
if( $display =~ m/DE/ ) {
push(@line, " DE:$textcolor $DE");
}
last;
}
}
## Find WM ##
while( (my $WMname, my $WMprocess) = each(%WMlist) ) {
print "\::$textcolor Testing $WMname process: $WMprocess \n" unless $quite == 1;
if ( $processes =~ m/$WMprocess/ ) {
$WM = $WMname;
print "\::$textcolor WM found as $WM\n" unless $quite == 1;
if( $display =~ m/WM/ ) {
push(@line, " WM:$textcolor $WM");
}
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 "Beryl" {
print "\::$textcolor Finding $WM theme\n" unless $quite == 1;
open(FILE, "$ENV{HOME}/.emerald/themes/schoensyDarkgreen/theme.ini")
|| die "\e[0;31m<Failed>\n";
while( <FILE> ) {
if( /name=(.+)/ ) {
print "\::$textcolor $WM theme found as $1\n" unless $quite == 1;
push(@line, " WM Theme:$textcolor $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 ans Font ##
if ( $display =~ m/[Theme, Icons, Font,]/) {
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");
}
}
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 = `cat /etc/arch-release`;
$version =~ s/\s+/ /g;
$version = " OS:$textcolor $version";
unshift(@line, "$version");
}
my $c1 = "\e[0;32m";
my $c2 = "\e[1;32m";
print "$c1 __
$c1 _=(SDGJT=_
$c1 _GTDJHGGFCVS) $c1@line[0]
$c1 ,GTDJGGDTDFBGX0 $c1@line[1]
$c1 JDJDIJHRORVFSBSVL$c2-=+=,_ $c1@line[2]
$c1 IJFDUFHJNXIXCDXDSV,$c2 \"DEBL $c1@line[3]
$c1 [LKDSDJTDU=OUSCSBFLD.$c2 '?ZWX, $c1@line[4]
$c1 ,LMDSDSWH' \`DCBOSI$c2 DRDS], $c1@line[5]
$c1 SDDFDFH' !YEWD,$c2 )HDROD $c1@line[6]
$c1 !KMDOCG &GSU|$c2\_GFHRGO' $c1@line[7]
$c1 HKLSGP'$c2 __$c1\TKM0$c2\GHRBV)' $c1@line[8]
$c1 JSNRVW'$c2 __+MNAEC$c1\IOI,$c2\BN'
$c1 HELK['$c2 __,=OFFXCBGHC$c1\FD)
$c1 ?KGHE $c2\_-#DASDFLSV='$c1 'EF
$c1 'EHTI !H
$c1 \`0F' '!
\e[0m";
}
if ( $distro =~ m/None/ ) {
my $color = "\e[0;34m";
foreach my $filled ( @line ) {
print "$color $filled\n"
}
}
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");
}
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";
}
## Run screen shot graper ##
`$command` unless $shot != 0;
How do I fix this, I've seen others that use virtually the same script.
Offline
I know Perl so I can help you.
It do not print Arch logo because of line near end:
if ( $distro =~ m/Archlinux/ ) {
and also look into this line:
my $distro = "ArchLinux";
because l in not same as L if statment gets "false" and as a result no archlogo and no @line[$x] data print for you.
I suggest to use this new if line:
if ( $distro =~ m/Arch[lL]inux/ ) {
or just simple:
if ( 1 == 1 ) {
or use Archlinux in options.
Last edited by ProzacR (2007-08-19 16:35:16)
Offline
So I made little fixes to code line 343 and now it is here:
http://pastebin.archlinux.org/12954
teested it and saw more bugs. i will try to fix.
Last edited by ProzacR (2007-08-19 17:43:04)
Offline
http://pastebin.archlinux.org/12961
I tested it with my Dontpanic and refreshed some lines. It sould work now.
p.s. If you get some unwanted spaces after "OS:" then replace "+" with "-" in line 356. I wanted to remove spaces and instead this added 3 more spaces,
Last edited by ProzacR (2007-08-19 20:02:05)
Offline
What about extending this thingy to auto-recognize some of the most relevant distributions and making a package of it, so It could be installed through pacman or any other distribution using another package tool?
Why are we here? What is the sense of life?
INVITATION TO THE TRUTH
Offline
My method of Arch vesion recognition works only for Arch. I grab just line from startup script where ant the begining it prints ArchLinux blabala loadin ....
Other distros do not do this so I neeed more ideas. Or better to say locations of texfiles with version names.
Offline
Here, I updated the script based on one posted earlier. I don't know what happened to my original version but the script keeps getting forked and its harder to maintain.
http://pastebin.archlinux.org/13900 -- main.pl
http://pastebin.archlinux.org/13901 -- logos.pl
There is really nothing that different about this update other than cleaning up the code and adding some functions.
It should be easier to add support for different DEs/WMs.
If your WM/DE isn't supported post a where the configurations can be read and the configuration file itself.
And with OS detection, maybe grep for a certain file in /etc?
Post logos too
rawr
Offline
All of your scripts don't work for me. And yes, I've marked them as executable.
$~: ./screenshot-info-grabber_main.pl
./screenshot-info-grabber_main.pl: line 1: tle: command not found
./screenshot-info-grabber_main.pl: line 8: syntax error near unexpected token `('
./screenshot-info-grabber_main.pl: line 8: `my %display = (
$~:
Should I install some additional stuff to get it working or where's the problem?
Why are we here? What is the sense of life?
INVITATION TO THE TRUTH
Offline
All of your scripts don't work for me. And yes, I've marked them as executable.
$~: ./screenshot-info-grabber_main.pl
./screenshot-info-grabber_main.pl: line 1: tle: command not found
./screenshot-info-grabber_main.pl: line 8: syntax error near unexpected token `('
./screenshot-info-grabber_main.pl: line 8: `my %display = (
$~:Should I install some additional stuff to get it working or where's the problem?
Post your file, it works perfectly for me. And no there is nothing extra you need.
rawr
Offline
I'm using the latest version of your script, which you posted today.
I also had problems with earlier versions and scripts modified by other people than you.
Why are we here? What is the sense of life?
INVITATION TO THE TRUTH
Offline
I'm using the latest version of your script, which you posted today.
I also had problems with earlier versions and scripts modified by other people than you.
maybe its you...
The script works fine for me, maybe your download was corrupt?
rawr
Offline
I re-downloaded it.
This time I get another error, lol.
$~: ./screenshot-info-grabber_main.pl
bash: ./screenshot-info-grabber_main.pl: /usr/bin/perl^M: bad interpreter: No such file or director
$~:
I'd say there is a problem with the Perl interpreter, isn't it?
Why are we here? What is the sense of life?
INVITATION TO THE TRUTH
Offline
I re-downloaded it.
This time I get another error, lol.
$~: ./screenshot-info-grabber_main.pl bash: ./screenshot-info-grabber_main.pl: /usr/bin/perl^M: bad interpreter: No such file or director $~:
I'd say there is a problem with the Perl interpreter, isn't it?
Maybe pastebin adds the carrage return, ^M. Anyways, strip it out
tr -d "\015" < main.pl > maybeiwillworkthistime.pl
rawr
Offline
Heres what I get with your latest one, with the main.pl and logos.pl.
Random line breaks.
Offline
Indeed, I also have something similar like that.
Offline
Bugs. Too much \n symbols in that code. new lines begining from line ~nr.220:
chop ($info[x])
chop ($info[y])
...
Where x, y... line numbers can remove some nasty newline symbols from end.
Numbers x,y ... can be found expermentaly.
Offline
Sorry, it was a bug in the Gnome part. I was trying to do multiple chomps and only the $icons variable was chomp'ed.
::Edit::
Updated code, got a svn server.
http://screenshotinfograb.googlecode.com/svn/ Rev. 1
Last edited by rab (2007-09-16 15:53:36)
rawr
Offline
Might be easier in Perl, but is there a reason it's not in what MOST people can use right away - a simple BASh script?
Offline
Might be easier in Perl, but is there a reason it's not in what MOST people can use right away - a simple BASh script?
You can't use this right away? There are no other packages required to run this and most distributions come prepackaged with Perl. So..?
Last edited by rab (2007-09-18 19:10:59)
rawr
Offline
Yo; what MOST people can use right away is simple Perl.
Offline