Dustin Decker

Multi-OS Screen Blanking

Several desktops and multiple operating systems had me doing this muscle memory thing… click here, select that, click here, do that… and it takes a holiday lull to actually come around to making it “easier”.

The goal: Automate the binary application of daytime/nighttime screen timeout for Windows, macOS and Kali Linux.

Day = 1 Hour Screen Blank
Night = 1 Minute Screen Blank

#########################################################
Windows 11
day.bat
# Set the display timeout to 1 hour (3600 seconds) when plugged in
powercfg /change monitor-timeout-ac 60

night.bat
# Set the display timeout to 1 minute (60 seconds) when plugged in
powercfg /change monitor-timeout-ac 1

#########################################################
macOS Ventura 13x
day.bash
sudo pmset -c displaysleep 60

night.bash
sudo pmset -c displaysleep 1

#########################################################
Kali Linux 2024.2
day.bash
gsettings set org.gnome.desktop.session idle-delay 60

night.bash
gsettings set org.gnome.desktop.session idle-delay 0