Posts: 1
Joined: Wed Jul 01, 2020 8:08 am

Raspberry Pi GUI

Wed Jul 01, 2020 8:12 am

hello im newbie in programming

i have a project to make GUI on raspberry pi that has a button (on screen) that can run speedtest cli, but i dont know how to make it.
any tutorial how to make it?


Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26685
Joined: Sat Jul 30, 2011 7:41 pm

Re: Raspberry Pi GUI

Wed Jul 01, 2020 8:39 am

I'd be inclined to use Python and tkinter. Look for tutorials on how to use those.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

User avatar
Posts: 6497
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Raspberry Pi GUI

Wed Jul 01, 2020 8:41 am

Before we help you with your homework project it would be nice to know which programming language you have some experience in or have chosen to use.

James's suggestion is good if you have not made any choice.
But your task could probably be completed with just using shell-scriptin and the "xdialog" utility also.
Last edited by topguy on Wed Jul 01, 2020 8:46 am, edited 1 time in total.

Posts: 10365
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Raspberry Pi GUI

Wed Jul 01, 2020 8:42 am

User avatar
Posts: 2191
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near Aston Martin factory

Re: Raspberry Pi GUI

Wed Jul 01, 2020 8:47 am

Maybe use node-red?
Or install PHP and apache2 on the pi, create a web page on the pi and have a button on the page that uses PHP to run the speed test.

User avatar
Posts: 1269
Joined: Thu Jan 17, 2019 9:47 pm
Location: Texas
Contact: Website

Re: Raspberry Pi GUI

Wed Jul 01, 2020 3:08 pm

Easiest way hands-down: YAD.
Install with:

Code: Select all

sudo apt install -y yad
And then to make a simple dialog with a button to run speedtest-cli, run this:

Code: Select all

yad --button=gtk-cancel:1 --button="Run a speedtest":'lxterminal -e speedtest-cli' --center
2020-07-01-100713_1280x1024_scrot.png (4.14 KiB) Viewed 179 times
Edit: YAD is similar to Zenity, but much better in every way. You can fine-tune it to a higher degree, like button icons, custom images, and much more complex forms. By far the best YAD tutorial/doc I've found is this one.
Last edited by Botspot on Wed Jul 01, 2020 10:06 pm, edited 1 time in total.
Ever wished you could "open" a RaspiOS .img file? Well now you can! I've developed Pi-Power-Tools, the only RaspiOS img editor on the planet.
Want to try it out?

Code: Select all

wget -O - | bash

Posts: 1429
Joined: Mon Dec 16, 2013 10:23 am

Re: Raspberry Pi GUI

Wed Jul 01, 2020 7:54 pm

I've not come across YAD, looks interesting.

For what it's worth, here's a picture of a Node-Red program to do it, with it's output on a web page
(If you like it, you have to work out your own javascript code to extract the data!)
Untitled 1.jpg
Untitled 1.jpg (71.62 KiB) Viewed 143 times

Return to “Beginners”