Signed-off-by: fbt <fbt@fleshless.org>
This commit is contained in:
2026-11-27 23:41:42 +00:00
parent 57f083772e
commit df9f749726
2 changed files with 24 additions and 13 deletions
+9 -6
View File
@@ -11,10 +11,10 @@ err() { echo "$*" >&2; }
usage() {
printf 'Usage: ufwd [flags]\n'
printf ' -h # Show this message.\n'
printf ' -n # Enable notifications with notify-send. Must be installed.\n'
printf ' -d [path] # Set the dir that is to be watched.\n'
printf ' -s # Push the file url into the clipboard.\n'
printf ' --help|-h # Show this message.\n'
printf ' --notify|-n # Enable notifications with notify-send. Must be installed.\n'
printf ' --workdir|-d [path] # Set the dir that is to be watched.\n'
printf ' --clipboard|-c # Enable clipboard.\n'
printf ' --magick <type:format> # Convert files of `type` into `format` with magick.\n'
}
@@ -75,7 +75,7 @@ main() {
shift
done
[[ $cfg_workdir ]] || cfg_workdir="$XDG_RUNTIME_DIR/ufwd"
[[ $cfg_workdir ]] || cfg_workdir=( "$XDG_RUNTIME_DIR/ufwd" )
if (( flag_enable_notifications )); then
if type -P notify-send &>/dev/null; then
@@ -87,7 +87,10 @@ main() {
fi
for p in "${cfg_workdir[@]}"; do
[[ -d "$p" ]] || return 1
[[ -d "$p" ]] || {
err "No such directory: $p"
return 1
}
done
printf 'Working in:\n'