You are not logged in.

#1 2010-08-27 07:51:01

dmz
Member
From: Sweden
Registered: 2008-08-27
Posts: 881
Website

screenfo - Yet another screenshot information tool

I was checking out the Perl source for the original arch-info script.
I felt an urgent need to clean it up, but it was just a big mess, so I started hacking... and here's the result.

GIT: http://github.com/trapd00r/screenfo
AUR: http://aur.archlinux.org/packages.php?ID=40299

0.22-t.png

man screenfo wrote:

NAME
      screenfo - screenshot information tool for nerds

SYNOPSIS
      screenfo [OPTION]...

DESCRIPTION
    Everybody likes 'The monthly screenshot thread' where one is supposed to
    show off their latest setup.

    Nobody likes screenshots that look awesome, but where there's no
    information at all available.

    screenfo outputs a load of system information, including the running
    window manager, GTK theme, icons, fonts, shell, terminal emulator, and
    much more, while taking the screenshot.

OPTIONS
      -c,   --color     specify colorscheme to use
      -l,   --list      list available colorschemes
      -a,   --ascii     specify ascii art to use
      -n,   --noran     dont randomize the colors
      -s    --shot      take screenshot

      -h,   --help      show help and exit
      -v,   --version   show version info and exit

ENVIRONMENT
    The configuration file should be placed in either /etc/screenfo.conf or
    $XDG_CONFIG_HOME/screenfo/screenfo.conf

REQUIREMENTS
    Perl => 5.10

    The String::Utils module, available in AUR and
    <http://github.com/trapd00r/String-Utils>

    Some standard UNIX tools

    scrot for taking the actual screenshot

AUTHOR
    Written by Magnus Woldrich

REPORTING BUGS
    Report bugs to trapd00r\@trapd00r.se or use the issue tracker located at
    <http://github.com/trapd00r/screenfo/issues>

    screenfo homepage: <http://github.com/trapd00r/screenfo>

COPYRIGHT
    Copyright (C) 2010 Magnus Woldrich

    License: GPLv2

HISTORY
    Lets quote the Arch Linux user dtw from a post on the BBS, late 2006:

        OK, all the time in the screenshots thread we get "What gtk theme is that?",
        "What is that in the corner?", blah blah blah.
        Now, while we try to encourage people to post that with their screenie why
        don't we make a simple script that grabs info from from the gtkrc's, .xinitrc,
        etc, and outputs into a nice cowsay-like soundbite?

    Couple days later, user rab made the first Perl version simply named
    'info.pl'. There were a lot of people in the community helping out,
    making it better, bigger, more complicated and virtually unmaintainable
    since absolutely no modularization or subroutines were used.

    People realized this and started to make their own versions in Bash and
    Python.

    My intent was to fork the original project, clean it up and make it
    maintainable, but that was no fun. Therefore, screenfo was born.

THANKS
    I'd like to thank the Archlinux community for being awesome, kittykatt
    for providing some ASCII art that I stole without asking, and slush- for
    coming up with this awesome name.

SEE ALSO
    The original post:
    <https://bbs.archlinux.org/viewtopic.php?id=24208&p=10>

    screenFetch: <http://github.com/KittyKatt/screenFetch>

    archey: <http://github.com/djmelik/archey>

Offline

#2 2010-08-27 08:25:57

melik
Member
Registered: 2009-10-11
Posts: 108

Re: screenfo - Yet another screenshot information tool

Looks really good, I'd help test it, but no more Arch Linux for the time being sad

Someone should make a wiki page for all the screenshot information tools.

Offline

#3 2010-08-27 20:55:11

goran'agar
Member
From: Nothern Italy
Registered: 2009-05-19
Posts: 171

Re: screenfo - Yet another screenshot information tool

Hi.
Very nice indeed. Some issues:
* musca is not recognized as a window manager
* theme / fonts etc. are not populated
* uptime less than 1 hour is reported as "-1 and 13 min"
* kernel 2.6.36-rc2+ is recognised as 2.6.36

Last edited by goran'agar (2010-08-27 21:14:59)


Sony Vaio VPCM13M1E  - Arch Linux - LXDE

Offline

#4 2010-08-27 21:26:20

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: screenfo - Yet another screenshot information tool

PKGBUILD and Makefile are bad. The PKGBUILD uses su for the Makefile to copy files to /usr/local/bin, and nothing is added to the package.

