You are not logged in.

#1 2010-03-30 15:32:38

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

screenFetch - The Bash Screenshot Information Tool

screenFetch

The title pretty much explains it. screenFetch is a screenshot information tool, similar to archinfo and archey, except in Bash instead of Perl or Python. wink

Features:
  - Detects Desktop Environment, Kernel, Uptime, Window Manager, Window Manager Theme, GTK Theme, GTK Icon Theme, and GTK Font. It also attempts to detect running distribution, but it's a little sketchy at the moment and needs a lot of testing.
  - Supported distros:  Arch Linux (yay!), Linux Mint, LMDE, Ubuntu, Debian, Fedora (untested), SuSe (untested), Mandriva/Mandrake (untested), Crunchbang (somewhat tested), Gentoo (untested), Red Hat Linux (untested), and Tiny Core.
  - Supported Desktop Environments:  KDE, GNOME, XFCE, LXDE, and "Not Present".
  - Supported Window Managers:  PekWM, FluxBox, OpenBox, BlackBox, Xfwm4, Metacity, Kwin (reported as not working), IceWM, FVWM, DWM, Awesome, WindowMaker, XMonad, Musca, i3, Ratpoison, ScrotWM, WMFS, wmii, subtle, E16, Sawfish, and Beryl (if you can find files or syntaxes to detect the theme of more window managers, let me know!)
  - Outputs ASCII logo with information, though you may specify to only output information and no ASCII art.
  - Flag to execute a scrot command to take screenshot named 'screenFetch-(YEAR)-(MONTH)-(DAY).png'
  - Ability to specify custom distribution name and custom screenshot command in execution on command-line.
  - Verbose output

Screenshots:

My official screenshots
Current
screenfetch-asciilogos-20120128-1.thumb.png
screenfetch-asciilogos-20120128-2.thumb.png
Old
screenfetch-asciiart-v2-3-0.thumb.png
moreascii-v1.7.7.thumb.png  v1.4.5-takescreen-example.thumb.png

I made most of these ASCII logos myself, so don't be too critical. wink


User Contributed Screenshots
user-asciilogos.thumb.png


More to come!


And finally, the source code can be found at either github or code.google.com (github will be more up to date as I am personally maintaining that one):

http://github.com/KittyKatt/screenFetch
http://code.google.com/p/screenfetch/
http://git.silverirc.com/cgit.cgi/screenfetch-dev.git/


Current Latest Versionv2.4.0
Latest version can always be found in this folder:  http://github.com/KittyKatt/screenFetch … er/latest/
Latest version can always be found at SilverIRC's Git Repository:  http://git.silverirc.com/cgit.cgi/screenfetch-dev.git/


AUR Packages


Before you say it, yes I do realize some of this is horribly ugly coding. This is one of my first big projects, so I'm welcome to constructive criticism. I'd rather not get "Go home. Try again." types of responses, if you wouldn't mind. ^^;

Any suggestions will be welcome! email me at kittykattATsilverircDOTcom or stop by my IRC network, SilverIRC, at irc://kittykatt.silverirc.com/randomz

Last edited by kittykatt (2012-02-10 12:46:10)


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

Offline

#2 2010-03-30 15:47:30

Ashren
Member
From: Denmark
Registered: 2007-06-13
Posts: 1,229
Website

Re: screenFetch - The Bash Screenshot Information Tool

Well, the ascii logo for Arch is the old (startrekky) one. No reason to use a deprecated logo.

Offline

#3 2010-03-30 15:50:30

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

Re: screenFetch - The Bash Screenshot Information Tool

Ashren wrote:

Well, the ascii logo for Arch is the old (startrekky) one. No reason to use a deprecated logo.

There's a couple others on file if you look in the ascii folder on the github repository. I personally like that one best, so I used it. wink


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

Offline

#4 2010-03-30 15:52:58

livibetter
Member
From: Taipei
Registered: 2008-05-14
Posts: 95
Website

Re: screenFetch - The Bash Screenshot Information Tool

I'm trying 1.7.6.4 but `-s` didn't work, I think some `exit` in your Bash code should be removed or to be `return`?

Last edited by livibetter (2010-03-30 16:05:32)

Offline

#5 2010-03-30 20:13:18

Gen2ly
Member
From: Sevierville, TN
Registered: 2009-03-06
Posts: 1,529
Website

Re: screenFetch - The Bash Screenshot Information Tool

