yadm-config/.config/yadm/bootstrap.v2/applications/30-Hyprdrop.sh
2025-04-21 22:19:46 +02:00

37 lines
604 B
Bash
Executable file

#!/bin/env sh
HYPRDROP_GIT_PATH="$HOME/.cache/hyprdrop"
install_hyprdrop() {
PREV_DIRECTORY=$PWD
if [ ! -d "$HYPRDROP_GIT_PATH" ]; then
git clone https://github.com/kjlo/hyprdrop "$HYPRDROP_GIT_PATH"
fi
cd ~/.cache/hyprdrop
cargo install --path .
cd $PREV_DIRECTORY
}
check_hyprdrop() {
if [ ! -d "$HOME/.cache/hyprdrop" ]; then
return 0
fi
PREV_DIRECTORY=$PWD
cd $HYPRDROP_GIT_PATH
if ! git remote update && git status | grep behind >>/dev/null; then
cd $PREV_DIRECTORY
return 0
fi
return 1
}
if check_hyprdrop; then
addActions install_hyprdrop
fi