--- # Use flatpaks because they're consistent versions across different distros! :) ## To see how much space is taken up try the .rc function flatpak-usage ## # If you'd like to remove flatpaks to save space: ## Note: This functionality now exists in .rc function flatpak-purge ## # $ flatpak remove --all --delete-data # $ flatpak repair # Then remove, autoremove, and purge flatpak executable with package manager. # Source: https://softhints.com/how-to-completely-remove-flatpak-linux-mint/ ## Flatpak Pre-reqs ## - name: Workstation | Linux | Flatpak Distro | Flatpak | Install package: name: flatpak update_cache: yes - name: Workstation | Linux | Flatpak Distro | Flatpak | Add Flathub for System flatpak_remote: name: flathub state: present method: system flatpakrepo_url: https://flathub.org/repo/flathub.flatpakrepo ## Flatpak Installs ## - name: Workstation | Linux | Flatpak Distro | Flatpak | Variables set_fact: flatpak_exec_dir: "{{ user_user.home }}/bin" flatpak_exec: "flatpak run" - name: Workstation | Linux | Flatpak Distro | Flatpak | Arrays set_fact: flatpaks_generic: - { app: "org.libreoffice.LibreOffice", name: "office", extra: "" } - { app: "io.lbry.lbry-app", name: "lbry", extra: "dbus-launch" } - { app: "io.gitlab.librewolf-community", name: "librewolf", extra: "" } - { app: "chat.delta.desktop", name: "deltachat", 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: "" } flatpaks_editing: - { app: "org.shotcut.Shotcut", name: "shotcut", extra: "" } - { app: "com.obsproject.Studio", name: "obs", extra: "" } - { app: "org.gimp.GIMP", name: "gimp", extra: "" } flatpaks_gaming: - { app: "com.valvesoftware.Steam", name: "steam", extra: "" } - { app: "com.play0ad.zeroad", name: "zeroad", extra: "" } - { app: "net.supertuxkart.SuperTuxKart", name: "tuxkart", extra: "" } flatpaks_remove: - { app: "org.mozilla.firefox", name: "firefox", extra: "" } - { app: "com.visualstudio.code", name: "vscode", extra: "" } # Why does this throw an error? It's the correct ID. - { app: "com.visualstudio.code-oss", name: "code-oss", extra: "" } - { app: "org.midori_browser.Midori", name: "midori", extra: "" } - { app: "com.github.Eloston.UngoogledChromium", name: "unchrome", extra: "" } - { app: "org.gnome.Evolution", name: "evolution", extra: "" } # Doesn't pick up GNOME theme since contained. - { app: "org.mozilla.Thunderbird", name: "thunderbird", extra: "" } # Doesn't integrate with Nextcloud as well as Evolution. - { app: "org.audacityteam.Audacity", name: "audacity", extra: "" } # Say "no thanks" to spyware. - { app: "com.discordapp.Discord", name: "discord", extra: "" } # Stopped working, just spins and says Starting. # 2022-11-20 No longer using any of these and they're taking up a lot of space. # - { app: "im.riot.Riot", name: "element", extra: "" } - { app: "org.signal.Signal", name: "signal", extra: "" } - { app: "org.telegram.desktop", name: "telegram", extra: "" } - { app: "com.jetbrains.PyCharm-Community", name: "pycharm", extra: "" } # End 2022-11-20 # # Generic # - name: Workstation | Linux | Flatpak Distro | Flatpak | Generic | Installs flatpak: name: "{{ item.app }}" remote: flathub state: present loop: "{{ flatpaks_generic }}" ignore_errors: yes - name: Workstation | Linux | Flatpak Distro | Flatpak | Generic | 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_generic }}" become_user: "{{ user }}" - name: Workstation | Linux | Flatpak Distro | Flatpak | Generic | Executable Permissions file: path: "{{ flatpak_exec_dir }}/{{ item.name }}" state: file mode: '0755' loop: "{{ flatpaks_generic }}" # Coding # - name: Workstation | Linux | Flatpak Distro | Flatpak | Coding | Installs flatpak: name: "{{ item.app }}" remote: flathub state: present loop: "{{ flatpaks_coding }}" ignore_errors: yes when: coding == true - name: Workstation | Linux | Flatpak Distro | Flatpak | Coding | 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_coding }}" become_user: "{{ user }}" when: coding == true - name: Workstation | Linux | Flatpak Distro | Flatpak | Coding | Executable Permissions file: path: "{{ flatpak_exec_dir }}/{{ item.name }}" state: file mode: '0755' loop: "{{ flatpaks_coding }}" when: coding == true - name: Workstation | Linux | Flatpak Distro | Flatpak | Coding | Uninstall flatpak: name: "{{ item.app }}" remote: flathub state: absent loop: "{{ flatpaks_coding }}" ignore_errors: yes when: not coding == true - name: Workstation | Linux | Flatpak Distro | Flatpak | Coding | Remove Executables file: path: "{{ flatpak_exec_dir }}/{{ item.name }}" state: absent loop: "{{ flatpaks_coding }}" ignore_errors: yes when: not coding == true # Media Editors # - name: Workstation | Linux | Flatpak Distro | Flatpak | Audio/Video Editors | Installs flatpak: name: "{{ item.app }}" remote: flathub state: present loop: "{{ flatpaks_editing }}" ignore_errors: yes when: editing == true - name: Workstation | Linux | Flatpak Distro | Flatpak | Audio/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 }}" become_user: "{{ user }}" when: editing == true - 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 - name: Workstation | Linux | Flatpak Distro | Flatpak | Audio/Video Editor Uninstalls flatpak: name: "{{ item.app }}" remote: flathub state: absent loop: "{{ flatpaks_editing }}" ignore_errors: yes when: not editing == true - name: Workstation | Linux | Flatpak Distro | Flatpak | Audio/Video Editors | Remove Executables file: path: "{{ flatpak_exec_dir }}/{{ item.name }}" state: absent loop: "{{ flatpaks_editing }}" ignore_errors: yes when: not editing == true # Gaming # - name: Workstation | Linux | Flatpak Distro | Flatpak | Gaming | Installs flatpak: name: "{{ item.app }}" remote: flathub state: present loop: "{{ flatpaks_gaming }}" ignore_errors: yes when: gaming == true - name: Workstation | Linux | Flatpak Distro | Flatpak | Gaming | 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_gaming }}" become_user: "{{ user }}" when: gaming == true - name: Workstation | Linux | Flatpak Distro | Flatpak | Gaming | Executable Permissions file: path: "{{ flatpak_exec_dir }}/{{ item.name }}" state: file mode: '0755' loop: "{{ flatpaks_gaming }}" when: gaming == true - name: Workstation | Linux | Flatpak Distro | Flatpak | Gaming | Uninstalls flatpak: name: "{{ item.app }}" remote: flathub state: absent loop: "{{ flatpaks_gaming }}" ignore_errors: yes when: not gaming == true - name: Workstation | Linux | Flatpak Distro | Flatpak | Gaming | Remove Executables file: path: "{{ flatpak_exec_dir }}/{{ item.name }}" state: absent loop: "{{ flatpaks_gaming }}" ignore_errors: yes when: not gaming == true # Removals # - name: Workstation | Linux | Flatpak Distro | Flatpak | Uninstalls | Uninstall flatpak: name: "{{ item.app }}" remote: flathub state: absent loop: "{{ flatpaks_remove }}" ignore_errors: yes - name: Workstation | Linux | Flatpak Distro | Flatpak | Uninstalls | Remove Executables file: path: "{{ flatpak_exec_dir }}/{{ item.name }}" state: absent loop: "{{ flatpaks_remove }}" ignore_errors: yes ## Other Stuff ## # Software not yet available or working properly in Flatpak form. - name: Workstation | Linux | Flatpak Distro | Package Manager | Install From Repo package: name: - "{{ firefox_esr }}" - vlc - "{{ appimagelauncher }}" - "{{ evolution }}" - "{{ evolution }}*" state: present - name: Workstation | Linux | Flatpak Distro | Package Manager | Remove Firefox Normal package: name: - "{{ firefox }}" state: absent when: firefox != firefox_esr # Lutris # - name: Workstation | Linux | Flatpak Distro | Package Manager | Add Lutris PPA (Ubuntu) apt_repository: repo: ppa:lutris-team/lutris update_cache: yes state: present when: ansible_distribution == "Ubuntu" and gaming == true ignore_errors: yes - name: Workstation | Linux | Flatpak Distro | Package Manager | Add Lutris (besides ARM) package: name: - lutris state: present when: ansible_architecture != "aarch64" and gaming == true ignore_errors: yes - name: Workstation | Linux | Flatpak Distro | Package Manager | Remove Lutris (besides ARM) package: name: - lutris state: absent when: ansible_architecture != "aarch64" and gaming is not defined ignore_errors: yes - name: Workstation | Linux | Flatpak Distro | Package Manager | Remove Lutris PPA (Ubuntu) apt_repository: repo: ppa:lutris-team/lutris update_cache: yes state: absent when: ansible_distribution == "Ubuntu" and gaming is not defined ignore_errors: yes # Remove Repo Software # - name: Workstation | Linux | Flatpak Distro | Package Manager | Remove Applications package: name: - "{{ thunderbird }}" - steam - vscode - code - '*libreoffice*' - gimp state: absent