From a900b2c4fa928de32c30943029ccd4b67c4b7ee9 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Sun, 21 Apr 2019 23:59:51 +0530 Subject: Support config dir ~/.config/nnn --- plugins/README.md | 2 +- plugins/kdeconnect | 8 +++++--- plugins/ndiff | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) (limited to 'plugins') diff --git a/plugins/README.md b/plugins/README.md index 236ab00..1454103 100644 --- a/plugins/README.md +++ b/plugins/README.md @@ -24,7 +24,7 @@ Plugins can access: - all files in the directory (`nnn` switches to the dir where the plugin is to be run so the dir is `$PWD` for the plugin) - the currently highlighted file (the file name is passed as the argument to a plugin) -- the current selection (by reading the file .nnncp, see the plugin `ndiff`) +- the current selection (by reading the file `~/.config/nnn/.selection`, see the plugin `ndiff`) Each script has a _Description_ section which provides more details on what the script does, if applicable. diff --git a/plugins/kdeconnect b/plugins/kdeconnect index 0fbafbb..a209f55 100755 --- a/plugins/kdeconnect +++ b/plugins/kdeconnect @@ -5,11 +5,13 @@ # Shell: POSIX compliant # Author: juacq97 +SELECTION=~/.config/nnn/.selection + id=$(kdeconnect-cli -a --id-only | awk '{print $1}') -if [ "$(find ~/.nnncp)" ]; then - kdeconnect-cli -d "$id" --share "$(cat ~/.nnncp)" +if [ "$(find "$SELECTION")" ]; then + kdeconnect-cli -d "$id" --share "$(cat "$SELECTION")" # If you want a system notification, uncomment the next 3 lines. -# notify-send -a "Kdeconnect" "Sending $(cat ~/.nnncp)" +# notify-send -a "Kdeconnect" "Sending $(cat "$SELECTION")" #else # notify-send -a "Kdeconnect" "No file selected" fi diff --git a/plugins/ndiff b/plugins/ndiff index e2f1125..fad28ad 100755 --- a/plugins/ndiff +++ b/plugins/ndiff @@ -5,4 +5,4 @@ # Shell: POSIX compliant # Author: Arun Prakash Jana -vimdiff $(cat ~/.nnncp | tr '\0' '\n') +vimdiff $(cat ~/.config/nnn/.selection | tr '\0' '\n') -- cgit v1.2.3-70-g09d2