Created
April 15, 2024 17:15
-
-
Save michaelmrose/c70a4ce33d949fb190c01ff2c72c4bb3 to your computer and use it in GitHub Desktop.
brightness service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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