Skip to content

Instantly share code, notes, and snippets.

@frennkie
Last active June 1, 2019 19:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frennkie/aef0a794a67c7ddd7742fddcc116d4c1 to your computer and use it in GitHub Desktop.
Save frennkie/aef0a794a67c7ddd7742fddcc116d4c1 to your computer and use it in GitHub Desktop.
#!/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