Nice program.  Went ahead an created a PKGBUILD for it:

# Contributor: Todd Partridge (Gen2ly) toddrpartridge (at) gmail

pkgname=screenfetch-git
pkgver=20100330
pkgrel=1
pkgdesc="Bash screenshot information tool"
arch=(any)
url="http://github.com/KittyKatt/screenFetch"
license=('GPL')
depends=('bash')
makedepends=('git')

_gitroot="git://github.com/KittyKatt/screenFetch.git"
_gitname="screenFetch"

build() {

  # Git
  cd "$srcdir"
  msg "Connecting to GIT server...."

  if [ -d $_gitname ] ; then
    cd $_gitname && git pull origin
    msg "The local files are updated."
  else
    git clone $_gitroot $_gitname
  fi

  msg "GIT checkout done or server timeout"
  msg "Starting make..."

  rm -rf "$srcdir/$_gitname-build"
  git clone "$srcdir/$_gitname" "$srcdir/$_gitname-build"
  cd "$srcdir/$_gitname-build"

  # Create pkgdir folders
  install -d $pkgdir/usr/bin
  install -d $pkgdir/usr/share/screenFetch

  # Install
  cp -r screenFetch $pkgdir/usr/share/screenFetch
  cp -r ascii $pkgdir/usr/share/screenFetch

  ln -s /usr/share/screenFetch/screenFetch/latest/screenFetch-v1.7.6.4 $pkgdir/usr/bin/screenfetch

}