Disk free looks like disk usage (1TB / 5TB, generally means 4TB free)

I think instead of a Makefile it would be easier to leave the installation to the PKGBUILD. Maybe something like this:
install -D "$srcdir/$_gitname-build"/src/screenfo "$pkgdir/usr/bin/"
mkdir -p "$pkgdir/usr/share/screenfo"
cp -R "$srcdir/$_gitname-build"/ascii/ "$pkgdir/usr/share/screenfo/"
install -D -m 664 "$srcdir/$_gitname-build"/screenfo.conf "$pkgdir/usr/share/screenfo/screenfo.conf.example"
install -D -m 664 "$srcdir/$_gitname-build"/screenfo.conf "$pkgdir/etc/screenfo.conf"

Last edited by Procyon (2010-08-27 22:09:45)

Offline

#5 2010-08-28 02:40:22

dmz
Member
From: Sweden
Registered: 2008-08-27
Posts: 881
Website

Re: screenfo - Yet another screenshot information tool

goran'agar wrote:

Hi.
Very nice indeed. Some issues:
* musca is not recognized as a window manager
* theme / fonts etc. are not populated
* uptime less than 1 hour is reported as "-1 and 13 min"
* kernel 2.6.36-rc2+ is recognised as 2.6.36

Thank you.
Musca is added, the uptime bug is fixed, and so is the kernel detection.

Are you using a $HOME/.gtkrc-2.0, or are there other places where this could be specified?

Last edited by dmz (2010-08-28 03:25:52)

Offline

#6 2010-08-28 02:48:48

dmz
Member
From: Sweden
Registered: 2008-08-27
Posts: 881
Website

Re: screenfo - Yet another screenshot information tool

Procyon wrote:

PKGBUILD and Makefile are bad. The PKGBUILD uses su for the Makefile to copy files to /usr/local/bin, and nothing is added to the package.

Disk free looks like disk usage (1TB / 5TB, generally means 4TB free)

I think instead of a Makefile it would be easier to leave the installation to the PKGBUILD. Maybe something like this:
install -D "$srcdir/$_gitname-build"/src/screenfo "$pkgdir/usr/bin/"
mkdir -p "$pkgdir/usr/share/screenfo"
cp -R "$srcdir/$_gitname-build"/ascii/ "$pkgdir/usr/share/screenfo/"
install -D -m 664 "$srcdir/$_gitname-build"/screenfo.conf "$pkgdir/usr/share/screenfo/screenfo.conf.example"
install -D -m 664 "$srcdir/$_gitname-build"/screenfo.conf "$pkgdir/etc/screenfo.conf"

har

Thanks a lot for the effort, that was indeed better and I knew the Makefile thingy couldn't be quite The Right Way. smile
I'm not certain installing the config file in /etc every time is such a good idea though, since it'll be overwritten (that was why I simply placed the example config in /usr/share/scrw.eenfo/).
But maybe there's a way one could simply specify that pacman should backup the config first, or install the new config as a .pacnew...

Edit: Got damn it, there even was a man PKGBUILD and a dedicated backup array. Thanks!

Edit again: It keeps on complaining on 'invalid backup entry' for some reason. Updated PKGBUILD - http://aur.archlinux.org/packages/scree … t/PKGBUILD

Last edited by dmz (2010-08-28 03:04:11)

Offline

#7 2010-08-28 03:26:23

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: screenfo - Yet another screenshot information tool

backup should be the path to the file, sans the leading slash. For example, from pacman's PKGBUILD:

backup=(etc/pacman.conf etc/makepkg.conf)

Your current PKGBUILD implies that there should be a '/screenfo.conf' file.

Offline

#8 2010-08-28 03:50:50

dmz
Member
From: Sweden
Registered: 2008-08-27
Posts: 881
Website

Re: screenfo - Yet another screenshot information tool

Excellent, thank you.

Offline

#9 2010-08-28 07:52:01

goran'agar
Member
From: Nothern Italy
Registered: 2009-05-19
Posts: 171

Re: screenfo - Yet another screenshot information tool

dmz wrote:
goran'agar wrote:

Hi.
Very nice indeed. Some issues:
* musca is not recognized as a window manager
* theme / fonts etc. are not populated
* uptime less than 1 hour is reported as "-1 and 13 min"
* kernel 2.6.36-rc2+ is recognised as 2.6.36

