Embroidermodder / libembroidery

Library for reading/writing/manipulating machine and design embroidery files
https://www.libembroidery.org
zlib License
45 stars 13 forks source link

Automation tools that integrate with the user's system #209

Open robin-swift opened 1 year ago

robin-swift commented 1 year ago

@marshallapparalautomation suggested to me via email that we could have a version of embroider that automatically converts the contents of a folder dynamically like a traditional UNIX daemon.

Rather than get knee deep in systemd, since this is something that could need versions for many different systems, lets sketch out a simple shell script.

Sketch of how the script would look, to be hooked onto, for example ~/.xinitrc.

# [At the bottom of .xinitrc]
export EMBROIDER_DIR="~/to_embroider"
. ~/embroidermodder2/embroiderd &

where embroiderd is our "UNIX daemon", here actually just a loop that runs without the need for a user-visible terminal

#!/bin/sh

while [ 1 ]
do
    for file in $EMBROIDER_DIR/*.svg
    do
        embroider -to dst $file
    done
    # To stop our script consuming too many system resources
    sleep 3
done

He can chime in here if that's not what what he means.