agg*_*sol 4 command-line audio-player
我的 bash 脚本应该直接调用用户首选的音频播放器而不是 vlc 或 mplayer。我如何从 bash 调用它?我假设类似
audio-player --play music.mp3
Run Code Online (Sandbox Code Playgroud)
N0r*_*ert 11
尝试使用 XDG open,它应该使用默认应用程序打开文件:
xdg-open music.mp3
Run Code Online (Sandbox Code Playgroud)
姓名
Run Code Online (Sandbox Code Playgroud)xdg-open - opens a file or URL in the user's preferred application概要
Run Code Online (Sandbox Code Playgroud)xdg-open {file | URL} xdg-open {--help | --manual | --version}描述
Run Code Online (Sandbox Code Playgroud)xdg-open opens a file or URL in the user's preferred application. If a URL is provided the URL will be opened in the user's preferred web browser. If a file is provided the file will be opened in the preferred application for files of that type. xdg-open supports file, ftp, http and https URLs. xdg-open is for use inside a desktop session only. It is not recommended to use xdg-open as root.
| 归档时间: |
|
| 查看次数: |
577 次 |
| 最近记录: |