mirror of
https://github.com/jtgans/g13gui.git
synced 2025-06-20 08:23:50 -04:00
g13d: Remove the last few bits of g13d from the tree
This commit is contained in:
parent
f4daed3148
commit
b3d0cb5f21
@ -1,5 +0,0 @@
|
|||||||
cmake_minimum_required(VERSION 3.16.3)
|
|
||||||
project(g13)
|
|
||||||
|
|
||||||
add_subdirectory(g13d)
|
|
||||||
add_subdirectory(etc)
|
|
@ -1,5 +0,0 @@
|
|||||||
cmake_minimum_required(VERSION 3.16.3)
|
|
||||||
project(g13)
|
|
||||||
|
|
||||||
install(FILES 91-g13.rules DESTINATION /etc/udev/rules.d)
|
|
||||||
install(FILES g13d.service DESTINATION /lib/systemd/system)
|
|
@ -1,7 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=Logitech g13 user-space daemon
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=simple
|
|
||||||
ExecStart=g13d --pipe_in /run/g13d/in --pipe_out /run/g13d/out
|
|
||||||
Restart=on-failure
|
|
@ -1,42 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
center_x=30
|
|
||||||
center_y=20
|
|
||||||
diameter=18
|
|
||||||
|
|
||||||
hr_orig_x=0
|
|
||||||
hr_orig_y=10
|
|
||||||
sec_orig_x=0
|
|
||||||
sec_orig_y=18
|
|
||||||
min_orig_x=0
|
|
||||||
min_orig_y=15
|
|
||||||
|
|
||||||
ticks=""
|
|
||||||
for i in $(seq 0 12)
|
|
||||||
do
|
|
||||||
tax=$(echo "scale=3;$center_x - $diameter * s($i/12*(2*4*a(1)))" | bc -l)
|
|
||||||
tay=$(echo "scale=3;$center_y + $diameter * c($i/12*(2*4*a(1)))" | bc -l)
|
|
||||||
tbx=$(echo "scale=3;$center_x - ($diameter - 3) * s($i/12*(2*4*a(1)))" | bc -l)
|
|
||||||
tby=$(echo "scale=3;$center_y + ($diameter - 3) * c($i/12*(2*4*a(1)))" | bc -l)
|
|
||||||
ticks="$ticks -draw \"line $tax,$tay $tbx,$tby\""
|
|
||||||
done
|
|
||||||
|
|
||||||
while true
|
|
||||||
do
|
|
||||||
Date=$(date +%Y-%m-%d)
|
|
||||||
Time=$(date +%H:%M:%S)
|
|
||||||
hr=$(date +%I)
|
|
||||||
min=$(date +%M)
|
|
||||||
sec=$(date +%S)
|
|
||||||
hr_x=$(echo "scale=3;$center_x + $hr_orig_y * s(($hr/12+$min/60/12)*(2*4*a(1)))" | bc -l)
|
|
||||||
hr_y=$(echo "scale=3;$center_y - $hr_orig_y * c(($hr/12+$min/60/12)*(2*4*a(1)))" | bc -l)
|
|
||||||
|
|
||||||
sec_x=$(echo "scale=3;$center_x + $sec_orig_y * s($sec/60*(2*4*a(1)))" | bc -l)
|
|
||||||
sec_y=$(echo "scale=3;$center_y - $sec_orig_y * c($sec/60*(2*4*a(1)))" | bc -l)
|
|
||||||
|
|
||||||
min_x=$(echo "scale=3;$center_x + $min_orig_y * s($min/60*(2*4*a(1)))" | bc -l)
|
|
||||||
min_y=$(echo "scale=3;$center_y - $min_orig_y * c($min/60*(2*4*a(1)))" | bc -l)
|
|
||||||
preparams="-size 160x43 xc:white -stroke black -fill white -draw \"circle 30,20 30,2\" -draw \"line 30,20 $sec_x,$sec_y\" -draw \"line 30,20 $min_x,$min_y\" -draw \"line 30,20 $hr_x,$hr_y\" "
|
|
||||||
postparams="-pointsize 16 -fill black -font Courier -draw \"text 60,15 '$Date'\" -draw \"text 68,35 '$Time'\" pbm:- "
|
|
||||||
eval convert $preparams $ticks $postparams | ./pbm2lpbm > /tmp/g13-0
|
|
||||||
sleep 1
|
|
||||||
done
|
|
@ -1,47 +0,0 @@
|
|||||||
#!/usr/bin/python
|
|
||||||
|
|
||||||
"""
|
|
||||||
simple test script to update G13 LCD with temperature values from lm-sensors
|
|
||||||
"""
|
|
||||||
|
|
||||||
import subprocess
|
|
||||||
import re
|
|
||||||
import time
|
|
||||||
|
|
||||||
|
|
||||||
def doCmd(*cmd):
|
|
||||||
# print("cmd = %r" % (cmd,))
|
|
||||||
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
|
||||||
out, err = p.communicate()
|
|
||||||
return out #, err
|
|
||||||
|
|
||||||
|
|
||||||
def get_sensors():
|
|
||||||
sensor_lines = doCmd('sensors').split('\n')
|
|
||||||
print("sensor_lines = %r" % (sensor_lines,))
|
|
||||||
temp_re = re.compile(r'''([a-zA-Z])[a-zA-Z s]+([0-9])\:\s*\+([0-9.]+)[\xc2\xb0C]*C.*''')
|
|
||||||
|
|
||||||
temps = []
|
|
||||||
for line in sensor_lines:
|
|
||||||
m = temp_re.match(line)
|
|
||||||
if m:
|
|
||||||
tag, index, value = m.groups()
|
|
||||||
print("%s%s = %s" % (tag, index, value))
|
|
||||||
# temps.append("%s%s:%s" % (tag, index, value))
|
|
||||||
temps.append("%s" % (value,))
|
|
||||||
# else:
|
|
||||||
# print("failed to match %r" % (line,))
|
|
||||||
|
|
||||||
with open('/home/jtgans/.local/var/g13d/in', 'w') as p:
|
|
||||||
p.write('pos 0 0 \n')
|
|
||||||
p.write('out %s\n' % (' '.join(temps)))
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
|
||||||
while True:
|
|
||||||
get_sensors()
|
|
||||||
time.sleep(1.0)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
main()
|
|
Loading…
Reference in New Issue
Block a user