diff --git a/media.yml b/media.yml new file mode 100644 index 0000000..4ed3188 --- /dev/null +++ b/media.yml @@ -0,0 +1,4 @@ +- name: Media + hosts: odhosts + roles: + - media diff --git a/multimedia.yml b/multimedia.yml deleted file mode 100644 index ca091cc..0000000 --- a/multimedia.yml +++ /dev/null @@ -1,23 +0,0 @@ -- name: Multimedia - hosts: odhosts - tasks: - - name: Install video/audio players - become: true - ansible.builtin.apt: - pkg: - - mpv - - haruna - - vlc - - name: Install image viewers and editors - become: true - ansible.builtin.apt: - pkg: - - gwenview - - gimp - - inkscape - - name: Install image/video processing software - become: true - ansible.builtin.apt: - pkg: - - imagemagick - - ffmpeg diff --git a/roles/media/files/mpv.conf b/roles/media/files/mpv.conf new file mode 100644 index 0000000..bddb762 --- /dev/null +++ b/roles/media/files/mpv.conf @@ -0,0 +1,16 @@ +# Don't start in fullscreen mode by default. +fs=no + +# Enable hardware decoding if available. Often, this does not work with all +# video outputs, but should work well with default settings on most systems. +# If performance or energy usage is an issue, forcing the vdpau or vaapi VOs +# may or may not help. +hwdec=auto + +# Display Russian subtitles if available. +slang=ru +# Enable fuzzy searching. +sub-auto=fuzzy + +# Play Japanese audio if available, fall back to English and Russian otherwise. +alang=en,jp,ru diff --git a/roles/media/tasks/hw-accel.yml b/roles/media/tasks/hw-accel.yml new file mode 100644 index 0000000..0ea1979 --- /dev/null +++ b/roles/media/tasks/hw-accel.yml @@ -0,0 +1,11 @@ +- name: Install VA-API and VDPAU + become: true + ansible.builtin.apt: + pkg: + - mesa-va-drivers + - vdpau-driver-all +- name: Install vulkan drivers + become: true + ansible.builtin.apt: + pkg: + - mesa-vulkan-drivers diff --git a/roles/media/tasks/main.yml b/roles/media/tasks/main.yml new file mode 100644 index 0000000..1e8ecff --- /dev/null +++ b/roles/media/tasks/main.yml @@ -0,0 +1,4 @@ +- name: Hardware acceleration + import_tasks: hw-accel.yml +- name: MPV + import_tasks: mpv.yml diff --git a/roles/media/tasks/mpv.yml b/roles/media/tasks/mpv.yml new file mode 100644 index 0000000..8daacb0 --- /dev/null +++ b/roles/media/tasks/mpv.yml @@ -0,0 +1,15 @@ +- name: Install mpv + become: true + ansible.builtin.apt: + pkg: + - mpv +- name: Create mpv config dir + ansible.builtin.file: + path: "{{ ansible_env.HOME }}/.config/mpv" + state: directory + mode: '1770' +- name: Copy mpv config file + ansible.builtin.copy: + src: files/mpv.conf + dest: "{{ ansible_env.HOME }}/.config/mpv/mpv.conf" + mode: '0660'