Pi66

pind
Simple Rust hotkey daemon.
git clone https://git.pi66.xyz/pind

← back to log

starting the app again will automatically restart it

author: pixel2175
date: 2025-08-13 14:05
hash: 6f2eac837a172d8952da829782bdd7d5d882dcf0

Diffstat:

M

Cargo.toml
2 ++++++++-------

M

pindc
4 +++++++++++++++---------------
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
diff --git a/Cargo.toml b/Cargo.toml
index 6681dc0..87bf89d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "pind"
-version = "0.1.0"
+version = "0.1.1"
 edition = "2024"

 [dependencies]
diff --git a/pindc b/pindc
index 9c3783b..3938ff6 100755
--- a/pindc
+++ b/pindc
@@ -2,9 +2,9 @@
 # Pixel 2025
 # https://pi66.xyz/pind | github:pixel2175/pind 
 # this script runs the daemon with the client env
-
 env_cmd="$1"
-[ -z "$env_cmd" ] && env_cmd="env"
+[ -z "$env_cmd" ] && env_cmd="sudo"
+pgrep -x "pindd" >/dev/null 2>&1 && $env_cmd pkill -x "pindd" >/dev/null 2>&1

 if [ "$env_cmd" = "doas" ]; then
     exec doas -u root env <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo stretchy="false">&#x00028;</mo><mi>p</mi><mi>r</mi><mi>i</mi><mi>n</mi><mi>t</mi><mi>e</mi><mi>n</mi><mi>v</mi><mo stretchy="false">&#x0007C;</mo><mi>t</mi><msup><mi>r</mi><mi>&#x02032;</mi></msup><msup><mi>\n</mi><mi>&#x02033;</mi></msup><mi>\</mi><msup><mn>0</mn><mi>&#x02032;</mi></msup><mo stretchy="false">&#x0007C;</mo><mi>x</mi><mi>a</mi><mi>r</mi><mi>g</mi><mi>s</mi><mo>&#x02212;</mo><mn>0</mn><mo>&#x02212;</mo><mi>I</mi><mrow /><mi>e</mi><mi>c</mi><mi>h</mi><mi>o</mi><mi>"</mi><mrow /><mi>"</mi><mo stretchy="false">&#x00029;</mo><mi>p</mi><mi>i</mi><mi>n</mi><mi>d</mi><mi>d</mi><mi>"</mi></mrow></math>USER"