forked from mirror/nnn
Allow gsconnect to handle multiple devices
When gsconnect is connected to multiple devices, the original script won't work. Now the code will share files to all devices.
This commit is contained in:
parent
bb875cd5e7
commit
5bc75ef4fd
1 changed files with 10 additions and 8 deletions
|
@ -8,12 +8,14 @@
|
||||||
# Author: Darukutsu
|
# Author: Darukutsu
|
||||||
selection=${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection}
|
selection=${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection}
|
||||||
gsconnect=$HOME/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js
|
gsconnect=$HOME/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js
|
||||||
id=$($gsconnect -l)
|
ids=$($gsconnect -l)
|
||||||
|
|
||||||
if [ -s "$selection" ]; then
|
for id in $ids; do
|
||||||
xargs -0 < "$selection" -I{} "$gsconnect" -d "$id" --share-file="{}"
|
if [ -s "$selection" ]; then
|
||||||
# Clear selection
|
xargs -0 < "$selection" -I{} "$gsconnect" -d "$id" --share-file="{}"
|
||||||
printf "-" > "$NNN_PIPE"
|
# Clear selection
|
||||||
else
|
printf "-" > "$NNN_PIPE"
|
||||||
"$gsconnect" -d "$id" --share-file="$2/$1"
|
else
|
||||||
fi
|
"$gsconnect" -d "$id" --share-file="$2/$1"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
Loading…
Reference in a new issue