Speedtest-CLI as a Desklet?

Forum rules
Before you post please read how to get help
Post Reply
Level 4
Level 4
Posts: 377
Joined: Thu Jul 09, 2009 12:51 pm
Location: Sanibel, FL USA

Speedtest-CLI as a Desklet?

Post by Kendoori » Mon Apr 29, 2019 11:48 am

I am having issues with my ISP regarding consistency of upload/download. I discovered https://github.com/sivel/speedtest-cli in my hopes of finding a test that wouldn't involve my browser. Works well, but would like a way to park this on my Cinnamon desktop somehow without having to call up a terminal. Ideally I could have a one-click refresh to show results as a Desklet or similar.

Any suggestions?

User avatar
Level 3
Level 3
Posts: 164
Joined: Wed Dec 05, 2018 1:26 pm

Re: Speedtest-CLI as a Desklet?

Post by secureIT » Mon Apr 29, 2019 4:09 pm

Not a Desklet, but a script which you can run with a launcher.
You must install zenity to interact and to see the results.
May be it is outdated regarding the given testfiles, but you can insert your own testfiles into the zenity dialog .... or modify the script with own testfile-links :

Code: Select all

# Output via zenity in kbit/s 
# Maximum download rate: 1023MB/s
# Selection of the test file -  Choice between given 3 x 10 MB test files
# or enter the url of your own testfile
url=$(zenity --list --text "choose your test file" --radiolist --column "klick" --column "Testfiles 10 MB" TRUE "own" FALSE "http://speedtestx.de/testfiles/data_10mb.test" FALSE "http://speedtest.wdc01.softlayer.com/downloads/test10.zip" FALSE "http://download.thinkbroadband.com/10MB.zip"); echo $url
# Own entry of a test file that is not in the selection
if [ $url = "own" ]; then
url=$(zenity --entry --text "please enter your own test file" --entry-text ""); echo $url
echo $url
# Query whether the input field remains empty - otherwise automatic loading of
# speedtest.wdc01.softlayer.com/downloads/test10.zip
if [ -z $url ]; then
# The test file is loaded into the virtual recycle bin
# The output from wget is stored for review in /home/speedtester.txt
#  If the script is running and everything is checked, we'll put it up
( wget -O /dev/null "${url}" &> speedtester.txt; echo "Finished!" ) | zenity --progress --pulsate --auto-kill --auto-close
# Extract the speed information from speedtester.txt 
val=$(tail -n2 speedtester.txt |grep -oE "\(.*\)"|tr -d "()" |cut -d " " -f 1 |tr "," ".")
unit=$(tail -n2 speedtester.txt |grep -oE "\(.*\)"|tr -d "()" |cut -d " " -f 2|tr -d "/s")
# After a final check of the script, the following command can be issued
# Subsequent command deletes the textfile speedtexter.txt
# rm /tmp/speedtester.txt
# Check the speed specification from speedtester.txt to MegaByte, KiloByte or Byte 
if [ $unit == "MB" ]; then
tmp=$(echo ${val}| awk '{print $1*1024}')
elif [ $unit == "KB" ]; then
elif [ $unit == "B" ]; then
tmp=$(echo ${val}| awk '{print $1/1024}')
result=$(echo ${tmp} | awk '{print $1*8 }')
echo $result
# Check if a testfile could be loaded
if [ $result == "0" ]; then
zenity --info --text="Testfile could not be loaded "
echo $result
zenity --info --text="Your download speed is      ${result} kbit/s"
In der Ruhe liegt die Kraft ! .......... The strenght is to be found in serenity !

Post Reply

Return to “Compiz, Conky, Docks, & Widgets”