Thank you.
Musca is added, the uptime bug is fixed, and so is the kernel detection.

Are you using a $HOME/.gtkrc-2.0, or are there other places where this could be specified?

Thanks. Musca detection is ok.

The uptime is not really fixed; it's just a cosmetical issue but it reads "0 and 5 min" instead of "o hrs and 5 min" or just "5 min".

The kernel detection is almost ok, it reads 2.6.36-rc2 instead of 2.6.36-rc2+

I indeed use $HOME/.gtkrc-2.0 . FYI, it reads just:

[root@ratbert] - [~] cat .gtkrc-2.0
gtk-font-name = "Dejavu Sans 9"
gtk-theme-name = "OverglossedHybrid"


Sony Vaio VPCM13M1E  - Arch Linux - LXDE

Offline

#10 2010-08-28 15:18:37

dmz
Member
From: Sweden
Registered: 2008-08-27
Posts: 881
Website

Re: screenfo - Yet another screenshot information tool

Uptime is now fixed, again. So should the kernel detection be, and if no data is found for a particular GTK item, we'll just show 'Not found' instead of emptyness.

Thank you for testing.

Offline

#11 2010-08-28 16:30:36

kmason
Member
From: Tempe, Arizona, USA
Registered: 2010-03-23
Posts: 256
Website

Re: screenfo - Yet another screenshot information tool

Could you add support for Compiz?

Offline

#12 2010-08-28 16:38:01

goran'agar
Member
From: Nothern Italy
Registered: 2009-05-19
Posts: 171

Re: screenfo - Yet another screenshot information tool

dmz wrote:

Uptime is now fixed, again. So should the kernel detection be, and if no data is found for a particular GTK item, we'll just show 'Not found' instead of emptyness.

Thank you for testing.

You're welcome.
And by the way, I found the bug which is preventing my GTK details to show: in your function "get_gtk_info" you assume that the entries are immediately followed by the "=" sign; this is not correct as they can be followed by any combination of blanks, tabs, etc.

So "gtk_theme_name=whatever" works and "gtk_theme_name      = whatever " fails.
Another one small bug, the "Not found" phrase is printed only in place of a missing theme and is not printed in case of missing icon theme or toolbar, which by the way is my case. :-)

Anyway, I "fixed" my gtkrc-2.0 and everything is working for me now. Many thanks.


Sony Vaio VPCM13M1E  - Arch Linux - LXDE

Offline

#13 2010-08-28 16:47:08

Chokkan
Member
Registered: 2009-04-06
Posts: 129

Re: screenfo - Yet another screenshot information tool

kmason wrote:

Could you add support for Compiz?

+1


< Daenyth> tomkx: my girlfriend is linux
< Daenyth> srsly
< Daenyth> she loves the way I «make install»
< Daenyth> all her /dev entries are mode 7 for me

Offline

#14 2010-08-28 18:08:56

dmz
Member
From: Sweden
Registered: 2008-08-27
Posts: 881
Website

Re: screenfo - Yet another screenshot information tool

Thank you for the investigation, goran'agar. I'm not to familiar with the GTK stuff so that was just guesswork. I've changed the regex now to allow the optional whitespace.

I've added compiz, metacity, beryl, kwin, xfwm4 and windowmaker support. Since I've never used either, I'm not sure if I got all the process names correct - please tell me the processname if requesting a new wm to be added.

Offline

#15 2010-08-28 18:25:26

goran'agar
Member
From: Nothern Italy
Registered: 2009-05-19
Posts: 171

Re: screenfo - Yet another screenshot information tool

dmz wrote:

Thank you for the investigation, goran'agar. I'm not to familiar with the GTK stuff so that was just guesswork. I've changed the regex now to allow the optional whitespace.

You're welcome. All the gtk stuff is ok now, but I just noticed that screenfo's  uptime says:

Uptime: 2:36 days and 0 users

instead of 2:36 hours ...


Sony Vaio VPCM13M1E  - Arch Linux - LXDE

Offline

#16 2010-08-28 18:31:17

dmz
Member
From: Sweden
Registered: 2008-08-27
Posts: 881
Website

Re: screenfo - Yet another screenshot information tool

You keep on having < 24h uptime, you. smile Fixed!

Offline

#17 2010-08-28 18:59:12

cesura
Package Maintainer (PM)
From: Tallinn, Estonia
Registered: 2010-01-23
Posts: 1,867

