From f90c34cd86046fcb8d20259331fd7e405fb7ff42 Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Sat, 11 Jun 2022 15:31:09 +0200 Subject: add install system --- status | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/status b/status index af5c190..5cd6678 100755 --- a/status +++ b/status @@ -49,8 +49,23 @@ help() { echo " -d - run daemon" } +install_unit() { + printf "prefix: " + read prefix + ln -s "$HOME/.local/bin/$1" "$HOME/.local/share/status/$prefix$1" +} + +remove_unit() { + unit=$(ls ~/.local/share/status/*$1) + printf "remove unit $unit? [Y/n]" + read $response + [ -z "$response" -o "$response" = "Y" ] && rm "$unit" +} + case "$1" in -d) daemon;; -u) echo "update $2" > $CMDFIFO;; -h) help;; + -i)install_unit $2;; + -r)remove_unit $2;; esac -- cgit v1.2.3-70-g09d2