KDE Connect bash helper
Project description
kcb
Execute bash scripts on top of KDEConnect's sftp mount
Installation and configuration
pip3 install --user kcb
mkdir .config/kcb
cp https://raw.githubusercontent.com/ReSqAr/kcb/master/Documentation/Examples/My%20Smartphone.sh .config/kcb/PHONENAME.sh
chown u+x .config/kcb/PHONENAME.sh
pico .config/kcb/PHONENAME.sh
One has to repeat the last three lines such that in the end
the local .config/kcb/ folder contains bash scripts for all phones,
where PHONENAME is a placeholder for the KDEConnect phone name.
These scripts can assume that they are run in the sftp mount point,
i.e. the folders DCIM, Downloads, Android, etc are actually are directly visible.
Example bash scripts
The following is a sample bash script which backups the photo folder, OSMAnd's GPS tracks and the WhatsApp folder to ~/MySmartphone folder.
set -x
TARGET="~/MySmartphone"
echo "file listing"
ls
echo "GPS Tracks"
rsync --human-readable --progress --archive --ignore-existing --itemize-changes --prune-empty-dirs "Android/data/net.osmand.plus/files/tracks/rec/" "$TARGET/GPS Tracks/"
echo "WhatsApp"
rsync --human-readable --progress --archive --ignore-existing --itemize-changes --prune-empty-dirs "WhatsApp/" "$TARGET/WhatsApp/"
echo "Photos"
rsync --human-readable --progress --archive --ignore-existing --itemize-changes --prune-empty-dirs "DCIM/Camera/" "$TARGET/"
Usage
Since we installed the kcb executable in ~/.local/bin/,
we start the application via ~/.local/bin/kcb.
There are multiple ways around that,
i.e. being able to just type kcb;
one could add ~/.local/bin to the $PATH variable for example.
Regarding the command line parameters of kcb,
you can run kcb without any parameters
in which case all bash scripts of online phones are executed.
Or you can list the names of the devices
whose bash scripts should be executed.
Example usage
Assume that KDE Connect knows two smartphones named OnePlus and Samsung S8.
.local/bin/kcb OnePlusexecutes justOnePlus.sh(if it exists).local/bin/kcb "Samsung S8"executes justSamsung S8.sh(if it exists).local/bin/kcbexecutes both shell scripts (if they exist).local/bin/kcb OnePlus "Samsung S8"executes both shell scripts (if they exist)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kcb-0.9.2.tar.gz.
File metadata
- Download URL: kcb-0.9.2.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec7ab3cb316bc7d69bcba11fcc0575cb990517c67fcde1b922e98317803ac582
|
|
| MD5 |
2d050f49fb50cc34966515437df4a532
|
|
| BLAKE2b-256 |
f936ee0c71fe9be2ea9ea1f71e5fa5843ffb473f8dfd3a7a5f0673406e274908
|
File details
Details for the file kcb-0.9.2-py3-none-any.whl.
File metadata
- Download URL: kcb-0.9.2-py3-none-any.whl
- Upload date:
- Size: 19.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89620a35aa5e2471924e519a986913537769ff59a928e1078a164cd7114c1d2b
|
|
| MD5 |
7018cc3430dbf95ee339d7d836b243a5
|
|
| BLAKE2b-256 |
d8ae827a67a2c040c6e267a3333941d0ae946d367b87953f8837eed807b8410e
|