I want to build a kisok mode much like in Windows where you can start Programms with .hta files.
So is it possible to have a Kind of gui (with chromium I guess) that is able to start specific programs? Or runs a Shell script per button press?
You can use python and Tkinter module:
import tkinter as tk
import os, subprocess
def btn_click():
# ASYNCH
os.system("bash /home/pi/shell_script.sh")
# SYNCH
p = subprocess.Popen(["bash", "/home/pi/shell_script.sh"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate()
print(out, err)
root = tk.Tk()
frame = tk.Frame(root)
frame.pack()
button = tk.Button(frame,text="QUIT", fg="red", command=quit)
button.pack(side=tk.LEFT)
btn_exec1= tk.Button(frame,text="start script 1",command=btn_click)
btn_exec1.pack(side=tk.LEFT)
root.mainloop()
and find correct parameter for design the window same as KIOSK mode (it's just window fullscreen parameters)... If you want a GUI as web-browser you can read the code here.
Kiosk Mode
For the kiosk part of your question, chromium comes with a built in kiosk and app mode, used as follows:
$ chromium-browser --kiosk --app=URL
Example, if you deployed a python GUI on localhost:
$ chromium-browser --kiosk --app=http://127.0.0.1
Web App GUI
As far as a backend GUI (for your clients to interface with, to start your programs/scripts), I would recommend using a Python-based Web App (Something like Dash by Plotly, a very intuitive and easy to learn backend/frontend web app library). It lets you set up a whole page (or even multiple) full of buttons, switches, and even live graphs. Clicking on the buttons/switches/etc can be tied to "callbacks", which are just functions that you define to do certain tasks (in this case, that could be running a bash script).
Calling scripts from the GUI
And as Ephemeral pointed out in his answer, use the python standard library subprocess
to actually call a script from the Python app (with Dash you can have a basic callback function that calls it). Refer to this stackoverflow thread on how to accomplish this - it's pretty straightforward.
push button (GPIO)
? or button onGUI
? for GUI you can use Tkinter and python. Create a gui and one button. On the button click event call os.system("command") or subprocess.Popen for start shell script or program...