Skip to content

perfect ak620 #4

Description

@digitalinferno

Hi, thanks for the wonderful work, I have tested the dev branch and the display works very well. But the installation is very annoying for me... I would prefer to have a simple installation of the service files and have a conf file to edit, perhaps with a simple tool that helps the less experienced users to find the right values.

A bash script like:

#!/bin/bash

# deepcool supported devices
JSON_FILE="devices.json5"

hex_to_dec() {
    echo $((16#$1))
}

# read
while read -r line; do
    if [[ $line =~ \"([A-Z0-9]+)\":\ \{ ]]; then
        DEVICE_NAME=${BASH_REMATCH[1]}
    elif [[ $line =~ \"vendor_id\":\ 0x([0-9a-fA-F]+), ]]; then
        VENDOR_ID=$(printf "%04x" $(hex_to_dec ${BASH_REMATCH[1]}))
    elif [[ $line =~ \"product_id\":\ 0x([0-9a-fA-F]+), ]]; then
        PRODUCT_ID=$(printf "%04x" $(hex_to_dec ${BASH_REMATCH[1]}))
    elif [[ $line =~ \} ]]; then
        DEVICE_ID="$VENDOR_ID:$PRODUCT_ID"
        if lsusb | grep -q "$DEVICE_ID"; then
            echo "Device $DEVICE_NAME (Vendor ID $VENDOR_ID, Product ID $PRODUCT_ID) found."
        else
            echo "Device $DEVICE_NAME (Vendor ID $VENDOR_ID, Product ID $PRODUCT_ID) not found."
        fi
    fi
done < "$JSON_FILE"

conf file:

[base]
device = 0002
unit = celsius
time = 5
[cpu]
cpu-loop = true
sensor = coretemp
sensor-id = 9
[gpu]
# gpu-loop = true
# gpu-temp = nvidia-smi
# gpu-load = nvidia-smi

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions