Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 00infoLCD_wrapper.py
import os
import tkinter as tk
import platform
COLOR = "black"
winfo = None
def is_windows():
if platform.system() == "Windows":
return True
return False
def callback():
global winfo
print("clicked")
if not is_windows:
os.system("xterm -into %d +sb -hold /home/admin/XXreboot.sh &" % winfo)
def main():
root = tk.Tk()
root.config(bg=COLOR)
root.overrideredirect(1)
root.geometry("480x320+0+0")
root.title("RaspiBlitz 1.x - alpha")
entry = tk.Entry(root)
entry.config(bg=COLOR, highlightbackground=COLOR)
frame1 = tk.Frame(entry, width=60, background="black")
frame2 = tk.Frame(entry, width=420, background="grey")
button1 = tk.Button(frame1, text='B1', fg='red')
button2 = tk.Button(frame1, text='B2', fg='blue')
button3 = tk.Button(frame1, text='', fg='grey')
button4 = tk.Button(frame1, text='Off', fg='red', command=callback)
button1.pack(pady=24)
button2.pack(pady=24)
button3.pack(pady=24)
button4.pack(pady=24)
entry.pack(side="bottom", fill="x")
frame1.pack(side="left", fill="both", expand=True)
frame2.pack(side="right", fill="both", expand=True)
global winfo
winfo = frame2.winfo_id()
if not is_windows:
os.system("xterm -into %d +sb -hold /home/admin/00infoLCD.sh &" % winfo)
root.mainloop()
if __name__ == '__main__':
main()
@frennkie
Copy link
Author

frennkie commented Jun 1, 2019

add shutdown button (restarts for now)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment