Skip to content

Instantly share code, notes, and snippets.

@michaelmrose
Created April 15, 2024 17:15
Show Gist options
  • Save michaelmrose/c70a4ce33d949fb190c01ff2c72c4bb3 to your computer and use it in GitHub Desktop.
Save michaelmrose/c70a4ce33d949fb190c01ff2c72c4bb3 to your computer and use it in GitHub Desktop.

Revisions

  1. michaelmrose created this gist Apr 15, 2024.
    33 changes: 33 additions & 0 deletions guide
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,33 @@
    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