Skip to content

Commit

Permalink
Add send-with-kdeconnect@rcalixte (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
rcalixte authored Nov 29, 2023
1 parent 89793dc commit 1533c73
Show file tree
Hide file tree
Showing 8 changed files with 117 additions and 0 deletions.
4 changes: 4 additions & 0 deletions send-with-kdeconnect@rcalixte/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

### 1.0

* Initial release
21 changes: 21 additions & 0 deletions send-with-kdeconnect@rcalixte/README.md
Original file line number Diff line number Diff line change
@@ -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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -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"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Send with KDE Connect
# Copyright (C) 2023
# Rick Calixte <[email protected]>, 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 ""

#: [email protected]:5
msgid "File(s) to send"
msgstr ""

#: [email protected]:6
msgid "Select the target device"
msgstr ""

#: [email protected]:7
msgid "Device Name"
msgstr ""

#: [email protected]:8
msgid "No devices available.\\n\\nPlease check KDE Connect and try again."
msgstr ""
Original file line number Diff line number Diff line change
@@ -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;
3 changes: 3 additions & 0 deletions send-with-kdeconnect@rcalixte/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"author": "rcalixte"
}
7 changes: 7 additions & 0 deletions send-with-kdeconnect@rcalixte/[email protected]_action.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[Nemo Action]
_Name=Send with KDE Connect
_Comment=Send file(s) to a paired device
Exec=<send-with-kdeconnect@rcalixte/[email protected] %F>
Selection=notnone
Extensions=nodirs;
Dependencies=gettext;kdeconnect-cli;zenity;

0 comments on commit 1533c73

Please sign in to comment.