1 unstable release
0.1.0 | Nov 24, 2024 |
---|
#1 in #organizing
122 downloads per month
34KB
633 lines
PLight
A configurable program for organizing dynamic backlighting.
Setup
Step 1: Clone repo and compile
- Clone this repository with:
git clone https://github.com/pguin-sudo/plight /usr/src/plight
cd /usr/src/plight
- Build using cargo:
cargo build --release
- Add semantic link to bin:
sudo ln -s /usr/src/plight/target/release/plight /usr/bin/plight
Step 2: Setup arduino
Setup arduino with arduino-cli
- Move to the arduino directory:
cd /usr/src/plight/arduino
-
Configure your setup in
/src/plight/arduino/sketch.yaml
: -
Edit permissions of your serial
/dev/ttyUSBX
:
sudo chmod 777 /dev/ttyUSBX
- Compile:
arduino-cli compile
- Upload:
arduino-cli upload
Step 3: Create a systemd Service File
Create a systemd service file to manage the daemon:
- Create a new file called
plight.service
in/etc/systemd/system/
:
sudo vim /etc/systemd/user/plight.service
- Add the following content to the file:
[Unit]
Description=PLight - dynamic backlighting
[Service]
ExecStart=/bin/plight
Restart=always
[Install]
WantedBy=default.target
- Change mode of USB device:
sudo vim /etc/udev/rules.d/99-usb-tty.rules
KERNEL=="ttyUSBX", MODE="0777"
Step 4: Start and Enable the Daemon
Run the following commands to start and enable the daemon:
systemctl --user start plight.service
systemctl --user enable plight.service
Step 4: Check the Logs
You can check the logs of your daemon using:
sudo journalctl -u plight.service -f
Dependencies
~12–38MB
~611K SLoC