You are not logged in.

#1 2015-01-31 22:24:32

wm
Member
Registered: 2014-06-01
Posts: 6

specy: a command line system description output tool

specy is a program which displays your computer's specifications (thus the name specy) which was inspired by the package archey. It is implemented in bash.


Features:
* Adapt to size of terminal to show minimal or full display
* Customizable colors through command arguments
* Easily add new information to the output
* Displays dynamically updating values including drives, swap, RAM, window manager, and packages installed
* Configure what is displayed upon execution

Dependencies:
* ncurses


specy is available in the AUR here.
The git repository is available here.


Here is an example of the program running in a large terminal:
https://farm9.staticflickr.com/8572/164 … cb7e_o.png


Here is an example of the program adapting to a smaller terminal:
https://farm8.staticflickr.com/7377/164 … 8d49_o.png


This is my first PKGBUILD I have created and uploaded to the AUR. Please contribute, criticize, and comment.



Thanks.



-- mod edit: read the Forum Etiquette and only post thumbnails http://wiki.archlinux.org/index.php/For … s_and_Code [jwr] --

Last edited by wm (2015-02-07 05:54:26)

Offline

#2 2015-02-01 00:51:55

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: specy: a command line system description output tool

Very nice, thank you!

Could you just `echo $EDITOR` rather than ask?

Also, monsterwm is not recognised; `wmctrl -m` returns:

Cannot get window manager info properties.
(_NET_SUPPORTING_WM_CHECK or _WIN_SUPPORTING_WM_CHECK)

But I suppose it is a little obscure...

Offline

#3 2015-02-01 01:31:19

wm
Member
Registered: 2014-06-01
Posts: 6

Re: specy: a command line system description output tool

Thank you for commenting!

I just added support for using the $EDITOR command if it is defined. When not defined. the user is prompted on what text editor they use.
I am baffled as to what is a universal method to detect the current window manager, the most comprehensive method I found was just using wmctrl.

I decided not to prompt the user because sometimes the user may not use a window manager or switch to another. Also, I believe wmctrl works in most cases.

If there is no other solution, you could edit the specy bash executable in /usr/bin/specy and edit the variable line9a to make the text statically output your window manager.

Offline

#4 2015-02-01 01:38:29

progandy
Member
Registered: 2012-05-17
Posts: 5,190

Re: specy: a command line system description output tool

Head_on_a_Stick wrote:

Could you just `echo $EDITOR` rather than ask?

I'd guess you could choose the editor from a list like this. I assume if emacs is installed you want to use it, then try vim as second choice then nano and as last resort vi.

{ [ -n $EDITOR ] && command -v $EDITOR >/dev/null 2>&1 } || for e in emacs vim nano vi; do
    command -v $e >/dev/null 2>&1 && EDITOR=$e && break
done

Last edited by progandy (2015-02-01 01:39:07)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#5 2015-02-01 01:40:35

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: specy: a command line system description output tool

wm wrote:

If there is no other solution

Well, you could steal the method used in screenfetch (lines 1251-1390, with initial definitions at lines 54-58)...

Offline

#6 2015-02-01 01:47:20

wm
Member
Registered: 2014-06-01
Posts: 6

Re: specy: a command line system description output tool

Head_on_a_Stick wrote:
wm wrote:

If there is no other solution

Well, you could steal the method used in screenfetch (lines 1251-1390, with initial definitions at lines 54-58)...

Very true. I can adapt this method for my program. I will add this, but first I will do a little research to see how to properly deal with licensing stuff. screenfetch is GPLv3.

Offline

#7 2015-02-01 01:56:03

wm
Member
Registered: 2014-06-01
Posts: 6

Re: specy: a command line system description output tool

progandy wrote:
Head_on_a_Stick wrote:

Could you just `echo $EDITOR` rather than ask?

I'd guess you could choose the editor from a list like this. I assume if emacs is installed you want to use it, then try vim as second choice then nano and as last resort vi.

