diff --git a/send-with-kdeconnect@rcalixte/CHANGELOG.md b/send-with-kdeconnect@rcalixte/CHANGELOG.md new file mode 100644 index 00000000..58d99ae8 --- /dev/null +++ b/send-with-kdeconnect@rcalixte/CHANGELOG.md @@ -0,0 +1,4 @@ + +### 1.0 + +* Initial release diff --git a/send-with-kdeconnect@rcalixte/README.md b/send-with-kdeconnect@rcalixte/README.md new file mode 100644 index 00000000..c797bfb0 --- /dev/null +++ b/send-with-kdeconnect@rcalixte/README.md @@ -0,0 +1,21 @@ +SEND WITH KDE CONNECT +===================== + +Send file(s) to a device paired with KDE Connect. + +DESCRIPTION +----------- + +This is an action that will send selected file(s) to a selected device that is +paired with KDE Connect and available. + +__NOTE:__ If there are no devices available, an error will be shown. + +DEPENDENCIES +------------ + +The following programs must be installed and available: + +* `gettext` for translations in the action's script +* `kdeconnect-cli` to provide the CLI for KDE Connect +* `zenity` to display dialogs diff --git a/send-with-kdeconnect@rcalixte/files/send-with-kdeconnect@rcalixte/icon.png b/send-with-kdeconnect@rcalixte/files/send-with-kdeconnect@rcalixte/icon.png new file mode 100644 index 00000000..bba2f2cf Binary files /dev/null and b/send-with-kdeconnect@rcalixte/files/send-with-kdeconnect@rcalixte/icon.png differ diff --git a/send-with-kdeconnect@rcalixte/files/send-with-kdeconnect@rcalixte/metadata.json b/send-with-kdeconnect@rcalixte/files/send-with-kdeconnect@rcalixte/metadata.json new file mode 100644 index 00000000..026d5160 --- /dev/null +++ b/send-with-kdeconnect@rcalixte/files/send-with-kdeconnect@rcalixte/metadata.json @@ -0,0 +1,7 @@ +{ + "description": "Send file(s) with KDE Connect", + "uuid": "send-with-kdeconnect@rcalixte", + "name": "Send with KDE Connect", + "author": "rcalixte", + "version": "1.0" +} diff --git a/send-with-kdeconnect@rcalixte/files/send-with-kdeconnect@rcalixte/po/send-with-kdeconnect@rcalixte.pot b/send-with-kdeconnect@rcalixte/files/send-with-kdeconnect@rcalixte/po/send-with-kdeconnect@rcalixte.pot new file mode 100644 index 00000000..b6c92a57 --- /dev/null +++ b/send-with-kdeconnect@rcalixte/files/send-with-kdeconnect@rcalixte/po/send-with-kdeconnect@rcalixte.pot @@ -0,0 +1,47 @@ +# Send with KDE Connect +# Copyright (C) 2023 +# Rick Calixte <10281587+rcalixte@users.noreply.github.com>, 2023. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: 1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-11-28 22:58-0500\n" +"PO-Revision-Date: \n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: en\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 3.4\n" + +#. metadata.json->description +msgid "Send file(s) with KDE Connect" +msgstr "" + +#. metadata.json->name +#. Name +msgid "Send with KDE Connect" +msgstr "" + +#. Comment +msgid "Send file(s) to a paired device" +msgstr "" + +#: send-with-kdeconnect@rcalixte.sh:5 +msgid "File(s) to send" +msgstr "" + +#: send-with-kdeconnect@rcalixte.sh:6 +msgid "Select the target device" +msgstr "" + +#: send-with-kdeconnect@rcalixte.sh:7 +msgid "Device Name" +msgstr "" + +#: send-with-kdeconnect@rcalixte.sh:8 +msgid "No devices available.\\n\\nPlease check KDE Connect and try again." +msgstr "" diff --git a/send-with-kdeconnect@rcalixte/files/send-with-kdeconnect@rcalixte/send-with-kdeconnect@rcalixte.sh b/send-with-kdeconnect@rcalixte/files/send-with-kdeconnect@rcalixte/send-with-kdeconnect@rcalixte.sh new file mode 100644 index 00000000..c0b79880 --- /dev/null +++ b/send-with-kdeconnect@rcalixte/files/send-with-kdeconnect@rcalixte/send-with-kdeconnect@rcalixte.sh @@ -0,0 +1,28 @@ +#! /bin/bash + +TEXTDOMAIN="send-with-kdeconnect@rcalixte" +TEXTDOMAINDIR="${HOME}/.local/share/locale" +_TITLE=$"File(s) to send" +_TEXT=$"Select the target device" +_COLUMN=$"Device Name" +_NODEVICES=$"No devices available.\n\nPlease check KDE Connect and try again." +TITLE="$(/usr/bin/gettext "$_TITLE")" +TEXT="$(/usr/bin/gettext "$_TEXT")" +COLUMN="$(/usr/bin/gettext "$_COLUMN")" +NODEVICES="$(/usr/bin/gettext "$_NODEVICES")" + +declare -A DEVICEMAP + +while IFS=' ' read -r value key; do + DEVICEMAP[$key]=$value; +done <<< $(/usr/bin/kdeconnect-cli --id-name-only --list-available 2>/dev/null) + +[[ ${#DEVICEMAP[@]} -eq 0 ]] && /usr/bin/zenity --error --text="${NODEVICES}" && exit 1 + +SELECTION=$(/usr/bin/zenity --list --title "${TITLE}" --column "${COLUMN}" --text "${TEXT}:" "${!DEVICEMAP[@]}") + +[[ -z $SELECTION ]] && exit + +for filename in "$@"; do + /usr/bin/kdeconnect-cli --device "${DEVICEMAP[$SELECTION]}" --share "${filename}" +done; diff --git a/send-with-kdeconnect@rcalixte/info.json b/send-with-kdeconnect@rcalixte/info.json new file mode 100644 index 00000000..48ccc0fc --- /dev/null +++ b/send-with-kdeconnect@rcalixte/info.json @@ -0,0 +1,3 @@ +{ + "author": "rcalixte" +} diff --git a/send-with-kdeconnect@rcalixte/send-with-kdeconnect@rcalixte.nemo_action.in b/send-with-kdeconnect@rcalixte/send-with-kdeconnect@rcalixte.nemo_action.in new file mode 100644 index 00000000..a5cfc2c6 --- /dev/null +++ b/send-with-kdeconnect@rcalixte/send-with-kdeconnect@rcalixte.nemo_action.in @@ -0,0 +1,7 @@ +[Nemo Action] +_Name=Send with KDE Connect +_Comment=Send file(s) to a paired device +Exec= +Selection=notnone +Extensions=nodirs; +Dependencies=gettext;kdeconnect-cli;zenity;