Page 1 of 1

Raspberry Pi GUI

Posted: Wed Jul 01, 2020 8:12 am
by NovaZephyrus
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?

thankyou

Re: Raspberry Pi GUI

Posted: Wed Jul 01, 2020 8:39 am
by jamesh
I'd be inclined to use Python and tkinter. Look for tutorials on how to use those.

Re: Raspberry Pi GUI

Posted: Wed Jul 01, 2020 8:41 am
by topguy
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.

Edit:
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.

Re: Raspberry Pi GUI

Posted: Wed Jul 01, 2020 8:42 am
by DirkS

Re: Raspberry Pi GUI

Posted: Wed Jul 01, 2020 8:47 am
by neilgl
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.

Re: Raspberry Pi GUI

Posted: Wed Jul 01, 2020 3:08 pm
by Botspot
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
Screenshot:
2020-07-01-100713_1280x1024_scrot.png
2020-07-01-100713_1280x1024_scrot.png (4.14 KiB) Viewed 176 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.

Re: Raspberry Pi GUI

Posted: Wed Jul 01, 2020 7:54 pm
by jbudd
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 140 times