diff --git a/tasks/mpd.yml b/tasks/mpd.yml index 3aa60ec..0673104 100644 --- a/tasks/mpd.yml +++ b/tasks/mpd.yml @@ -22,6 +22,7 @@ loop: - { path: '{{ mpd_configuration_dir }}', state: 'directory' } - { path: '{{ ncmpc_configuration_dir }}', state: 'directory' } + - { path: '{{ ncmpcpp_configuration_dir }}', state: 'directory' } - { path: '{{ mpd_configuration_dir }}/playlists', state: 'directory' } - { path: '{{ mpd_configuration_dir }}/state', state: 'touch' } @@ -41,8 +42,14 @@ loop: - { src: 'templates/mpd/mpd.conf.j2', dest: '{{ mpd_configuration_dir }}/mpd.conf' } - { src: 'templates/mpd/ncmpc.j2', dest: '{{ ncmpc_configuration_dir }}/config' } + - { src: 'templates/mpd/ncmpcpp/config.j2', dest: '{{ ncmpcpp_configuration_dir }}/config' } + - { + src: 'templates/mpd/ncmpcpp/bindings.j2', + dest: '{{ ncmpcpp_configuration_dir }}/bindings' + } notify: - stop mpd service + # TODO: install https://aur.archlinux.org/mpd-mpris-bin.git from AUR # Use mpc to control local mpd server. # Use $ mpc add http://{{ mpd_remote_address }}:{{ mpd_remote_stream_port }} diff --git a/templates/mpd/mpd.conf.j2 b/templates/mpd/mpd.conf.j2 index 92db4da..d99b7d4 100644 --- a/templates/mpd/mpd.conf.j2 +++ b/templates/mpd/mpd.conf.j2 @@ -3,7 +3,8 @@ bind_to_address "{{ mpd_listen_address }}" port "{{ mpd_listen_port }}" -playlist_directory "{{ mpd_configuration_dir }}/playlists" +playlist_directory "{{ mpd_configuration_dir }}/playlists" +state_file "{{ mpd_configuration_dir }}/state" database { plugin "proxy" @@ -12,11 +13,9 @@ database { } audio_output { - type "pulse" - name "mpd" - replay_gain_handler "software" - mixer_type "hardware" - format "128000:24:2" + name "mpd" + type "pipewire" + dsd "yes" } input { diff --git a/templates/mpd/ncmpcpp/bindings.j2 b/templates/mpd/ncmpcpp/bindings.j2 new file mode 100644 index 0000000..a1bd2ce --- /dev/null +++ b/templates/mpd/ncmpcpp/bindings.j2 @@ -0,0 +1,16 @@ +# {{ ansible_managed }} + +def_key "l" + next_column +def_key "h" + previous_column +def_key "k" + scroll_up +def_key "j" + scroll_down + +def_key "l" + jump_to_playing_song + +def_key "a" + add_item_to_playlist diff --git a/templates/mpd/ncmpcpp/config.j2 b/templates/mpd/ncmpcpp/config.j2 new file mode 100644 index 0000000..f532ff1 --- /dev/null +++ b/templates/mpd/ncmpcpp/config.j2 @@ -0,0 +1,36 @@ +# {{ ansible_managed }} +# + +############## Connection ################### +## Connect to mpd running on a specified host +mpd_host = 10.0.0.1 + +## Connect to mpd on the specified port. +mpd_port = 21000 + +# header_visibility = yes +# playlist_show_mpd_host = yes +# titles_visibility = yes +# enable_window_title = yes + + +connected_message_on_startup = no + +display_bitrate = yes + +############## Theme ################### + +user_interface = classic + +song_columns_list_format = "(40)[9]{t|f} (25)[245]{a} (25)[245]{b} (25)[245]{l}" +song_list_format = "{$5 %a$9 $1│$9 $8%t$9 }|{ $8%f$9}$R{$5%b $7}" + +# Column Names +header_window_color = 1 + +# Main window +main_window_color = 1 + +# Bottombar +progressbar_color = 1 +player_state_color = 1 diff --git a/vars/mpd.yml b/vars/mpd.yml index 8e2e696..742d0d4 100644 --- a/vars/mpd.yml +++ b/vars/mpd.yml @@ -7,3 +7,4 @@ mpd_remote_stream_port: '8000' # note that this is not used (yet) mpd_configuration_dir: '{{ ansible_env.HOME }}/.config/mpd' ncmpc_configuration_dir: '{{ ansible_env.HOME }}/.config/ncmpc' +ncmpcpp_configuration_dir: '{{ ansible_env.HOME }}/.config/ncmpcpp'