4 KDECONN
=$
(which kdeconnect-cli
)
5 CHOICE
=/tmp
/choose_devices
6 OUTPUT
=/tmp
/share_output
9 function scan_devices
() {
10 if [[ -f $CHOICE ]]; then
13 DEV_NAMES
=$
(${KDECONN} -a --name-only)
14 DEV
=$
($QARMA --list --text="Select your device" --hide-header "$DEV_NAMES" > $CHOICE)
17 # echo "${KDECONN} --share figa -n \"$(cat $CHOICE)\""
18 DEVICE
="$(cat $CHOICE)"
21 $QARMA --info --title="Exiting!" --text="No device was selected."
25 $QARMA --error --title="Ooops!!" --text="Something unexpected happened."
32 function send_file
() {
33 if [[ -f $OUTPUT ]]; then
36 if [[ -f $1 && -n $2 ]]; then
39 echo -e "Sharing to ${DEST} - " > $OUTPUT
40 $KDECONN --share "$FILE" -n "$DEST" 2>&1 >> $OUTPUT
41 $QARMA --info --title="Share to Device" --text="$(cat $OUTPUT)"
43 echo "no device selected"
48 # we have a file to share
50 SHAREDTO
=$
(scan_devices
)
51 send_file
"$SHARED" "$SHAREDTO"
53 echo "tell me what to send"