sync-res: added script

also have trash now
This commit is contained in:
dogeystamp 2024-09-28 11:23:10 -04:00
parent 66d7d08d17
commit d328a324a6
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38
3 changed files with 32 additions and 3 deletions

View File

@ -62,6 +62,7 @@ libappimage
nftables
sdcv
ufw
trash-cli
rofi
rink
progress
@ -72,11 +73,11 @@ which
dnsutils
man-pages
zoxide
tinyxxd
# IME input
fcitx5
fcitx5-chinese-addons
fcitx5-configtool
tinyxxd
# in the aur
tmsu

View File

@ -1,5 +1,6 @@
#!/bin/sh
# Categorize files in the quarantine directory
# depends: fzf, mpv
# read -n 1 isn't POSIX-compliant so we implement something
# https://unix.stackexchange.com/questions/464930/can-i-read-a-single-character-from-stdin-in-posix-shell
@ -56,7 +57,6 @@ PREVNAME=""
find ~/quar \
-maxdepth 1 \
-type f \
-not -path '*/trash/*' \
\( \
-name '*.mov' -o \
-name '*.MOV' -o \
@ -97,7 +97,7 @@ while read -r FILE; do
break
fi;;
s ) break;;
d ) mv "$FILE" ~/quar/trash/; break;;
d ) trash "$FILE"; break;;
* )
printf "\nInvalid input! Press enter to continue\n";
read </dev/tty;

View File

@ -0,0 +1,28 @@
#!/bin/sh
# Resolve Syncthing conflicts
# depends: trash-cli
col() {
printf "\033[34m %s \033[0m" "$1"
}
die() {
echo $@ 2>&1
exit 1
}
PROGNAME=$(basename "$0")
if [ -z "$1" ]; then
die usage: $PROGNAME file.sync-conflict-XXXXXXXX-XXXXXX-XXXXXXX
fi
ORIG=$(echo "$1" | sed 's/\.sync-conflict.*$//')
if [ "$ORIG" = "$1" ]; then
die Could not find original file. Is this a sync-conflict file?
else
printf "Using original file '%s'.\n" "$ORIG"
fi
diff --color=always "$1" "$ORIG" > /dev/tty
trash -i "$1"