From 3dffbc11db24307cde58e85057d8cf64a3a67452 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sun, 5 Jan 2025 16:59:37 -0700 Subject: [PATCH] Fancify the `editing` setting to allow only audio or only video programs. Move GIMP to Generic so that it's always installed.. --- tasks/general/acct_mgmt/provision_config.yml | 4 + .../workstation/freebsd/software/packages.yml | 20 ++--- tasks/workstation/linux/software/flatpaks.yml | 75 +++++++++++++++---- tasks/workstation/linux/software/packages.yml | 2 +- tasks/workstation/mac-os/software/brew.yml | 14 +++- 5 files changed, 87 insertions(+), 28 deletions(-) diff --git a/tasks/general/acct_mgmt/provision_config.yml b/tasks/general/acct_mgmt/provision_config.yml index c56d261..b1de527 100644 --- a/tasks/general/acct_mgmt/provision_config.yml +++ b/tasks/general/acct_mgmt/provision_config.yml @@ -181,6 +181,10 @@ ; coding : Set to true for installation of code editors (VSCode, PyCharm, Android Studio) ; ; editing : Set to true for installation of Audio/Video editors (Shotcut, Audacity, OBS Stdio, GIMP) + ; Set to video for only the video related portions. + ; - Shotcut, OpenShot, OBS Studio, etc. + ; Set to audio for only the music related portions. + ; - Audacity (or similar), LMMS, VMPK, etc. ; ; gaming : Set to true for installation of gaming software (Steam, Lutris) ; diff --git a/tasks/workstation/freebsd/software/packages.yml b/tasks/workstation/freebsd/software/packages.yml index 3ea36ed..4562427 100644 --- a/tasks/workstation/freebsd/software/packages.yml +++ b/tasks/workstation/freebsd/software/packages.yml @@ -4,7 +4,7 @@ # General # - name: Workstation | FreeBSD | Software | Packages | General | Install - package: + package: name: - "{{ firefox_esr }}" - "{{ evolution }}" @@ -13,7 +13,7 @@ state: present - name: Workstation | FreeBSD | Software | Packages | General | Uninstall Bloat - package: + package: name: - "{{ firefox }}" - "{{ thunderbird }}" @@ -22,14 +22,14 @@ # Coding # - name: Workstation | FreeBSD | Software | Packages | Coding | Install - package: + package: name: - vscode state: present when: coding == true - name: Workstation | FreeBSD | Software | Packages | Coding | Install - package: + package: name: - vscode state: absent @@ -38,27 +38,27 @@ # Media Editors # - name: Workstation | FreeBSD | Software | Packages | Editing | Install - package: + package: name: - gimp - shotcut - obs-studio state: present - when: editing == true + when: editing in (true, "video") - name: Workstation | FreeBSD | Software | Packages | Editing | Install - package: + package: name: - gimp - shotcut - obs-studio state: absent - when: not editing == true + when: not editing in (true, "video") # Gaming # - name: Workstation | FreeBSD | Software | Packages | Gaming | Install - package: + package: name: - 0ad - supertuxkart @@ -66,7 +66,7 @@ when: gaming == true - name: Workstation | FreeBSD | Software | Packages | Gaming | Install - package: + package: name: - 0ad - supertuxkart diff --git a/tasks/workstation/linux/software/flatpaks.yml b/tasks/workstation/linux/software/flatpaks.yml index 52850ca..0041a47 100644 --- a/tasks/workstation/linux/software/flatpaks.yml +++ b/tasks/workstation/linux/software/flatpaks.yml @@ -40,17 +40,18 @@ - { app: "org.signal.Signal", name: "signal", extra: "" } - { app: "org.mozilla.firefox", name: "firefox-flatpak", extra: "" } - { app: "com.transmissionbt.Transmission", name: "transmission", extra: "" } + - { app: "org.gimp.GIMP", name: "gimp", extra: "" } flatpaks_coding: - { app: "com.vscodium.codium", name: "codium", extra: "" } - { app: "com.google.AndroidStudio", name: "android-studio", extra: "" } - { app: "io.dbeaver.DBeaverCommunity", name: "dbeaver", extra: "" } - { app: "org.godotengine.Godot", name: "godot", extra: "" } - { app: "com.visualstudio.code-oss", name: "code", extra: "" } - flatpaks_editing: + flatpaks_editing_video: - { app: "org.shotcut.Shotcut", name: "shotcut", extra: "" } - { app: "com.obsproject.Studio", name: "obs", extra: "" } - - { app: "org.gimp.GIMP", name: "gimp", extra: "" } - { app: "org.openshot.OpenShot", name: "openshot", extra: "" } + flatpaks_editing_audio: - { app: "org.tenacityaudio.Tenacity", name: "tenacity", extra: "" } - { app: "io.lmms.LMMS", name: "lmms", extra: "" } - { app: "net.sourceforge.VMPK", name: "vmpk", extra: "" } @@ -158,14 +159,62 @@ # Media Editors # -- name: Workstation | Linux | Flatpak Distro | Flatpak | Audio/Video Editors | Installs +- name: Workstation | Linux | Flatpak Distro | Flatpak | Video Editors | Installs flatpak: name: "{{ item.app }}" remote: flathub state: present - loop: "{{ flatpaks_editing }}" + loop: "{{ flatpaks_editing_video }}" ignore_errors: yes - when: editing == true + when: editing in (true, "video") + +- name: Workstation | Linux | Flatpak Distro | Flatpak | Video Editors | Executables + blockinfile: + path: "{{ flatpak_exec_dir }}/{{ item.name }}" + block: | + {{ item.extra }} {{ flatpak_exec }} {{ item.app }} + marker: '{mark}' + marker_begin: "#!{{ bash_exec.stdout }}" + marker_end: "exit 0" + state: present + create: yes + loop: "{{ flatpaks_editing_video }}" + become_user: "{{ user }}" + when: editing in (true, "video") + +- name: Workstation | Linux | Flatpak Distro | Flatpak | Video Editors | Executable Permissions + file: + path: "{{ flatpak_exec_dir }}/{{ item.name }}" + state: file + mode: '0755' + loop: "{{ flatpaks_editing_video }}" + when: editing in (true, "video") + +- name: Workstation | Linux | Flatpak Distro | Flatpak | Video Editor Uninstalls + flatpak: + name: "{{ item.app }}" + remote: flathub + state: absent + loop: "{{ flatpaks_editing_video }}" + ignore_errors: yes + when: not editing in (true, "video") + +- name: Workstation | Linux | Flatpak Distro | Flatpak | Video Editors | Remove Executables + file: + path: "{{ flatpak_exec_dir }}/{{ item.name }}" + state: absent + loop: "{{ flatpaks_editing_video }}" + ignore_errors: yes + when: not editing in (true, "video") + +- name: Workstation | Linux | Flatpak Distro | Flatpak | Audio Editors | Installs + flatpak: + name: "{{ item.app }}" + remote: flathub + state: present + loop: "{{ flatpaks_editing_audio }}" + ignore_errors: yes + when: editing in (true, "audio") - name: Workstation | Linux | Flatpak Distro | Flatpak | Audio/Video Editors | Executables blockinfile: @@ -177,34 +226,34 @@ marker_end: "exit 0" state: present create: yes - loop: "{{ flatpaks_editing }}" + loop: "{{ flatpaks_editing_audio }}" become_user: "{{ user }}" - when: editing == true + when: editing in (true, "audio") - name: Workstation | Linux | Flatpak Distro | Flatpak | Audio/Video Editors | Executable Permissions file: path: "{{ flatpak_exec_dir }}/{{ item.name }}" state: file mode: '0755' - loop: "{{ flatpaks_editing }}" - when: editing == true + loop: "{{ flatpaks_editing_audio }}" + when: editing in (true, "audio") - name: Workstation | Linux | Flatpak Distro | Flatpak | Audio/Video Editor Uninstalls flatpak: name: "{{ item.app }}" remote: flathub state: absent - loop: "{{ flatpaks_editing }}" + loop: "{{ flatpaks_editing_audio }}" ignore_errors: yes - when: not editing == true + when: not editing in (true, "audio") - name: Workstation | Linux | Flatpak Distro | Flatpak | Audio/Video Editors | Remove Executables file: path: "{{ flatpak_exec_dir }}/{{ item.name }}" state: absent - loop: "{{ flatpaks_editing }}" + loop: "{{ flatpaks_editing_audio }}" ignore_errors: yes - when: not editing == true + when: not editing in (true, "audio") # Gaming # diff --git a/tasks/workstation/linux/software/packages.yml b/tasks/workstation/linux/software/packages.yml index 78bccf4..8d72d8b 100644 --- a/tasks/workstation/linux/software/packages.yml +++ b/tasks/workstation/linux/software/packages.yml @@ -24,7 +24,7 @@ name: - "{{ ffmpeg }}" state: present - when: editing == true + when: editing in (true, "video", "audio") ## Other Stuff diff --git a/tasks/workstation/mac-os/software/brew.yml b/tasks/workstation/mac-os/software/brew.yml index 26c7c90..1dc9920 100644 --- a/tasks/workstation/mac-os/software/brew.yml +++ b/tasks/workstation/mac-os/software/brew.yml @@ -1,5 +1,5 @@ --- -# Download packages from Homebrew. +# Download packages from Homebrew. # Should this just be done in a Generic view? Is this really mac-specific, or just the facts? # FreeBSD has its own. May be good to keep it separate so it's more to-the-point. @@ -22,13 +22,19 @@ status: present when: coding == true -- name: Workstation | Mac OS | Software | Brew | Install Packages (Editing) +- name: Workstation | Mac OS | Software | Brew | Install Packages (Editing:Video) + package: + name: + - shotcut + status: present + when: editing in (true, "video") + +- name: Workstation | Mac OS | Software | Brew | Install Packages (Editing:Audio) package: name: - audacity - - shotcut status: present - when: editing == true + when: editing in (true, "audio") - name: Workstation | Mac OS | Software | Brew | Install Packages (Gaming) package: