Skip to content

Instantly share code, notes, and snippets.

@tyrelsouza
Created March 7, 2025 05:00
Show Gist options
  • Save tyrelsouza/6b7ad32ce44375360abf718c1866ae9c to your computer and use it in GitHub Desktop.
Save tyrelsouza/6b7ad32ce44375360abf718c1866ae9c to your computer and use it in GitHub Desktop.
make the resolution smaller throughout the days while your eyes get tired.
#!/bin/bash
resolutions=(
"2560x1600"
"1920x1200"
"1920x1080"
"1600x1200"
"1680x1050"
"1280x1024"
"1440x900"
)
current_hour=$(date +"%H")
if (( current_hour < 11 )); then
resolution_index=0 # Before 11 AM, use max resolution
else
resolution_index=$(( (current_hour - 11) / 2 ))
if (( resolution_index >= ${#resolutions[@]} )); then
resolution_index=$((${#resolutions[@]} - 1))
fi
fi
xrandr --output eDP --mode "${resolutions[$resolution_index]}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment