You are not logged in.
why can I not get this script to work?
http://pastie.org/685061
Offline
Great project!
I just want to say one thing: in order to avoid scrot taking screenshot every time you run the script, editing the configuration part of the script (change a value from 0 to 1), simply does not work for me.
Anyways, I've just commented out the very last row of the script to avoid screeenshoting and this works.
Can you confirm this "bug"?
Another thing: it would be useful and much appreciated to have a simple table with all the colour codes available: this way one can easily change colours in the output and edit them in order to best fit his desktop colors!
Thank you!
rent0n@deviantART | rent0n@bitbucket | rent0n@identi.ca | LRU #337812
aspire: Acer Aspire 5920 Arch Linux x86_64 | beetle: Gericom Beetle G733 Arch Linux i686
Offline
if ( $display =~ "uptime"){
my $uptime = `uptime | sed -e 's/^.*up //' -e 's/, *[0-9]*.users.*//'`;
$uptime =~ s/\s+/ /g;
$uptime = " Uptime:$textcolor $uptime";
push(@line, "$uptime");
}
Here's a small bit to display uptime; if you'd like to add it to the script. (I just figured it could make a good addition)
Example: http://omploader.org/vMnIyaw
Last edited by melik (2009-11-12 07:41:33)
Offline
So, any idea WHY info.pl gives me nothing but errors??
Offline
A friend and I ported part of the script to python, its still not done yet. In my opinion, the script is a lot cleaner, also you can easily switch color schemes to match your theme. Let me know if there are any problems.
#!/usr/bin/env python
import commands
# Define colors
clear = "\x1b[0m"
# color = "\x1b[1;30m" # black
# color2 = "\x1b[0;30m" # black
# color = "\x1b[1;31m" # red
# color2 = "\x1b[0;30m" # red
# color = "\x1b[1;32m" # green
# color2 = "\x1b[0;32m" # green
# color = "\x1b[1;33m" # yellow
# color2 = "\x1b[0;33m" # yellow
color = "\x1b[1;34m" # blue
color2 = "\x1b[0;34m" # blue
# color = "\x1b[1;35m" # magenta
# color2 = "\x1b[0;35m" # magenta
# color = "\x1b[1;36m" # cyan
# color2 = "\x1b[0;36m" # cyan
# color = "\x1b[1;37m" # white
# color2 = "\x1b[0;37m" # white
# Define arrays containing values.
list = []
blank = [ '', '', '', '', '', '', '', '', '' ]
# Find running processes
processes = commands.getoutput("ps -A | awk {'print $4'}").split("\n")
# Print coloured key with normal value.
def output(key, value):
output = "%s%s:%s %s" % (color, key, clear, value)
list.append(output)
def distro_display():
distro = "Arch Linux"
output('Distro', distro)
def kernel_display():
kernel = commands.getoutput("uname -r")
output ('Kernel', kernel)
def uptime_display():
uptime = commands.getoutput('uptime | sed -e \'s/^.*up //\' -e \'s/, *[0-9]*.users.*//\'')
output ('Uptime', uptime)
def battery_display():
battery = commands.getoutput('acpi | sed \'s/.*, //\'')
output ('Battery', battery)
def de_display():
dict = {'gnome-session': 'GNOME',
'ksmserver': 'KDE',
'xfce-mcs-manager': 'Xfce'}
de = 'None found'
for key in dict.keys():
if key in processes: de = dict[key]
output ('DE', de)
def wm_display():
dict = {'awesome': 'Awesome',
'beryl': 'Beryl',
'blackbox': 'Blackbox',
'dwm': 'DWM',
'enlightenment': 'Enlightenment',
'fluxbox': 'Fluxbox',
'fvwm': 'FVWM',
'icewm': 'icewm',
'kwin': 'kwin',
'metacity': 'Metacity',
'openbox': 'Openbox',
'wmaker': 'Window Maker',
'xfwm4': 'Xfwm',
'xmonad': 'Xmonad'}
wm = 'None found'
for key in dict.keys():
if key in processes: wm = dict[key]
output ('WM', wm)
# Values to display.
# Possible options: kernel, uptime, battery, distro, de, wm, wmtheme, theme, font, icons.
display = [ 'distro', 'kernel', 'uptime', 'battery', 'de', 'wm' ]
for x in display:
funcname=x+"_display"
func=locals()[funcname]
func()
list.extend(blank)
# Result
print """%s
%s +
%s #
%s ### %s
%s ##### %s
%s ###### %s
%s ; #####; %s
%s +##.##### %s
%s +########## %s
%s ######%s#####%s##; %s
%s ###%s############%s+ %s
%s #%s###### ####### %s
%s .######; ;###;`\". %s
%s .#######; ;#####.
%s #########. .########`
%s ######' '######
%s ;#### ####;
%s ##' '##
%s #' `# %s
""" % (color, color, color, color, list[0], color, list[1], color, list[2], color, list[3], color, list[4], color, list[5], color, color2, color, list[6], color, color2, color, list[7], color, color2, list[8], color2, list[9], color2, color2, color2, color2, color2, color2, clear)
Also here it is in action: http://omploader.org/vMnhmeg
Note: If you are on a desktop, you can simply remove 'battery' from the line:
display = [ 'distro', 'kernel', 'uptime', 'battery', 'de', 'wm' ]
Last edited by melik (2009-12-06 22:25:55)
Offline
getting errors when runnign the code.
[ender@Null ~ ]$ perl script.pl
String found where operator expected at script.pl line 31, near "if( /gtk-icon-theme-name.*=.*""
(Might be a runaway multi-line "" string starting on line 28)
(Missing semicolon on previous line?)
String found where operator expected at script.pl line 34, near "if( /gtk-font-name.*=.*""
(Might be a runaway multi-line "" string starting on line 31)
(Missing semicolon on previous line?)
String found where operator expected at script.pl line 45, near "$WM =~ /Unknown/ && print ""
(Might be a runaway multi-line "" string starting on line 34)
(Missing semicolon on previous line?)
String found where operator expected at script.pl line 51, near "print ""
(Might be a runaway multi-line "" string starting on line 45)
(Missing semicolon on previous line?)
syntax error at script.pl line 28, near "(."
Search pattern not terminated at script.pl line 51.
[ender@Null ~ ]$
Proud Arch i686 & x86_64 User
Share your knowledge!
Arch Linux Forum Etiquette
Offline
getting errors when runnign the code.
[ender@Null ~ ]$ perl script.pl String found where operator expected at script.pl line 31, near "if( /gtk-icon-theme-name.*=.*"" (Might be a runaway multi-line "" string starting on line 28) (Missing semicolon on previous line?) String found where operator expected at script.pl line 34, near "if( /gtk-font-name.*=.*"" (Might be a runaway multi-line "" string starting on line 31) (Missing semicolon on previous line?) String found where operator expected at script.pl line 45, near "$WM =~ /Unknown/ && print "" (Might be a runaway multi-line "" string starting on line 34) (Missing semicolon on previous line?) String found where operator expected at script.pl line 51, near "print "" (Might be a runaway multi-line "" string starting on line 45) (Missing semicolon on previous line?) syntax error at script.pl line 28, near "(." Search pattern not terminated at script.pl line 51. [ender@Null ~ ]$
The perl script is quite buggy, try the python version.
Last edited by melik (2009-12-07 08:34:10)
Offline
try the python version.
http://pastebin.ca/1705285
Nice! Works well.
(altho do remove the battery as the default display option, since it "crashes" the script when not found)
Thanks
Offline
melik wrote:try the python version.
http://pastebin.ca/1705285Nice! Works well.
(altho do remove the battery as the default display option, since it "crashes" the script when not found)Thanks
Good idea, done, and your welcome
Latest version: http://github.com/djmelik/archey/blob/master/archey.py
Last edited by melik (2009-12-07 12:38:26)
Offline
3nd3r wrote:getting errors when runnign the code.
[ender@Null ~ ]$ perl script.pl String found where operator expected at script.pl line 31, near "if( /gtk-icon-theme-name.*=.*"" (Might be a runaway multi-line "" string starting on line 28) (Missing semicolon on previous line?) String found where operator expected at script.pl line 34, near "if( /gtk-font-name.*=.*"" (Might be a runaway multi-line "" string starting on line 31) (Missing semicolon on previous line?) String found where operator expected at script.pl line 45, near "$WM =~ /Unknown/ && print "" (Might be a runaway multi-line "" string starting on line 34) (Missing semicolon on previous line?) String found where operator expected at script.pl line 51, near "print "" (Might be a runaway multi-line "" string starting on line 45) (Missing semicolon on previous line?) syntax error at script.pl line 28, near "(." Search pattern not terminated at script.pl line 51. [ender@Null ~ ]$
The perl script is quite buggy, try the python version.
[ender@Null ~ ]$ python script.py
File "script.py", line 86
if key in processes: wm = dict[key]
^
IndentationError: expected an indented block
[ender@Null ~ ]$
=\
Proud Arch i686 & x86_64 User
Share your knowledge!
Arch Linux Forum Etiquette
Offline
melik wrote:3nd3r wrote:getting errors when runnign the code.
[ender@Null ~ ]$ perl script.pl String found where operator expected at script.pl line 31, near "if( /gtk-icon-theme-name.*=.*"" (Might be a runaway multi-line "" string starting on line 28) (Missing semicolon on previous line?) String found where operator expected at script.pl line 34, near "if( /gtk-font-name.*=.*"" (Might be a runaway multi-line "" string starting on line 31) (Missing semicolon on previous line?) String found where operator expected at script.pl line 45, near "$WM =~ /Unknown/ && print "" (Might be a runaway multi-line "" string starting on line 34) (Missing semicolon on previous line?) String found where operator expected at script.pl line 51, near "print "" (Might be a runaway multi-line "" string starting on line 45) (Missing semicolon on previous line?) syntax error at script.pl line 28, near "(." Search pattern not terminated at script.pl line 51. [ender@Null ~ ]$
The perl script is quite buggy, try the python version.
[ender@Null ~ ]$ python script.py File "script.py", line 86 if key in processes: wm = dict[key] ^ IndentationError: expected an indented block [ender@Null ~ ]$
=\
Umm..
wget http://github.com/djmelik/archey/raw/master/archey.py
python archey.py
run those commands.
Last edited by melik (2009-12-07 12:43:15)
Offline
3nd3r wrote:melik wrote:The perl script is quite buggy, try the python version.
[ender@Null ~ ]$ python script.py File "script.py", line 86 if key in processes: wm = dict[key] ^ IndentationError: expected an indented block [ender@Null ~ ]$
=\
Umm..
wget http://github.com/djmelik/archey/raw/master/archey.py python archey.py
run those commands.
yay
[ender@Null ~ ]$ python archey.py
+
#
### OS: Arch Linux
##### Kernel: 2.6.31-ARCH
###### Uptime: 1:47
; #####; DE: KDE
+##.##### WM: kwin
+########## Packages: 854
#############; Root: 5.2G / 19G
###############+
####### #######
.######; ;###;`".
.#######; ;#####.
#########. .########`
######' '######
;#### ####;
##' '##
#' `#
[ender@Null ~ ]$
Proud Arch i686 & x86_64 User
Share your knowledge!
Arch Linux Forum Etiquette
Offline
script can now be found in the AUR:
Offline
Hello,
Here a little patch for archey to add Xfce4.6 support as a DE(no xfce-mcs-manager anymore) :
--- /usr/bin/archey 2009-12-27 20:12:22.000000000 +0100
+++ archey 2009-12-27 20:15:17.000000000 +0100
@@ -99,7 +99,8 @@
def de_display():
dict = {'gnome-session': 'GNOME',
'ksmserver': 'KDE',
- 'xfce-mcs-manager': 'Xfce'}
+ 'xfce-mcs-manager': 'Xfce 4',
+ 'xfconfd': 'Xfce 4.6'}
de = 'None found'
for key in dict.keys():
if key in processes: de = dict[key]
There is an other script (in perl) which i take in this thread, 'archinfo', here the aur package: http://aur.archlinux.org/packages.php?ID=30517
Offline
Hello,
Here a little patch for archey to add Xfce4.6 support as a DE(no xfce-mcs-manager anymore) :
--- /usr/bin/archey 2009-12-27 20:12:22.000000000 +0100 +++ archey 2009-12-27 20:15:17.000000000 +0100 @@ -99,7 +99,8 @@ def de_display(): dict = {'gnome-session': 'GNOME', 'ksmserver': 'KDE', - 'xfce-mcs-manager': 'Xfce'} + 'xfce-mcs-manager': 'Xfce 4', + 'xfconfd': 'Xfce 4.6'} de = 'None found' for key in dict.keys(): if key in processes: de = dict[key]
There is an other script (in perl) which i take in this thread, 'archinfo', here the aur package: http://aur.archlinux.org/packages.php?ID=30517
Thanks, I'll push it to github right now. I also improved the fs_display function.
I'm also looking for any suggestions for new features to add to archey.
Last edited by melik (2009-12-28 03:28:34)
Offline
Skunnyk wrote:Hello,
Here a little patch for archey to add Xfce4.6 support as a DE(no xfce-mcs-manager anymore) :
--- /usr/bin/archey 2009-12-27 20:12:22.000000000 +0100 +++ archey 2009-12-27 20:15:17.000000000 +0100 @@ -99,7 +99,8 @@ def de_display(): dict = {'gnome-session': 'GNOME', 'ksmserver': 'KDE', - 'xfce-mcs-manager': 'Xfce'} + 'xfce-mcs-manager': 'Xfce 4', + 'xfconfd': 'Xfce 4.6'} de = 'None found' for key in dict.keys(): if key in processes: de = dict[key]
There is an other script (in perl) which i take in this thread, 'archinfo', here the aur package: http://aur.archlinux.org/packages.php?ID=30517
Thanks, I'll push it to github right now. I also improved the fs_display function.
I'm also looking for any suggestions for new features to add to archey.
wmii was missing from the wm_display function, too.
I alternate between wmii and KDE (and xmonad on occasion), and I don't really want KWin displayed when I'm in KDE or "none found" displayed for my DE when I'm in wmii. I think it'd be handy to have a function that displays your DE if you're using one and falls back to your WM otherwise. I added a de_or_wm option that does just that (and added wmii to the WM dict); all my changes are at github, so feel free to pull whatever you like!
If you're masochistic, you could try adding theme support like in one of the Perl versions. Anyway, thanks for archey! I have to agree that the code is a bit nicer on the eyes than the Perl versions.
Offline
i finally got my own now as well Thanks guys!
Registered Linux user :#500622
"être fort pour être utile" (be strong to be useful) —Georges Hébert
"There is only Good people and Bad people, we should not be judged by Race, religion or sex but we should be judged by our deeds or actions." - Lindsey Irving
Xenokite aka Lycan
Offline
melik wrote:Skunnyk wrote:Hello,
Here a little patch for archey to add Xfce4.6 support as a DE(no xfce-mcs-manager anymore) :
--- /usr/bin/archey 2009-12-27 20:12:22.000000000 +0100 +++ archey 2009-12-27 20:15:17.000000000 +0100 @@ -99,7 +99,8 @@ def de_display(): dict = {'gnome-session': 'GNOME', 'ksmserver': 'KDE', - 'xfce-mcs-manager': 'Xfce'} + 'xfce-mcs-manager': 'Xfce 4', + 'xfconfd': 'Xfce 4.6'} de = 'None found' for key in dict.keys(): if key in processes: de = dict[key]
There is an other script (in perl) which i take in this thread, 'archinfo', here the aur package: http://aur.archlinux.org/packages.php?ID=30517
Thanks, I'll push it to github right now. I also improved the fs_display function.
I'm also looking for any suggestions for new features to add to archey.
wmii was missing from the wm_display function, too.
I alternate between wmii and KDE (and xmonad on occasion), and I don't really want KWin displayed when I'm in KDE or "none found" displayed for my DE when I'm in wmii. I think it'd be handy to have a function that displays your DE if you're using one and falls back to your WM otherwise. I added a de_or_wm option that does just that (and added wmii to the WM dict); all my changes are at github, so feel free to pull whatever you like!
If you're masochistic, you could try adding theme support like in one of the Perl versions. Anyway, thanks for archey! I have to agree that the code is a bit nicer on the eyes than the Perl versions.
Hey thanks, I'll be pushing your code to the official rep right now .
Also I'll be adding GPU/CPU/RAM info tonight.
Last edited by melik (2009-12-28 21:17:01)
Offline
Hi marinftw - welcome to the forums!
I think that you are after the monthly screenshot thread: http://bbs.archlinux.org/viewtopic.php?id=87851
Nice shot, btw...
Offline
I've got a Bash version version of archinfo out now.
http://github.com/KittyKatt/screenFetch
Previews: http://github.com/KittyKatt/screenFetch … r/gallery/
Edit: Now also hosted at code.google.com: http://code.google.com/p/screenfetch/
Edit 2: Got semi-working distribution detection down. It's sketchy and a little hacky, but it's passed all tests so far. Haven't commited yet. Will do so when it's stable enough to do so. I'll post here when it's been commited. I could use some people to test various distributions.
Last edited by kittykatt (2010-03-29 17:46:02)
- [ My Blog ] | [ AUR Packages ] | [ My deviantART ] | [ screenFetch ] | [ SilverIRC ] -
Offline
Offline
I've got a Bash version version of archinfo out now.
http://github.com/KittyKatt/screenFetch
Previews: http://github.com/KittyKatt/screenFetch … r/gallery/
Edit: Now also hosted at code.google.com: http://code.google.com/p/screenfetch/
Edit 2: Got semi-working distribution detection down. It's sketchy and a little hacky, but it's passed all tests so far. Haven't commited yet. Will do so when it's stable enough to do so. I'll post here when it's been commited. I could use some people to test various distributions.
A simple patch to make it fvwm-compliant :-)
--- screenFetch-v1.7.6.4.orig 2010-03-30 11:50:29.711351696 +0200
+++ screenFetch-v1.7.6.4 2010-03-30 11:49:35.493449165 +0200
@@ -50,7 +50,7 @@ display="OS Kernel Uptime DE WM Win_them
# labelcolor="\e[1;34m"
# WM & DE process names
-wmnames="fluxbox openbox blackbox xfwm4 metacity kwin icewm pekwm"
+wmnames="fluxbox openbox blackbox xfwm4 metacity kwin icewm pekwm fvwm"
denames="gnome-session xfce-mcs-manage xfce4-session ksmserver lxsession"
# Screenshot Settings
@@ -85,7 +85,7 @@ while getopts ":hsvVnc:D:" flags; do
echo ""
echo "Supported Distributions: Arch Linux, Linux Mint, Ubuntu, Crunchbang, Debian, Fedora, and BSD"
echo "Supported Desktop Managers: KDE, GNOME, XFCE, and LXDE"
- echo "Supported Window Managers: PekWM, OpenBox, FluxBox, BlackBox, Xfwm4m, Metacity, KWin, and IceWM"
+ echo "Supported Window Managers: PekWM, OpenBox, FluxBox, BlackBox, Xfwm4m, Metacity, KWin, IceWM and FVWM"
echo ""
echo "Options:"
echo " -v Verbose output."
@@ -209,6 +209,7 @@ detectwm(){
'kwin') WM="KWin";;
'icewm') WM="IceWM";;
'pekwm') WM="PekWM";;
+ 'fvwm') WM="FVWM";;
esac
fi
done
Sony Vaio VPCM13M1E - Arch Linux - LXDE
Offline
kittykatt wrote:I've got a Bash version version of archinfo out now.
http://github.com/KittyKatt/screenFetch
Previews: http://github.com/KittyKatt/screenFetch … r/gallery/
Edit: Now also hosted at code.google.com: http://code.google.com/p/screenfetch/
Edit 2: Got semi-working distribution detection down. It's sketchy and a little hacky, but it's passed all tests so far. Haven't commited yet. Will do so when it's stable enough to do so. I'll post here when it's been commited. I could use some people to test various distributions.
A simple patch to make it fvwm-compliant :-)
--- screenFetch-v1.7.6.4.orig 2010-03-30 11:50:29.711351696 +0200 +++ screenFetch-v1.7.6.4 2010-03-30 11:49:35.493449165 +0200 @@ -50,7 +50,7 @@ display="OS Kernel Uptime DE WM Win_them # labelcolor="\e[1;34m" # WM & DE process names -wmnames="fluxbox openbox blackbox xfwm4 metacity kwin icewm pekwm" +wmnames="fluxbox openbox blackbox xfwm4 metacity kwin icewm pekwm fvwm" denames="gnome-session xfce-mcs-manage xfce4-session ksmserver lxsession" # Screenshot Settings @@ -85,7 +85,7 @@ while getopts ":hsvVnc:D:" flags; do echo "" echo "Supported Distributions: Arch Linux, Linux Mint, Ubuntu, Crunchbang, Debian, Fedora, and BSD" echo "Supported Desktop Managers: KDE, GNOME, XFCE, and LXDE" - echo "Supported Window Managers: PekWM, OpenBox, FluxBox, BlackBox, Xfwm4m, Metacity, KWin, and IceWM" + echo "Supported Window Managers: PekWM, OpenBox, FluxBox, BlackBox, Xfwm4m, Metacity, KWin, IceWM and FVWM" echo "" echo "Options:" echo " -v Verbose output." @@ -209,6 +209,7 @@ detectwm(){ 'kwin') WM="KWin";; 'icewm') WM="IceWM";; 'pekwm') WM="PekWM";; + 'fvwm') WM="FVWM";; esac fi done
Still need a line to grab the FVWM theme. Got that? o.O
Example: The line that grabs the fluxbox theme...
'FluxBox') if [ -f $HOME/.fluxbox/init ]; then Win_theme=`awk -F"/" '/styleFile/ {print $NF}' $HOME/.fluxbox/init`; fi;;
If you could get me that, I'll add it to the source and commit a new version.
And also, very nice shot dmz.
Last edited by kittykatt (2010-03-30 12:55:25)
- [ My Blog ] | [ AUR Packages ] | [ My deviantART ] | [ screenFetch ] | [ SilverIRC ] -
Offline
Still need a line to grab the FVWM theme. Got that? o.O
Example: The line that grabs the fluxbox theme...
'FluxBox') if [ -f $HOME/.fluxbox/init ]; then Win_theme=`awk -F"/" '/styleFile/ {print $NF}' $HOME/.fluxbox/init`; fi;;
If you could get me that, I'll add it to the source and commit a new version.
FVWM is configured with a single file, usually called .fvwm2rc of .fvwm/config and usually runs without a specific theme. For example, I run it without any theme.
There is a package called fvwm-themes that can also be used but it's not mandatory at all; I never used it.
Sony Vaio VPCM13M1E - Arch Linux - LXDE
Offline