plight

Crates.ioplight
lib.rsplight
version0.1.0
sourcesrc
created_at2024-11-24 18:34:25.503867
updated_at2024-11-24 18:34:25.503867
descriptionA configurable program for organizing dynamic backlighting.
homepage
repositoryhttps://github.com/pguin-sudo/plight
max_upload_size
id1459497
size111,658
PGuin (pguin-sudo)

documentation

README

PLight

A configurable program for organizing dynamic backlighting.

Setup

Step 1: Clone repo and compile

  1. Clone this repository with:
git clone https://github.com/pguin-sudo/plight /usr/src/plight
cd /usr/src/plight
  1. Build using cargo:
cargo build --release
  1. 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

  1. Move to the arduino directory:
cd /usr/src/plight/arduino
  1. Configure your setup in /src/plight/arduino/sketch.yaml:

  2. Edit permissions of your serial /dev/ttyUSBX:

sudo chmod 777 /dev/ttyUSBX 
  1. Compile:
arduino-cli compile 
  1. Upload:
arduino-cli upload 

Step 3: Create a systemd Service File

Create a systemd service file to manage the daemon:

  1. Create a new file called plight.service in /etc/systemd/system/:
sudo vim /etc/systemd/user/plight.service
  1. Add the following content to the file:
[Unit]
Description=PLight - dynamic backlighting

[Service]
ExecStart=/bin/plight
Restart=always

[Install]
WantedBy=default.target
  1. 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
Commit count: 21

cargo fmt