2 # From http://bbs.archlinux.org/viewtopic.php?id=24208 #
12 ## What distro logo to use to use, Available "Archlinux Debian Ubuntu None" ##
13 my $distro = "Archlinux";
14 my $myArchVersion = "ArchLinux (Core Dump)";
16 ## what values to display. Use "OS Kernel DE WM win_theme Theme Font Icons" ##
17 my $display = "OS Kernel DE WM Win_theme Theme Icons Font Background";
19 ## Takes a screen shot if set to 0 ##
21 ## Command to run to take screen shot ##
22 my $command = "scrot -d 10";
24 ## What colors to use for the variables. ##
25 my $textcolor = "\e[0m";
27 ## Prints little debugging messages if set to 0 ##
32 ########################
33 ## Script starts here ##
34 ########################
35 ## Define some thing to work with strict ##
41 ## Hash of WMs and the process they run ##
42 my %WMlist = ("Beryl", "beryl",
45 "Blackbox", "blackbox",
47 "Metacity", "metacity",
50 "Enlightenment", "enlightenment",
52 "Window Maker", "wmaker",
55 ## Hash of DEs and the process they run ##
56 my %DElist = ("Gnome", "gnome-session",
57 "Xfce4", "xfce-mcs-manage",
61 ## Get Kernel version ##
62 if ( $display =~ "Kernel"){
63 print "\::$textcolor Finding Kernel version\n" unless $quite == 1;
64 my $kernel = `uname -r`;
66 $kernel = " Kernel:$textcolor $kernel";
67 push(@line, "$kernel");
70 ## Find running processes ##
71 print "\::$textcolor Getting processes \n" unless $quite == 1;
72 my $processes = `ps -A | awk {'print \$4'}`;
75 while( (my $DEname, my $DEprocess) = each(%DElist) ) {
76 print "\::$textcolor Testing $DEname process: $DEprocess \n" unless $quite == 1;
77 if ( $processes =~ m/$DEprocess/ ) {
79 print "\::$textcolor DE found as $DE\n" unless $quite == 1;
80 if( $display =~ m/DE/ ) {
81 push(@line, " DE:$textcolor $DE");
88 while( (my $WMname, my $WMprocess) = each(%WMlist) ) {
89 print "\::$textcolor Testing $WMname process: $WMprocess \n" unless $quite == 1;
90 if ( $processes =~ m/$WMprocess/ ) {
92 print "\::$textcolor WM found as $WM\n" unless $quite == 1;
93 if( $display =~ m/WM/ ) {
94 push(@line, " WM:$textcolor $WM");
101 if ( $display =~ m/Win_theme/ ){
104 print "\::$textcolor Finding $WM theme\n" unless $quite == 1;
105 open(FILE
, "$ENV{HOME}/.config/openbox/rc.xml")
106 || die "\e[0;31m<Failed>\n";
108 if( /<name>(.+)<\/name
>/ ) {
109 while ( $found == 0 ) {
110 print "\::$textcolor $WM theme found as $1\n" unless $quite == 1;
111 push(@line, " WM Theme:$textcolor $1");
119 print "\::$textcolor Finding $WM theme\n" unless $quite == 1;
120 my $gconf = `gconftool-2 -g /apps/metacity/general/theme`;
121 print "\::$textcolor $WM theme found as $gconf\n" unless $quite == 1;
123 push(@line, " WM Theme:$textcolor $gconf");
126 print "\::$textcolor Finding $WM theme\n" unless $quite == 1;
127 open(FILE
, "$ENV{HOME}/.fluxbox/init")
128 || die "\e[0;31m<Failed>\n";
130 if( /session.styleFile:.*\/(.+)/ ) {
131 print "\::$textcolor $WM theme found as $1\n" unless $quite == 1;
132 push(@line, " WM Theme:$textcolor $1");
138 print "\::$textcolor Finding $WM theme\n" unless $quite == 1;
139 open(FILE
, "$ENV{HOME}/.blackboxrc")
140 || die "\e[0;31m<Failed>\n";
142 if( /session.styleFile:.*\/(.+)/ ) {
143 print "\::$textcolor $WM theme found as $1\n" unless $quite == 1;
144 push(@line, " WM Theme:$textcolor $1");
150 print "\::$textcolor Finding $WM theme\n" unless $quite == 1;
153 open(FILE
, "$ENV{HOME}/.config/xfce4/mcs_settings/xfwm4.xml")
154 || die "\e[0;31m<Failed>\n";
156 if( /<option name="Xfwm\/ThemeName
" type="string
" value="(.+)"\/>/ ) {
157 print "\
::$textcolor $WM theme found as
$1\n" unless $quite == 1;
158 push(@line, " WM Theme
:$textcolor $1");
164 my $xfconf = `xfconf-query -c xfwm4 -p /general/theme`;
166 push(@line, " WM Theme
:$textcolor $xfconf");
171 print "\
::$textcolor Finding
$WM theme
\n" unless $quite == 1;
172 open(FILE, "$ENV{HOME
}/.kde/share
/config/kwinrc
")
173 || die "\e
[0;31m
<Failed
>\n";
175 if( /PluginLib=kwin3_(.+)/ ) {
176 print "\
::$textcolor $WM theme found as
$1\n" unless $quite == 1;
177 push(@line, " WM Theme
:$textcolor $1");
182 case "Enlightenment
" {
183 print "\
::$textcolor Finding
$WM theme
\n" unless $quite == 1;
184 my $remote = `enlightenment_remote -theme-get theme` ;
185 if( $remote =~ m/.*FILE="(.+).edj"/ ) {
186 print "\
::$textcolor $WM theme found as
$1\n" unless $quite == 1;
187 push(@line, " WM Theme
:$textcolor $1");
191 print "\
::$textcolor Finding
$WM theme
\n" unless $quite == 1;
192 open(FILE, "$ENV{HOME
}/.icewm/theme
")
193 || die "\e
[0;31m
<Failed
>\n";
195 if( /Theme="(.+)\
/.*.theme
/ ) {
196 while( $found == 0 ) {
197 print "\::$textcolor $WM theme found as $1\n" unless $quite == 1;
198 push(@line, " WM Theme:$textcolor $1");
206 print "\::$textcolor Finding $WM theme\n" unless $quite == 1;
207 open(FILE
, "$ENV{HOME}/.pekwm/config")
208 || die "\e[0;31m<Failed>\n";
210 if( /Theme.*\/(.*)"/ ) {
211 print "\
::$textcolor $WM theme found as
$1\n" unless $quite == 1;
212 push(@line, " WM Theme
:$textcolor $1");
220 ## Find Theme Icon and Font ##
221 if ( $display =~ m/[Theme, Icons, Font, Background]/) {
224 print "\
::$textcolor Finding
$DE variables
\n" unless $quite == 1;
225 if ( $display =~ m/Theme/ ) {
226 my $gconf = `gconftool-2 -g /desktop/gnome/interface/gtk_theme`;
228 print "\
::$textcolor GTK Theme found as
$1\n" unless $quite == 1;
229 push(@line, " GTK Theme
:$textcolor $gconf");
231 if ( $display =~ m/Icons/ ) {
232 my $gconf = `gconftool-2 -g /desktop/gnome/interface/icon_theme`;
234 push(@line, " Icons
:$textcolor $gconf");
236 if ( $display =~ m/Font/ ) {
237 my $gconf = `gconftool-2 -g /desktop/gnome/interface/font_name`;
239 push(@line, " Font
:$textcolor $gconf");
241 if ( $display =~ m/Background/ ) {
242 my $gconf = `gconftool-2 -g /desktop/gnome/background/picture_filename`;
244 my $bname = basename($gconf);
245 push(@line, " Background
:$textcolor $bname");
251 print "\
::$textcolor Finding
$DE variables
\n" unless $quite == 1;
252 open(FILE, "$ENV{HOME
}/.config/xfce
4/mcs_settings/gtk
.xml
")
253 || die "\e
[0;31m
<Failed
>\n";
255 if ( $display =~ m/Theme/ ) {
256 if (/<option name="Net\
/ThemeName
" type="string
" value="(.+)"\/>/ ) {
257 print "\
::$textcolor GTK Theme found as
$1\n" unless $quite == 1;
258 unshift(@sort, " GTK Theme
:$textcolor $1");
261 if ( $display =~ m/Icons/ ) {
262 if (/<option name="Net\
/IconThemeName
" type="string
" value="(.+)"\/>/ ) {
263 print "\
::$textcolor Icons found as
$1\n" unless $quite == 1;
264 unshift(@sort, " Icons
:$textcolor $1");
267 if ( $display =~ m/Font/ ) {
268 if ( /<option name="Gtk\
/FontName
" type="string
" value="(.+)"\/>/ ) {
269 print "\
::$textcolor Font found as
$1\n" unless $quite == 1;
270 unshift(@sort, " Font
:$textcolor $1");
275 ## Sort variables so they're ordered "Theme Icon Font
" ##
276 foreach my $i (@sort) {
282 print "\
::$textcolor Finding
$DE variables
\n" unless $quite == 1;
283 if ( $display =~ m/Theme/ ) {
284 my $xfconf = `xfconf-query -c xsettings -p /Net/ThemeName`;
286 push(@line, " GTK Theme
:$textcolor $xfconf");
288 if ( $display =~ m/Icons/ ) {
289 my $xfconf = `xfconf-query -c xsettings -p /Net/IconThemeName`;
291 push(@line, " Icons
:$textcolor $xfconf");
293 if ( $display =~ m/Font/ ) {
294 my $xfconf = `xfconf-query -c xsettings -p /Gtk/FontName`;
296 push(@line, " Font
:$textcolor $xfconf");
298 if ( $display =~ m/Background/ ) {
299 my $xfconf = `xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path`;
301 my $bname = basename($xfconf);
302 push(@line, " Background
:$textcolor $bname");
306 print "\
::$textcolor Finding
$DE variables
\n" unless $quite == 1;
307 open(FILE, "$ENV{HOME
}/.kde/share
/config/kdeglobals
")
308 || die "\e
[0;31m
<Failed
>\n";
310 if ( $display =~ m/Theme/ ) {
311 if ( /widgetStyle=(.+)/ ) {
312 print "\
::$textcolor Wiget Style found as
$1\n" unless $quite == 1;
313 push(@line, " Wiget Style
:$textcolor $1");
315 if (/colorScheme=(.+).kcsrc/ ) {
316 print "\
::$textcolor Color Scheme found as
$1\n" unless $quite == 1;
317 push(@line, " Color Scheme
:$textcolor $1");
320 if ( $display =~ m/Icons/ ) {
321 if ( /Theme=(.+)/ ) {
322 print "\
::$textcolor Icons found as
$1\n" unless $quite == 1;
323 push(@line, " Icons
:$textcolor $1");
326 if ( $display =~ m/Font/ ) {
328 my $font = (split/,/, $1)[0];
329 print "\
::$textcolor Font found as
$font\n" unless $quite == 1;
330 push(@line, " Font
:$textcolor $font");
338 my @files = ("$ENV{HOME
}/.gtkrc-2.0", "$ENV{HOME}/.gtkrc
.mine
",);
339 foreach my $file (@files) {
341 print "\
::$textcolor Opening
$file\n" unless $quite == 1;
343 || die "\e
[0;31m
<Failed
>\n";
345 if ( $display =~ m/Theme/ ) {
346 if( /include ".*themes\
/(.+)\
/gtk-(1|2)\.0\/gtkrc
"/ ){
347 print "\
::$textcolor GTK theme found as
$1\n" unless $quite == 1;
348 push(@line, " GTK Theme
:$textcolor $1");
351 if ( $display =~ m/Icons/ ) {
352 if( /.*gtk-icon-theme-name.*"(.+)"/ ) {
353 print "\
::$textcolor Icons found as
$1\n" unless $quite == 1;
354 push(@line, " Icons
:$textcolor $1");
357 if ( $display =~ m/Font/ ) {
358 if( /.*gtk-font-name.*"(.+)"/ ) {
359 print "\
::$textcolor Font found as
$1\n" unless $quite == 1;
360 push(@line, " Font
:$textcolor $1");
371 ## Display the system info ##
373 if ( $distro =~ m/Archlinux/ ) {
375 ## Get Archlinux version ##
376 if ( $display =~ "OS
"){
377 print "\
::$textcolor Finding Archlinux version
\n" unless $quite == 1;
378 my $version = $myArchVersion;
379 $version =~ s/\s+/ /g;
380 $version = " OS
:$textcolor $version";
381 unshift(@line, "$version");
396 ${c1} `/:-:++oooo
+: $c1@line[0]
397 ${c1
} `/++++/+++++++: $c1@line[1]
398 ${c1} `/++++++++++++++: $c1@line[2]
399 ${c1
} `/+++${c2}ooooooooooooo/` $c1@line[3]
400 ${c2
} ./ooosssso
++osssssso
+` $c1@line[4]
401 ${c2} .oossssso-````/ossssss+` $c1@line[5]
402 ${c2
} -osssssso
. :ssssssso
. $c1@line[6]
403 ${c2
} :osssssss
/ osssso
+++. $c1@line[7]
404 ${c2
} /ossssssss/ +ssssooo
/- $c1@line[8]
405 ${c2
} `/ossssso+/:- -:/+osssso+-
406 ${c2} `+sso
+:-` `.-/+oso
:
413 system("scrot -d 1");