Concepts
AppleScript has been introduced in GeekTool because some users wanted to extend possibilities in ways that could not be implemented directly into the software.That's why it is a very powerful tool that will let you go far beyond the standard features of GeekTool.
The structure of scriptability in GeekTool is quite simple. The application object is composed of geeklet objects and group objects.
I want to run a Ruby script in Geektool that refreshes every 3 hours (so I set the refresh rate to 10,800 seconds) and the shell command in Geektool has this code in it: ruby '/file.rb' The file is located at root for convenience.
Open GeekTool and click 'New Entry' (bottom left) and then select 'Shell' from the drop down like you said, and just paste the code. You can change the appearance from the Colors and Fonts tab. Jan 04, 2016 Geektool is a program for adding customizable widgets to your Mac’s desktop. Geektool runs almost entirely on shell scripts, which update every few seconds to display useful information on the desktop. Customizing Geektool is made easy by packaged scripts called Geeklets, which can be installed quickly and do not require knowledge of shell scripts to use. Implementing the Script as a Geeklet. Once you're finished coding, save out this script in your Geeklets folder. Now go back to GeekTool and drag out a new shell Geeklet. In the Command field, type 'osascript' followed by a space and the path to wherever you place the script. Here's what my command looks like.
Each geeklet object has a set of properties and attached groups.
Each group can be set visible or not, this has the same effect as enabling or disabling groups in the menu or in system preferences.
Example
An easy way to get a list of geeklet objects is to run this simple script in Script Editor :
This produces an output like this :
As you can see, geeklets are referenced by their ID. This ID is generated when you create the Geeklet from System Preferences, and is unique.
A convenient way to get the ID of a given geeklet is to open GeekTool Preferences, select a geeklet, and double click on the bottom of the inspector palette where the ID is displayed. This will copy the ID in the pasteboard.
You can also get a given geeklet by its name, as long as you did set one in the inspector, like this :
It should return an output similar to this one :
Now you know how to reference Geeklets, let's see what you can do with it.
Manipulating Geeklets
This shows how to hide or show individual geeklets :
The only way to get it back is to set the property back to true, or relaunch GeekTool.
This flag will totally ignore groups settings. It will show, or hide a geeklet without checking if the geeklet should be visible or invisible according to currently enabled groups. Cisco router ios image gns3 workbench.
Manipulating groups
Here is how you can show or hide groups.
Refreshing geeklets
Another useful feature is the refresh (or refresh all) command
Rawr Hub Script
This will refresh all geeklets eligible to a refresh action (not File, which are continuous)
tell application 'GeekTool Helper' to refresh all
This will refresh a specific geeklet
tell application 'GeekTool Helper' to refresh geeklet id 'CAD821B6-EBC9-42CF-ADDC-AB3A473D1D7B'
Note the short notation used here, without tell / end tell block, this is standard AppleScript shortcut.
Cool Geektool Scripts
A long form would be :
Geeklets
Getting GeekTool dictionary
There is a little trick to get the GeekTool dictionary in Script Editor because the actual scriptable application is hidden into the .prefPane bundle.
- In Script Editor, open the Library from the Window menu (Or Shift-Command-L)
- Go to
/Applications
directory in the Finder - Right click (or control click) on GeekTool, and choose 'Show Package Content'
- Go into
Contents/PlugIns/
- Right click (or control click) on GeekTool.prefPane, and choose 'Show Package Content'
- Go into
Contents/Resources/
- Drag and Drop 'GeekTool Helper' application to the Library window of Script Editor
A more complex example
Geek Tools For Windows
This script displays a dialog where you can select one or multiple geeklet to refresh nowCourtesy of Philippe M.