Pi66

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

pindc

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
#!/bin/env sh
# 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="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>g</mi><mi>r</mi><mi>e</mi><mi>p</mi><mo>&#x02212;</mo><mi>v</mi><msup><mi>"</mi><mi>&#x02032;</mi></msup><mi>"</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"
elif [ "$env_cmd" = "sudo" ]; then
    exec sudo -E env pindd "$USER"
else
    exec "<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mi>e</mi><mi>n</mi><msub><mi>v</mi><mi>c</mi></msub><mi>m</mi><mi>d</mi><mi>"</mi><mi>p</mi><mi>i</mi><mi>n</mi><mi>d</mi><mi>d</mi><mi>"</mi></mrow></math>USER"
fi