diff options
| author | 2019-04-21 23:59:51 +0530 | |
|---|---|---|
| committer | 2019-04-21 23:59:51 +0530 | |
| commit | a900b2c4fa928de32c30943029ccd4b67c4b7ee9 (patch) | |
| tree | 480c94e5017b4891b1a16e4d9134816fd44c4d16 /plugins | |
| parent | f9264577d295be0ccb788224e677e4615e53f843 (diff) | |
| download | nnn-a900b2c4fa928de32c30943029ccd4b67c4b7ee9.tar.gz | |
Support config dir ~/.config/nnn
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/README.md | 2 | ||||
| -rwxr-xr-x | plugins/kdeconnect | 8 | ||||
| -rwxr-xr-x | plugins/ndiff | 2 |
3 files changed, 7 insertions, 5 deletions
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') |