WARNING: These scripts are OS (Windows) specific |
---|
These scripts will provide you the functionalities for getting the current window on the foreground and getting and setting your computer's brightness
Click here if you just want to use the binary
Before using this script, there are several dependencies that need to be installed. Use the package manager pip to install them.
pip install WMI
pip install win32gui
from brightness import Brightness
b = Brightness()
b.get_brightness() # Get the current brightness
b.set_brightness(30) # Percentage [0-100]
from brightness import Brightness
from gui import ForegroundGUI
import time
brightness = Brightness()
gui = ForegroundGUI()
interval = 1
while True:
current_brightness = brightness.get_brightness()
current_window = gui.get_foreground_window()
#Your app logic here based on the current brightness and current window
time.sleep(interval)
from brightness import Brightness
from event import ForegroundEvent
brightness = Brightness()
event = ForegroundEvent(callback)
def callback(current_window):
#Your app logic based on current window provided
The binary can be downloaded on the release page
program.exe start one "Untitled - Notepad" 40
program.exe start file yourfile.csv
The csv file specified should have two columns (without header). The first column is the window name and the second one is the brightness value if true.
See example.csv for reference
program.exe start -d 40 one "Untitled - Notepad" 40
program.exe start -d 40 file yourfile.csv
program.exe test