Chad 295b309354
Re-Enable Normal Firefox, Add Image Script (#46)
* Add normal Firefox flatpak in case Librewolf is ever too strict. Keep having it installed from package in case the flatpak version still has issues.

* Add missing interpretation.

* Add a check which makes sure the user does not mistake a *compressed* file for being smaller.

* Add a timestamp for when the program completed.

* Add today's version of shrink.sh with an extra comment.

* Add a comment regarding the final resolution.

* Create file which will allow the full-scale downsizing of a media library.

* Add goals and skeleton.

* Rearrange variable setup.

* Fix permissions.

* Add most functionality, has not been fully tested.

* Add spacing and a success message.

* Program is testing really well, most functionality seems to exist.

* BASH should handle this fine with "".

* Fix spaces in names, add prompt to delete compressed files which grew.

* Image compression program complete, remove old optionless shrink program.
2023-09-01 06:01:01 -07:00

276 lines
9.7 KiB
YAML

---
# GNOME settings, extensions, and setup.
# Make sure Gnome-Tweaks is installed
- name: Workstation | Account Management | GNOME | Install Dependencies
package:
name:
- "{{ gnome_tweaks }}"
- "{{ dconf_editor }}"
- "{{ psutil }}"
state: present
## Dash to Dock Extension ##
# Note: Validate DtD by checking /org/gnome/shell/enabled-extensions for dash-to-dock@micxgx.gmail.com
- name: Workstation | Account Management | GNOME | Dash To Dock
block:
- name: Workstation | Account Management | GNOME | Dash To Dock | Check
shell: "cd ~/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/"
become_user: "{{ user }}"
register: dash_to_dock_exists
# Install #
# https://micheleg.github.io/dash-to-dock/download.html
- name: Workstation | Account Management | GNOME | Dash To Dock | Install | Clone Repo
git:
repo: https://github.com/micheleg/dash-to-dock.git
dest: "~/TRASH/dash-to-dock/"
clone: yes
force: no
version: master
become_user: "{{ user }}"
when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed
- name: Workstation | Account Management | GNOME | Dash To Dock | Install | Dependencies
package:
name:
- "{{ make }}"
- "{{ msgfmt }}"
- "{{ sassc }}"
state: present
when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed
- name: Workstation | Account Management | GNOME | Dash To Dock | Install | Make
shell: "cd ~/TRASH/dash-to-dock/; {{ make }}; {{ make }} install"
become_user: "{{ user }}"
when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed
- name: Workstation | Account Management | GNOME | Dash To Dock | Read Enabled Extension Array
dconf:
key: /org/gnome/shell/enabled-extensions
state: read
become_user: "{{ user }}"
register: gnome_enabled_extensions
when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed
- name: Workstation | Account Management | GNOME | Dash To Dock | dconf Return Object
debug:
var: gnome_enabled_extensions
when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed
# https://ansible-docs.readthedocs.io/zh/stable-2.0/rst/playbooks_filters.html#filters-for-formatting-data
- name: Workstation | Account Management | GNOME | Dash To Dock | Variables 1
set_fact:
gnome_enabled_extensions: "{{ gnome_enabled_extensions.value | replace('@as ', '') }}"
dash_to_dock_ext_comma: ""
when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed
- name: Workstation | Account Management | GNOME | Dash To Dock | After replace()
debug:
var: gnome_enabled_extensions
when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed
- name: Workstation | Account Management | GNOME | Dash To Dock | Variables 2
set_fact:
dash_to_dock_ext_comma: ", "
when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed and gnome_enabled_extensions not in ("[]", [], "None")
- name: Workstation | Account Management | GNOME | Dash To Dock | Variables 3
set_fact:
dash_to_dock_ext_name: "{{ dash_to_dock_ext_comma }}'dash-to-dock@micxgx.gmail.com']"
when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed
- name: Workstation | Account Management | GNOME | Dash To Dock | Variables 4
set_fact:
gnome_enabled_extensions: "[]"
when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed and gnome_enabled_extensions == "None"
- name: Workstation | Account Management | GNOME | Dash To Dock | Print Value To Append With
debug:
var: dash_to_dock_ext_name
when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed
- name: Workstation | Account Management | GNOME | Dash To Dock | Print Value To Append To
debug:
var: gnome_enabled_extensions
when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed
- name: Workstation | Account Management | GNOME | Dash To Dock | Print Combined Value
debug:
msg: "{{ gnome_enabled_extensions | replace(']', dash_to_dock_ext_name) }}"
when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed
- name: Workstation | Account Management | GNOME | Dash To Dock | Enable
dconf:
key: /org/gnome/shell/enabled-extensions
value: "{{ gnome_enabled_extensions | replace(']', dash_to_dock_ext_name) }}"
state: present
become_user: "{{ user }}"
when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed
# Settings #
- name: Workstation | Account Management | GNOME | Dash To Dock | Dock Position
dconf:
key: /org/gnome/shell/extensions/dash-to-dock/dock-position
value: "'LEFT'"
state: present
become_user: "{{ user }}"
- name: Workstation | Account Management | GNOME | Dash To Dock | Dock Fixed
dconf:
key: /org/gnome/shell/extensions/dash-to-dock/dock-fixed
value: "true"
state: present
become_user: "{{ user }}"
- name: Workstation | Account Management | GNOME | Dash To Dock | Icon Size
dconf:
key: /org/gnome/shell/extensions/dash-to-dock/dash-max-icon-size
value: "28"
state: present
become_user: "{{ user }}"
ignore_errors: yes
# End block for Dash To Dock.
# The first Firefox is from Flatpak, and firefox_firefox.desktop is snap/apt.
- name: Workstation | Account Management | GNOME + Cinnamon | Favorites (Linux)
dconf:
key: "{{ item }}"
value: "[ 'org.gnome.Terminal.desktop', 'gnome-system-monitor.desktop'
, 'org.gnome.Nautilus.desktop'
, 'io.gitlab.librewolf-community.desktop'
, 'org.mozilla.firefox.desktop'
, 'org.gnome.Evolution.desktop', 'chat.delta.desktop.desktop'
, 'com.vscodium.codium.desktop', 'org.shotcut.Shotcut.desktop'
, 'io.lbry.lbry-app.desktop'
, 'org.signal.Signal.desktop', 'im.riot.Riot.desktop'
, 'org.telegram.desktop.desktop', 'com.discordapp.Discord.desktop'
, 'com.valvesoftware.Steam.desktop'
]"
state: present
become_user: "{{ user }}"
when: ansible_system == "Linux"
loop:
- /org/gnome/shell/favorite-apps
- /org/cinnamon/favorite-apps
# As of 2023-07-01 this only sets the Menu Favorites on Cinnamon, not the
# Panel Pins. Cannot find any details online of where the pinned application
# data lives. Cloned and searched the linuxmint/cinnamon project too and
# couldn't find which function handles it. Leaving the loop for it but it's
# not what was hoped for and is sort of a TBD/TODO.
- name: Workstation | Account Management | GNOME | Favorites (FreeBSD)
dconf:
key: /org/gnome/shell/favorite-apps
value: "['org.gnome.Terminal.desktop', 'org.gnome.Nautilus.desktop',
'firefox.desktop', 'org.gnome.Evolution.desktop', 'org.mozilla.Thunderbird.desktop',
'code-oss.desktop', 'org.telegram.desktop.desktop']"
state: present
become_user: "{{ user }}"
when: ansible_system == "FreeBSD"
## Top Bar Settings ##
# (Battery Percentage, Clock Weekday+Seconds, Calendar Week Numbers)
- name: Workstation | Account Management | GNOME | Interface - Show Date
dconf:
key: /org/gnome/desktop/interface/clock-show-date
value: "true"
state: present
become_user: "{{ user }}"
- name: Workstation | Account Management | GNOME | Interface - 24h Format
dconf:
key: /org/gnome/desktop/interface/clock-format
value: "'24h'"
state: present
become_user: "{{ user }}"
- name: Workstation | Account Management | GNOME | Interface - Show Seconds
dconf:
key: /org/gnome/desktop/interface/clock-show-seconds
value: "true"
state: present
become_user: "{{ user }}"
- name: Workstation | Account Management | GNOME | Interface - Show Weekday
dconf:
key: /org/gnome/desktop/interface/clock-show-weekday
value: "true"
state: present
become_user: "{{ user }}"
- name: Workstation | Account Management | GNOME | Interface - 24h Format
dconf:
key: /org/gnome/desktop/interface/show-battery-percentage
value: "true"
state: present
become_user: "{{ user }}"
- name: Workstation | Account Management | GNOME | Interface - Show Week Date
dconf:
key: /org/gnome/desktop/calendar/show-weekdate
value: "true"
state: present
become_user: "{{ user }}"
# Never Prompt for Removal Media
# Dark theme?
#Pop-dark on Pop
#Adwaita-dark on everything else
# Window Titlebars (Titlebar Buttons Minimize)
- name: Workstation | Account Management | GNOME | Window Buttons
dconf:
key: /org/gnome/desktop/wm/preferences/button-layout
value: "'appmenu:minimize,close'"
state: present
become_user: "{{ user }}"
# Security
- name: Workstation | Account Management | GNOME | Privacy - Camera
dconf:
key: /org/gnome/desktop/privacy/disable-camera
value: "true"
state: present
become_user: "{{ user }}"
- name: Workstation | Account Management | GNOME | Privacy - Microphone
dconf:
key: /org/gnome/desktop/privacy/disable-microphone
value: "true"
state: present
become_user: "{{ user }}"
# Schemas to try after looking at gsettings list-schemas | sort
# org.gnome.ControlCenter -- not very interesting
# org.gnome.desktop.default-applications -- nothing?? Where do we set Brave and Evolution?
# org.gnome.desktop.interface -- Good stuff in here.
# org.gnome.desktop.peripherals -- Nothing :(
# org.gnome.desktop.privacy -- Good stuff here too!! Cool!
# org.gnome.desktop.session
# org.gnome.desktop.wm.keybindings
# org.gnome.desktop.wm.preferences
# org.gnome.power-manager
# org.gnome.SessionManager
# org.gnome.shell
# org.gnome.shell.extensions.pop-shell
# org.gnome.shell.keybindings