Commit 2fc0d4ec22e7b79a3a784fe3edcacdaac829c698

Commits
[COMMIT BEGIN]
commit 2fc0d4ec22e7b79a3a784fe3edcacdaac829c698
Author: 0x4248 <[email protected]>
Date:   Sun Mar 15 09:16:26 2026 +0000

    Felix: various fixes to buzzer

diff --git a/systems/linux/dotfiles/felix/home/felix/buzzerd/buzzerd.py b/systems/linux/dotfiles/felix/home/felix/buzzerd/buzzerd.py
index 898c02d..33422a7 100644
--- a/systems/linux/dotfiles/felix/home/felix/buzzerd/buzzerd.py
+++ b/systems/linux/dotfiles/felix/home/felix/buzzerd/buzzerd.py
@@ -1,13 +1,13 @@
 import serial
 
-SERIAL="/dev/ttyACM0"
-PIPE="/tmp/buzzer"
+SERIAL = "/dev/ttyACM0"
+PIPE = "/dev/buzzer"
 
-ser = serial.Serial(SERIAL,115200)
+ser = serial.Serial(SERIAL, 115200)
 
 print("buzzer daemon started")
 
 while True:
-    with open(PIPE,"r") as f:
+    with open(PIPE, "r") as f:
         for line in f:
-            ser.write((line.strip()+"\n").encode())
\ No newline at end of file
+            ser.write((line.strip() + "\n").encode())
\ No newline at end of file
diff --git a/systems/linux/dotfiles/felix/home/felix/buzzerd/init.sh b/systems/linux/dotfiles/felix/home/felix/buzzerd/init.sh
index 0f5cb68..7def75a 100644
--- a/systems/linux/dotfiles/felix/home/felix/buzzerd/init.sh
+++ b/systems/linux/dotfiles/felix/home/felix/buzzerd/init.sh
@@ -1,17 +1,21 @@
-# Setup arduino buzzer
+#!/bin/bash
 
-if [ ! -e /dev/ttyACM0 ]; then
-    echo "Error: /dev/ttyACM0 not found. Please connect the Arduino device and try again."
-    exit 1
-fi
-chmod a+rw /dev/ttyACM0
-stty -F /dev/ttyACM0 115200 raw -echo
+SERIAL="/dev/ttyACM0"
+PIPE="/dev/buzzer"
+
+# Give permissions
+chmod a+rw $SERIAL
+stty -F $SERIAL 115200 raw -echo
 
-mkfifo /tmp/buzzer
-chmod 666 /tmp/buzzer
+# Create named pipe if it doesn't exist
+if [ ! -p "$PIPE" ]; then
+    mkfifo "$PIPE"
+    chmod 666 "$PIPE"
+fi
 
-python3 buzzerd.py &
+# Start Python daemon if not already running
+if ! pgrep -f buzzerd.py >/dev/null; then
+    python3 /root/felix/buzzerd.py &
+fi
 
-echo 500 > /tmp/buzzer
-sleep 1
-echo 0 > /tmp/buzzer
\ No newline at end of file
+echo "Felix init done"
\ No newline at end of file
diff --git a/systems/linux/dotfiles/felix/home/felix/systemd/install.sh b/systems/linux/dotfiles/felix/home/felix/systemd/install.sh
index 3facd3c..5f0a165 100644
--- a/systems/linux/dotfiles/felix/home/felix/systemd/install.sh
+++ b/systems/linux/dotfiles/felix/home/felix/systemd/install.sh
@@ -2,16 +2,5 @@
 
 cp /root/felix/systemd/felix.service /etc/systemd/system/
 systemctl enable felix.service
+chmod -x /root/felix/felix_init.sh
 echo "Felix service installed. Please reboot to start the service."
-consent=""
-
-while [[ ! "$consent" =~ ^[Yy]$ ]]; do
-    read -p "Do you want to reboot now? (y/n) " consent
-    if [[ "$consent" =~ ^[Yy]$ ]]; then
-        clear
-        echo "Felix service installer is rebooting the system to start the service. Please wait..."
-        systemctl reboot
-    else
-        exit 0
-    fi
-done
\ No newline at end of file
diff --git a/systems/linux/dotfiles/felix/install.sh b/systems/linux/dotfiles/felix/install.sh
new file mode 100644
index 0000000..d59c87f
--- /dev/null
+++ b/systems/linux/dotfiles/felix/install.sh
@@ -0,0 +1,11 @@
+# Install/update the felix service
+rm -rf /root/felix
+mkdir -p /root/felix
+cp -r home/felix/. /root/felix/.
+if [ -f /etc/systemd/system/felix.service ]; then
+    systemctl disable felix.service
+    rm /etc/systemd/system/felix.service
+fi
+
+bash /root/felix/systemd/install.sh
+systemctl daemon-reload
\ No newline at end of file
[COMMIT END]
(C) 2025 0x4248 (C) 2025 4248 Media and 4248 Systems, All part of 0x4248 See LICENCE files for more information. Not all files are by 0x4248 always check Licencing.