mirror of
https://github.com/jarun/nnn.git
synced 2024-12-02 11:26:38 +00:00
Updated Advanced use cases (markdown)
parent
115d7b148a
commit
a652ca3ad6
|
@ -122,6 +122,31 @@ StartupWMClass=NNN
|
||||||
|
|
||||||
`--class "NNN"` is used to group all `nnn` instances together and `StartupWMClass=NNN` to tell launcher which windows should be associated with this icon.
|
`--class "NNN"` is used to group all `nnn` instances together and `StartupWMClass=NNN` to tell launcher which windows should be associated with this icon.
|
||||||
|
|
||||||
|
### Browser Integration
|
||||||
|
|
||||||
|
#### Chromium
|
||||||
|
|
||||||
|
To use `nnn` as the file picker dialog for chromium browsers, create a script `kdialog` in your path:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
#!/bin/sh
|
||||||
|
while :; do case $1 in
|
||||||
|
--getsavefilename) file="$2" break ;;
|
||||||
|
--*) shift ;;
|
||||||
|
*) break ;;
|
||||||
|
esac done
|
||||||
|
file="${file##/*/}"
|
||||||
|
st -c picker sh -c "nnn -S -s picker -p - | awk '{ print system(\"[ -d \" \$0 \" ]\") ? \$0: \$0\"/${file##/*/}\" }' > /proc/$$/fd/1"
|
||||||
|
```
|
||||||
|
|
||||||
|
Then create a browser wrapper that launches your browser with `XDG_CURRENT_DESKTOP=KDE`:
|
||||||
|
```sh
|
||||||
|
#!/bin/sh
|
||||||
|
XDG_CURRENT_DESKTOP=KDE <browser binary> "$@"
|
||||||
|
```
|
||||||
|
|
||||||
|
This will cause chromium to look for `kdialog` to open files, make sure the `kdialog` script comes in your `PATH` before the `kdialog` package binary if you have this installed.
|
||||||
|
|
||||||
## Launch `nnn` with a keyboard shortcut
|
## Launch `nnn` with a keyboard shortcut
|
||||||
|
|
||||||
### On a Desktop Environment (KDE, GNOME, XFCE)
|
### On a Desktop Environment (KDE, GNOME, XFCE)
|
||||||
|
@ -314,4 +339,4 @@ list of supported commands:
|
||||||
|
|
||||||
help on a particular command:
|
help on a particular command:
|
||||||
|
|
||||||
lftp :~> help put
|
lftp :~> help put
|
||||||
|
|
Loading…
Reference in a new issue