Re: screenfo - Yet another screenshot information tool

Stop making useful things! tongue

Offline

#18 2010-08-30 03:45:11

kittykatt
Member
From: Missouri, USA
Registered: 2009-11-04
Posts: 260
Website

Re: screenfo - Yet another screenshot information tool

I really need to test this out ASAP. I also need to find you on IRC. *does a WHOIS on freenode* PSSSHH! Not in any channels. You should join SilverIRC once in awhile, too. We're still there, though collecting a little dust lately, unfortunately. The archlinux.gr community is really the thing that keeps it alive.

Anyways, enough unrelated postage.


- [ My Blog ] | [ AUR Packages ] | [ My deviantART ] | [ screenFetch ] | [ SilverIRC ] -

Offline

#19 2010-08-30 04:01:43

dmz
Member
From: Sweden
Registered: 2008-08-27
Posts: 881
Website

Re: screenfo - Yet another screenshot information tool

I'm on freenode under the nick 'scp1'. tongue

Offline

#20 2010-09-03 08:15:22

goran'agar
Member
From: Nothern Italy
Registered: 2009-05-19
Posts: 171

Re: screenfo - Yet another screenshot information tool

dmz wrote:

You keep on having < 24h uptime, you. smile Fixed!

It now says 0 days and 46 min.

Last edited by goran'agar (2010-09-03 08:16:55)


Sony Vaio VPCM13M1E  - Arch Linux - LXDE

Offline

#21 2010-09-03 09:03:00

dmz
Member
From: Sweden
Registered: 2008-08-27
Posts: 881
Website

Re: screenfo - Yet another screenshot information tool

Good.

Added Maemo and Matchbox support.
Remade the CPU finding function so that ARM processors could be identified as well.

Offline

#22 2010-09-03 09:13:23

igndenok
Member
From: Sidoarjo, Indonesia
Registered: 2010-06-07
Posts: 160

Re: screenfo - Yet another screenshot information tool

Theme, Icons and Toolbar show 'None found', I think it should be 'Not found' ???
I used awesome WM, here my screenshot


Ask, and it shall be given you.
Seek, and ye shall find.
Knock, and it shall be opened unto you.

Offline

#23 2010-09-03 09:25:08

dmz
Member
From: Sweden
Registered: 2008-08-27
Posts: 881
Website

Re: screenfo - Yet another screenshot information tool

igndenok wrote:

Theme, Icons and Toolbar show 'None found', I think it should be 'Not found' ???
I used awesome WM, here my screenshot

Could I see your $HOME/.gtkrc-2.0 if you have one please?

Offline

#24 2010-09-03 09:41:41

igndenok
Member
From: Sidoarjo, Indonesia
Registered: 2010-06-07
Posts: 160

Re: screenfo - Yet another screenshot information tool

dmz wrote:

Could I see your $HOME/.gtkrc-2.0 if you have one please?

Here my .gtkrc-2.0

# -- THEME AUTO-WRITTEN DO NOT EDIT
include "/usr/share/themes/Clearlooks/gtk-2.0/gtkrc"

style "user-font" {
    font_name = "Sans 8"
}

widget_class "*" style "user-font"

gtk-font-name="Sans 8"

include "/home/igndenok/.gtkrc.mine"

# -- THEME AUTO-WRITTEN DO NOT EDIT

And my .gtkrc.mine

# User config
gtk-icon-theme-name   = "elementary"

#gtk-toolbar-style     = GTK_TOOLBAR_ICONS
#gtk-toolbar-style     = GTK_TOOLBAR_TEXT
#gtk-toolbar-style     = GTK_TOOLBAR_BOTH
gtk-toolbar-style     = GTK_TOOLBAR_BOTH_HORIZ

Ask, and it shall be given you.
Seek, and ye shall find.
Knock, and it shall be opened unto you.

Offline

#25 2010-09-03 14:20:15

kittykatt
Member
From: Missouri, USA
Registered: 2009-11-04
Posts: 260
Website

Re: screenfo - Yet another screenshot information tool

I suggest writing a couple lines in your GKT detection to detect "include" lines that reference a directory in /usr/share/themes/. Just a thought.

Also, keep up the good work, dmz. Looking good. big_smile


- [ My Blog ] | [ AUR Packages ] | [ My deviantART ] | [ screenFetch ] | [ SilverIRC ] -

Offline

Board footer

Powered by FluxBB