This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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