sync-res: added script
also have trash now
This commit is contained in:
parent
66d7d08d17
commit
d328a324a6
3
programs
3
programs
@ -62,6 +62,7 @@ libappimage
|
|||||||
nftables
|
nftables
|
||||||
sdcv
|
sdcv
|
||||||
ufw
|
ufw
|
||||||
|
trash-cli
|
||||||
rofi
|
rofi
|
||||||
rink
|
rink
|
||||||
progress
|
progress
|
||||||
@ -72,11 +73,11 @@ which
|
|||||||
dnsutils
|
dnsutils
|
||||||
man-pages
|
man-pages
|
||||||
zoxide
|
zoxide
|
||||||
|
tinyxxd
|
||||||
# IME input
|
# IME input
|
||||||
fcitx5
|
fcitx5
|
||||||
fcitx5-chinese-addons
|
fcitx5-chinese-addons
|
||||||
fcitx5-configtool
|
fcitx5-configtool
|
||||||
tinyxxd
|
|
||||||
|
|
||||||
# in the aur
|
# in the aur
|
||||||
tmsu
|
tmsu
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Categorize files in the quarantine directory
|
# Categorize files in the quarantine directory
|
||||||
|
# depends: fzf, mpv
|
||||||
|
|
||||||
# read -n 1 isn't POSIX-compliant so we implement something
|
# 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
|
# https://unix.stackexchange.com/questions/464930/can-i-read-a-single-character-from-stdin-in-posix-shell
|
||||||
@ -56,7 +57,6 @@ PREVNAME=""
|
|||||||
find ~/quar \
|
find ~/quar \
|
||||||
-maxdepth 1 \
|
-maxdepth 1 \
|
||||||
-type f \
|
-type f \
|
||||||
-not -path '*/trash/*' \
|
|
||||||
\( \
|
\( \
|
||||||
-name '*.mov' -o \
|
-name '*.mov' -o \
|
||||||
-name '*.MOV' -o \
|
-name '*.MOV' -o \
|
||||||
@ -97,7 +97,7 @@ while read -r FILE; do
|
|||||||
break
|
break
|
||||||
fi;;
|
fi;;
|
||||||
s ) break;;
|
s ) break;;
|
||||||
d ) mv "$FILE" ~/quar/trash/; break;;
|
d ) trash "$FILE"; break;;
|
||||||
* )
|
* )
|
||||||
printf "\nInvalid input! Press enter to continue\n";
|
printf "\nInvalid input! Press enter to continue\n";
|
||||||
read </dev/tty;
|
read </dev/tty;
|
||||||
|
28
src/dot_local/bin/executable_sync-res.sh
Normal file
28
src/dot_local/bin/executable_sync-res.sh
Normal 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"
|
Loading…
x
Reference in New Issue
Block a user