Skip to content

Instantly share code, notes, and snippets.

@michaelmrose
Created April 15, 2024 17:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaelmrose/c70a4ce33d949fb190c01ff2c72c4bb3 to your computer and use it in GitHub Desktop.
Save michaelmrose/c70a4ce33d949fb190c01ff2c72c4bb3 to your computer and use it in GitHub Desktop.
brightness service
Create a new systemd service file:
sudo nano /etc/systemd/system/brightness.service
Add the following to the file:
================================
[Unit]
Description=Set screen brightness
After=multi-user.target
[Service]
Type=oneshot
ExecStart=/usr/bin/brightnessctl set 50%
[Install]
WantedBy=multi-user.target
======================================
Reload Systemd to Recognize New Service
Whenever you create a new service file or modify an existing one, you need to reload the systemd manager configuration to recognize and list the new service:
sudo systemctl daemon-reload
Enable and start the service:
sudo systemctl enable brightness.service
sudo systemctl start brightness.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment