CaseySJ
Moderator
- Joined
- Nov 11, 2018
- Messages
- 22,225
- Motherboard
- Asus ProArt Z690-Creator
- CPU
- i7-12700K
- Graphics
- RX 6800 XT
- Mac
- Classic Mac
- Mobile Phone
** Automating Liquidctl at Start Up **
Purpose:
To install a script that will run automatically at startup to configure Aura LED color channels.
Procedure:
There are two parts to the procedure:
- Creating a script to configure color channels
- Creating and registering a LaunchAgent
This is a simple procedure. We create a script that will contain all of the
liquidctl
operations we want to perform at startup. Then we'll change its ownership to root
.Download the sample file below called liquidctl-start.sh. It looks like this:
Bash:
#!/bin/bash
# initialize devices
/usr/local/bin/liquidctl -m Aura initialize
# set color modes
/usr/local/bin/liquidctl -m Aura set argb1 color static ff0000
/usr/local/bin/liquidctl -m Aura set argb3 color static 0000ff
Then we change its ownership as follows:
Bash:
cd /Users/Shared
sudo xattr -d com.apple.quarantine liquidctl-start.sh
sudo chown root liquidctl-start.sh
Part 2: Create and Register a LaunchAgent
A LaunchAgent is a
.plist
file that tells macOS what to do on system start. We proceed as follows:- Download the attached file called com.caseysj.liquidctl.plist. Fortunately we don't need to make any changes to this file.
- Let's assume the plist is in our Downloads folder. Copy the file using admin privileges to
/Library/LaunchAgents
. - Then we register the plist file with
launchctl
.
Bash:
# copy the file
sudo cp ~/Downloads/com.caseysj.liquidctl.plist /Library/LaunchAgents
# register the file with launchctl
cd /Library/LaunchAgents
launchctl load com.caseysj.liquidctl.plist
XML:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.caseysj.liquidctl</string>
<key>Disabled</key>
<false/>
<key>KeepAlive</key>
<false/>
<key>Program</key>
<string>/Users/Shared/liquidctl-start.sh</string>
<key>ProgramArguments</key>
<array>
<string>/Users/Shared/liquidctl-start.sh</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
After rebooting and logging in, check if active color modes match the settings specified in liquidctl-start.sh.
Procedure to Remove the LaunchAgent Job:
Bash:
cd /Library/LaunchAgents
launchctl unload com.caseysj.liquidctl.plist
# we can now delete the plist file
sudo rm com.caseysj.liquidctl.plist
# optional: if you wish to remove the script as well
cd /Users/Shared
sudo rm liquidctl-start.sh
Attachments
Last edited: