commit 59cf8834375b7912d85367d8c8c975ec2123952b parent bb875cd5e715a563fb195d3507da6b57ef091ad1 Author: Arun <engineerarun@gmail.com> Date: Sat, 9 Apr 2022 16:56:30 +0530 Merge pull request #1338 from JingMatrix/fix-gsconnect Allow gsconnect to handle multiple devices Diffstat:
| M | plugins/gsconnect | | | 18 | ++++++++++-------- |
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/plugins/gsconnect b/plugins/gsconnect @@ -8,12 +8,14 @@ # Author: Darukutsu selection=${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection} gsconnect=$HOME/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js -id=$($gsconnect -l) +ids=$($gsconnect -l) -if [ -s "$selection" ]; then - xargs -0 < "$selection" -I{} "$gsconnect" -d "$id" --share-file="{}" - # Clear selection - printf "-" > "$NNN_PIPE" -else - "$gsconnect" -d "$id" --share-file="$2/$1" -fi +for id in $ids; do + if [ -s "$selection" ]; then + xargs -0 < "$selection" -I{} "$gsconnect" -d "$id" --share-file="{}" + # Clear selection + printf "-" > "$NNN_PIPE" + else + "$gsconnect" -d "$id" --share-file="$2/$1" + fi +done