Creating a GUI front end

Hi, If I wanted to create a GUI front end with buttons that run BASH commands or scrips in the background, or preferably echo what is being run, what would be the best way to get started?

I’m thinking about the Welcome GUI at startup, and wondering what tools/language it was written with/in.

If anone could point me in the right direction I’d really appreciate it. Thank :slight_smile:

I believe that Welcome is just a bash script, using something like yad or zenity for the GTK popups.

I could be wrong though.

2 Likes

You are correct, bash script with yad for the user interfaces. Actually, it uses eos-yad which is an EndeavourOS patched yad that @manuel came up with to suit his purposes.

EndeavourOS is FOSS and completely transparent. Here are the PKGBUILDS for the eos exclusive packages.

Pudge

6 Likes

I use PythonSimpleGUI for my simple GUIs:
image

If you know any python, it is really easy to use.

#!/usr/bin/env python

import PySimpleGUIQt as sg
import os

#sg.ChangeLookAndFeel('Default')

sg.theme('DarkBlue')

Editor="emacsclient -c -s GUI "

layout = [[sg.Button("config",  button_color=("white", "blue"), size=(13, 1), font=("Noto Sans Bold", 11))],
          [sg.Button("groups",  button_color=("white", "green"), size=(13, 1), font=("Noto Sans Bold", 11))],
          [sg.Button("hooks",   button_color=("white", "brown"), size=(13, 1), font=("Noto Sans Bold", 11))],
          [sg.Button("keys",    button_color=("white", "orange"), size=(13, 1), font=("Noto Sans Bold", 11))],
          [sg.Button("layouts", button_color=("white", "purple"), size=(13, 1), font=("Noto Sans Bold", 11))],
          [sg.Button("mouse",   button_color=("white", "grey"), size=(13, 1), font=("Noto Sans Bold", 11))],
          [sg.Button("screens", button_color=("white", "navy"), size=(13, 1), font=("Noto Sans Bold", 11))],
          [sg.Button("widgets", button_color=("black", "yellow"), size=(13, 1), font=("Noto Sans Bold", 11))],
          [sg.Button("autostart", button_color=("white", "Olive"), size=(13, 1), font=("Noto Sans Bold", 11))],
          [sg.Button("restart", button_color=("white", "DarkRed"), size=(13, 1), font=("Noto Sans Bold", 11))],
          [sg.Exit(button_color=("white", "Black"), size=(13, 1),font=("Noto Sans Bold", 11))]]

# window = sg.Window("Button Bar", no_titlebar=True).Layout(layout)

# window = sg.Window("Button Bar", keep_on_top=True, location=(40,580), \
# no_titlebar=True).Layout(layout).Finalize()

window = sg.Window("Button Bar", location=(40, 400), alpha_channel=1,
                   keep_on_top=True, no_titlebar=True).Layout(layout).Finalize()

while True:
    event, values = window.Read()
    if event in (None, 'Exit'):
        break

    if event == 'config':
        os.system(Editor+"~/.config/qtile/"+event+".py&")

    if event == 'groups':
        os.system(Editor+"~/.config/qtile/modules/"+event+".py&")

    if event == 'hooks':
        os.system(Editor+"~/.config/qtile/modules/"+event+".py&")

    if event == 'keys':
        os.system(Editor+"~/.config/qtile/modules/"+event+".py&")

    if event == 'layouts':
        os.system(Editor+"~/.config/qtile/modules/"+event+".py&")

    if event == 'mouse':
        os.system(Editor+"~/.config/qtile/modules/"+event+".py&")

    if event == 'screens':
        os.system(Editor+"~/.config/qtile/modules/"+event+".py&")

    if event == 'widgets':
        os.system(Editor+"~/.config/qtile/modules/"+event+".py&")

    if event == 'autostart':
        os.system(Editor+"~/.config/qtile/"+event+".sh&")

    if event == 'restart':
        os.system("qtile cmd-obj -o cmd -f restart")

A script to edit EnOS Qtile config files.

3 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.