Quantcast
Channel: Geeklets
Viewing all 81 articles
Browse latest View live

ActiveNetwork Interface

$
0
0

Modified from a geeklet that I found a few years ago, source unknown, but updated to work in MacOS Sierra.

This script detects active network interfaces, identifies their human-friendly name in the system, and reports the name and IP dynamically. This addresses two issues that are often not accounted for in geeklets:

1) When moving the geeklet between desktop and portable Macs, the en0 -1 assignments vary depending on the machine configuration. On laptops, en0 is now Wi-Fi.

2) Additionally, when using thunderbolt to ethernet adapters, each adapter registers a different en#, as do various docking stations.

In my case, this meant that my current network interface could be any of two thunderbolt-ethernet adapters, a thunderbolt docking station, and/or Wi-Fi, or a USB or Bluetooth Connection to my mobile phone.

This script uses system information to detect, identify and label them.


Jarvis Inspired

$
0
0

Jarvis Inspired Geeklet. Found a lot of the scripts from this site!

Battery info

$
0
0

Battery and system info Further information on tuttologico.altervista.org/batterytime-ripristino-del-tempo-di-utilizzo-residuo-della-batteria-su-osx/

Captain America Theme

$
0
0

This is my first go at this. Let me know if you would like to see a list of all I used. Thanks!

Smart Weather

$
0
0

Description

No need to enter your location or edit the code; it will use your public IP address to determine your approximate location and pull weather data (in celsius) from openweathermap.org. This dynamic location capability is extremely useful if you travel a lot.

I've separated the code into 4 different geeklets so you can format the 4 elements independently:

  1. Current temperature and weather condition
  2. Daily low and high temperature
  3. Sunrise and sunset times
  4. Current city and country

Examples

23°C, scattered clouds
-1°C, clear skies

Displaying and Editing Location

You can check the city and country that is being used (based on your public IP) by running the "citycountry.glet" geeklet. If the city/country displayed is not accurate, go into the code for any of the weather geeklets attached and look for the following two lines:

lon=${coords#*,}
lat=${coords%,*}

and manually replace them with numbers pertaining to your longitude and latitude. For example:

lon=-80.5454
lat=43.4715

Note

Please set the shell's refresh rate to more than 2 minutes. Reasoning: the code is using my personal API key to access data from openweathermap.org. The limit for my personal API key is 60 queries per minute. So if too many people use this code and more than 60 queries occur per minute, some people will experience denial-of-service errors.

Comprehensive system monitor - Yosemite

$
0
0

This monitor shows your CPU, Memory, Hard Drive, and network usage. Also shows your internal IP Address, internal temperature, the fan speed, and the total uptime of your machine.

Secondly, is a built in to do list. I simply have an alias that edits a text file on my dropbox with vim to modify this.

Thirdly, it shows the top 10 processes on your machine sorted by CPU usage. Along with their processor ID and memory usage as well.

#!/bin/bash

echo && echo ———————-System Information:——————— && echo

Find time since last boot.

then=$(sysctl kern.boottime | awk '{print $5}' | sed "s/,//") now=$(date +%s) diff=$(($now-$then))

Convert time to human readable stuff.

days=$(($diff/86400)); diff=$(($diff-($days86400))) hours=$(($diff/3600)) diff=$(($diff-($hours3600))) minutes=$(($diff/60))

Find current bandwith in each pipe

myvar1=netstat -bI en0 | awk "/en0/"'{print $7;exit}' myvar3=netstat -bI en0 | awk "/en0/"'{print $10;exit}'

sleep 1

Find current bandwith in each pipe after a second.

myvar2=netstat -bI en0 | awk "/en0/"'{print $7;exit}' myvar4=netstat -bI en0 | awk "/en0/"'{print $10;exit}'

Find the difference between each pipe after 1 second.

subin=$(($myvar2 - $myvar1)) subout=$(($myvar4 - $myvar3))

Convert the bytes to kilobytes

kbin=echo "scale=2; $subin/1024;" | bc kbout=echo "scale=2; $subout/1024;" | bc

Current CPU usage

echo CPU: top -l 1 | awk '/CPU usage/ {print $3}' | sed s/%//%

Current Memory Usage

usedMEM=top -l 1 -s 0 | grep PhysMem | awk $'{print $2}' | awk $'{print $0}' | sed 's/M$//' && usedMEM=bc <<< "scale = 2; $usedMEM/1024" /bin/echo -n MEM: $usedMEM && /bin/echo GB

Current Disk Usage

usedHDD=df -h | grep -E "disk1" | awk '{print $3}' | sed 's/Gi$//' /bin/echo -n HDD: $usedHDD GB && echo

echo

Current Network Traffic

echo "UPL: $kbout KB/s" echo "DWN: $kbin KB/s"

Current IP Address

/bin/echo -n IPA: && ipconfig getifaddr en0

echo

Current CPU Temp

/bin/echo -n TMP: && istats | grep CPU\ temp | awk '{print $3}'

Current Fan speed

/bin/echo -n FAN: && istats | grep Fan\ 0\ speed: | awk '{print $4,$5}'

Current uptime

echo UPT: $days Days $hours Hours $minutes Minutes

To do list

echo && echo && echo && echo echo ———————————To Do List:———————————- && echo head -n 10 ~/Dropbox/Miscellaneous/Work.txt

Top 10 processes

echo && echo && echo && echo echo —————————Top Processes:—-————————- && echo ps -arcwwwxo "command pid %cpu %mem" | head -11

The Original Momentum Inspired Desktop (with Updates)

$
0
0

Originally featured by Lifehacker in July 2017.

I love Rainmeter and having moved to OS X full-time (at home) several months ago, I find I really miss it. In the meantime, I discovered Momentum, a “new tab” Chrome-extension that I quite like. Eventually these two things inspired this Geektool desktop.

For the first screenshot:

  • Wallpaper from Interfacelift

  • Left: “Three Things” reads from a text file (shell geeklet: cat /path/to/filename.txt)

  • Left: “Now Playing” is Bowtie with the Karma theme (works fairly well with Spotify + last.fm)

  • Center: Time (simple Date command: date +”%l:%M”)

  • Center: Greeting using a simple shell script found via Google

  • Center: Date (simple Date command: date “+%A, %B %e”)

  • Center: Today reads from a text file (or you could just as easily use “echo” twice in a shell geeklet)

  • Center: Parsed RSS feed (hosted on dropbox.com) from QuotesDaddy.com

  • Right: Weather geeklet by RikerJoe (thanks for this!)

Updated (second screenshot):

  • Wallpaper from 500px.com

  • Replaced Bowtie App with Simplify, using the Essence 1.2 jacket.

  • Replaced weather geeklet with HTML geeklet and darksky.net embed code. This is pretty slick because it's responsive; you can resize it just to show the current conditions and not the forecast.

My productivity setup

$
0
0

A slightly cramped but functional setup that helps me get through the day.


Fresh, Clean Desktop 2017

$
0
0

The perfect marriage of aesthetics & Functionality.

Due to the restrictions of the website once downloaded you will have to rename the weather.txt to weather.php then use the weather.glet and change the path in the .glet command so that it matches the weather.php path The Weather Glet should look like this but with the path of the weather.php subbed in: if nc -zw1 google.com 443; then php /Path-to-file/Weather.php else echo "" fi

Ensure that the correct location is chosen for the weather based on the woeid tag, to change woeid tag open up the .php and sub in your locations woeid. You may find the woeid tag for your location at this website: http://woeid.rosselliot.co.nz

The font used is Josefine Slab thin as well as Josefine Slab thin italic. Free download here: https://www.fontsquirrel.com/fonts/josefin-slab To install the font you will need to follow this quick tutorial: https://www.fontspring.com/support/installing/how-do-i-install-fonts-on-my-mac

I hope you enjoy!

Alex

Weather using Yahoo (2016)

$
0
0

Save the code below to a file (WeatherCurrent.php) and then create a shell command Geeklet with the command:

php /pathtofile/WeatherCurrent.php

Change the path variables to where you have your weather icons stored.

Create an Image Geeklet with URL:

file://localhost/pathtofiles/Geeklets/Weather/CurrentCondition.png

PHP Code

<?php
$Location = 'Universal City, CA';
$pathtoimages = '/pathtofiles/Geeklets/Weather/ConditionIcons/';
$pathtocurrentimage = '/pathtofiles/Geeklets/Weather/CurrentCondition.png';`
$BASE_URL = "http://query.yahooapis.com/v1/public/yql";
$yql_query = 'select * from weather.forecast where woeid in (select woeid from geo.places(1) where text="'.$Location.'")';
$yql_query_url = $BASE_URL . "?q=" . urlencode($yql_query) . "&format=json";
// Make call with cURL
$session = curl_init($yql_query_url);
curl_setopt($session, CURLOPT_RETURNTRANSFER,true);
$json = curl_exec($session);
// Convert JSON to PHP object
 $phpObj =  json_decode($json,true);
//print_r($phpObj);
$temp = $phpObj['query']['results']['channel']['item']['condition']['temp'];
$condition = $phpObj['query']['results']['channel']['item']['condition']['text'];
$weathericon = $phpObj['query']['results']['channel']['item']['condition']['code'];
$units = $phpObj['query']['results']['channel']['units']['temperature'];

$weatherimage = $pathtoimages.$weathericon.'.png';

copy($weatherimage, $pathtocurrentimage);

echo $condition.' '.$temp.'°'.$units."\n";
?>

Miminal

$
0
0

My first attempt at a collection. Used geeklets from here.

My Highlight Calendar

$
0
0

Calendar is useful to highlight current day and a periodic event (such as a payday).

Flexible configurations are easily implemented with this python script. Must use a monotype font for days and dates to align properly.

To use, simply paste the text file contents into the geeklet command/script window.

Features: 1. Current day is set to be red. Highlight switches to red background when today intersects with highlight interval.

  1. Periodic interval can easily be set by changing the interval days and the first date occurrance. Default highlight color is green.

  2. Any number of months can be used.

  3. Space between months is always the same (accounts for more and fewer weeks between months)

Web Server with different Port - Status

$
0
0

This script can take multiple servers at once but in order to see the status images I made each entry a new geeklet.

I was determined to have this on my desktop so I did it. The script does tend to time out so play with the TCP_TIMEOUT and see what works best for you.

Sorry that it's not the best. If you would like to make it better I'd love to have you share it with everyone here so we can all learn and move forward.

Thanks and I hope you all have a great day.

echo “www.somewebsite.com 8080” | ( TCP_TIMEOUT=3 while read host port; do r=$(bash -c 'exec 3<> /dev/tcp/'$host'/'$port';echo $?' 2>/dev/null) if [ "$r" = "0" ]; then echo "$host:$port is live" exit 0 else echo "$host:$port is closed" exit 1 # To force fail result in ShellScript fi done ) 2>/dev/null # avoid bash message "Terminated ..."

Simple Public / Internet IP Display

$
0
0

Requirement

You need to install brew and cURL first, open terminal, paste this and press enter : ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null

Then once brew is installed, write : brew install curl

Edit the script as you wish

Replace internet ip with whatever text you want, if one day, it's not working anymore, change ifconfig.me with one of the following :

ident.me
tnx.nl/ip
icanhazip.com
ipecho.net/plain
ip.appspot.com
whatsmyip.akamai.com

HF :)

Ansiweather weather geeklet + Current location update

$
0
0

Weather

Ansiweather is a small terminal program, that lets you check weather data via commands in the terminal.

Open Terminal and run the command:

sudo apt-get install ansiweather 

Enter your password and hit Enter. to install it.

Once you installed it you can run it with Terminal with the command:

ansiweather

to change the config file in Terminal run:

nano ~/.ansiweatherrc

there you can change the color of the output, location, greetings text etc. See https://github.com/fcambus/ansiweather for more details.

For example:

background:\33[0m
text:\33[0m
data:\33[32m
delimiter:\33[0m
dashes:\33[0m

location:London,GB

fetch_cmd:curl -s
units:metric
symbols:true
show_daylight:true
timeformat:%b %d %R
forecast:0
greeting_text:Weather in
wind_text:\nWind speed
humidity_text:\nHumidity
pressure_text:\nAir pressure
sunrise_text:\nSunrise
sunset_text:\nSunset

# Icons
sun:\033[33;1m\xe2\x98\x80
moon:\033[36m\xe2\x98\xbd
clouds:\033[37;1m\xe2\x98\x81
rain:\xe2\x98\x94
fog:\033[37;1m\xe2\x96\x92
mist:\033[34m\xe2\x96\x91
haze:\033[33m\xe2\x96\x91
snow:\033[37;1m\xe2\x9d\x84
thunderstorm:\xe2\x9a\xa1

Crtl+X to exit, Y+Enter to accept changes.

Ansiweather cannot be run through the GeekTool Shell commands, therefore you have to work around a little bit. You can set up a Cronjob to create a .txt file of the Ansiweather output which again can be displayed in Geektool. For that you have to edit the systemwide Crontab:

sudo nano /etc/crontab

Enter your password and hit Enter. Insert following text:

SHELL=/bin/sh

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:

* * * * *       root ansiweather > /"Path were the Textfile should be saved".txt/

Change the asterisks to set up the refresh rate.

*\5 * * * * -> refreshing every 5 minutes.

30 * * * * -> resfreshing every half hour.

See https://crontab.guru/ for more options.

Crtl+X to exit, Y+Enter to accept changes.

Once you are happy with all your settings, create a new Shell window in Geektool and insert the command

cat /"Path were the Textfile has been saved".txt/

Location Update

If you want to tell Ansiweather your current location you can write a small Shell-Script that will update the Ansiweather config file. Open Terminal and type:

nano /"Path of your shell-scrip".sh

And insert following text:

#!bash
curl "http://api.ipinfodb.com/v3/ip-city/?key=77aefa17ff64cff681bc8f6dd12f513b77356c469edbf1c345583451d45b07b2&format=raw" > /"Path of your location textfile".txt

city="$(cat /"Path of your location textfile".txt | cut -d ";" -f7)"

country="$(cat /"Path of your location textfile".txt | cut -d ";" -f4)"

perl -i -pe 's/.*/location:'${city}','${country}'/ if $.==7' ~/ansiweatherrc

Crtl+X to exit, Y+Enter to accept changes.

This will get your location via the ipinfo.io API, save the output as a textfile and copy the city name and country code into the Ansiweather config file. Be sure that location= is in the 7th row in your ansiweatherrc config file., otherwise edit $.==7into the correct row number.

To set the refresh rate of the location script you have to set up another Cronjob. This time it does not have to be systemwide. Use following command in Terminal:

export VISUAL=nano; crontab -e

and insert the text:

* * * * *    sh /"Path of your shell script".sh

Change the asterisks to set up the refresh rate.

*\5 * * * * -> refreshing every 5 minutes.

30 * * * * -> resfreshing every half hour.

See https://crontab.guru/ for more options.

Crtl+X to exit, Y+Enter to accept changes.

Please set up the refresh rate to more than 5 minutes, because it uses my personal API key, which only allows 60 updates per minute


Time On Earth Ticker

$
0
0

Just a simple geeklet that shows how long you've been alive...

Go here: https://www.timeanddate.com/date/durationresult.html

Then set your birthdate (don't forget to add the time fields as well).

Then just copy and replace this link with that new URL:

"https://www.timeanddate.com/date/durationresult.html?m1=5&d1=10&y1=1983&m2=&d2=&y2=&h1=16&i1=31&s1=0&h2=&i2=&s2="

Enjoy!

inspired by "momentum inspired desktop"

$
0
0

i basically made all the geeklets a bit more user friendly the Ram, HDD and Battery all run .sh files the weather is from darksky the wallpaper and lower part of the wallpaper are included in the zip file also included a .SH (batch script) that should edit the variables asking for location details and changing the path of the files to 'userid by using whoami command' and replacing in all affected files ! NOTE: files must be extracted do folder "Documents" After extraction open the Terminal and navigate to '/Users/$User/Documents' and run './RUNMEFIRST.sh'

Download Here

Daily News

$
0
0

This is my current desktop using geektool. If you are interested in any of the scripts, just post a note here and I will upload them.

The weather is captured using PHP with open weather API, so you would need your own API key from them, which is free.

The clock is just simple clock, which is also free, yes it works.

Also, if anyone can figure out how to get Gcal to work with geektool I would greatly appreciate it

I added the weather information picture, just incase someone wants a good weather geeklet or two (of course they can be changed to english with a flip of the wrist)

2018 - Weather, forecast in your language, units and location

$
0
0

Installation

No installation required.

Create your own web glet, put it in your favorite place on desktop and then add this:

https://loom.ovh/apps/geektool/glet/forecast/info.php?units=[metrics]&city=<city,country>&lang=<lang>&color=<text-color>

Change the options:

  • [metrics] - optional, you can use c or f (default: c)
  • <city,country> - use it in this format: cityname,country (example: london,uk)
  • <lang> - your language code, example for english: en
  • <color> - you can define your text color according your wallpaper, use any color name (black, red, white, etc...)

geektoolio

$
0
0

Screen

This is not exactly a geeklet

it's an app using geektool infrastructure to give you power to display whatever you like on the desktop. you can use your html and css knowledge to create your own look & feel Or your javascript skill to implement new information sources

Currently implementing

  • CPU usage
  • Memory usage
  • Bandwidth usage & graph
  • Top processes
  • Cryptocurrency ticker
  • Now playing (itunes and spotify)

github

Viewing all 81 articles
Browse latest View live