You are not logged in.
Look at lines 9 -> 18 of the ssig.pl ! You have to change some "0" to "1" according your wishes!
oh dear lol, thx I didn't notice those
ARCH64 | XMonad | Configs | myAURpkgs | ArchWiki Contribs | Screenies
Offline
Has anyone got this to grab the wallpaper for xfce4?
Offline
Has anyone got this to grab the wallpaper for xfce4?
Depends on the verson your running; but this should give you an idea the bit that grabs the wallpaper has comments before and after it;
case "Xfce4" {
my @sort = ();
print "\:: Finding $DE variables\n" unless $debug == FALSE;
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 "\:: GTK Theme found as $1\n" unless $quite == 1;
unshift(@sort, " GTK Theme: $1");
}
}
if ( $display =~ m/Icons/ ) {
if (/<option name="Net\/IconThemeName" type="string" value="(.+)"\/>/ ) {
print "\:: Icons found as $1\n" unless $quite == 1;
unshift(@sort, " Icons: $1");
}
}
if ( $display =~ m/Font/ ) {
if ( /<option name="Gtk\/FontName" type="string" value="(.+)"\/>/ ) {
print "\:: Font found as $1\n" unless $quite == 1;
unshift(@sort, " Font: $1");
}
}
}
close(FILE);
## Sort variables so they're ordered "Theme Icon Font" ##
foreach my $i (@sort) {
push(@line, "$i");
}
## This is the wallpaper bit ##
open(FILE, "$ENV{HOME}/.config/xfce4/mcs_settings/desktop.xml")
|| die "\e[0;31m<Failed>\n";
while( <FILE> ) {
if ( $display =~ m/Wallpaper/ ) {
if ( /<option name="imagepath_0_0" type="string" value=".*\/(.+)"\/>/ ) {
print "\:: Wallpaper found as $1\n" unless $quite == 1;
push(@line, " Wallpaper: $1");
}
}
}
close(FILE);
## end wallpaper bit ##
}
You will also have to add "Wallpaper" to $display at the top
Offline
I have downloaded the files rson451 postet.
If I try to run the script with:
./ssig.pl
I get the following error:
bash: ./ssig.pl: /usr/bin/perl^M: bad interpreter: No such file or directory
If I add an "-w" to the first line(#!/usr/bin/perl -w) I don't get this error.
Furthermore if I use the full path of the interpreter I don't get an error either:
/usr/bin/perl ssig.pl
Offline
Reasons wrote:Has anyone got this to grab the wallpaper for xfce4?
Depends on the verson your running; but this should give you an idea the bit that grabs the wallpaper has comments before and after it;
case "Xfce4" { my @sort = (); print "\:: Finding $DE variables\n" unless $debug == FALSE; 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 "\:: GTK Theme found as $1\n" unless $quite == 1; unshift(@sort, " GTK Theme: $1"); } } if ( $display =~ m/Icons/ ) { if (/<option name="Net\/IconThemeName" type="string" value="(.+)"\/>/ ) { print "\:: Icons found as $1\n" unless $quite == 1; unshift(@sort, " Icons: $1"); } } if ( $display =~ m/Font/ ) { if ( /<option name="Gtk\/FontName" type="string" value="(.+)"\/>/ ) { print "\:: Font found as $1\n" unless $quite == 1; unshift(@sort, " Font: $1"); } } } close(FILE); ## Sort variables so they're ordered "Theme Icon Font" ## foreach my $i (@sort) { push(@line, "$i"); } ## This is the wallpaper bit ## open(FILE, "$ENV{HOME}/.config/xfce4/mcs_settings/desktop.xml") || die "\e[0;31m<Failed>\n"; while( <FILE> ) { if ( $display =~ m/Wallpaper/ ) { if ( /<option name="imagepath_0_0" type="string" value=".*\/(.+)"\/>/ ) { print "\:: Wallpaper found as $1\n" unless $quite == 1; push(@line, " Wallpaper: $1"); } } } close(FILE); ## end wallpaper bit ## }
You will also have to add "Wallpaper" to $display at the top
I think the version you have is different to the current one:
#!/usr/bin/perl
#
# @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" => 1, # 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 ~/Pictures/Screenshots/\'';
#my $screenshot = '';
# The Color to use for the variables, needs to be global for logos.pl
@colors = ( "\e[33;1;34m", "\e[33;0;26m", "\e[m" );
# Debugging
my $debug = 1;
## End of configuration
########################
## Script starts here ##
########################
@distros = ();
require '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",
"Dwm" => "dwm" );
## Hash of DEs and the process they run ##
my %DElist = ("Gnome" => "gnome-session",
"Xfce4" => "xfce-mcs-manage",
"KDE" => "ksmserver");
## Get Kernel version ##
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 "::$colors[0] Getting processes$nocolor\n"
if $debug;
my $processes = `ps -A | awk {'print \$4'}`;
## Find a Desktop Environment ##
DESKTOP:
goto WINDOWM if !$display{DE};
while(my($DEname,$DEprocess) = each(%DElist)) {
next if $processes !~ /$DEprocess/s;
$DE = $DEname;
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 a Window Manager ##
WINDOWM:
goto ICON if !$display{WM};
while(my($WMname,$WMprocess) = each(%WMlist)) {
next if $processes !~ /$WMprocess/sg;
$WM = $WMname;
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 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;
};
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\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);
}
}
$/ = $slurp;
@retvals;
}
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;
}
return ""
if $distro eq "";
$/ = $slurp; $distro = lc $distro;
eval "\$distro = \$$distro;";
push @info, "$colors[0]Distro\t\t\t$colors[1]$fdistro$nocolor";
$distro;
}
ARCH64 | XMonad | Configs | myAURpkgs | ArchWiki Contribs | Screenies
Offline
I've been hacknig the ssig.pl and logos.pl scripts for a while (and I don't know any Perl so it's a bit of a feat to have accomplished almost everything I want so far) but I still have one problem.
The colours.
I changed the Arch logo to a personal one (one provided in this thread) but I would like to change it to one colour, and not cyan or blue. What other colour can I use (more of an "Archy" colour than pure cyan or pure blue) instead of "@colors = ( "\e[36m", "\e[37m");" (I'm only looking to change the first, I want the second one white)
Offline
Is this available as a package?
Offline
I got some trouble getting this to work, and i must add i am new to Arch and not that experienced with Linux (only used Ubuntu since 7,04).
What i have tried is to copy the text in the scripts to a text editor. But i cant save the file in "/usr/bin/" since i just get the error message "Can't open file to write" (i get the same error when i try without .pl). The editor i use is mousepad... I have also tried to save the file in /home, but i cant get it to work by typing ssig.pl or ssig (i have no idea what else to write).
I have googled around but i cant find any info on how to get it working. If there is info out there i have not been able to find it.
Could someone please be so kind to write down how to get this to work or tell me where to find a howto? I will be forever grateful.
Offline
Could someone please be so kind to write down how to get this to work or tell me where to find a howto? I will be forever grateful.
next time its faster to google for basics.
http://www.tech-geeks.org/contrib/mdron … /perl.html
Offline
I got some trouble getting this to work, and i must add i am new to Arch and not that experienced with Linux (only used Ubuntu since 7,04).
What i have tried is to copy the text in the scripts to a text editor. But i cant save the file in "/usr/bin/" since i just get the error message "Can't open file to write" (i get the same error when i try without .pl). The editor i use is mousepad... I have also tried to save the file in /home, but i cant get it to work by typing ssig.pl or ssig (i have no idea what else to write).
I have googled around but i cant find any info on how to get it working. If there is info out there i have not been able to find it.
Could someone please be so kind to write down how to get this to work or tell me where to find a howto? I will be forever grateful.
To save a file in /usr/bin/, you need to be root.
You could just save it in home or whatever folder, and then run it by "./ssig.pl" without the "". Don't forget to make it executable first.
Offline
Awesome-o:D
Thanks alot Mikko777 and Gigamo. Now it works like a charm. Kinda emberessing the solution is so simple when it feels like its impossible to work out.
@Mikko777: I did google, but never thought about googleing for what you linked too. I blame me lack of knowledge:P
Last edited by yama (2008-04-07 21:01:12)
Offline
Hello!
I've modified the info.pl one found in the Ubuntu thread and added the new logo found in one of the latest logos.pl found in this thread, plus some color modifications plus a version to put in your .bashrc! .
It looks like this: http://img227.imageshack.us/img227/9577/001yv5.png
New info.pl: http://pastebin.ca/976237
For your terminals: http://pastebin.ca/976240
Enjoy!
Offline
Updated code, got a svn server.
can we rely on this to be the one true source for this script?
if so, can we update the first post to have this link and info so i don't have to browse through all 7 pages just to find it?
Please test out rainbow.
l3ib.org projects | themes and such | blag
Offline
^ Seconded.
Something witty.
Offline
OK i have pasted the info.pl and the sig.pl. I tried using nano and gedit. They paste just fine. O i also made them executable. when I run info.pl this is what I get.
[rich@MyArch irssi]$ ./info1.pl
./info1.pl: line 1: 1.: command not found
./info1.pl: line 3: 2.: command not found
./info1.pl: line 4: use: command not found
./info1.pl: line 5: 3.: command not found
./info1.pl: line 6: use: command not found
./info1.pl: line 7: 4.: command not found
./info1.pl: line 8: use: command not found
./info1.pl: line 9: 5.: command not found
./info1.pl: line 11: 6.: command not found
./info1.pl: line 13: 7.: command not found
./info1.pl: line 15: 8.: command not found
./info1.pl: line 17: 9.: command not found
./info1.pl: line 19: 10.: command not found
./info1.pl: line 25: syntax error near unexpected token `('
./info1.pl: line 25: ` my $myArchVersion = "ArchLinux (Core Dump)";'
I know its renamed to info1.pl because I already had info.pl and it was doing the samething. any suggestions?
Chm0d
Offline
OK i have pasted the info.pl and the sig.pl. I tried using nano and gedit. They paste just fine. O i also made them executable. when I run info.pl this is what I get.
[rich@MyArch irssi]$ ./info1.pl
./info1.pl: line 1: 1.: command not found
./info1.pl: line 3: 2.: command not found
./info1.pl: line 4: use: command not found
./info1.pl: line 5: 3.: command not found
./info1.pl: line 6: use: command not found
./info1.pl: line 7: 4.: command not found
./info1.pl: line 8: use: command not found
./info1.pl: line 9: 5.: command not found
./info1.pl: line 11: 6.: command not found
./info1.pl: line 13: 7.: command not found
./info1.pl: line 15: 8.: command not found
./info1.pl: line 17: 9.: command not found
./info1.pl: line 19: 10.: command not found
./info1.pl: line 25: syntax error near unexpected token `('
./info1.pl: line 25: ` my $myArchVersion = "ArchLinux (Core Dump)";'I know its renamed to info1.pl because I already had info.pl and it was doing the samething. any suggestions?
Chm0d
In the pastbin, on the left are numbers...
You're copying them...
Edit: So you know, there's a box a bit lower which does not contain those numbers
Last edited by X/ax (2008-06-08 00:41:07)
My coding blog (or an attempt at it)
Archer start page (or an attempt at it)
Offline
hm...the script only finds my OS, kernel, WM, and WM Theme. Nothing about the GTK theme, fonts, icons, etc. =/
Last edited by Stythys (2008-06-11 03:15:47)
[home page] -- [code / configs]
"Once you go Arch, you must remain there for life or else Allan will track you down and break you."
-- Bregol
Offline
I think it has problems finding the wallpaper on xfce afaik.
ARCH64 | XMonad | Configs | myAURpkgs | ArchWiki Contribs | Screenies
Offline
It does not detect the wmii window manager by default.
In my personal one I added Wmii to the WMlist and it worked. (it runs two proccesses. wmii and wmiirc. I have it detecting wmii)
It didn't get my font or the wm theme (because by default it doesn't even get wmii) though. Mabye it would be possible to pull the colors being used out of wmii's config.
Last edited by tadada (2008-07-12 19:58:10)
Offline
I don't use a DE, just gtkrc file. Can you make the script read that file and detect my theme?
Offline
Offline
if someone is running info.pl and getting: <Failed>
i'm guessing you are on KDE4, and so you should edit info.pl and change every instance of ~/.kde to ~/.kde4
Offline
Offline
hi guys.. today i've discovered this great script, but i was wondering why my colors are messed up.. look by yourself
http://img504.imageshack.us/img504/4923 … va9.th.jpg
how can i fix this? i'd like to have colors like maddog39's screenshot
Change the colors in the script... >.>
Offline
.... i knew i've to change the values of the color, but how?? I don't understand the colour format.. are they RGB values?? or what??
Offline