linux优雅地在终端播放音乐——ncmpcpp
音乐播放后端(mpd——Music Player Daemon): https://github.com/MusicPlayerDaemon/MPD
音乐播放客户端(ncmpcpp): https://github.com/ncmpcpp/ncmpcpp
安装使用
1 2
| # 直接用包管理工具安装即可 各大发行版都有包 yay -S mpd ncmpcpp
|
配置说明
配置MPD
配置文件位置 ~/.config/mpd/mpd.conf
个人配置demo
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| music_directory "~/Music" playlist_directory "~/.config/mpd/playlists" db_file "~/.config/mpd/database" log_file "~/.config/mpd/log" pid_file "~/.config/mpd/pid" state_file "~/.config/mpd/state" bind_to_address "localhost" port "6600" log_level "default" restore_paused "yes" auto_update "yes" auto_update_depth "4"
audio_output { type "pulse" name "pulse audio" }
audio_output { type "fifo" name "Visualizer feed" path "/tmp/mpd.fifo" format "44100:16:2" }
|
配置NCMPCPP
配置位置 ~/.config/ncmpcpp/config
个人配置demo
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| ncmpcpp_directory = ~/.ncmpcpp lyrics_directory = ~/.ncmpcpp/lyrics mpd_music_dir = ~/Music
visualizer_in_stereo = "no" visualizer_fifo_path = "/tmp/mpd.fifo" visualizer_output_name = "my_fifo" visualizer_sync_interval = "10" visualizer_type = "spectrum" #spectrum/wave/wave_filled/ellipse
autocenter_mode = yes message_delay_time = "1" song_list_format = "{{%a %t}|{%f}}{$R%l}" current_item_prefix = $b$7 current_item_inactive_column_prefix = $b$(white)$r now_playing_prefix = "$b$3" now_playing_suffix = "$b$9" main_window_color = white execute_on_song_change = notify-send "♫ Now Playing" "$(mpc current)"
playlist_display_mode = "classic" user_interface = classic header_visibility = "no" statusbar_visibility = "no" titles_visibility = "no"
mouse_support = "yes"
follow_now_playing_lyrics = yes fetch_lyrics_for_current_song_in_background = yes
progressbar_look = "▃▃ " progressbar_elapsed_color = "magenta"
|
快捷键设置文件位置 ~/.config/ncmpcpp/bindings
个人配置demo
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| def_key "k" scroll_up
def_key "j" scroll_down
def_key "g" page_up
def_key "G" page_down
def_key "home" move_home
def_key "end" move_end
def_key "d" delete_playlist_items
def_key "delete" delete_stored_playlist
def_key "l" next_column
def_key "h" previous_column
def_key "tab" next_screen
def_key "L" show_lyrics
def_key "space" pause
def_key "t" jump_to_playing_song
def_key "s" toggle_visualization_type
|
NCMPCPP使用简介
先启动mpd
再启动ncmpcpp
F1 可以看快捷键说明 大体上类似于vim快捷键
1 2 3 4 5 6 7 8 = 可以切换列表
2 展示全部歌曲 按v反选全部歌曲 a添加到playlists,如果报错需要手动创建目录,q退出
ENJOY