NovaZephyrus
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?

thankyou

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26660
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
topguy
Posts: 6491
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.

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.
Last edited by topguy on Wed Jul 01, 2020 8:46 am, edited 1 time in total.

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

Re: Raspberry Pi GUI

Wed Jul 01, 2020 8:42 am


User avatar
neilgl
Posts: 2185
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
Botspot
Posts: 1263
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
Screenshot:
2020-07-01-100713_1280x1024_scrot.png
2020-07-01-100713_1280x1024_scrot.png (4.14 KiB) Viewed 164 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.
I've developed the most intuitive RaspiOS img editor on the planet.
With a GUI similar to Gparted, managing imgs and sd cards is a breeze!
Boot it in a VM, Flash from the Internet at top speed, Mount (to drop in files), Shrink/Expand, Repair, and more.
https://github.com/Botspot/Pi-Power-Tools
> 400 users! 8-)

jbudd
Posts: 1409
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 128 times

Return to “Beginners”