{ [ -n $EDITOR ] && command -v $EDITOR >/dev/null 2>&1 } || for e in emacs vim nano vi; do
    command -v $e >/dev/null 2>&1 && EDITOR=$e && break
done

I honestly admire your script-fu. I would use this, but I feel it assumes something which would better to prompt for. In my case, I sometimes install emacs on my system, try it for a while, and don't uninstall it in case I want to experiment with it although I use vim.

Also, what if someone uses gedit, sandy, neovim, or another weird editor like uemacs. They possibly would have to override the program's assumption. I could enumerate a list of every editor in a descending order of specialty and still miss some, but I find prompting to be a more elegant and concise means of getting what editor the user uses.

P.S.
Linux's diverse ecosystem creates a lot of issues, but I wouldn't trade it for any platform which didn't provide such flexibility.

Offline

#8 2015-02-01 13:33:12

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: specy: a command line system description output tool

wm wrote:

screenfetch is GPLv3.

You are free to copy, modify and re-distribute the code (and even charge for it), but it would be polite to acknowledge the source and it's author.

http://www.gnu.org/licenses/gpl-faq.html

Offline

#9 2015-02-01 15:20:41

wm
Member
Registered: 2014-06-01
Posts: 6

Re: specy: a command line system description output tool

Head_on_a_Stick wrote:
wm wrote:

If there is no other solution

Well, you could steal the method used in screenfetch (lines 1251-1390, with initial definitions at lines 54-58)...

I implemented the method of window manager detection found in screenFetch and simplified the code a bit. I tested it with monsterwm, Mutter, and awesome. I also updated the PKGBUILD and fixed a few minor things. You can upgrade by rebuilding the new package from the AUR.

Thanks for the suggestion, I never thought of scanning the ongoing processes.


I fixed some permissions problems in the upgraded PKGBUILD to change the owner of /etc/xdg/specy/ram.py to root. I figure this is reasonable due to it being in a directory owned by root and not configurable. You might get a permissions error if reinstalling the new package. The solution is to uninstall the old (deleting the problematic file) and then install from the new, update PKGBUILD.

Offline

#10 2015-02-01 16:04:42

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,774

Re: specy: a command line system description output tool

Head_on_a_Stick wrote:
wm wrote:

screenfetch is GPLv3.

...You are free to copy, modify and re-distribute the code..."
http://www.gnu.org/licenses/gpl-faq.html

But...   Any redistribution must be done using the GPLv3 license.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#11 2015-02-01 18:14:02

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

Re: specy: a command line system description output tool

By default the config file is stored in ~/.local/share/specy/config

What an odd choice... why?


He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.

Douglas Adams

Offline

#12 2015-02-01 18:24:13

wm
Member
Registered: 2014-06-01
Posts: 6

Re: specy: a command line system description output tool

Rasi wrote:

By default the config file is stored in ~/.local/share/specy/config

What an odd choice... why?

I wanted the configuration file to be writable without root. I just changed it to be ~/.config/specy. That seems more sensible.

Offline

#13 2015-02-01 18:30:23

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

Re: specy: a command line system description output tool

yes, it does. thanks


He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.

Douglas Adams

Offline

#14 2015-02-02 17:28:28

angelic_sedition
Member
Registered: 2014-01-20
Posts: 124
Website

Re: specy: a command line system description output tool

Saw that you plan on adding the ram percent and moving the ram stuff over to bash. This is what I'm using for ram percentage:

# percent
free | awk '/Mem/ {printf("%d", $3/$2 * 100)}'
# used
free -h | awk '/Mem/ {print $3}'
# total
free -h | awk '/Mem/ {print $2}'

Awk is nice. It seems awkward to me to be using python for this.

Last edited by angelic_sedition (2015-02-02 17:32:50)

Offline

Board footer

Powered by FluxBB