Ranger 什么程序正在打开文件?

Ranger 什么程序正在打开文件?

我正在使用 Ranger,当我导航到包含音频文件的文件夹并按 Enter 键时,它会在终端中播放 mp3 文件。

终端音频程序不是我的默认程序,因为当我从 GUI 双击时,会打开一个不同的程序。

我想弄清楚 Ranger 正在使用什么程序,这样我就可以尝试手动使用它来处理未在 Ranger 中打开的波形文件。

关于找出正在使用的程序有什么建议吗?

在此输入图像描述

答案1

Ranger 使用的应用程序在rifle.conf 中定义。

这些是 Fedora 下与音频相关的默认设置:

#--------------------------------------------
# Audio without X
#-------------------------------------------
mime ^audio|ogg$, terminal, has mplayer  = mplayer -- "$@"
mime ^audio|ogg$, terminal, has mplayer2 = mplayer2 -- "$@"
mime ^audio|ogg$, terminal, has mpv      = mpv -- "$@"
ext midi?,        terminal, has wildmidi = wildmidi -- "$@"

#--------------------------------------------
# Video/Audio with a GUI
#-------------------------------------------
mime ^video|audio, has gmplayer, X, flag f = gmplayer -- "$@"
mime ^video|audio, has smplayer, X, flag f = smplayer "$@"
mime ^video,       has mpv,      X, flag f = mpv -- "$@"
mime ^video,       has mpv,      X, flag f = mpv --fs -- "$@"
mime ^video,       has mplayer2, X, flag f = mplayer2 -- "$@"
mime ^video,       has mplayer2, X, flag f = mplayer2 -fs -- "$@"
mime ^video,       has mplayer,  X, flag f = mplayer -- "$@"
mime ^video,       has mplayer,  X, flag f = mplayer -fs -- "$@"
mime ^video|audio, has vlc,      X, flag f = vlc -- "$@"
mime ^video|audio, has totem,    X, flag f = totem -- "$@"
mime ^video|audio, has totem,    X, flag f = totem --fullscreen -- "$@"

找到你的游侠配置文件夹(通常$HOME/.config/ranger),打开rifle.conf 文件并搜索这些行。

答案2

启动后,ranger 会创建一个目录 ~/.config/ranger。要将默认配置复制到此目录,请发出以下命令:

$ Ranger --copy-config=全部

rc.conf - startup commands and key bindings
commands.py - commands which are launched with :
rifle.conf - applications used when a given type of file is launched.

相关内容