Skip to content

Instantly share code, notes, and snippets.

@vgmoose
Last active Aug 29, 2015
Embed
What would you like to do?
from Tkinter import *
import os
def set_values(val):
os.system("echo "+str(val)+" > /sys/class/backlight/acpi_video0/brightness")
def stay_open():
pass
master = Tk()
master.title("Brightness")
# keep window on top, and try to prevent user closing
master.wm_attributes('-topmost', 1)
master.protocol("WM_DELETE_WINDOW", stay_open)
master.resizable(0,0)
# create the slider
slider = Scale(master, from_=0, to=10, orient=HORIZONTAL, command=set_values, length=300)
slider.set(5)
slider.pack()
mainloop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment