Chad e66dbed7a8
Enhance Functions + General Improvements (#52)
* Add an alternative to Audacity.

* Remove the Brave Browser since the repo has started failing and I only use Firefox browsers these days.

* Remove alias audacity for tenacity.

* Ignore if the repos are already removed.

* Stop installing Telegraf.

* Add the new dconf name for System Monitor.

* Remove the download if it already exists. Force the move.

* Fix overwrite prompt for Metasploit.

* Don't do flatpaks during a battery device's goodbye.

* Fix variable case, add quotes.

* Fix double quotes.

* Add full set of commands for compressing videos.

* Fix trash size checking to work for folders.

* Allow only updating system or Flatpak programs.

* Also check the DE trash folder.

* No longer have Flatpaks contingent on system updates.

* Improve variable names and flow.

* Fix maxdepth.

* Check network mounts for hidden trash folders.

* Add media. Only restrict maxdepth for Home directory.

* Properly check media.

* Ensure hidden files also get seen and removed.
2024-09-23 11:51:17 -07:00

272 lines
9.1 KiB
YAML

---
# 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.gitlab.librewolf-community", name: "librewolf", extra: "" }
- { app: "org.signal.Signal", name: "signal", extra: "" }
- { app: "org.mozilla.firefox", name: "firefox-flatpak", extra: "" }
- { app: "com.transmissionbt.Transmission", name: "transmission", extra: "" }
- { app: "org.gnome.Geary", name: "geary", 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:
- { 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: "" }
- { app: "org.tenacityaudio.Tenacity", name: "tenacity", 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: "com.visualstudio.code", name: "vscode", extra: "" } # Why does this throw an error? It's the correct ID.
- { 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.telegram.desktop", name: "telegram", extra: "" }
- { app: "com.jetbrains.PyCharm-Community", name: "pycharm", extra: "" }
# End 2022-11-20 #
- { app: "io.lbry.lbry-app", name: "lbry", extra: "dbus-launch" } # No longer supported, noticed 2023-09-01.
- { app: "chat.delta.desktop", name: "deltachat", extra: "" } # No longer used, removed 2023-12-18.
# 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