dotfiles/.local/bin/scripts/kdeconnect-share

9 lines
368 B
Plaintext
Raw Normal View History

2021-07-15 08:36:53 +00:00
#!/bin/sh
2021-11-23 12:03:43 +00:00
kdeconnect-cli --refresh
2021-07-15 08:36:53 +00:00
if ! test -f "$1"; then echo "Please specify a file to share" && exit 1; fi
file="$1"
2024-01-12 16:53:41 +00:00
device="$(kdeconnect-cli --list-available 2>/dev/null | fzf -0 -1 | sed -E 's|.*: ([^ ]*) .*|\1|')"
2021-12-20 17:34:03 +00:00
test -z "$device" && kdeconnect-cli --list-devices && echo "No device available!" && exit 1
2021-07-15 08:36:53 +00:00
shift
kdeconnect-cli "--share=$file" -d "$device" "$@"