aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreinerxyz>2022-06-11 15:31:09 +0200
committerNathan Reiner <nathan@nathanreinerxyz>2022-06-11 15:31:09 +0200
commitf90c34cd86046fcb8d20259331fd7e405fb7ff42 (patch)
treed53290ab6cd12f5bf0209d3655f69c477d325cc8
parentd01b8ee2cebe3d05a2e16ec2e90b2d683585270f (diff)
add install system
-rwxr-xr-xstatus15
1 files changed, 15 insertions, 0 deletions
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