Fixes and Enhancements (#48)

* Fix metasplot install if /usr/local/bin is not active in path yet. Also use variables.

* Use plocate on openSUSE. Supposed to be faster. Cannot have both m and p installed at the same time and p comes with the base system.

* Include wheel group for user as well.

* Finalize GNOME settings, go with RC commands instead of dconf module.

* Add hostname to report files.

* Add TBD for shared home situation.

* Fix cron service for Fedora.

* Disable the power button.

* Fix Fedora ffmpeg issues. Move package modules from flatpak playbook. Uninstall firefox from package manager.

* Enhance update function to handle shared home between multiple distributions.

* Allow keeping local backups of files.

* Replace flatpak repair check with accept flag instead of battery so that any automated update runs do the cleanup.

* Begin hoarding settings files.

* Start building out a FireFox profile.

* Fix extra comment command in comment.

* Add an All option to completely compress the entire directory.

* Codium is still broken on all tested systems, hide from Favorites.

* Add scipt to handle audio files. Also can convert to 432Hz.

* Use cut instead of awk to get rid of first parameter. Fixes bugs when spaces are allowed in the filenames.

* Enhancements and bugfix for "$freq".

* Add playbook for desktop VPN clients. Start with Mullvad.

* Add website to the seeded projects.

* Add firmware updates to the update function.

* Allow `fwupdmgr` to fail and have `update` still continue.

* Shorten lines.

* Uninstall DeltaChat.

* Separate the firmware update into its own function.

* Add alias for cloning one folder to another without using rm/cp.

* Fix typo in rsync.

* Go ahead and add extra options.

* Make the files human readable size descriptions.

* Remove unnecessary v, P does good enough.
This commit is contained in:
2024-01-23 09:43:42 -07:00
committed by GitHub
parent 392294fb45
commit 7519f23a81
20 changed files with 588 additions and 347 deletions

View File

@ -28,7 +28,7 @@ function usage() {
# Parameters:
# 1) The exit status to use.
status=$1
echo "Usage: $PROG [-s SIZE] [-l LOCATION] [-r] [-f] [-d] [-c] [-h] [-x]" >&2
echo "Usage: $PROG [-s SIZE] [-l LOCATION] [-A | [-r] [-f] [-d] [-c]] [-h] [-x]" >&2
cat <<- EOF
Compress JPG or PNG image(s). Can handle folders and work recursively.
@ -39,6 +39,7 @@ function usage() {
-f : Force the image to be shrunk even if a file already exists for it.
-d : Delete the original image if the compressed image is smaller.
-c : Clean the filename of underscores, dashes, 'IMG', etc.
-A : Resursively Force, Delete, and Clean.
-h : Display this usage text.
-x : Enable BASH debugging.
EOF
@ -47,7 +48,7 @@ function usage() {
## Parameters ##
while getopts ":s:l:rfdchx" opt; do
while getopts ":s:l:rfdcAhx" opt; do
case $opt in
s) in_size="$OPTARG" && size="$in_size" ;;
l) location="$OPTARG" ;;
@ -55,6 +56,7 @@ while getopts ":s:l:rfdchx" opt; do
f) force="Y" ;;
d) delete="Y" ;;
c) clean="Y" ;;
A) recurse="Y" && search="find" && force="Y" && delete="Y" && clean="Y" ;;
h) usage 0 ;;
x) set -x ;;
*) echo "ERROR: Option $OPTARG not recognized." >&2 && usage 1 ;;
@ -147,7 +149,7 @@ $search "$location" | sort | while read image; do
echo " $line"
done
smaller_file=`
ls -sh "$image" "$new_image" | sort -h | awk '{print $2}' | head -n 1
ls -sh "$image" "$new_image" | sort -h | cut -f 2- -d ' ' | head -n 1
`
if [[ "$smaller_file" == "$image" ]]; then
echo -n " WARNING: Conversion caused growth, original was likely lesser "