Be free to put it on the AUR or whatever.  To better create the package a few ideas (not sure if they meld with the development philosophy).  The script in latest could be a link to the newest.  Also the script could be lowercase (I think people have becomed accustomed to that [both programs and scripts] and is the general recommendation.  Last but least (I really do like this script btw big_smile) there is no '--help' option.  Yes I found '-h' but in my experiences '--help' is more prevalant.  Thanks for the script, very nice.


Setting Up a Scripting Environment | Proud donor to wikipedia - link

Offline

#6 2010-03-30 20:43:08

Daenyth
Forum Fellow
From: Boston, MA
Registered: 2008-02-24
Posts: 1,244

Re: screenFetch - The Bash Screenshot Information Tool

Why do you have a ton of sub directories in there? I... ugh. Isn't the point of using a VCS to avoid that sort of hackery? sad

Offline

#7 2010-03-31 00:46:11

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

Re: screenFetch - The Bash Screenshot Information Tool

First, of all, thank you very much for this and for the praise/support Gen2ly! It's much appreciated. Here's a couple things I'd like to ask/point out/discuss/whatnot with you:

Gen2ly wrote:

The script in latest could be a link to the newest.

Thought about this. The only crappy part is updating the symlink everytime I update to a new version. Though I'm already copying the new version into the "latest" folder anyways, so I suppose that's feasible. I'll get on that.

Gen2ly wrote:

Also the script could be lowercase (I think people have becomed accustomed to that [both programs and scripts] and is the general recommendation.

Hm. I'll consider that. big_smile

Gen2ly wrote:

Last but least (I really do like this script btw big_smile) there is no '--help' option.  Yes I found '-h' but in my experiences '--help' is more prevalant.

I'm a noob with getopts (this is literally my first time extensively using it), and as I understand it does not support long options. I had a very hacky method to "redirect" all double hyphen "--" options to their short option "-" equivalent, but it had many issues. Any ideas would be appreciated as I do support the need for both --help and --version.

I'm also a huge newbie with hosting on the AUR. Any good guides to getting a package up on there? big_smile And where do I put in the copyright-ish stuff? >.>



Daenyth wrote:

Why do you have a ton of sub directories in there? I... ugh. Isn't the point of using a VCS to avoid that sort of hackery?

This is my first attempt at dealing with hosting any kind of repository through a VCS, so forgive my design flaws for the moment, if you will. wink Any suggestions you have would be more than welcome.




livibetter wrote:

I'm trying 1.7.6.4 but `-s` didn't work, I think some `exit` in your Bash code should be removed or to be `return`?

Huh. I guess I should have tested that a little more thoroughly. I see that it doesn't work now. I'll get back to you on that.

Last edited by kittykatt (2010-03-31 00:51:14)


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

Offline

#8 2010-03-31 02:21:28

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

Re: screenFetch - The Bash Screenshot Information Tool

Fixed "-s" flag. You were right and it was my many, many unnecessary "exit"s. Thanks.

I'll upload the fix now.


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

Offline

#9 2010-03-31 02:41:30

Gen2ly
Member
From: Sevierville, TN
Registered: 2009-03-06
Posts: 1,529
Website

Re: screenFetch - The Bash Screenshot Information Tool

Sure be glad to point you to a couple links.  Using the AUR is pretty simple.

About Submitting and Maintaining a package in the AUR:

[wiki]AUR#Submitting_Packages_to_UNSUPPORTED[/wiki]

About Creating PKGBUILDS:

[wiki]Creating_Packages[/wiki]

It may look like a bit of details, but really it's pretty straightforward.  If unclear on any details, please ask.


Setting Up a Scripting Environment | Proud donor to wikipedia - link

Offline

#10 2010-03-31 02:45:02

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

Re: screenFetch - The Bash Screenshot Information Tool

Gen2ly wrote:

Sure be glad to point you to a couple links.  Using the AUR is pretty simple.

About Submitting and Maintaining a package in the AUR:

[wiki]AUR#Submitting_Packages_to_UNSUPPORTED[/wiki]

About Creating PKGBUILDS:

[wiki]Creating_Packages[/wiki]

It may look like a bit of details, but really it's pretty straightforward.  If unclear on any details, please ask.

Thank you VERY much. I'll be using those ASAP.

Also, v1.7.6.5 is out with the -s flag fix. Screenshots should be possible now. wink

I also reworked the directory structure. Let me know if anyone thinks it's no good.

Last edited by kittykatt (2010-03-31 03:06:02)


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

Offline

#11 2010-03-31 05:17:50

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

Re: screenFetch - The Bash Screenshot Information Tool

Uploaded that PKGBUILD. screenFetch is officially in the AUR. wink

Package Name:  screenfetch-git


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

Offline

#12 2010-03-31 05:57:30

my0pic
Member
From: Melbourne, Australia
Registered: 2008-05-23
Posts: 206

Re: screenFetch - The Bash Screenshot Information Tool

Hi, just trying this out now. Found that your install script doesn't chmod+x /usr/share/screenFetch/latest/screenFetch.

Offline

#13 2010-03-31 06:39:08

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

Re: screenFetch - The Bash Screenshot Information Tool

Yeah, I'm horrible with PKGBUILD's. Tried to add it in there, but failed miserably. If you wanna go ahead and throw me a fixed PKGBUILD that'd be great.

I tried adding...

  chmod +x /usr/share/screenFetch/latest/screenFetch

To the end of the file as well as...

  chmod +x $pkgdir/usr/bin/screenfetch

But both failed.

I'm a noob at PKGBUILD's. >.>



Also, what'd you think of the script itself? Feedback == Awesome. xD

Last edited by kittykatt (2010-03-31 06:40:14)


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

Offline

#14 2010-03-31 09:05:56

my0pic
Member
From: Melbourne, Australia
Registered: 2008-05-23
Posts: 206

Re: screenFetch - The Bash Screenshot Information Tool

just chmod +x the file on the git server.

Offline

#15 2010-03-31 09:09:02

livibetter
Member
From: Taipei
Registered: 2008-05-14
Posts: 95
Website

Re: screenFetch - The Bash Screenshot Information Tool

my0pic wrote:

just chmod +x the file on the git server.

I agreed with this because I cloned your git repo. (I'm not using Arch) and make a symbolic link to the latest. This would be better for me.

Offline

#16 2010-03-31 10:20:14

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

Re: screenFetch - The Bash Screenshot Information Tool

chmodded the file that the PKGBUILD downloads. symlinks absolutely failed to upload to github correctly. >.<


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

Offline

#17 2010-03-31 14:55:09

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

Re: screenFetch - The Bash Screenshot Information Tool

Pushed/Committed to v1.7.7

Changes:
  - Added FVWM support as per request of goran'agar on these forums. Actual forum post [url=http://bbs.archlinux.org/viewtopic.php?pid=734003#p734003]here[/here].

Latest source:  Folder   Raw Source


I also added REAL thumbnails to the first post. I'll be updating that post whenever any changes occur.

We're in the AUR! screenfetch-git

Pushed/Committed to v1.7.9

Changes:
  - Added support to DETECT the following window managers:  DWM, Awesome, and WindowMaker. Currently, none of the theme detections I have for these are fool-proof, so if anyone has any ideas, that'd be amazing.

Latest source:  Folder   Raw Source


Edit: Holy cheez whiz. screenFetch got featured in the April Article of the ALM. Thank you so very much!

Last edited by kittykatt (2010-04-06 03:01:56)


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

Offline

#18 2010-04-14 21:40:57

eMxyzptlk
Member
Registered: 2008-02-04
Posts: 7

Re: screenFetch - The Bash Screenshot Information Tool

First thanks for this cute proggy smile

kittykatt wrote:
Daenyth wrote:

Why do you have a ton of sub directories in there? I... ugh. Isn't the point of using a VCS to avoid that sort of hackery?

This is my first attempt at dealing with hosting any kind of repository through a VCS, so forgive my design flaws for the moment, if you will. wink Any suggestions you have would be more than welcome.

Actually, using folders like these to store versions is at best VERY BAD smile it's like you're on subversion days, instead of having folders like these, you should use tags http://www.kernel.org/pub/software/scm/ … t-tag.html a small howto:

$ git tag -s v1.2 -m 'Release Version 1.2'
$ git push --tags

NOTE: the -s tells git to sign (using gpg) the tag, which you should omit if you don't use/have gpg configured..

You can also create tags for the version as they were by appending the hash of latest commit of that version to the end of the git tag command..

If you have questions don't hesitate to ask smile

Offline

#19 2010-04-14 21:54:32

eMxyzptlk
Member
Registered: 2008-02-04
Posts: 7

Re: screenFetch - The Bash Screenshot Information Tool

I have a small note about the way you detect window manager or desktop environment etc.. you use pidof to check if it's running, but imagine that there's two or more users with open sessions, one using Gnome, one using Awesome and another using KDE, how would you know which one the current user is running?

To solve this, instead of getting all PIDs of all process matching your search, look for the PIDs under the current user using the pgrep function, example:

                                                              
userId="$(id -u ${USER})"
for each in $wmnames; do
    PID="$(pgrep -U ${userId} $each)
    if $PID; then ...

Last edited by eMxyzptlk (2010-04-14 21:55:28)

Offline

#20 2010-04-15 04:16:25

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

Re: screenFetch - The Bash Screenshot Information Tool

Thanks for the suggestions! I never thought about the multiple session/user problem before because I do most of my testing on my laptop. ^^; I'll be sure to integrate that into the next version.

Also, I'll look into those tags. I've revamped the structuring just a bit at the moment, but it's still ugly. I'll have another go at it sometime soon.


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

Offline

#21 2010-04-18 16:47:44

francisc1701
Member
From: Romania
Registered: 2008-11-27
Posts: 14

Re: screenFetch - The Bash Screenshot Information Tool

Detecting the gtk theme doesn't work for me. Specifically, this line:

awk -F"/" '/^include/ { getline; print $5}' $HOME/.gtkrc.mine

returns an empty string or a newline (or something):

2 18:25 asdf@myhost ~
$ awk -F"/" '/^include/ { getline; print $5}' $HOME/.gtkrc.mine

2 18:27 asdf@myhost ~
$

My .gtkrc.mine:

include "/usr/share/themes/Clearlooks/gtk-2.0/gtkrc"

gtk-toolbar-style = GTK_TOOLBAR_ICONS
gtk-icon-theme-name = "gnome"

This works for me:

$ grep '^include.*gtkrc' $HOME/.gtkrc.mine | awk -F "/" '{ print $5 }'
Clearlooks

Also, screenfetch detects two Awesome themes, because of this part of my rc.lua:

$ grep themes .config/awesome/rc.lua 
theme_file = awful.util.getdir("config") .. "/themes/default/theme.lua"
--theme_file = "/usr/share/awesome/themes/sky/theme.lua"

Perhaps change this:

Win_theme=`grep -e '\(theme\|beautiful\).*lua' $HOME/.config/awesome/rc.lua

to

Win_theme=`grep -e '^[^-].*\(theme\|beautiful\).*lua' $HOME/.config/awesome/rc.lua

so it ignores any lines that start with a dash.

I set my gtk icon theme in .gtkrc.mine. You could make it look like this:

if [ -f $HOME/.gtkrc.mine ]; then
   if grep -q "^include" $HOME/.gtkrc.mine; then
      gtkTheme=$(awk -F"/" '/^include/ { getline; print $5}' $HOME/.gtkrc.mine)
   fi

+   if grep -q "^gtk-icon-theme-name" $HOME/.gtkrc.mine; then
+     gtkIcons=$(grep 'gtk-icon-theme-name' $HOME/.gtkrc.mine | awk -F '"' '{print $2}')
+   fi
fi

Anyway, here's the diff containing the changes I made: http://pasteit.ghost1227.com/2151
Before: sad
tNDcycg
After: smile
tNDcydA

If I do screenfetch -s more than once a day in the same folder, the old shot is overwritten without any sort of warning. Perhaps make the filename screenFetch-YYYY-MM-DD-hhmmss.png

screenfetch version: 20100413-1

Last edited by francisc1701 (2010-04-18 16:57:56)

Offline

#22 2010-04-18 22:34:26

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

Re: screenFetch - The Bash Screenshot Information Tool

@francisc1701:  Thanks for all of the input! I'll look into the bugs you've mentioned and fix them. smile

I think you switched those around, because it looks like your "After" screenshot is pretty broken in several places. ^^;

Other than these little bugs, do you like screenFetch so far? big_smile



@eMxyzptlk:  I've encountered an error. What if the user is using GDM? KDM? LXDM? SLiM? As far as I know, those run the window managers under their own user (I know for a fact that GDM does, tested it today) and therefore it would not sense ANY window manager using the method you posted and that I've integrated. Any ideas there?

Last edited by kittykatt (2010-04-19 02:01:43)


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

Offline

#23 2010-04-19 09:16:38

francisc1701
Member
From: Romania
Registered: 2008-11-27
Posts: 14

Re: screenFetch - The Bash Screenshot Information Tool

kittykatt wrote:

I think you switched those around, because it looks like your "After" screenshot is pretty broken in several places. ^^;

I dunno, they look right to me neutral

kittykatt wrote:

Other than these little bugs, do you like screenFetch so far? big_smile

Yes, I like it.

Offline

#24 2010-07-16 22:03:24

dkorzhevin
Member
From: Kiev, Ukraine
Registered: 2010-04-23
Posts: 61

Re: screenFetch - The Bash Screenshot Information Tool

Very good program, I recommend use it to anyone who makes screenshots:)

Offline

#25 2010-08-30 12:49:30

Sector11
Banned
Registered: 2010-02-25
Posts: 10

Re: screenFetch - The Bash Screenshot Information Tool

tNWR3ag
OK I do see a few "Oops! that's not good!" things in there.  When I did a verbose output I see more. 

Keep in mind that this is #! Statler - OpenBox and Xfce as a DM doesn't really exist.

Also I am NOT complaining as this is an ARCH tool, just thought you might like to know.   smile

  09:24 ~
         $ screenfetch
:: Finding distro...found as 'Debian'
:: Finding kernel version...found as '2.6.32-5-amd64'
:: Finding current uptime...found as '35m'
/home/sector11/bin/screenfetch: line 181: xfce4-settings-manager: command not found
:: Finding desktop environment...found as 'XFCE'    <<----- not really there
:: Finding window manager...found as 'OpenBox'
:: Finding window manager theme...found as 'S11-OB3-A2'    <<----- S11-OB3-StatlerBox
:: Finding GTK theme...found as 'S11-Window'    <<----- S11-OB3-StatlerBox
:: Finding icon theme...found as 'kover'    <<----- AnyColorYouLike
:: Finding user font...found as 'Monospace 9'
:: Finding width of terminal...found as '88'
  _,met$$$$$gg.
  ,g$$$$$$$$$$$$$$$P.
  ,g$$P"" """Y$$.".
  ,$$P' `$$$.  OS: Debian x86_64
 ',$$P ,ggs. `$$b:  Kernel: 2.6.32-5-amd64
 `d$$' ,$P"\' . $$$  Uptime: 35m
  $$P d$\' , $$P  DE: XFCE
  $$: $$. - ,d$$'  WM: OpenBox
  $$\; Y$b._ _,d$P'  WM Theme: S11-OB3-A2
  Y$$. `.`"Y$$$$P"'  GTK Theme: S11-Window
  `$$b "-.__  Icon Theme: kover
  `Y$$  Font: Monospace 9
  `Y$$. 
  `$$b.
  `Y$$b.
  `"Y$b._
  `""""

  09:24 ~
         $ 

Offline

Board footer

Powered by FluxBB