0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

nnnのpluginを書いてみた

Last updated at Posted at 2025-07-17

nnnのpluginは~/.config/nnn/pluginに作ります。

dirplay
#!/usr/bin/env sh

#RAOP=10.0.1.30

if [ -d "$1" ]; then

TOTAL=`find "$1" -name \*.m4a | wc -l`
LIST=`find "$1" -name \*.m4a`

IFS=$'\n'

echo $1

echo "Total Track: ${TOTAL}"

for i in ${LIST};
do
FN=`basename ${i}`
echo "${FN}"
light-play $RAOP "${i}"
#sleep 2
done
fi

OPENEでは$1で絶対パスが渡されますが、PLUGINでは選択されているものの名前だけでした。

サウンドデバイスはいくつかあるので、RAOPは事前に環境変数をセットしておくとにしました。

二回findを実行しているのはLISTを数える事が出来なかったからです。いけてないです。

pに設定します。(sh,bashの場合はexport)

c1k: {6} setenv NNN_PLUG "p:dirplay"

ディレクトリを選んで;pと入力します。ALTは普通のターミナルのデフォルトでは使えないと思います。

image.png

c1k: {7} nnn
遠い音楽
Total Track:        9
01 満ち潮の夜.m4a
02 夢を見る方法.m4a

現在の構成はこんな感じです。

ALACPlay.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?