https://github.com/64j0/linux-screen-brightness
Simple script to control multiple screen brightness on Linux
https://github.com/64j0/linux-screen-brightness
linux screen-brightness shell-script
Last synced: 28 days ago
JSON representation
Simple script to control multiple screen brightness on Linux
- Host: GitHub
- URL: https://github.com/64j0/linux-screen-brightness
- Owner: 64J0
- Created: 2023-12-03T13:46:10.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-12-03T13:46:30.000Z (over 1 year ago)
- Last Synced: 2025-04-01T14:31:01.544Z (about 1 month ago)
- Topics: linux, screen-brightness, shell-script
- Language: Shell
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
Awesome Lists containing this project
README
#+TITLE: Linux terminal - Screen brightness changer
#+AUTHOR: 64J0When working with multiple monitors, it's often hard to keep both brightness
synced, which is annoying and probably bad for the eyes health (need to check
this later).Some projects that aim to solve the same problem:
+ https://github.com/WinEunuuchs2Unix/eyesome
+ https://github.com/LordAmit/BrightnessWith this in mind, I decided to start exploring how to control the screen
brightness through terminal on Linux. This repository holds what I found most
effective to my case.** Script
#+BEGIN_SRC bash :tangle screen-brightness.sh :tangle-mode (identity #o744)
#!/bin/bash
set -euo pipefail# must be a float within 0.0 - 1.0 range
BRIGHTNESS_LEVEL="${1:-1.0}"function main {
echo "Using BRIGHTNESS_LEVEL: ${BRIGHTNESS_LEVEL}..."
xrandr --listmonitors |\
grep -E -o '\s\w+(-1)' |\
xargs -I '{}' xrandr --output '{}' --brightness "${BRIGHTNESS_LEVEL}"
}main
#+END_SRC