📜 ⬆️ ⬇️

GeekTool - customization of the desktop in OS X

Foreword


Hello, dear Habrasoobschestvo. Yesterday I came across an interesting program with an unequivocal name - GeekTool .



What it is and what you can do with it, I want to tell you in this post. For details, welcome under cat. Attention, pictures!

Experience of use


And so, GeekTool is a utility with which OS X users can customize their desktop. The utility bears such a name for good reason: despite the fact that it is not too complicated to use, even for simply outputting time to the desktop, you need to be able to use Google to know a few terminal commands. For me, a person not familiar with programming, it was a bit unexpected, but, nevertheless, not so difficult as it seemed at first glance. Moreover, many things are really easy on the net.
')
When you open the program, you see the following window:


The File icon is responsible for displaying various information from text files (for example, logs). Image, as you can guess, displays images from local folders, and Shell - for what, in fact, you need to install this utility. With the help of scripts and direct hands, you can do very cool things that will please your eye and cause a WOW effect to your friends. For example, such:

image

Unfortunately, the photoshop on the computer is not installed, so I could not reproduce such a cool piece. However, after a short mastering of this program, I got the following:



And so, in turn. We will need several Shell plug-ins, which we simply drag from the program window to the place we need on the desktop:



In order to configure our plugins, we will use the following window:



In the upper part you can set the name of our applet, select a group for it. At the bottom you can stylize it as you see fit: change fonts, colors, etc. But the most important is centered center - Command.

Here are some commands that I have already more or less learned:
Full day: date +% A
Day short: date +% a
Time: date +% H:% M
Full date: date +% D
Today's date: date +% d
Full month: date +% B
Month in brief: date +% b

In order to display the weather on your desktop, we will use the weather.yahoo.com service.



We drive in the location you need, switch to degrees Celsius (1), and in the new tab open RSS (2):



We copy this rss-link and paste it into such a code that I got somewhere on the Internet, after which we drive it all into our gyclet:

curl --silent "http://weather.yahooapis.com/forecastrss?p=BOXX0005&u=c" | grep -E '(Current Conditions:|C<BR)' | tail -n1 | sed -e 's/<BR \/>//' -e 's/ C$/˚C/'

In order to display a beautiful weather icon on our desktop, we will use the following code:

curl --silent "http://weather.yahoo.com/belarus/minsk/minsk-834463/?unit=c" | grep "forecast-icon" | sed "s/.*background\:url(\'\(.*\)\')\;\ _background.*/\1/" | xargs curl --silent -o /tmp/weather.png\

Instead of Minsk, you should insert your address ( note, you need to insert not rss legal, but the one that appeared after you have entered your city, that is, marked with 3 in the figure). This giklet does not directly show the picture, but only pulls yahs from the site, so we need to add an Image applet, into which we will write the following into the URL of our picture:

file://localhost/tmp/weather.png

That's all. Now your desktop has become even more beautiful!

Conclusion


Personally, I really liked this utility. GeekTool is a very flexible program, which is limited, in fact, only by your knowledge and skills. Anyone interested would like to advise the site on which a lot of geklets are collected, different in form and content, which may be useful to you. I also advise you to watch a video on how they were created on the site with the first beautiful wallpapers! Very interesting, he himself would probably not have thought of such a thing.

PS I found one small nuance here: the GeekTool Helper process sometimes (to all appearances, when the open window with the program hangs for a long time) starts to flow, which instead of 17 megabytes begins to eat 150, or even 300. Just finish it, and then restart - everything will fall into place.



We must not forget to write to the author about this, you see, correct in the next version.

PPS Constructive comments are welcome, however, I ask you to make a discount on what I did not write articles on Habré earlier.

UPD: at the request of added one beautiful to kata :)

Source: https://habr.com/ru/post/142702/


All Articles