From 70956369156c8262f90f7d6358d3d6298ec9e7e1 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 14 Oct 2025 15:03:43 -0700 Subject: [PATCH 001/112] Remove trailing `s`. --- files/scripts/backup_system.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/scripts/backup_system.sh b/files/scripts/backup_system.sh index 7992337..33ae498 100755 --- a/files/scripts/backup_system.sh +++ b/files/scripts/backup_system.sh @@ -48,7 +48,7 @@ fi if [[ -e "$BACKUP" ]]; then ls -alh "$BACKUP" - echo "*** '$BACKUP' created successfully! ***"s + echo "*** '$BACKUP' created successfully! ***" else echo "*** '$BACKUP' not found! ***" exit 1 From 6a789338759963b49ab1b70b57fdf6b4d8ea6368 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 15 Oct 2025 04:52:15 -0700 Subject: [PATCH 002/112] Add helper for reorienting a git branch. --- tasks/general/acct_mgmt/users.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index 069f502..dcd0606 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -881,6 +881,24 @@ alias_sudo: | # Allows for alias expansions when using sudo, such as doing "sudo ll". alias sudo="sudo " + function_load_branch: | + # Change a branch to point at another. + function load-branch { + rcvr="$1" # branch which we want to modify + base="$2" # branch with the changes we want + if [[ "$1" == main ]]; + echo "Are you nuts, fool!? Not main! Do it manually!" + exit 1 + fi + git switch "$base" + git branch -f "$rcvr" "$base" + #git switch "$rcvr" + git push --force --set-upstream origin "$rcvr" + git switch "$base" + git branch + } + alias load-prod="load-branch prod dev" + alias load-stage="load-branch stage dev" - name: General | Account Management | Users | Files | Common Variable set_fact: @@ -956,6 +974,7 @@ {{ function_debian_upgrade }} {{ function_ebook_convert }} {{ alias_sudo }} + {{ function_load_branch }} - name: General | Account Management | Users | Files | .bashrc blockinfile: From 305b8df6ff9d94ce4c5e98cc5cc786d18998a53b Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 15 Oct 2025 05:09:56 -0700 Subject: [PATCH 003/112] Ensure user is on dev branch if it exists. --- tasks/general/acct_mgmt/users.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index dcd0606..3a8ec04 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -564,6 +564,13 @@ echo -e "\n*** `basename $project` ***" cd $project if [[ -d .git ]]; then + git ls-remote --exit-code origin dev + dev_exists="$?" + if [[ "$dev_exists" == 0 ]]; + git switch dev + else + git switch main + fi git pull git push else From 4e0ff86295cac693fb61a829df4ab0ac78a4904e Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 15 Oct 2025 05:19:21 -0700 Subject: [PATCH 004/112] Add missing then. --- tasks/general/acct_mgmt/users.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index 3a8ec04..3630c28 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -566,7 +566,7 @@ if [[ -d .git ]]; then git ls-remote --exit-code origin dev dev_exists="$?" - if [[ "$dev_exists" == 0 ]]; + if [[ "$dev_exists" == 0 ]]; then git switch dev else git switch main From 89cdf8157fd36da619466ffa175536e453dd1101 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 15 Oct 2025 05:19:57 -0700 Subject: [PATCH 005/112] Add other missing then. --- tasks/general/acct_mgmt/users.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index 3630c28..de334dc 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -893,7 +893,7 @@ function load-branch { rcvr="$1" # branch which we want to modify base="$2" # branch with the changes we want - if [[ "$1" == main ]]; + if [[ "$1" == main ]]; then echo "Are you nuts, fool!? Not main! Do it manually!" exit 1 fi From aa3075a9fce34bdb7c5267f8d4dbab62047125e5 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 15 Oct 2025 05:33:17 -0700 Subject: [PATCH 006/112] Do not do switch back to sender if did not switch to receiver. --- tasks/general/acct_mgmt/users.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index de334dc..1010334 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -901,7 +901,7 @@ git branch -f "$rcvr" "$base" #git switch "$rcvr" git push --force --set-upstream origin "$rcvr" - git switch "$base" + #git switch "$base" git branch } alias load-prod="load-branch prod dev" From 73e527640fa45b6a40e08f42aaccf59605efdfda Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 15 Oct 2025 05:41:12 -0700 Subject: [PATCH 007/112] Add heads back onto the ls-remote command. --- tasks/general/acct_mgmt/users.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index 1010334..b1681f9 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -564,7 +564,7 @@ echo -e "\n*** `basename $project` ***" cd $project if [[ -d .git ]]; then - git ls-remote --exit-code origin dev + git ls-remote --exit-code --heads origin dev dev_exists="$?" if [[ "$dev_exists" == 0 ]]; then git switch dev From d81c42487857c428899ffdd1b1d6c097226449b1 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 15 Oct 2025 05:47:01 -0700 Subject: [PATCH 008/112] Allow using `load-prod` and `load-stage` with any branch, and default to `dev` if nothing is provided. --- tasks/general/acct_mgmt/users.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index b1681f9..3691fdc 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -893,10 +893,13 @@ function load-branch { rcvr="$1" # branch which we want to modify base="$2" # branch with the changes we want - if [[ "$1" == main ]]; then + if [[ "$rcvr" == main ]]; then echo "Are you nuts, fool!? Not main! Do it manually!" exit 1 fi + if [[ -z "$base" ]]; then + base="dev" + fi git switch "$base" git branch -f "$rcvr" "$base" #git switch "$rcvr" @@ -904,8 +907,8 @@ #git switch "$base" git branch } - alias load-prod="load-branch prod dev" - alias load-stage="load-branch stage dev" + alias load-prod="load-branch prod" + alias load-stage="load-branch stage" - name: General | Account Management | Users | Files | Common Variable set_fact: From 71d236d0bad99b36a0fb999d2071794bfecf1f19 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 15 Oct 2025 05:48:18 -0700 Subject: [PATCH 009/112] Add aliases to roll branches back to main, AKA the last official pull request. --- tasks/general/acct_mgmt/users.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index 3691fdc..78fece4 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -909,6 +909,9 @@ } alias load-prod="load-branch prod" alias load-stage="load-branch stage" + alias rollback-prod="load-branch prod main" + alias rollback-stage="load-branch stage main" + alias rollback-dev="load-branch dev main" - name: General | Account Management | Users | Files | Common Variable set_fact: From d91663779883c87d1217eaca110ca5bb5bcad40c Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 15 Oct 2025 05:53:48 -0700 Subject: [PATCH 010/112] Complete the conditional branches. --- tasks/general/acct_mgmt/users.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index 78fece4..ef1193a 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -568,8 +568,11 @@ dev_exists="$?" if [[ "$dev_exists" == 0 ]]; then git switch dev - else + elif [[ "$dev_exists" == 2 ]]; then git switch main + else + echo "ERROR: Unknown status for dev_exists, '$dev_exists'." + continue fi git pull git push From 13bc98d7ef7d1043df245973b963765909253319 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 15 Oct 2025 06:06:05 -0700 Subject: [PATCH 011/112] Further enhancments to load-branch. Better output and branch choices. --- tasks/general/acct_mgmt/users.yml | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index ef1193a..abd53f1 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -896,19 +896,33 @@ function load-branch { rcvr="$1" # branch which we want to modify base="$2" # branch with the changes we want - if [[ "$rcvr" == main ]]; then - echo "Are you nuts, fool!? Not main! Do it manually!" + if [[ "$rcvr" == "main" ]]; then + echo "*** ERROR: Are you nuts, fool!? Not main! Do it manually! ***" exit 1 fi if [[ -z "$base" ]]; then - base="dev" + if [[ "$rcvr" == "prod" ]]; then + base="stage" + elif [[ "$rcvr" == "stage" ]]; then + base="dev" + else + echo "* Unsure which branch to use for '$rcvr'. Please specify." + exit 1 + fi + echo "* Base not specified, using '$base' for '$rcvr'." fi + echo "* Ensuring we are on base branch '$base'." git switch "$base" + echo "* Changing pointer for '$rcvr' to '$base'." git branch -f "$rcvr" "$base" + #echo "* Switching to branch '$rcvr'." #git switch "$rcvr" + echo "* Forcing push on branch '$rcvr'." git push --force --set-upstream origin "$rcvr" + #echo "* Switching back to '$base'." #git switch "$base" - git branch + echo "* Done! Displaying list of remote branches." + git ls-remote --heads | sort } alias load-prod="load-branch prod" alias load-stage="load-branch stage" From 40ee72b5877907304ad2eae59dbd25696925671e Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 15 Oct 2025 06:15:13 -0700 Subject: [PATCH 012/112] Only continue each commnd if they are successful. --- tasks/general/acct_mgmt/users.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index abd53f1..fd26603 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -911,17 +911,17 @@ fi echo "* Base not specified, using '$base' for '$rcvr'." fi - echo "* Ensuring we are on base branch '$base'." - git switch "$base" - echo "* Changing pointer for '$rcvr' to '$base'." - git branch -f "$rcvr" "$base" - #echo "* Switching to branch '$rcvr'." - #git switch "$rcvr" - echo "* Forcing push on branch '$rcvr'." - git push --force --set-upstream origin "$rcvr" - #echo "* Switching back to '$base'." - #git switch "$base" - echo "* Done! Displaying list of remote branches." + echo "* Ensuring we are on base branch '$base'." && + git switch "$base" && + echo "* Changing pointer for '$rcvr' to '$base'." && + git branch -f "$rcvr" "$base" && + #echo "* Switching to branch '$rcvr'." && + #git switch "$rcvr" && + echo "* Forcing push on branch '$rcvr'." && + git push --force --set-upstream origin "$rcvr" && + #echo "* Switching back to '$base'." && + #git switch "$base" && + echo "* Done! Displaying list of remote branches." && git ls-remote --heads | sort } alias load-prod="load-branch prod" From 2ca308c2875783d54d0e4f790cbafad74d80b1d5 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 15 Oct 2025 06:28:38 -0700 Subject: [PATCH 013/112] Re-do changes lost between branch pointing. --- tasks/general/acct_mgmt/users.yml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index fd26603..83e1aa8 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -909,20 +909,25 @@ echo "* Unsure which branch to use for '$rcvr'. Please specify." exit 1 fi - echo "* Base not specified, using '$base' for '$rcvr'." + echo "* Base was not specified, using '$base' for '$rcvr'." + else + echo "* Requested pointing '$rcvr' branch to '$base'." fi - echo "* Ensuring we are on base branch '$base'." && + echo -e "\n* Ensuring we are on base branch '$base'." && git switch "$base" && - echo "* Changing pointer for '$rcvr' to '$base'." && + echo -e "\n* Changing pointer for '$rcvr' to '$base'." && git branch -f "$rcvr" "$base" && - #echo "* Switching to branch '$rcvr'." && + #echo -e "\n* Switching to branch '$rcvr'." && #git switch "$rcvr" && - echo "* Forcing push on branch '$rcvr'." && + echo -e "\n* Forcing push on branch '$rcvr'." && git push --force --set-upstream origin "$rcvr" && - #echo "* Switching back to '$base'." && - #git switch "$base" && - echo "* Done! Displaying list of remote branches." && + echo -e "\n* Done! Displaying list of remote branches." && git ls-remote --heads | sort + + if [[ "$base" != "dev" ]]; then + echo -e "\n* Switching back to dev." + git switch "$base" + fi } alias load-prod="load-branch prod" alias load-stage="load-branch stage" From 57ca267aa50d19a9d7270019ead7e56d8a3c5863 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 15 Oct 2025 06:32:28 -0700 Subject: [PATCH 014/112] Add back the display of the current local branch we're on. Add newlines for readability. --- tasks/general/acct_mgmt/users.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index 83e1aa8..34a726b 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -896,10 +896,12 @@ function load-branch { rcvr="$1" # branch which we want to modify base="$2" # branch with the changes we want + if [[ "$rcvr" == "main" ]]; then echo "*** ERROR: Are you nuts, fool!? Not main! Do it manually! ***" exit 1 fi + if [[ -z "$base" ]]; then if [[ "$rcvr" == "prod" ]]; then base="stage" @@ -913,6 +915,7 @@ else echo "* Requested pointing '$rcvr' branch to '$base'." fi + echo -e "\n* Ensuring we are on base branch '$base'." && git switch "$base" && echo -e "\n* Changing pointer for '$rcvr' to '$base'." && @@ -928,6 +931,9 @@ echo -e "\n* Switching back to dev." git switch "$base" fi + + echo -e "\n* Verifying which branch we're on." + git branch } alias load-prod="load-branch prod" alias load-stage="load-branch stage" From 5b749d21001b0cbb6f407bb2f26c9677206ce068 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 15 Oct 2025 06:35:02 -0700 Subject: [PATCH 015/112] Fix failed branch switch. Hardcode to dev! --- tasks/general/acct_mgmt/users.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index 34a726b..81b2d41 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -929,7 +929,7 @@ if [[ "$base" != "dev" ]]; then echo -e "\n* Switching back to dev." - git switch "$base" + git switch dev fi echo -e "\n* Verifying which branch we're on." From 8dfb3fe2a68e7a4957e0356e635e6ce4a08ecfcb Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 15 Oct 2025 06:38:50 -0700 Subject: [PATCH 016/112] Change rollback aliases to only go down 1 layer. Add reset aliases for going all the way back to main. --- tasks/general/acct_mgmt/users.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index 81b2d41..802bab3 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -938,8 +938,11 @@ alias load-prod="load-branch prod" alias load-stage="load-branch stage" alias rollback-prod="load-branch prod main" - alias rollback-stage="load-branch stage main" - alias rollback-dev="load-branch dev main" + alias rollback-stage="load-branch stage prod" + alias rollback-dev="load-branch dev stage" + alias reset-prod="load-branch prod main" + alias reset-stage="load-branch stage main" + alias reset-dev="load-branch dev main" - name: General | Account Management | Users | Files | Common Variable set_fact: From 8445b64d6b426775cdb7d91bd9fbc3a1d462fa3c Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 15 Oct 2025 06:42:16 -0700 Subject: [PATCH 017/112] Check if the dev branch exists before moving to it. --- tasks/general/acct_mgmt/users.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index 802bab3..ec7e10d 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -928,8 +928,17 @@ git ls-remote --heads | sort if [[ "$base" != "dev" ]]; then - echo -e "\n* Switching back to dev." - git switch dev + git ls-remote --exit-code --heads origin dev + dev_exists="$?" + if [[ "$dev_exists" == 0 ]]; then + echo -e "\n* Switching back to dev." + git switch dev + elif [[ "$dev_exists" == 2 ]]; then + echo -e "\n* Switching back to main." + git switch main + else + echo "*** ERROR: Unknown status for dev_exists, '$dev_exists'. ***" + fi fi echo -e "\n* Verifying which branch we're on." From 7c93f25a5d6179d7c836f66a145817268ab5cd90 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 15 Oct 2025 06:45:49 -0700 Subject: [PATCH 018/112] Add output for why dev branch shows up twice during load-prod. --- tasks/general/acct_mgmt/users.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index ec7e10d..794cc52 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -928,6 +928,7 @@ git ls-remote --heads | sort if [[ "$base" != "dev" ]]; then + echo -e "\n* Checking if a dev branch exists." git ls-remote --exit-code --heads origin dev dev_exists="$?" if [[ "$dev_exists" == 0 ]]; then From 0d3931d738dd1c58dc5dbc7b5413211aabcdd001 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sun, 19 Oct 2025 21:41:59 -0700 Subject: [PATCH 019/112] Fix cronjobs to use BASH for RANDOM variable. --- tasks/general/cron/ansible.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/general/cron/ansible.yml b/tasks/general/cron/ansible.yml index f68cb45..df6eafa 100644 --- a/tasks/general/cron/ansible.yml +++ b/tasks/general/cron/ansible.yml @@ -12,7 +12,7 @@ user: ansible name: "Ansible Sync" minute: "*/30" - job: "sleep $(( $RANDOM / 20 )); sudo {{ ansible_pull_exec.stdout }} -v -o -U {{ git_repo_http }} --checkout {{ branch }}" + job: "bash -c 'sleep $(( $RANDOM / 20 )); sudo {{ ansible_pull_exec.stdout }} -v -o -U {{ git_repo_http }} --checkout {{ branch }}'" state: present disabled: "{{ 'yes' if no_telem else 'no' }}" @@ -21,6 +21,6 @@ user: ansible name: "Ansible Weekly Forced Sync" special_time: daily - job: "sleep $(( $RANDOM / 1 )); sudo {{ ansible_pull_exec.stdout }} -v -U {{ git_repo_http }} --checkout {{ branch }}" + job: "bash -c 'sleep $(( $RANDOM / 1 )); sudo {{ ansible_pull_exec.stdout }} -v -U {{ git_repo_http }} --checkout {{ branch }}'" state: present disabled: "{{ 'yes' if no_telem else 'no' }}" From 49ababedc54911565ba12596c63a9e47ab83d595 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 20 Oct 2025 19:32:49 -0700 Subject: [PATCH 020/112] Add the flatpak Grayjay. --- tasks/workstation/linux/software/flatpaks.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/tasks/workstation/linux/software/flatpaks.yml b/tasks/workstation/linux/software/flatpaks.yml index 9e986e0..e89db37 100644 --- a/tasks/workstation/linux/software/flatpaks.yml +++ b/tasks/workstation/linux/software/flatpaks.yml @@ -43,6 +43,7 @@ - { app: "org.gimp.GIMP", name: "gimp", extra: "" } - { app: "org.libreoffice.LibreOffice", name: "office", extra: "" } - { app: "com.transmissionbt.Transmission", name: "transmission", extra: "" } + - { app: "app.grayjay.Grayjay", name: "grayjay", extra: "" } flatpaks_coding: - { app: "com.vscodium.codium", name: "codium-flatpak", extra: "" } - { app: "com.google.AndroidStudio", name: "android-studio", extra: "" } From 82ab31b9eab7b03582c6e76c0714581fdd9de14d Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 20 Oct 2025 19:33:09 -0700 Subject: [PATCH 021/112] Add Grayjay to GNOME favorites. --- tasks/workstation/shared/settings/gnome.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/tasks/workstation/shared/settings/gnome.yml b/tasks/workstation/shared/settings/gnome.yml index 9d28198..48f79c4 100644 --- a/tasks/workstation/shared/settings/gnome.yml +++ b/tasks/workstation/shared/settings/gnome.yml @@ -19,6 +19,7 @@ , 'codium.desktop' , 'org.shotcut.Shotcut.desktop' , 'io.lmms.LMMS.desktop' + , 'app.grayjay.Grayjay.desktop' , 'io.lbry.lbry-app.desktop', 'lbry.desktop' , 'com.valvesoftware.Steam.desktop' , 'net.lutris.Lutris.desktop' From dc2ae57bd6c444f11aec9b280bf564db1ca6146d Mon Sep 17 00:00:00 2001 From: Hyperling Date: Thu, 23 Oct 2025 19:42:50 -0700 Subject: [PATCH 022/112] Add command to pull production backups while making sure that failed downloads are easily identified. --- tasks/general/acct_mgmt/users.yml | 41 +++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index 794cc52..7d487f7 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -793,16 +793,52 @@ date "+%Y%m%d" } function_backup: | + export BACKUP_DIR="/srv/backup" function backup { /usr/local/bin/backup_system.sh } alias backup-system="backup" alias system-backup="backup" - alias check-backups="ll /srv/backup" + alias check-backups="ll $BACKUP_DIR" function clean-backup { - sh -c "rm -rfv /srv/backup/*" + sh -c "rm -rfv $BACKUP_DIR/*" } alias clean-backups="clean-backup" + function_pull_prod_backups: | + export BACKUP="Backup" + export SYSTEM="System" + function pull_prod_backup { + if [[ -z "$1" || ("$1" != "$BACKUP" && "$1" != "$SYSTEM") ]]; then + echo "ERROR: Parameter 1 not correct, expecting '$BACKUP' or '$SYSTEM'." + return 1 + fi + backup_type="$1" + mkdir -pv tmp + scp -P {{ prod_port }} \ + {{ prod_user }}@{{ prod_host }}:"$BACKUP_DIR/*${backup_type}*.zip" \ + tmp/ + if [[ "$?" == "0" ]]; then + echo "Succeeded!" + mv -v "tmp/*${backup_type}*.zip" ./ + rmdir tmp + else + rm -rv tmp + fi + } + function pull_prod_backups { + dir="ProductionBackups-Pulled`today`" + mkdir -pv "$dir" + cd "$dir" + pull_prod_backup "$BACKUP" + pull_prod_backup "$SYSTEM" + cd .. + } + alias pull-prod-backups="pull_prod_backups" + alias pull-backups="pull_prod_backups" + alias prod-backups="pull_prod_backups" + alias prod-backup="pull_prod_backups" + alias pull-prod="pull_prod_backups" + alias prod-pull="pull_prod_backups" function_log: | function log { echo -e "$1" @@ -1024,6 +1060,7 @@ {{ alias_ansible_facts }} {{ function_now }} {{ function_backup }} + {{ function_pull_prod_backups }} {{ function_log }} {{ function_debian_upgrade }} {{ function_ebook_convert }} From 97ddcc4573fe134cee4c71233f4f6e0e775362cb Mon Sep 17 00:00:00 2001 From: Hyperling Date: Thu, 23 Oct 2025 19:50:57 -0700 Subject: [PATCH 023/112] Properly handle removing the failed files. --- tasks/general/acct_mgmt/users.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index 7d487f7..dffd5b9 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -822,7 +822,7 @@ mv -v "tmp/*${backup_type}*.zip" ./ rmdir tmp else - rm -rv tmp + mv tmp ~/TRASH/"tmp_`now`" fi } function pull_prod_backups { From a7083733cc693039ede2f3146704b1d835b7b044 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Thu, 23 Oct 2025 19:59:56 -0700 Subject: [PATCH 024/112] Add check on whether any zips were successful. --- tasks/general/acct_mgmt/users.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index dffd5b9..cef3e32 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -820,7 +820,7 @@ if [[ "$?" == "0" ]]; then echo "Succeeded!" mv -v "tmp/*${backup_type}*.zip" ./ - rmdir tmp + rmdir -v tmp else mv tmp ~/TRASH/"tmp_`now`" fi @@ -831,7 +831,13 @@ cd "$dir" pull_prod_backup "$BACKUP" pull_prod_backup "$SYSTEM" + du -h *.zip + status="$?" cd .. + if [[ "$status" != 0 ]]; then + echo "Failed to find zip files, removing folder." + rmdir -v "$dir" + fi } alias pull-prod-backups="pull_prod_backups" alias pull-backups="pull_prod_backups" From d32b636a99bc4778a7fd28ecff9fa1a9eba7e302 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Thu, 23 Oct 2025 20:02:52 -0700 Subject: [PATCH 025/112] Add more output. --- tasks/general/acct_mgmt/users.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index cef3e32..c953a91 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -822,6 +822,7 @@ mv -v "tmp/*${backup_type}*.zip" ./ rmdir -v tmp else + echo "Failed!" mv tmp ~/TRASH/"tmp_`now`" fi } @@ -837,7 +838,9 @@ if [[ "$status" != 0 ]]; then echo "Failed to find zip files, removing folder." rmdir -v "$dir" + return 1 fi + echo "Done!" } alias pull-prod-backups="pull_prod_backups" alias pull-backups="pull_prod_backups" From 4c4d4bbef78672a2481021a095675337274a56c2 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 24 Oct 2025 14:53:36 -0700 Subject: [PATCH 026/112] Additional enhancements to pulling Production backups. --- tasks/general/acct_mgmt/users.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index c953a91..6aa980e 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -813,13 +813,18 @@ return 1 fi backup_type="$1" + if [[ -f *"${backup_type}"*".zip" ]]; then + echo "File already downloaded, skipping." + ls -lh *"${backup_type}"*".zip" + return 0 + fi mkdir -pv tmp scp -P {{ prod_port }} \ {{ prod_user }}@{{ prod_host }}:"$BACKUP_DIR/*${backup_type}*.zip" \ tmp/ if [[ "$?" == "0" ]]; then echo "Succeeded!" - mv -v "tmp/*${backup_type}*.zip" ./ + mv -v tmp/*.zip ./ rmdir -v tmp else echo "Failed!" From 5004250f85127fdffbf21b4c7077855ef3565bb6 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 24 Oct 2025 14:55:11 -0700 Subject: [PATCH 027/112] Add aliases for reloading shell like in Termux environment. --- tasks/general/acct_mgmt/users.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index 6aa980e..9cfbe4c 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -1003,6 +1003,12 @@ alias reset-prod="load-branch prod main" alias reset-stage="load-branch stage main" alias reset-dev="load-branch dev main" + alias_reload_bash: | + alias reload-bash="source ~/.bashrc" + alias bash-reload="reload-bash" + alias shell-reload="reload-bash" + alias reload-shell="reload-bash" + alias reload="reload-bash" - name: General | Account Management | Users | Files | Common Variable set_fact: @@ -1080,6 +1086,7 @@ {{ function_ebook_convert }} {{ alias_sudo }} {{ function_load_branch }} + {{ alias_reload_bash }} - name: General | Account Management | Users | Files | .bashrc blockinfile: From a94959bcf9447a5d7e7b411925737baff2aeaf91 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 24 Oct 2025 15:15:05 -0700 Subject: [PATCH 028/112] Add more verbosity. Change "BACKUP" to "DOCKER". --- tasks/general/acct_mgmt/users.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index 9cfbe4c..1022837 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -805,18 +805,23 @@ } alias clean-backups="clean-backup" function_pull_prod_backups: | - export BACKUP="Backup" + export DOCKER="DOCKER" export SYSTEM="System" function pull_prod_backup { - if [[ -z "$1" || ("$1" != "$BACKUP" && "$1" != "$SYSTEM") ]]; then - echo "ERROR: Parameter 1 not correct, expecting '$BACKUP' or '$SYSTEM'." + if [[ -z "$1" || ("$1" != "$DOCKER" && "$1" != "$SYSTEM") ]]; then + echo "ERROR: Parameter 1 not correct, expecting '$DOCKER' or '$SYSTEM'." return 1 fi backup_type="$1" - if [[ -f *"${backup_type}"*".zip" ]]; then + echo "Looking for '*${backup_type}*.zip'" + ls -lh *${backup_type}*.zip 2>/dev/null + status="$?" + echo "Status of file check came back as '$status'." + if [[ "$status" == "0" ]]; then echo "File already downloaded, skipping." - ls -lh *"${backup_type}"*".zip" return 0 + else + echo "File still needed, downloading to local tmp/." fi mkdir -pv tmp scp -P {{ prod_port }} \ @@ -835,9 +840,9 @@ dir="ProductionBackups-Pulled`today`" mkdir -pv "$dir" cd "$dir" - pull_prod_backup "$BACKUP" + pull_prod_backup "$DOCKER" pull_prod_backup "$SYSTEM" - du -h *.zip + ls -lh *.zip status="$?" cd .. if [[ "$status" != 0 ]]; then From f02aec2cdb36551f9b364cbd6801fb10fd155207 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 24 Oct 2025 15:16:57 -0700 Subject: [PATCH 029/112] Fix case of DOCKER value. --- tasks/general/acct_mgmt/users.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index 1022837..2fef564 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -805,7 +805,7 @@ } alias clean-backups="clean-backup" function_pull_prod_backups: | - export DOCKER="DOCKER" + export DOCKER="Docker" export SYSTEM="System" function pull_prod_backup { if [[ -z "$1" || ("$1" != "$DOCKER" && "$1" != "$SYSTEM") ]]; then From a7f395a62af64471dde61b1964f109c8c5eb7698 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 24 Oct 2025 15:18:44 -0700 Subject: [PATCH 030/112] Remove test output. --- tasks/general/acct_mgmt/users.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index 2fef564..973839c 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -816,7 +816,6 @@ echo "Looking for '*${backup_type}*.zip'" ls -lh *${backup_type}*.zip 2>/dev/null status="$?" - echo "Status of file check came back as '$status'." if [[ "$status" == "0" ]]; then echo "File already downloaded, skipping." return 0 From f8a60b4287a674bddcc24cfba7b55d608a908d50 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 24 Oct 2025 15:26:40 -0700 Subject: [PATCH 031/112] Change final backup check to use `du` again, not `ls -l`. --- tasks/general/acct_mgmt/users.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index 973839c..6f15f96 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -841,7 +841,7 @@ cd "$dir" pull_prod_backup "$DOCKER" pull_prod_backup "$SYSTEM" - ls -lh *.zip + du -h *.zip | sort -h status="$?" cd .. if [[ "$status" != 0 ]]; then From 816a0d4f694bd4ab39152c2888479493162c2427 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 25 Oct 2025 14:43:14 -0700 Subject: [PATCH 032/112] Do not check the kernelfor the OS when inside of Docker containers. --- setup.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index e10f8c1..37a8ad0 100755 --- a/setup.sh +++ b/setup.sh @@ -55,7 +55,11 @@ fi ## Main ## os="$(cat /etc/os-release)" -os="$os $(uname -a)" +if [[ ! -f /.dockerenv ]]; then + # If we are not in a Docker container, also check what the kernel says. + os="$os $(uname -a)" + # Docker containers use the host kernel which gives an incorrect reading. +fi echo "Making sure all necessary packages are installed..." if [[ `which ansible > /dev/null; echo $?` != 0 ]]; then From c46c78519bfb31f85a7d1a384a89a0f2c71d1323 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 25 Oct 2025 14:58:03 -0700 Subject: [PATCH 033/112] Do not mention using the default branch if using local. --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 37a8ad0..3664124 100755 --- a/setup.sh +++ b/setup.sh @@ -47,7 +47,7 @@ if [[ ! -z $1 && $1 != "-"* ]]; then usage 1 fi -if [[ $branch == "" ]]; then +if [[ -z "$local" && "$branch" == "" ]]; then echo "Using default branch $BRANCH." branch="$BRANCH" fi From 71ca410123abf3cfed8bf4ae7461785414fa82e5 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 25 Oct 2025 15:12:03 -0700 Subject: [PATCH 034/112] Add ability to spawn basic configurations for testing. --- setup.sh | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 57 insertions(+), 3 deletions(-) diff --git a/setup.sh b/setup.sh index 3664124..c571464 100755 --- a/setup.sh +++ b/setup.sh @@ -15,7 +15,7 @@ BRANCH="main" function usage { cat <<- EOF - $PROG [-l] [-b branch_name] [-h] + $PROG [-l] [-b branch_name] [-g] [-w] [-s] [-h] Program to initialize synchronization with Hyperling's Ansible configuration. $URL @@ -23,7 +23,10 @@ function usage { -l : Run the local playbook associated with this $PROG. This is helpful for development or just saving bandwidth. It also provides prettier colors than the plaintext from ansible-pull. ;) - -b branch_name: Download and run a specific branch. Default is $BRANCH. + -b branch_name : Download and run a specific branch. Default is $BRANCH. + -g : Enable the General config with test contents. + -w : Enable the Workstation config with test contents. + -s : Enable the Server config with test contents. -h : Display this help text EOF @@ -32,10 +35,13 @@ function usage { ## Parameter Parsing ## -while getopts ":lb:h" arg; do +while getopts ":lb:gwsh" arg; do case $arg in l) local="Y" && echo "Running $LOCAL as the playbook." ;; b) branch="$OPTARG" && echo "Using branch $branch instead of $BRANCH." ;; + l) create_general="Y" && echo "Creating basic '$general_config'." ;; + l) create_workstation="Y" && echo "Creating basic '$workstation_config'." ;; + l) create_server="Y" && echo "Creating basic '$server_config'." ;; h) usage ;; *) echo "ERROR: Parameter $OPTARG was not recognized." && usage 1 ;; esac @@ -52,6 +58,19 @@ if [[ -z "$local" && "$branch" == "" ]]; then branch="$BRANCH" fi +if [[ -n "$create_general" && -f "$general_config" ]]; then + echo "WARNING: General configuration already exists, will not overwrite." + ls -lh "$general" +fi +if [[ -n "$create_workstation" && -f "$workstation_config" ]]; then + echo "WARNING: Workstation configuration already exists, will not overwrite." + ls -lh "$workstation_config" +fi +if [[ -n "$create_server" && -f "$server_config" ]]; then + echo "WARNING: Server configuration already exists, will not overwrite." + ls -lh "$server_config" +fi + ## Main ## os="$(cat /etc/os-release)" @@ -105,6 +124,41 @@ echo "Installed!" #ansible-galaxy collection install community.general #echo "Added!" +# Create basic layouts if configs do not exist and are requested. +if [[ -n "$create_general" && ! -f "$general_config" ]]; then + function print_general_contents { + cat <<- EOF + enable=true + user=test + user_desc=Test + branch=$branch + EOF + } + print_general_contents > "$general_config" +fi +if [[ -n "$create_workstation" && ! -f "$workstation_config" ]]; then + function print_workstation_contents { + cat <<- EOF + enable=true + user=test + user_desc=Test + branch=$branch + EOF + } + print_workstation_contents > "$workstation_config" +fi +if [[ -n "$create_server" && ! -f "$server_config" ]]; then + function print_server_contents { + cat <<- EOF + enable=true + user=test + user_desc=Test + branch=$branch + EOF + } + print_server_contents > "$server_config" +fi + echo "Provisioning Ansible..." if [[ $local == "Y" ]]; then sudo ansible-playbook $LOCAL From 07d1adc926c1da72db37cee4b44f5923c0e1f1fa Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 25 Oct 2025 15:15:30 -0700 Subject: [PATCH 035/112] Create the proper contents in each test file. --- setup.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/setup.sh b/setup.sh index c571464..1767733 100755 --- a/setup.sh +++ b/setup.sh @@ -140,9 +140,9 @@ if [[ -n "$create_workstation" && ! -f "$workstation_config" ]]; then function print_workstation_contents { cat <<- EOF enable=true - user=test - user_desc=Test - branch=$branch + coding=true + editing=false + gaming=false EOF } print_workstation_contents > "$workstation_config" @@ -151,9 +151,6 @@ if [[ -n "$create_server" && ! -f "$server_config" ]]; then function print_server_contents { cat <<- EOF enable=true - user=test - user_desc=Test - branch=$branch EOF } print_server_contents > "$server_config" From a42d1d05df04d6b1c3076c4b375f5eea1b1bfa7c Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 25 Oct 2025 15:16:50 -0700 Subject: [PATCH 036/112] Fix the parameter switches. --- setup.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/setup.sh b/setup.sh index 1767733..540b616 100755 --- a/setup.sh +++ b/setup.sh @@ -24,9 +24,9 @@ function usage { This is helpful for development or just saving bandwidth. It also provides prettier colors than the plaintext from ansible-pull. ;) -b branch_name : Download and run a specific branch. Default is $BRANCH. - -g : Enable the General config with test contents. - -w : Enable the Workstation config with test contents. - -s : Enable the Server config with test contents. + -g : Enable the General config with test contents. + -w : Enable the Workstation config with test contents. + -s : Enable the Server config with test contents. -h : Display this help text EOF @@ -39,9 +39,9 @@ while getopts ":lb:gwsh" arg; do case $arg in l) local="Y" && echo "Running $LOCAL as the playbook." ;; b) branch="$OPTARG" && echo "Using branch $branch instead of $BRANCH." ;; - l) create_general="Y" && echo "Creating basic '$general_config'." ;; - l) create_workstation="Y" && echo "Creating basic '$workstation_config'." ;; - l) create_server="Y" && echo "Creating basic '$server_config'." ;; + g) create_general="Y" && echo "Creating basic '$general_config'." ;; + w) create_workstation="Y" && echo "Creating basic '$workstation_config'." ;; + s) create_server="Y" && echo "Creating basic '$server_config'." ;; h) usage ;; *) echo "ERROR: Parameter $OPTARG was not recognized." && usage 1 ;; esac From 1f4abd2d6c3c9739c948bfe8580ab8393d2a3471 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 25 Oct 2025 15:18:55 -0700 Subject: [PATCH 037/112] Create the filepaths for the config files. Output the files and their contents after creation. --- setup.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/setup.sh b/setup.sh index 540b616..042344c 100755 --- a/setup.sh +++ b/setup.sh @@ -9,6 +9,10 @@ LOCAL=$DIR/local.yml URL="https://git.hyperling.com/me/env-ansible" BRANCH="main" +general_config="/usr/local/etc/hyperling-scm/general.ini" +workstation_config="/usr/local/etc/hyperling-scm/workstation.ini" +server_config="/usr/local/etc/hyperling-scm/server.ini" + ## Functions ## # Accepts 1 parameter, it is used as the exit status. @@ -135,6 +139,8 @@ if [[ -n "$create_general" && ! -f "$general_config" ]]; then EOF } print_general_contents > "$general_config" + ls -lh "$general_config" + cat "$general_config" fi if [[ -n "$create_workstation" && ! -f "$workstation_config" ]]; then function print_workstation_contents { @@ -146,6 +152,8 @@ if [[ -n "$create_workstation" && ! -f "$workstation_config" ]]; then EOF } print_workstation_contents > "$workstation_config" + ls -lh "$workstation_config" + cat "$workstation_config" fi if [[ -n "$create_server" && ! -f "$server_config" ]]; then function print_server_contents { @@ -154,6 +162,8 @@ if [[ -n "$create_server" && ! -f "$server_config" ]]; then EOF } print_server_contents > "$server_config" + ls -lh "$server_config" + cat "$server_config" fi echo "Provisioning Ansible..." From fca20b31bdf2e5792fb5b8b0d75a0ba6663417d3 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 25 Oct 2025 15:20:59 -0700 Subject: [PATCH 038/112] Change wording so that user does not expect files to exist right away. --- setup.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.sh b/setup.sh index 042344c..7db5e11 100755 --- a/setup.sh +++ b/setup.sh @@ -43,9 +43,9 @@ while getopts ":lb:gwsh" arg; do case $arg in l) local="Y" && echo "Running $LOCAL as the playbook." ;; b) branch="$OPTARG" && echo "Using branch $branch instead of $BRANCH." ;; - g) create_general="Y" && echo "Creating basic '$general_config'." ;; - w) create_workstation="Y" && echo "Creating basic '$workstation_config'." ;; - s) create_server="Y" && echo "Creating basic '$server_config'." ;; + g) create_general="Y" && echo "Requested '$general_config'." ;; + w) create_workstation="Y" && echo "Requested '$workstation_config'." ;; + s) create_server="Y" && echo "Requested '$server_config'." ;; h) usage ;; *) echo "ERROR: Parameter $OPTARG was not recognized." && usage 1 ;; esac From cfc2694737f65bf0b5fbc2559852493e525beff3 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 25 Oct 2025 15:30:40 -0700 Subject: [PATCH 039/112] Add that the file contains test data. Add output of the function for testing. --- setup.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/setup.sh b/setup.sh index 7db5e11..8c70a3c 100755 --- a/setup.sh +++ b/setup.sh @@ -132,12 +132,15 @@ echo "Installed!" if [[ -n "$create_general" && ! -f "$general_config" ]]; then function print_general_contents { cat <<- EOF + ; TEST DATA enable=true user=test user_desc=Test branch=$branch + ; TEST DATA EOF } + print_general_contents # FORTEST print_general_contents > "$general_config" ls -lh "$general_config" cat "$general_config" @@ -145,12 +148,15 @@ fi if [[ -n "$create_workstation" && ! -f "$workstation_config" ]]; then function print_workstation_contents { cat <<- EOF + ; TEST DATA enable=true coding=true editing=false gaming=false + ; TEST DATA EOF } + print_workstation_contents # FORTEST print_workstation_contents > "$workstation_config" ls -lh "$workstation_config" cat "$workstation_config" @@ -158,9 +164,12 @@ fi if [[ -n "$create_server" && ! -f "$server_config" ]]; then function print_server_contents { cat <<- EOF + ; TEST DATA enable=true + ; TEST DATA EOF } + print_server_contents # FORTEST print_server_contents > "$server_config" ls -lh "$server_config" cat "$server_config" From 03b8169401cb983143797c4ec6fcbba7ff74bca4 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 25 Oct 2025 15:38:12 -0700 Subject: [PATCH 040/112] Try adding the output to the files in a different way. --- setup.sh | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/setup.sh b/setup.sh index 8c70a3c..3f7345f 100755 --- a/setup.sh +++ b/setup.sh @@ -140,10 +140,8 @@ if [[ -n "$create_general" && ! -f "$general_config" ]]; then ; TEST DATA EOF } - print_general_contents # FORTEST - print_general_contents > "$general_config" + print_general_contents | sudo tee "$general_config" ls -lh "$general_config" - cat "$general_config" fi if [[ -n "$create_workstation" && ! -f "$workstation_config" ]]; then function print_workstation_contents { @@ -156,10 +154,8 @@ if [[ -n "$create_workstation" && ! -f "$workstation_config" ]]; then ; TEST DATA EOF } - print_workstation_contents # FORTEST - print_workstation_contents > "$workstation_config" + print_workstation_contents | sudo tee "$workstation_config" ls -lh "$workstation_config" - cat "$workstation_config" fi if [[ -n "$create_server" && ! -f "$server_config" ]]; then function print_server_contents { @@ -169,10 +165,8 @@ if [[ -n "$create_server" && ! -f "$server_config" ]]; then ; TEST DATA EOF } - print_server_contents # FORTEST - print_server_contents > "$server_config" + print_server_contents | sudo tee "$server_config" ls -lh "$server_config" - cat "$server_config" fi echo "Provisioning Ansible..." From 0920493634c08136af3ff75e9e1982c9cc966c64 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 25 Oct 2025 15:46:52 -0700 Subject: [PATCH 041/112] Create the config directory so that tee can create the files. --- setup.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/setup.sh b/setup.sh index 3f7345f..57f312d 100755 --- a/setup.sh +++ b/setup.sh @@ -9,9 +9,10 @@ LOCAL=$DIR/local.yml URL="https://git.hyperling.com/me/env-ansible" BRANCH="main" -general_config="/usr/local/etc/hyperling-scm/general.ini" -workstation_config="/usr/local/etc/hyperling-scm/workstation.ini" -server_config="/usr/local/etc/hyperling-scm/server.ini" +config_dir="/usr/local/etc/hyperling-scm" +general_config="$config_dir/general.ini" +workstation_config="$config_dir/workstation.ini" +server_config="$config_dir/server.ini" ## Functions ## @@ -129,6 +130,12 @@ echo "Installed!" #echo "Added!" # Create basic layouts if configs do not exist and are requested. +if [[ -n "$create_general" + || -n "$create_workstation" + || -n "$create_server" ]] +then + sudo mkdir -pv "$config_dir" +fi if [[ -n "$create_general" && ! -f "$general_config" ]]; then function print_general_contents { cat <<- EOF From 2be7e028b67aacebe48ad9abf8933923218d90c7 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Thu, 30 Oct 2025 12:13:55 -0700 Subject: [PATCH 042/112] Add Mullvad to the end of favorites list. --- tasks/workstation/shared/settings/gnome.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/tasks/workstation/shared/settings/gnome.yml b/tasks/workstation/shared/settings/gnome.yml index 48f79c4..7ae2d55 100644 --- a/tasks/workstation/shared/settings/gnome.yml +++ b/tasks/workstation/shared/settings/gnome.yml @@ -23,6 +23,7 @@ , 'io.lbry.lbry-app.desktop', 'lbry.desktop' , 'com.valvesoftware.Steam.desktop' , 'net.lutris.Lutris.desktop' + , 'mullvad-vpn.desktop' ]" dconf_terminal: gnome-terminal dconf_theme: Adwaita-dark From c2790e2de4308508a38003d3470d83523c6979d1 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Thu, 30 Oct 2025 15:02:16 -0700 Subject: [PATCH 043/112] Fix error "File contains no section headers." when creating test config. --- setup.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/setup.sh b/setup.sh index 57f312d..3b71c2f 100755 --- a/setup.sh +++ b/setup.sh @@ -140,6 +140,7 @@ if [[ -n "$create_general" && ! -f "$general_config" ]]; then function print_general_contents { cat <<- EOF ; TEST DATA + [global] enable=true user=test user_desc=Test @@ -154,6 +155,7 @@ if [[ -n "$create_workstation" && ! -f "$workstation_config" ]]; then function print_workstation_contents { cat <<- EOF ; TEST DATA + [global] enable=true coding=true editing=false @@ -168,6 +170,7 @@ if [[ -n "$create_server" && ! -f "$server_config" ]]; then function print_server_contents { cat <<- EOF ; TEST DATA + [global] enable=true ; TEST DATA EOF From b562308cf144406f49ee56f4d553d13507c35b18 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Thu, 30 Oct 2025 15:15:13 -0700 Subject: [PATCH 044/112] Remove header, ensure test data is after the blockinfile header by including the tags it's looking for. --- setup.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/setup.sh b/setup.sh index 3b71c2f..d502e95 100755 --- a/setup.sh +++ b/setup.sh @@ -130,17 +130,21 @@ echo "Installed!" #echo "Added!" # Create basic layouts if configs do not exist and are requested. + if [[ -n "$create_general" || -n "$create_workstation" || -n "$create_server" ]] then sudo mkdir -pv "$config_dir" + MARK1="BEGIN" + MARK2="END" fi if [[ -n "$create_general" && ! -f "$general_config" ]]; then function print_general_contents { cat <<- EOF + ; $MARK1 MANAGED BY ANSIBLE | Generic Config + ; $MARK2 MANAGED BY ANSIBLE | Generic Config ; TEST DATA - [global] enable=true user=test user_desc=Test @@ -154,8 +158,9 @@ fi if [[ -n "$create_workstation" && ! -f "$workstation_config" ]]; then function print_workstation_contents { cat <<- EOF + ; $MARK1 MANAGED BY ANSIBLE | Workstation Config + ; $MARK2 MANAGED BY ANSIBLE | Workstation Config ; TEST DATA - [global] enable=true coding=true editing=false @@ -169,8 +174,9 @@ fi if [[ -n "$create_server" && ! -f "$server_config" ]]; then function print_server_contents { cat <<- EOF + ; $MARK1 MANAGED BY ANSIBLE | Server Config + ; $MARK2 MANAGED BY ANSIBLE | Server Config ; TEST DATA - [global] enable=true ; TEST DATA EOF From 0d8d872bfc1f5f3383ba2d2ce97cda59a9a956b8 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Thu, 30 Oct 2025 15:15:28 -0700 Subject: [PATCH 045/112] Fix typo in "portion". --- tasks/general/acct_mgmt/provision_config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/general/acct_mgmt/provision_config.yml b/tasks/general/acct_mgmt/provision_config.yml index 18fc457..8fbd5c7 100644 --- a/tasks/general/acct_mgmt/provision_config.yml +++ b/tasks/general/acct_mgmt/provision_config.yml @@ -26,7 +26,7 @@ blockinfile: path: "{{ gen_file }}" block: | - ; Please note that all potions require lowercase keys and values. + ; Please note that all portions require lowercase keys and values. ; ;;;;;;;;;;;;;;;;;;;; Basic Options ;;;;;;;;;;;;;;;;;;;; ; From 4864ee3869b4c2509b9948fe338f728753827e31 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Thu, 30 Oct 2025 15:37:17 -0700 Subject: [PATCH 046/112] Convert dnf5 to dnf. --- facts/general/package.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/facts/general/package.yml b/facts/general/package.yml index d65af26..cd72f54 100644 --- a/facts/general/package.yml +++ b/facts/general/package.yml @@ -2,7 +2,7 @@ # Define program names for package builtin. # This file is for ALL systems and should not include UI components. -- name: General | Facts | Packages | Shared Defaults +- name: General | Facts | Package | Shared Defaults set_fact: sshfs: sshfs tar: tar @@ -12,7 +12,7 @@ dig: dig neofetch: neofetch -- name: General | Facts | Packages | Parrot OS Fixes +- name: General | Facts | Package | Parrot OS Fixes set_fact: ansible_pkg_mgr: "apt" ansible_python_interpreter: "/usr/bin/python3" @@ -56,6 +56,11 @@ encfs: fusefs-encfs when: ansible_system == "FreeBSD" +- name: General | Facts | Package | dnf Fixes + set_fact: + ansible_pkg_mgr: dnf + when: ansible_pkg_mgr in ("dnf5") + - name: General | Facts | Package | dnf set_fact: sshfs: fuse-sshfs From 8636a0e11202c1e437a90961dd49bf5e73ca329f Mon Sep 17 00:00:00 2001 From: Hyperling Date: Thu, 30 Oct 2025 15:37:33 -0700 Subject: [PATCH 047/112] Add option to spit out facts. --- setup.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/setup.sh b/setup.sh index d502e95..4daef13 100755 --- a/setup.sh +++ b/setup.sh @@ -20,7 +20,7 @@ server_config="$config_dir/server.ini" function usage { cat <<- EOF - $PROG [-l] [-b branch_name] [-g] [-w] [-s] [-h] + $PROG [-l] [-b branch_name] [-g] [-w] [-s] [-f] [-h] Program to initialize synchronization with Hyperling's Ansible configuration. $URL @@ -32,7 +32,8 @@ function usage { -g : Enable the General config with test contents. -w : Enable the Workstation config with test contents. -s : Enable the Server config with test contents. - -h : Display this help text + -f : Display this system's facts. + -h : Display this help text. EOF exit $1 @@ -40,13 +41,14 @@ function usage { ## Parameter Parsing ## -while getopts ":lb:gwsh" arg; do +while getopts ":lb:gwsfh" arg; do case $arg in l) local="Y" && echo "Running $LOCAL as the playbook." ;; b) branch="$OPTARG" && echo "Using branch $branch instead of $BRANCH." ;; g) create_general="Y" && echo "Requested '$general_config'." ;; w) create_workstation="Y" && echo "Requested '$workstation_config'." ;; s) create_server="Y" && echo "Requested '$server_config'." ;; + f) show_facts="Y" ;; h) usage ;; *) echo "ERROR: Parameter $OPTARG was not recognized." && usage 1 ;; esac @@ -125,6 +127,11 @@ if [[ `which ansible > /dev/null; echo $?` != 0 ]]; then fi echo "Installed!" +if [[ "$show_facts" == "Y" ]]; then + echo "Showing Ansible Facts" + ansible localhost -m setup --connection=local +fi + #echo "Adding Ansible Collections..." #ansible-galaxy collection install community.general #echo "Added!" From 32dfd0af252d9aaf696d45c7dea1e5c31bb9caec Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 1 Nov 2025 04:07:39 -0700 Subject: [PATCH 048/112] Begin fixing package installs for DNF (Fedora). --- facts/general/package.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/facts/general/package.yml b/facts/general/package.yml index cd72f54..f774ffa 100644 --- a/facts/general/package.yml +++ b/facts/general/package.yml @@ -56,7 +56,7 @@ encfs: fusefs-encfs when: ansible_system == "FreeBSD" -- name: General | Facts | Package | dnf Fixes +- name: General | Facts | Package | dnf (Fixes) # TBD: Fix + test package names: mlocate, dig, neofetch set_fact: ansible_pkg_mgr: dnf when: ansible_pkg_mgr in ("dnf5") @@ -64,7 +64,7 @@ - name: General | Facts | Package | dnf set_fact: sshfs: fuse-sshfs - locate: mlocate + locate: plocate opensshd: openssh microcode_amd: microcode_ctl microcode_intel: microcode_ctl From c927a5bd2db607afd7f0e0b6ed83e86deeaea936 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 8 Nov 2025 15:20:19 -0700 Subject: [PATCH 049/112] Add alias for running `hugo server` with sane defaults. --- tasks/general/acct_mgmt/users.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index 6f15f96..c71d1fb 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -1013,6 +1013,8 @@ alias shell-reload="reload-bash" alias reload-shell="reload-bash" alias reload="reload-bash" + alias_hugo_server: | + alias hugo-server="hugo server -D --gc --minify" - name: General | Account Management | Users | Files | Common Variable set_fact: @@ -1091,6 +1093,7 @@ {{ alias_sudo }} {{ function_load_branch }} {{ alias_reload_bash }} + {{ alias_hugo_server }} - name: General | Account Management | Users | Files | .bashrc blockinfile: From 4c467fff6d7bf58973b1aee43b6079244039f630 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 8 Nov 2025 15:28:15 -0700 Subject: [PATCH 050/112] Add multiple versions of calling hugo server. --- tasks/general/acct_mgmt/users.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index c71d1fb..2e09b85 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -1014,7 +1014,10 @@ alias reload-shell="reload-bash" alias reload="reload-bash" alias_hugo_server: | - alias hugo-server="hugo server -D --gc --minify" + alias hugo-server-dev="hugo server -D --gc --ignoreCache --noHTTPCache --disableFastRender" + alias hugo-server-stage="hugo server --gc --noHTTPCache --disableFastRender" + alias hugo-server-prod="hugo server --gc --minify" + alias hugo-server="hugo-server-dev" - name: General | Account Management | Users | Files | Common Variable set_fact: From 8898959a95b4b94f33afb803f509a22a15cc6c75 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sun, 9 Nov 2025 20:01:14 -0700 Subject: [PATCH 051/112] Fix typo in comment. --- tasks/workstation/shared/software/dwm.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tasks/workstation/shared/software/dwm.yml b/tasks/workstation/shared/software/dwm.yml index c9e2c96..a93bc88 100644 --- a/tasks/workstation/shared/software/dwm.yml +++ b/tasks/workstation/shared/software/dwm.yml @@ -3,7 +3,7 @@ # https://dwm.suckless.org/ # https://sites.google.com/site/lazyboxx/-articles/dwm-a-newbie-s-guide#TOC-Status-Bar -#TODO: Move this to tasks/shared/ pasth rather than tasks/linux/. +#TODO: Move this to tasks/shared/ path rather than tasks/linux/. #TODO: Generate files based on blockinfile. #TODO: Fix config.mk for FreeBSD automatically (use /usr/local/ for libs not /usr/X11RC/) #TODO: scm.sh to use bash variable so that FreeBSD correctly hits /usr/local/bin/bash. @@ -23,14 +23,14 @@ ## Download ## - name: Workstation | Linux | Software | DWM | Git Clone - git: + git: repo: https://git.suckless.org/dwm dest: "{{ dwm_install_dir }}" clone: yes force: yes - name: Workstation | Linux | Software | DWM | Git Clone (st) - git: + git: repo: https://git.suckless.org/st dest: "{{ st_install_dir }}" clone: yes From 0e1cb8bacbb74c642f0112e494a5480f5dad91ec Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sun, 9 Nov 2025 20:59:02 -0700 Subject: [PATCH 052/112] Add slightly easier to remember shortcuts for DWM. --- files/dwm/config.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/files/dwm/config.h b/files/dwm/config.h index c83cd5d..6d0ebf5 100644 --- a/files/dwm/config.h +++ b/files/dwm/config.h @@ -104,7 +104,11 @@ static Key keys[] = { { MODKEY|ShiftMask, XK_q, quit, {0} }, // Mine { MODKEY, XK_q, killclient, {0} }, -// Volume (https://varunbpatil.github.io/2013/09/28/dwm.html) + // extra search shortcut + { MODKEY, XK_s, spawn, {.v = dmenucmd } }, + // fullscreen shortcut for m onocle + { MODKEY, XK_f, setlayout, {.v = &layouts[2]} }, +// Volume (https://varunbpatil.github.io/2013/09/28/dwm.html) { 0, 0x1008ff12,spawn, {.v = mutecmd } }, { 0, 0x1008ff11,spawn, {.v = lowervolcmd } }, { 0, 0x1008ff13,spawn, {.v = raisevolcmd } }, From 16dfeca6896e08c3bdd8e439af4dc370500396f7 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 13:44:23 -0700 Subject: [PATCH 053/112] Add terminal based volume function! Tested to work great so far. --- files/dwm/volume.function | 149 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 files/dwm/volume.function diff --git a/files/dwm/volume.function b/files/dwm/volume.function new file mode 100644 index 0000000..39664c5 --- /dev/null +++ b/files/dwm/volume.function @@ -0,0 +1,149 @@ +#!/usr/bin/env bash +# 2025-11-10 Hyperling +# Volume management for systems without working volume buttons. +# Written for ease of use in terminal and simple window management systems. + +function volume-usage { + cat <<- EOF + Usage: volume [%int] [(+/-)%int] [-d] [-r] [-t] [-h] + + Set to a static value: + volume 100, volume 65 + + Increment or decrement. Passing only + or - and no number defaults to 5. + volume -5, volume 5-, volume - 5, volume 5 - + volume +20, volume 20+, volume + 20, volume 20 + + + Display the current volume: + volume, + volume-display, volume display, volume --display, volume -d, + volume +d + + Set volume to a random number between 0 and 100. + volume-random, volume random, volume --random, volume -r + + Be silly and oscillate volume in a loop: + volume-trip, volume trip, volume --trip, volume -t + + Display this help text: + volume-usage, + volume-help volume help, volume --help, volume -h + EOF + return "$1" +} +alias volume-help="volume-usage" +alias vol-h="volume-help" + +function volume { + if [[ "$1" == "--help" || "$1" == "help" || "$1" == "-h" ]]; then + volume-usage + fi + if [[ (-z "$1" && -z "$2") + || "$1" == "--display" || "$1" == "display" || "$1" == "-d" || "$1" == "+d" + ]]; then + volume-display + fi + + if [[ "$1" == *"%"* || "$2" == *"%"* ]]; then + set -- "${1//%/}" "${2//%/}" + fi + + dir="" + typeset -i amt + + # Check if format is written text. + if [[ "$1" == "full" || "$1" == "max" ]]; then + amt=100 + fi + if [[ "$1" == "mute" || "$1" == "none" ]]; then + amt=0 + fi + + # Check if the format is "volume +/- %int" + if [[ -z "$amt" && -z "$dir" ]]; then + if [[ "$1" == "+" || "$1" == "-" ]]; then + dir="$1" + amt="$2" + if [[ -z "$2" ]]; then + amt="5" + else + amt="$2" + fi + fi + fi + + # Check if the format is "volume +/- %int". + if [[ -z "$amt" && -z "$dir" ]]; then + if [[ "$2" == "+" || "$2" == "-" ]]; then + amt="$1" + dir="$2" + fi + fi + + # Check if amount and direction are adjacent, and if so, pull the values. + if [[ -z "$amt" && -z "$dir" ]]; then + if [[ "$1" == *"+"* ]]; then + dir="+" + elif [[ "$1" == *"-"* ]]; then + dir="-" + fi + if [[ -n "$dir" && -z "$amt" ]]; then + amt="$1" + fi + fi + + amt=${amt//-/} + amt=${amt//+/} + + if [[ -n "$dir" && -n "$amt" ]]; then + echo "> Changing volume by '$dir$amt%'." + amixer -q sset Master ${amt}%${dir} + echo "> Volume is now '`volume-display`'." + return 0 + fi + + if [[ -z "$dir" && -n "$1" ]]; then + echo "> Setting volume to '$amt'." + amixer -q sset Master ${amt}% + echo "> Volume has been set to '`volume-display`'." + return 0 + fi + + echo "Error: Should not have made it here. Please report this to the developer." + echo "$0 $1 $2" + return 7 +} +alias vol="volume " +alias vol-="volume - " +alias vol+="volume + " + +function volume-display { + if [[ "$1" == "-v" || "$1" == "--verbose" || "$1" == "verbose" ]]; then + amixer sget Master + else + amixer sget Master | egrep -o '[0-9]{1,3}%' | head -n 1 + fi +} +alias "vol-d"="volume-display" + +# Go up and down until cancelled. +#function volume-trip { +# curr eq amixer current readout +# if curr lt 50 then dir eq + else dir eq - +# while true; do +# if vol is 0 then dir eq + +# if vol is 100 then dir eq - +# curr eq \$curr $dir 1 +# amixer set volume to curr +# sleep 0.1 +# done +#} +#alias vol-t="volume-trip" +#alias volume-wub="volume-trip" +#alias vol-w="volume-wub" + +#function volume-random { +# v eq $RANDOM % 101 +# amixer set volume eq v +#} +#alias vol-r="volume-random" From e7ae358fa965f42b444c970fc98f9ac1d6fa0e45 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 14:02:01 -0700 Subject: [PATCH 054/112] Add function to check battery percentage. --- files/dwm/battery.function | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 files/dwm/battery.function diff --git a/files/dwm/battery.function b/files/dwm/battery.function new file mode 100755 index 0000000..343bc1b --- /dev/null +++ b/files/dwm/battery.function @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +function battery { + upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep percentage | grep -o "[0-9.%]*" +} +alias show-battery="battery" +alias battery-display="battery" From 856290c33f5e460f810f46a81ba2cdb1cb070cdf Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 14:02:16 -0700 Subject: [PATCH 055/112] Add function to quickly check storage. --- files/dwm/storage.function | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 files/dwm/storage.function diff --git a/files/dwm/storage.function b/files/dwm/storage.function new file mode 100644 index 0000000..204a1d3 --- /dev/null +++ b/files/dwm/storage.function @@ -0,0 +1,30 @@ +#!/usr/bin/env bash + +function storage { + location="$1" + quiet="$2" + + if [[ -z $location ]]; then + echo "ERROR: Location must be passed. $location" + fi + + if [[ -n "$quiet" ]]; then + df -h $location | tail -n 1 | awk {print $5", "$3"/"$2""} + else + df -h $location | tail -n 1 | awk {print $5" Free, "$3"/"$2" Used"} + fi +} + +function storage-root { + storage / $1 +} +function storage-root-dwm { + storage-root q +} + +function storage-home { + storage /home $1 +} +function storage-home-dwm { + storage-root q +} From e42e3b4fcd089f7febcd120f444f2b5a38e03a6e Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 14:02:31 -0700 Subject: [PATCH 056/112] Change permissions. --- files/dwm/volume.function | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 files/dwm/volume.function diff --git a/files/dwm/volume.function b/files/dwm/volume.function old mode 100644 new mode 100755 From 428684b9b375ee3cb755bc788ca6744c76bbd872 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 14:03:03 -0700 Subject: [PATCH 057/112] Change permissions for storage too. --- files/dwm/storage.function | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 files/dwm/storage.function diff --git a/files/dwm/storage.function b/files/dwm/storage.function old mode 100644 new mode 100755 From 07cc51a5cc1f13a3154b5d1fc117a03b61ffce0b Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 14:20:39 -0700 Subject: [PATCH 058/112] Make the storage functions more versatile. --- files/dwm/storage.function | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/files/dwm/storage.function b/files/dwm/storage.function index 204a1d3..2220514 100755 --- a/files/dwm/storage.function +++ b/files/dwm/storage.function @@ -2,29 +2,33 @@ function storage { location="$1" - quiet="$2" + style="$2" if [[ -z $location ]]; then echo "ERROR: Location must be passed. $location" fi - if [[ -n "$quiet" ]]; then - df -h $location | tail -n 1 | awk {print $5", "$3"/"$2""} + if [[ "$style" == "%" || "$style" == "pct" || "$style" == "percent" ]]; then + df -h $location | tail -n 1 | awk {print $5} + elif [[ "$style" == "/" || "$style" == "use" || "$style" == "usage" ]] + df -h $location | tail -n 1 | awk {print $3"/"$2} else df -h $location | tail -n 1 | awk {print $5" Free, "$3"/"$2" Used"} fi } +export dwm_storage_style="usage" + function storage-root { - storage / $1 + storage / "$1" } function storage-root-dwm { - storage-root q + storage-root "$dwm_storage_style" } function storage-home { - storage /home $1 + storage /home "$1" } function storage-home-dwm { - storage-root q + storage-root "$dwm_storage_style" } From b48dbbeee1127b604dd831cd6f0a33346819ba38 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 14:41:38 -0700 Subject: [PATCH 059/112] Copy the new dwm function files into the global bin, usually `/usr/local/bin/`. --- tasks/workstation/shared/software/dwm.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tasks/workstation/shared/software/dwm.yml b/tasks/workstation/shared/software/dwm.yml index a93bc88..6d05050 100644 --- a/tasks/workstation/shared/software/dwm.yml +++ b/tasks/workstation/shared/software/dwm.yml @@ -78,3 +78,14 @@ owner: root group: "{{ root_group }}" mode: 0644 + + +## Helper Functions for Status Bar ## + +- name: Workstation | Linux | Software | DWM | Status Bar Functions + copy: + src: dwm/*.functions + dest: "{{ global_bin }}" + owner: root + group: "{{ root_group }}" + mode: 0644 From 6ccdb395cd1aeb83cb047c6a5e9f0144da586602 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 14:42:10 -0700 Subject: [PATCH 060/112] Add calls to the dwm helper functions in the portion which sets the status bar time. Add a sleep so that a CPU is not always busy. --- files/dwm/dwm.sh | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/files/dwm/dwm.sh b/files/dwm/dwm.sh index 31e9669..e261399 100644 --- a/files/dwm/dwm.sh +++ b/files/dwm/dwm.sh @@ -5,17 +5,17 @@ ## Load System Libs ## if [ -d /etc/X11/xinit/xinitrc.d ]; then - for f in /etc/X11/xinit/xinitrc.d/*; do - [ -x "$f" ] && . "$f" - done - unset f + for f in /etc/X11/xinit/xinitrc.d/*; do + [ -x "$f" ] && . "$f" + done + unset f fi if [ -d /usr/local/etc/X11/xinit/xinitrc.d ]; then - for f in /usr/local/etc/X11/xinit/xinitrc.d/*; do - [ -x "$f" ] && . "$f" - done - unset f + for f in /usr/local/etc/X11/xinit/xinitrc.d/*; do + [ -x "$f" ] && . "$f" + done + unset f fi @@ -35,8 +35,23 @@ xsetroot -solid "$purple" #exec slstatus & # Custom # +source `which volume.function` +source `which battery.function` +source `which storage.function` +if [[ "`storage-root`" == "`storage-home`" ]]; then + storage_cmd=echo 'Storage: `storage-root-dwm`)"' +else + storage_cmd=echo '"Storage(Root:`storage-root-dwm` Home:`storage-home-dwm`)' +fi while true; do - xsetroot -name "`whoami`@`hostname` `date +"%Y-%m-%d %H:%M:%S"`" + readout="$readout Battery: `battery-display`" + readout="$readout | `storage_cmd`" + readout="$readout | `volume-display`" + readout="$readout | `whoami`@`hostname`" + readout="$readout `date +"%Y-%m-%d %H:%M:%S"`" + xsetroot -name "$readout" + readout="" + sleep 0.75 done & From a0f7773998eed339df5ceda6db2201011296383c Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 14:42:26 -0700 Subject: [PATCH 061/112] Add author and date. --- files/dwm/battery.function | 1 + files/dwm/storage.function | 1 + 2 files changed, 2 insertions(+) diff --git a/files/dwm/battery.function b/files/dwm/battery.function index 343bc1b..62beb9a 100755 --- a/files/dwm/battery.function +++ b/files/dwm/battery.function @@ -1,4 +1,5 @@ #!/usr/bin/env bash +# 2025-11-10 Hyperling function battery { upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep percentage | grep -o "[0-9.%]*" diff --git a/files/dwm/storage.function b/files/dwm/storage.function index 2220514..43ea5f2 100755 --- a/files/dwm/storage.function +++ b/files/dwm/storage.function @@ -1,4 +1,5 @@ #!/usr/bin/env bash +# 2025-11-10 Hyperling function storage { location="$1" From 2770bbac5f65c4f9a8c7b9b18fe29e52ae7396ca Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 14:47:46 -0700 Subject: [PATCH 062/112] If the DWM helper functions are available, go ahead and source them for local usage. --- tasks/general/acct_mgmt/users.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index 2e09b85..c9d8dee 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -1018,6 +1018,16 @@ alias hugo-server-stage="hugo server --gc --noHTTPCache --disableFastRender" alias hugo-server-prod="hugo server --gc --minify" alias hugo-server="hugo-server-dev" + dwm_functions: | + if [[ -f "{{ global_bin }}/volume.function" ]]; then + source "{{ global_bin }}/volume.function" + fi + if [[ -f "{{ global_bin }}/battery.function" ]]; then + source "{{ global_bin }}/battery.function" + fi + if [[ -f "{{ global_bin }}/storage.function" ]]; then + source "{{ global_bin }}/storage.function" + fi - name: General | Account Management | Users | Files | Common Variable set_fact: @@ -1097,6 +1107,7 @@ {{ function_load_branch }} {{ alias_reload_bash }} {{ alias_hugo_server }} + {{ dwm_functions }} - name: General | Account Management | Users | Files | .bashrc blockinfile: From eae66f99675b20d64c8949a8f6a1ae083b870c91 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 14:57:00 -0700 Subject: [PATCH 063/112] Add back in direct volume assignment, may have been cut and not copied back in. Re-test to ensure all is working well. --- files/dwm/volume.function | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/files/dwm/volume.function b/files/dwm/volume.function index 39664c5..325ba47 100755 --- a/files/dwm/volume.function +++ b/files/dwm/volume.function @@ -49,7 +49,7 @@ function volume { fi dir="" - typeset -i amt + amt="" # Check if format is written text. if [[ "$1" == "full" || "$1" == "max" ]]; then @@ -89,11 +89,15 @@ function volume { fi if [[ -n "$dir" && -z "$amt" ]]; then amt="$1" + amt=${amt//-/} + amt=${amt//+/} fi fi - amt=${amt//-/} - amt=${amt//+/} + # Check if format is direct volume. + if [[ -z "$dir" && -z "$amt" && -n "$1" && -z "$2" ]]; then + amt="$1" + fi if [[ -n "$dir" && -n "$amt" ]]; then echo "> Changing volume by '$dir$amt%'." From 8970bb3a1bda298547ac4a7e10d761279571c99f Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 14:58:21 -0700 Subject: [PATCH 064/112] Add quotes in case path has spaces, which it shouldn't, but it's good practice to protect it anyways. --- files/dwm/dwm.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/files/dwm/dwm.sh b/files/dwm/dwm.sh index e261399..a4be275 100644 --- a/files/dwm/dwm.sh +++ b/files/dwm/dwm.sh @@ -35,9 +35,9 @@ xsetroot -solid "$purple" #exec slstatus & # Custom # -source `which volume.function` -source `which battery.function` -source `which storage.function` +source "`which volume.function`" +source "`which battery.function`" +source "`which storage.function`" if [[ "`storage-root`" == "`storage-home`" ]]; then storage_cmd=echo 'Storage: `storage-root-dwm`)"' else From 46d1bfb70e741b286ebba6a645dba23cb342dfe0 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 15:05:42 -0700 Subject: [PATCH 065/112] Still thinking of rewording line 2. Modify spacing. --- tasks/workstation/shared/software/dwm.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tasks/workstation/shared/software/dwm.yml b/tasks/workstation/shared/software/dwm.yml index 6d05050..fa9f0c7 100644 --- a/tasks/workstation/shared/software/dwm.yml +++ b/tasks/workstation/shared/software/dwm.yml @@ -84,8 +84,10 @@ - name: Workstation | Linux | Software | DWM | Status Bar Functions copy: - src: dwm/*.functions + src: "{{ item }}" dest: "{{ global_bin }}" owner: root group: "{{ root_group }}" mode: 0644 + with_fileglob: + - "dwm/*.function" From 68eb84af52916638d3b1af605ffa58343adb39ab Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 15:07:45 -0700 Subject: [PATCH 066/112] Fix missing then. --- files/dwm/storage.function | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/dwm/storage.function b/files/dwm/storage.function index 43ea5f2..7cb0a94 100755 --- a/files/dwm/storage.function +++ b/files/dwm/storage.function @@ -11,7 +11,7 @@ function storage { if [[ "$style" == "%" || "$style" == "pct" || "$style" == "percent" ]]; then df -h $location | tail -n 1 | awk {print $5} - elif [[ "$style" == "/" || "$style" == "use" || "$style" == "usage" ]] + elif [[ "$style" == "/" || "$style" == "use" || "$style" == "usage" ]]; then df -h $location | tail -n 1 | awk {print $3"/"$2} else df -h $location | tail -n 1 | awk {print $5" Free, "$3"/"$2" Used"} From d1cd9dddf1c925c8e2871f9b6f0559ea2f8595e4 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 15:08:26 -0700 Subject: [PATCH 067/112] Add quotes around location variable. --- files/dwm/storage.function | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/files/dwm/storage.function b/files/dwm/storage.function index 7cb0a94..f202843 100755 --- a/files/dwm/storage.function +++ b/files/dwm/storage.function @@ -5,16 +5,16 @@ function storage { location="$1" style="$2" - if [[ -z $location ]]; then + if [[ -z "$location" ]]; then echo "ERROR: Location must be passed. $location" fi if [[ "$style" == "%" || "$style" == "pct" || "$style" == "percent" ]]; then - df -h $location | tail -n 1 | awk {print $5} + df -h "$location" | tail -n 1 | awk {print $5} elif [[ "$style" == "/" || "$style" == "use" || "$style" == "usage" ]]; then - df -h $location | tail -n 1 | awk {print $3"/"$2} + df -h "$location" | tail -n 1 | awk {print $3"/"$2} else - df -h $location | tail -n 1 | awk {print $5" Free, "$3"/"$2" Used"} + df -h "$location" | tail -n 1 | awk {print $5" Free, "$3"/"$2" Used"} fi } From 407bdb2ddf5016e0ae8e311b30693ab491be938e Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 15:09:37 -0700 Subject: [PATCH 068/112] Add single quotes around awk parameters. --- files/dwm/storage.function | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/files/dwm/storage.function b/files/dwm/storage.function index f202843..fc1eddd 100755 --- a/files/dwm/storage.function +++ b/files/dwm/storage.function @@ -10,11 +10,11 @@ function storage { fi if [[ "$style" == "%" || "$style" == "pct" || "$style" == "percent" ]]; then - df -h "$location" | tail -n 1 | awk {print $5} + df -h "$location" | tail -n 1 | awk '{print $5}' elif [[ "$style" == "/" || "$style" == "use" || "$style" == "usage" ]]; then - df -h "$location" | tail -n 1 | awk {print $3"/"$2} + df -h "$location" | tail -n 1 | awk '{print $3"/"$2}' else - df -h "$location" | tail -n 1 | awk {print $5" Free, "$3"/"$2" Used"} + df -h "$location" | tail -n 1 | awk '{print $5" Free, "$3"/"$2" Used"}' fi } From f562c8aecdc178aeaca5840e4508466a515acbb1 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 16:46:00 -0700 Subject: [PATCH 069/112] Create function files as executable. --- tasks/workstation/shared/software/dwm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/workstation/shared/software/dwm.yml b/tasks/workstation/shared/software/dwm.yml index fa9f0c7..c015a83 100644 --- a/tasks/workstation/shared/software/dwm.yml +++ b/tasks/workstation/shared/software/dwm.yml @@ -88,6 +88,6 @@ dest: "{{ global_bin }}" owner: root group: "{{ root_group }}" - mode: 0644 + mode: 0755 with_fileglob: - "dwm/*.function" From 5c3d5dd41e942f4c72f3b4605dd6d78bbf26154d Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 16:56:14 -0700 Subject: [PATCH 070/112] Change the function name to be more consistent with other files. --- files/dwm/battery.function | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/files/dwm/battery.function b/files/dwm/battery.function index 62beb9a..5914117 100755 --- a/files/dwm/battery.function +++ b/files/dwm/battery.function @@ -1,8 +1,8 @@ #!/usr/bin/env bash # 2025-11-10 Hyperling -function battery { +function battery-display { upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep percentage | grep -o "[0-9.%]*" } -alias show-battery="battery" -alias battery-display="battery" +alias show-battery="battery-display" +alias battery="battery-display" From dff1560f6f677ce932a9437592c591af6b688c11 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 16:56:50 -0700 Subject: [PATCH 071/112] Properly call the storage commands, using more functions! --- files/dwm/dwm.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/files/dwm/dwm.sh b/files/dwm/dwm.sh index a4be275..75fad2b 100644 --- a/files/dwm/dwm.sh +++ b/files/dwm/dwm.sh @@ -39,20 +39,24 @@ source "`which volume.function`" source "`which battery.function`" source "`which storage.function`" if [[ "`storage-root`" == "`storage-home`" ]]; then - storage_cmd=echo 'Storage: `storage-root-dwm`)"' + function dwm-storage { + echo "`storage-root-dwm`)" + } else - storage_cmd=echo '"Storage(Root:`storage-root-dwm` Home:`storage-home-dwm`)' + function dwm-storage { + echo "(Root#`storage-root-dwm`, Home#`storage-home-dwm`)" + } fi while true; do readout="$readout Battery: `battery-display`" - readout="$readout | `storage_cmd`" - readout="$readout | `volume-display`" + readout="$readout | Storage: `dwm-storage`" + readout="$readout | Volume: `volume-display`" readout="$readout | `whoami`@`hostname`" readout="$readout `date +"%Y-%m-%d %H:%M:%S"`" xsetroot -name "$readout" readout="" sleep 0.75 -done & +done ## Start ## From 50d3104f9f78de88749660b3ab7a650dfe9426c4 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 17:01:58 -0700 Subject: [PATCH 072/112] Rename the function to be more consistent and add a sane default check. --- files/dwm/storage.function | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/files/dwm/storage.function b/files/dwm/storage.function index fc1eddd..64fc85d 100755 --- a/files/dwm/storage.function +++ b/files/dwm/storage.function @@ -1,7 +1,7 @@ #!/usr/bin/env bash # 2025-11-10 Hyperling -function storage { +function storage-display { location="$1" style="$2" @@ -17,6 +17,7 @@ function storage { df -h "$location" | tail -n 1 | awk '{print $5" Free, "$3"/"$2" Used"}' fi } +alias storage='echo -n "Root: " && storage-display "/" && echo -n "Home: " && storage-display "/home"' export dwm_storage_style="usage" From ee7aa402aa753633401c861771669b55a8c9cf87 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 17:18:24 -0700 Subject: [PATCH 073/112] More testing and fixes for volume functions. --- files/dwm/volume.function | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/files/dwm/volume.function b/files/dwm/volume.function index 325ba47..db8c457 100755 --- a/files/dwm/volume.function +++ b/files/dwm/volume.function @@ -29,19 +29,21 @@ function volume-usage { volume-usage, volume-help volume help, volume --help, volume -h EOF - return "$1" + return $1 } alias volume-help="volume-usage" alias vol-h="volume-help" function volume { if [[ "$1" == "--help" || "$1" == "help" || "$1" == "-h" ]]; then - volume-usage + volume-usage 1 + return 1 fi if [[ (-z "$1" && -z "$2") || "$1" == "--display" || "$1" == "display" || "$1" == "-d" || "$1" == "+d" ]]; then volume-display + return 0 fi if [[ "$1" == *"%"* || "$2" == *"%"* ]]; then @@ -99,6 +101,13 @@ function volume { amt="$1" fi + regex='^[0-9]+$' + if ! [[ $amt =~ $regex ]]; then + echo "> ERROR: Amount '$amt' does not seem like a integer." + volume-usage 2 + return 2 + fi + if [[ -n "$dir" && -n "$amt" ]]; then echo "> Changing volume by '$dir$amt%'." amixer -q sset Master ${amt}%${dir} @@ -130,6 +139,8 @@ function volume-display { } alias "vol-d"="volume-display" +## TBD/TODO ## + # Go up and down until cancelled. #function volume-trip { # curr eq amixer current readout From 6607438f85f4ae07e2345f852655734ec6aa3cf0 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 17:21:09 -0700 Subject: [PATCH 074/112] Add comments and error consistency. --- files/dwm/volume.function | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/files/dwm/volume.function b/files/dwm/volume.function index db8c457..6807ff0 100755 --- a/files/dwm/volume.function +++ b/files/dwm/volume.function @@ -35,6 +35,9 @@ alias volume-help="volume-usage" alias vol-h="volume-help" function volume { + + ## Check Params ## + if [[ "$1" == "--help" || "$1" == "help" || "$1" == "-h" ]]; then volume-usage 1 return 1 @@ -46,13 +49,16 @@ function volume { return 0 fi - if [[ "$1" == *"%"* || "$2" == *"%"* ]]; then - set -- "${1//%/}" "${2//%/}" - fi + ## Parse Params ## dir="" amt="" + # Remove percent signs. + if [[ "$1" == *"%"* || "$2" == *"%"* ]]; then + set -- "${1//%/}" "${2//%/}" + fi + # Check if format is written text. if [[ "$1" == "full" || "$1" == "max" ]]; then amt=100 @@ -101,6 +107,7 @@ function volume { amt="$1" fi + ## Error Checking ## regex='^[0-9]+$' if ! [[ $amt =~ $regex ]]; then echo "> ERROR: Amount '$amt' does not seem like a integer." @@ -108,6 +115,8 @@ function volume { return 2 fi + ## Main ## + if [[ -n "$dir" && -n "$amt" ]]; then echo "> Changing volume by '$dir$amt%'." amixer -q sset Master ${amt}%${dir} @@ -122,7 +131,7 @@ function volume { return 0 fi - echo "Error: Should not have made it here. Please report this to the developer." + echo "> ERROR: Should not have made it here. Please report this to the developer." echo "$0 $1 $2" return 7 } From b734f16af146170c8c37542777a491e3abb21fdf Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 17:23:10 -0700 Subject: [PATCH 075/112] Fix function rename in lower calls. --- files/dwm/storage.function | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/dwm/storage.function b/files/dwm/storage.function index 64fc85d..9a5c5c5 100755 --- a/files/dwm/storage.function +++ b/files/dwm/storage.function @@ -22,14 +22,14 @@ alias storage='echo -n "Root: " && storage-display "/" && echo -n "Home: " && st export dwm_storage_style="usage" function storage-root { - storage / "$1" + storage-display / "$1" } function storage-root-dwm { storage-root "$dwm_storage_style" } function storage-home { - storage /home "$1" + storage-display /home "$1" } function storage-home-dwm { storage-root "$dwm_storage_style" From baa52bdca6a59501ff771226500891d0a8032f93 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 17:24:05 -0700 Subject: [PATCH 076/112] Add more aliases for battery function. --- files/dwm/battery.function | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/files/dwm/battery.function b/files/dwm/battery.function index 5914117..5154e18 100755 --- a/files/dwm/battery.function +++ b/files/dwm/battery.function @@ -6,3 +6,7 @@ function battery-display { } alias show-battery="battery-display" alias battery="battery-display" +alias battery-use="battery-display" +alias battery-usage="battery-display" +alias battery-level="battery-display" +alias battery-levels="battery-display" From 5bee3a30f9f0aeb2c80fd4a0bc7ab14d1dcc1e38 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 17:25:06 -0700 Subject: [PATCH 077/112] Add back the `&` which went missing while playing with `test.sh`. --- files/dwm/dwm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/dwm/dwm.sh b/files/dwm/dwm.sh index 75fad2b..d84f317 100644 --- a/files/dwm/dwm.sh +++ b/files/dwm/dwm.sh @@ -56,7 +56,7 @@ while true; do xsetroot -name "$readout" readout="" sleep 0.75 -done +done & ## Start ## From af49b5dc86087c40968712bbcce12d3a159a1e80 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 17:33:54 -0700 Subject: [PATCH 078/112] Change status bar words to icons. --- files/dwm/dwm.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/files/dwm/dwm.sh b/files/dwm/dwm.sh index d84f317..03b330c 100644 --- a/files/dwm/dwm.sh +++ b/files/dwm/dwm.sh @@ -34,7 +34,8 @@ xsetroot -solid "$purple" # slstatus, from Suckless # #exec slstatus & -# Custom # +# Custom Setup # +# Icons: https://fontawesome.com/v4/cheatsheet/ source "`which volume.function`" source "`which battery.function`" source "`which storage.function`" @@ -44,18 +45,18 @@ if [[ "`storage-root`" == "`storage-home`" ]]; then } else function dwm-storage { - echo "(Root#`storage-root-dwm`, Home#`storage-home-dwm`)" + echo "(Root `storage-root-dwm`, Home `storage-home-dwm`)" } fi while true; do - readout="$readout Battery: `battery-display`" - readout="$readout | Storage: `dwm-storage`" - readout="$readout | Volume: `volume-display`" + readout="$readout : `battery-display`" + readout="$readout | : `dwm-storage`" + readout="$readout | : `volume-display`" readout="$readout | `whoami`@`hostname`" readout="$readout `date +"%Y-%m-%d %H:%M:%S"`" xsetroot -name "$readout" readout="" - sleep 0.75 + sleep 0.2 done & From f32074a387d02d320d2107ff7d6e98cd310ea515 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 17:40:24 -0700 Subject: [PATCH 079/112] Fix dwm home call to use home not root. --- files/dwm/storage.function | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/dwm/storage.function b/files/dwm/storage.function index 9a5c5c5..7809023 100755 --- a/files/dwm/storage.function +++ b/files/dwm/storage.function @@ -32,5 +32,5 @@ function storage-home { storage-display /home "$1" } function storage-home-dwm { - storage-root "$dwm_storage_style" + storage-home "$dwm_storage_style" } From 4b73dc336c34b213b7c7b859dd740903b84daaa7 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 17:45:10 -0700 Subject: [PATCH 080/112] Remove colons after icons, did not look good. --- files/dwm/dwm.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/files/dwm/dwm.sh b/files/dwm/dwm.sh index 03b330c..df17cb0 100644 --- a/files/dwm/dwm.sh +++ b/files/dwm/dwm.sh @@ -49,9 +49,9 @@ else } fi while true; do - readout="$readout : `battery-display`" - readout="$readout | : `dwm-storage`" - readout="$readout | : `volume-display`" + readout="$readout  `battery-display`" + readout="$readout |  `dwm-storage`" + readout="$readout |  `volume-display`" readout="$readout | `whoami`@`hostname`" readout="$readout `date +"%Y-%m-%d %H:%M:%S"`" xsetroot -name "$readout" From ce67c2a5b869ffb4d025b9fa5d5ce5305f3a4bd9 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 21:07:39 -0700 Subject: [PATCH 081/112] Correct the free and used wording. --- files/dwm/storage.function | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/files/dwm/storage.function b/files/dwm/storage.function index 7809023..774c736 100755 --- a/files/dwm/storage.function +++ b/files/dwm/storage.function @@ -10,11 +10,11 @@ function storage-display { fi if [[ "$style" == "%" || "$style" == "pct" || "$style" == "percent" ]]; then - df -h "$location" | tail -n 1 | awk '{print $5}' + df -h "$location" | tail -n 1 | awk '{print $5" Used"}' elif [[ "$style" == "/" || "$style" == "use" || "$style" == "usage" ]]; then - df -h "$location" | tail -n 1 | awk '{print $3"/"$2}' + df -h "$location" | tail -n 1 | awk '{print $4"/"$2" Free"}' else - df -h "$location" | tail -n 1 | awk '{print $5" Free, "$3"/"$2" Used"}' + df -h "$location" | tail -n 1 | awk '{print $5" Used, "$4"/"$2" Free"}' fi } alias storage='echo -n "Root: " && storage-display "/" && echo -n "Home: " && storage-display "/home"' From b0762c7baf06f84cf5cf650acf4d93a47c94bda9 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 21:11:10 -0700 Subject: [PATCH 082/112] Move the status generation to its own file and give it a testing mode. Greatly enhance the logic and reduce the amount of times each variable gets updated. --- files/dwm/dwm-status.function | 64 +++++++++++++++++++++++++++++++++++ files/dwm/dwm.sh | 25 ++------------ 2 files changed, 66 insertions(+), 23 deletions(-) create mode 100755 files/dwm/dwm-status.function diff --git a/files/dwm/dwm-status.function b/files/dwm/dwm-status.function new file mode 100755 index 0000000..f42087a --- /dev/null +++ b/files/dwm/dwm-status.function @@ -0,0 +1,64 @@ +#!/usr/bin/env bash +# 2025-11-10 Hyperling +# Icons: https://fontawesome.com/v4/cheatsheet/ + +source "`which volume.function`" +source "`which battery.function`" +source "`which storage.function`" + +function datetime { + date +"%Y-%m-%d %H:%M:%S" +} +function dwm-status { + cmd="xsetroot -name " + if [[ $1 == "-t" || $1 == "--test" || $1 == "test" ]]; then + cmd="echo" + fi + + if [[ "`storage-root`" == "`storage-home`" ]]; then + function dwm-status-storage { + echo "`storage-root-dwm`)" + } + else + function dwm-status-storage { + echo "(Root `storage-root-dwm`, Home `storage-home-dwm`)" + } + fi + battery=""; storage=""; volume=""; datetime=""; + while true; do + # Reset Variables + if [[ $datetime == *"00" ]]; then + unset battery + unset storage + fi + if [[ $datetime != "`datetime`" ]]; then + unset volume + unset datetime + fi + + # Set Variables + if [[ -z $battery ]]; then + battery="`battery-display`" + fi + if [[ -z $storage ]]; then + storage="`dwm-status-storage`" + fi + if [[ -z $volume ]]; then + volume="`volume-display`" + fi + if [[ -z $datetime ]]; then + datetime="`datetime`" + fi + + # Display Variables + readout="$readout  $battery" + readout="$readout |  $storage" + readout="$readout |  $volume" + readout="$readout | `whoami`@`hostname`" + readout="$readout $datetime" + $cmd "$readout" + readout="" + sleep 0.2 + done +} +alias status="dwm-status --test" diff --git a/files/dwm/dwm.sh b/files/dwm/dwm.sh index df17cb0..352bf77 100644 --- a/files/dwm/dwm.sh +++ b/files/dwm/dwm.sh @@ -35,29 +35,8 @@ xsetroot -solid "$purple" #exec slstatus & # Custom Setup # -# Icons: https://fontawesome.com/v4/cheatsheet/ -source "`which volume.function`" -source "`which battery.function`" -source "`which storage.function`" -if [[ "`storage-root`" == "`storage-home`" ]]; then - function dwm-storage { - echo "`storage-root-dwm`)" - } -else - function dwm-storage { - echo "(Root `storage-root-dwm`, Home `storage-home-dwm`)" - } -fi -while true; do - readout="$readout  `battery-display`" - readout="$readout |  `dwm-storage`" - readout="$readout |  `volume-display`" - readout="$readout | `whoami`@`hostname`" - readout="$readout `date +"%Y-%m-%d %H:%M:%S"`" - xsetroot -name "$readout" - readout="" - sleep 0.2 -done & +source "`which dwm-status.function`" +dwm-status & ## Start ## From e6947d4a303f0aa9f59eafa0bb8b24a181b461c6 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 21:12:53 -0700 Subject: [PATCH 083/112] Only show the int value of the battery percentage by default, rather than including the decimals. --- files/dwm/battery.function | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/files/dwm/battery.function b/files/dwm/battery.function index 5154e18..c74e298 100755 --- a/files/dwm/battery.function +++ b/files/dwm/battery.function @@ -2,7 +2,17 @@ # 2025-11-10 Hyperling function battery-display { - upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep percentage | grep -o "[0-9.%]*" + detailed="N" + if [[ -n $1 ]]; then + detailed="Y" + fi + + if [[ "$detailed" == "Y" ]]; then + upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep percentage | grep -o "[0-9.%]*" + else + int="`upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep percentage | grep -o "[0-9]*" | head -n 1`" + echo "${int}%" + fi } alias show-battery="battery-display" alias battery="battery-display" From dde5b35beff5d9e4d261dc3ba22a55705528d723 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 21:19:16 -0700 Subject: [PATCH 084/112] Ensure all function files get sourced rather than hardcoding them. --- tasks/general/acct_mgmt/users.yml | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index c9d8dee..4741f9f 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -1018,16 +1018,10 @@ alias hugo-server-stage="hugo server --gc --noHTTPCache --disableFastRender" alias hugo-server-prod="hugo server --gc --minify" alias hugo-server="hugo-server-dev" - dwm_functions: | - if [[ -f "{{ global_bin }}/volume.function" ]]; then - source "{{ global_bin }}/volume.function" - fi - if [[ -f "{{ global_bin }}/battery.function" ]]; then - source "{{ global_bin }}/battery.function" - fi - if [[ -f "{{ global_bin }}/storage.function" ]]; then - source "{{ global_bin }}/storage.function" - fi + global_functions: | + ls "{{ global_bin }}/"*".function" | while read global_function; do + source "$global_function" + done - name: General | Account Management | Users | Files | Common Variable set_fact: @@ -1107,7 +1101,7 @@ {{ function_load_branch }} {{ alias_reload_bash }} {{ alias_hugo_server }} - {{ dwm_functions }} + {{ global_functions }} - name: General | Account Management | Users | Files | .bashrc blockinfile: From 72ce1e2ab5fbe2e058506f50023e17d5d716b1f8 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 21:19:36 -0700 Subject: [PATCH 085/112] Prevent additional call in dwm-status. --- files/dwm/dwm-status.function | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/files/dwm/dwm-status.function b/files/dwm/dwm-status.function index f42087a..676c2ae 100755 --- a/files/dwm/dwm-status.function +++ b/files/dwm/dwm-status.function @@ -25,6 +25,7 @@ function dwm-status { } fi battery=""; storage=""; volume=""; datetime=""; + userhost="`whoami`@`hostname`" while true; do # Reset Variables if [[ $datetime == *"00" ]]; then @@ -54,7 +55,7 @@ function dwm-status { readout="$readout  $battery" readout="$readout |  $storage" readout="$readout |  $volume" - readout="$readout | `whoami`@`hostname`" + readout="$readout |  $userhost" readout="$readout $datetime" $cmd "$readout" readout="" From a4378c2bb30752440922e94e70e2e12bf739e1fd Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 21:25:14 -0700 Subject: [PATCH 086/112] Use for loop and `.` to keep functions in current shell. --- tasks/general/acct_mgmt/users.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index 4741f9f..4d69484 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -1019,8 +1019,10 @@ alias hugo-server-prod="hugo server --gc --minify" alias hugo-server="hugo-server-dev" global_functions: | - ls "{{ global_bin }}/"*".function" | while read global_function; do - source "$global_function" + for global_function in "{{ global_bin }}/"*".function"; do + if [[ -f "$global_function" ]]; then + . "$global_function" + fi done - name: General | Account Management | Users | Files | Common Variable From 4584a1a4c38edab33cfcf36391dfb6aeab12f65f Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 21:29:01 -0700 Subject: [PATCH 087/112] Add clock icon. --- files/dwm/dwm-status.function | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/dwm/dwm-status.function b/files/dwm/dwm-status.function index 676c2ae..cd44319 100755 --- a/files/dwm/dwm-status.function +++ b/files/dwm/dwm-status.function @@ -56,7 +56,7 @@ function dwm-status { readout="$readout |  $storage" readout="$readout |  $volume" readout="$readout |  $userhost" - readout="$readout $datetime" + readout="$readout |  $datetime" $cmd "$readout" readout="" sleep 0.2 From 91c0a412bfe04adaa869eb325326ae2de61e1534 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 21:29:46 -0700 Subject: [PATCH 088/112] Change storage output to be shorter. --- files/dwm/storage.function | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/files/dwm/storage.function b/files/dwm/storage.function index 774c736..b06e56c 100755 --- a/files/dwm/storage.function +++ b/files/dwm/storage.function @@ -13,13 +13,15 @@ function storage-display { df -h "$location" | tail -n 1 | awk '{print $5" Used"}' elif [[ "$style" == "/" || "$style" == "use" || "$style" == "usage" ]]; then df -h "$location" | tail -n 1 | awk '{print $4"/"$2" Free"}' + elif [[ "$style" == "G" || "$style" == "S" || "$style" == "F" ]]; then + df -h "$location" | tail -n 1 | awk '{print $4" Free"}' else df -h "$location" | tail -n 1 | awk '{print $5" Used, "$4"/"$2" Free"}' fi } -alias storage='echo -n "Root: " && storage-display "/" && echo -n "Home: " && storage-display "/home"' +alias storage='echo -n "Root: " && storage-display "/" "F" && echo -n "Home: " && storage-display "/home" "F"' -export dwm_storage_style="usage" +export dwm_storage_style="F" function storage-root { storage-display / "$1" From 683e03eab2f7032748f3863f6932d793e282335c Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 21:37:25 -0700 Subject: [PATCH 089/112] Move function files to their own folder. Move the copy to General from Workstation. Leave dwm-status function under Workstation. --- files/{dwm => functions}/battery.function | 0 files/{dwm => functions}/storage.function | 0 files/{dwm => functions}/volume.function | 0 tasks/general/acct_mgmt/users.yml | 10 ++++++++++ tasks/workstation/shared/software/dwm.yml | 4 ++-- 5 files changed, 12 insertions(+), 2 deletions(-) rename files/{dwm => functions}/battery.function (100%) rename files/{dwm => functions}/storage.function (100%) rename files/{dwm => functions}/volume.function (100%) diff --git a/files/dwm/battery.function b/files/functions/battery.function similarity index 100% rename from files/dwm/battery.function rename to files/functions/battery.function diff --git a/files/dwm/storage.function b/files/functions/storage.function similarity index 100% rename from files/dwm/storage.function rename to files/functions/storage.function diff --git a/files/dwm/volume.function b/files/functions/volume.function similarity index 100% rename from files/dwm/volume.function rename to files/functions/volume.function diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index 4d69484..0568c7b 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -1173,3 +1173,13 @@ - .bashrc - .zshrc - .vimrc + +- name: General | Account Management | Users | Files | Helper Functions + copy: + src: "{{ item }}" + dest: "{{ global_bin }}" + owner: root + group: "{{ root_group }}" + mode: 0755 + with_fileglob: + - "functions/*.function" diff --git a/tasks/workstation/shared/software/dwm.yml b/tasks/workstation/shared/software/dwm.yml index c015a83..1e5d77d 100644 --- a/tasks/workstation/shared/software/dwm.yml +++ b/tasks/workstation/shared/software/dwm.yml @@ -80,9 +80,9 @@ mode: 0644 -## Helper Functions for Status Bar ## +## Status Bar ## -- name: Workstation | Linux | Software | DWM | Status Bar Functions +- name: Workstation | Linux | Software | DWM | Status Bar Function copy: src: "{{ item }}" dest: "{{ global_bin }}" From 7af798a7c0b7afd8be68ac705e0c8defb3b65094 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 21:37:47 -0700 Subject: [PATCH 090/112] Add placeholder functions for later functionality. --- files/functions/cpu.function | 3 +++ files/functions/memory.function | 3 +++ files/functions/swap.function | 3 +++ files/functions/vpn.function | 3 +++ files/functions/wifi.function | 3 +++ 5 files changed, 15 insertions(+) create mode 100644 files/functions/cpu.function create mode 100644 files/functions/memory.function create mode 100644 files/functions/swap.function create mode 100644 files/functions/vpn.function create mode 100644 files/functions/wifi.function diff --git a/files/functions/cpu.function b/files/functions/cpu.function new file mode 100644 index 0000000..c333f30 --- /dev/null +++ b/files/functions/cpu.function @@ -0,0 +1,3 @@ +#/usr/local/bin env + +# TBD/TODO diff --git a/files/functions/memory.function b/files/functions/memory.function new file mode 100644 index 0000000..c333f30 --- /dev/null +++ b/files/functions/memory.function @@ -0,0 +1,3 @@ +#/usr/local/bin env + +# TBD/TODO diff --git a/files/functions/swap.function b/files/functions/swap.function new file mode 100644 index 0000000..c333f30 --- /dev/null +++ b/files/functions/swap.function @@ -0,0 +1,3 @@ +#/usr/local/bin env + +# TBD/TODO diff --git a/files/functions/vpn.function b/files/functions/vpn.function new file mode 100644 index 0000000..c333f30 --- /dev/null +++ b/files/functions/vpn.function @@ -0,0 +1,3 @@ +#/usr/local/bin env + +# TBD/TODO diff --git a/files/functions/wifi.function b/files/functions/wifi.function new file mode 100644 index 0000000..c333f30 --- /dev/null +++ b/files/functions/wifi.function @@ -0,0 +1,3 @@ +#/usr/local/bin env + +# TBD/TODO From 692df74d419a84b0659083736a133e2c25305857 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 21:57:20 -0700 Subject: [PATCH 091/112] Add reset of function files in case of renames. --- tasks/general/acct_mgmt/users.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index 0568c7b..785545b 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -1174,6 +1174,10 @@ - .zshrc - .vimrc + +- name: General | Account Management | Users | Files | Helper Functions (Reset) + shell: "rm -v {{ global_bin }}/*.function" + - name: General | Account Management | Users | Files | Helper Functions copy: src: "{{ item }}" From 5274d6d94da7cc2e0f81d76834e5f56812ad62be Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 21:57:59 -0700 Subject: [PATCH 092/112] Move status to be a normal function so it's available on non-workstations. --- files/functions/status.function | 82 +++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100755 files/functions/status.function diff --git a/files/functions/status.function b/files/functions/status.function new file mode 100755 index 0000000..b1790ed --- /dev/null +++ b/files/functions/status.function @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +# 2025-11-10 Hyperling +# Icons: https://fontawesome.com/v4/cheatsheet/ + +source "`which volume.function`" +source "`which battery.function`" +source "`which storage.function`" + +function datetime { + date +"%Y-%m-%d %H:%M:%S" +} +function status-display { + # Defaults + cmd="echo" + sleep=0.2 + if [[ "`storage-root`" == "`storage-home`" ]]; then + function status-display-storage { + echo "`storage-root`" + } + else + function status-display-storage { + echo "Root (`storage-root`), Home (`storage-home`)" + } + fi + + # Test Config + if [[ $1 == "-t" || $1 == "--test" || $1 == "test" ]]; then + sleep=5 + fi + + # DWM Config + if [[ $1 == "-d" || $1 == "--dwm" || $1 == "dwm" ]]; then + cmd="xsetroot -name" + if [[ "`storage-root`" == "`storage-home`" ]]; then + function status-display-storage { + echo "`storage-root-dwm`)" + } + else + function status-display-storage { + echo "(Root `storage-root-dwm`, Home `storage-home-dwm`)" + } + fi + fi + battery=""; storage=""; volume=""; datetime=""; + userhost="`whoami`@`hostname`" + while true; do + # Reset Variables + if [[ $datetime == *"00" ]]; then + unset battery + unset storage + fi + if [[ $datetime != "`datetime`" ]]; then + unset volume + unset datetime + fi + + # Set Variables + if [[ -z $battery ]]; then + battery="`battery-display`" + fi + if [[ -z $storage ]]; then + storage="`status-display-storage`" + fi + if [[ -z $volume ]]; then + volume="`volume-display`" + fi + if [[ -z $datetime ]]; then + datetime="`datetime`" + fi + + # Display Variables + readout="$readout  $battery" + readout="$readout |  $storage" + readout="$readout |  $volume" + readout="$readout |  $userhost" + readout="$readout |  $datetime" + $cmd "$readout" + readout="" + sleep $sleep + done +} +alias status="status-display --test" From 88b602f8f4b4d6ee76321dbe49d2da511b15379d Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 21:58:13 -0700 Subject: [PATCH 093/112] Have DWM status call status with a parameter. --- files/dwm/dwm-status.function | 60 ++--------------------------------- 1 file changed, 2 insertions(+), 58 deletions(-) diff --git a/files/dwm/dwm-status.function b/files/dwm/dwm-status.function index cd44319..7eeee70 100755 --- a/files/dwm/dwm-status.function +++ b/files/dwm/dwm-status.function @@ -2,64 +2,8 @@ # 2025-11-10 Hyperling # Icons: https://fontawesome.com/v4/cheatsheet/ -source "`which volume.function`" -source "`which battery.function`" -source "`which storage.function`" +source "`which status.function`" -function datetime { - date +"%Y-%m-%d %H:%M:%S" -} function dwm-status { - cmd="xsetroot -name " - if [[ $1 == "-t" || $1 == "--test" || $1 == "test" ]]; then - cmd="echo" - fi - - if [[ "`storage-root`" == "`storage-home`" ]]; then - function dwm-status-storage { - echo "`storage-root-dwm`)" - } - else - function dwm-status-storage { - echo "(Root `storage-root-dwm`, Home `storage-home-dwm`)" - } - fi - battery=""; storage=""; volume=""; datetime=""; - userhost="`whoami`@`hostname`" - while true; do - # Reset Variables - if [[ $datetime == *"00" ]]; then - unset battery - unset storage - fi - if [[ $datetime != "`datetime`" ]]; then - unset volume - unset datetime - fi - - # Set Variables - if [[ -z $battery ]]; then - battery="`battery-display`" - fi - if [[ -z $storage ]]; then - storage="`dwm-status-storage`" - fi - if [[ -z $volume ]]; then - volume="`volume-display`" - fi - if [[ -z $datetime ]]; then - datetime="`datetime`" - fi - - # Display Variables - readout="$readout  $battery" - readout="$readout |  $storage" - readout="$readout |  $volume" - readout="$readout |  $userhost" - readout="$readout |  $datetime" - $cmd "$readout" - readout="" - sleep 0.2 - done + status-display --dwm } -alias status="dwm-status --test" From 477797e045111ff6e6e27203d6d290cf1acccf66 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 10 Nov 2025 21:58:30 -0700 Subject: [PATCH 094/112] Change default non-DWM formatting. --- files/functions/storage.function | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/functions/storage.function b/files/functions/storage.function index b06e56c..62c8d72 100755 --- a/files/functions/storage.function +++ b/files/functions/storage.function @@ -16,7 +16,7 @@ function storage-display { elif [[ "$style" == "G" || "$style" == "S" || "$style" == "F" ]]; then df -h "$location" | tail -n 1 | awk '{print $4" Free"}' else - df -h "$location" | tail -n 1 | awk '{print $5" Used, "$4"/"$2" Free"}' + df -h "$location" | tail -n 1 | awk '{print $5" Used - "$4"/"$2" Free"}' fi } alias storage='echo -n "Root: " && storage-display "/" "F" && echo -n "Home: " && storage-display "/home" "F"' From 8a4446f7e332d1737fee00d2dc9dbbd9c7d5f0e1 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 11 Nov 2025 20:11:15 -0700 Subject: [PATCH 095/112] Add TBD. --- files/functions/status.function | 3 +++ 1 file changed, 3 insertions(+) diff --git a/files/functions/status.function b/files/functions/status.function index b1790ed..27d90a6 100755 --- a/files/functions/status.function +++ b/files/functions/status.function @@ -44,6 +44,9 @@ function status-display { battery=""; storage=""; volume=""; datetime=""; userhost="`whoami`@`hostname`" while true; do + # Exit if parent process is gone. + #TBD/TODO + # Reset Variables if [[ $datetime == *"00" ]]; then unset battery From f48fcaf610a8a57da3257ea158ffba01b969e8f6 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sun, 16 Nov 2025 07:24:03 -0700 Subject: [PATCH 096/112] Stop using the Hugo Server params recommended by YT videos, they seem to make things break and also cause caching issues which were not previously present. --- tasks/general/acct_mgmt/users.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index 785545b..9ff389a 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -1014,8 +1014,8 @@ alias reload-shell="reload-bash" alias reload="reload-bash" alias_hugo_server: | - alias hugo-server-dev="hugo server -D --gc --ignoreCache --noHTTPCache --disableFastRender" - alias hugo-server-stage="hugo server --gc --noHTTPCache --disableFastRender" + alias hugo-server-dev="hugo server -D --gc" # --ignoreCache --noHTTPCache --disableFastRender" + alias hugo-server-stage="hugo server --gc" # --noHTTPCache --disableFastRender" alias hugo-server-prod="hugo server --gc --minify" alias hugo-server="hugo-server-dev" global_functions: | From c568e0efbb80ccf704352d515414ee991e39e278 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 19 Nov 2025 12:31:20 -0700 Subject: [PATCH 097/112] Ensure headers are always installed on Debian systems. They stopped being included on a Macbook which resulted in Broadcom wl not being available, meaning WiFi was not working. --- tasks/general/software/packages.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tasks/general/software/packages.yml b/tasks/general/software/packages.yml index 5f0d05f..c1975d5 100644 --- a/tasks/general/software/packages.yml +++ b/tasks/general/software/packages.yml @@ -82,6 +82,15 @@ when: ansible_distribution == "Ubuntu" ignore_errors: yes +- name: General | Software | Packages | Add Generic Kernel + Headers (Debian) + package: + name: + - linux-image-amd64 + - linux-headers-amd64 + state: present + when: ansible_distribution == "Debian" + ignore_errors: yes + - name: General | Software | Services | Install killall (Looking at you, Debian) package: name: psmisc From 1d699ae4a5428fbd1c4f4a35c45c15b46ff828e9 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 21 Nov 2025 08:29:02 -0700 Subject: [PATCH 098/112] Run pull and build before taking the container down. --- tasks/general/acct_mgmt/users.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index 9ff389a..87ca17b 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -453,8 +453,8 @@ return 0 fi - docker compose down && docker compose build && + docker compose down && docker compose up -d if [[ -n "$1" ]]; then @@ -475,9 +475,9 @@ return 0 fi - docker compose down && docker compose pull && docker compose build && + docker compose down && docker compose up -d if [[ -n "$1" ]]; then @@ -519,12 +519,12 @@ docker ps return; fi - echo "*** Going Down ***" && - docker compose down && echo "*** Upgrading Images ***" && docker compose pull && echo "*** Building Containers ***" && docker compose build && + echo "*** Going Down ***" && + docker compose down && echo "*** Starting Daemons ***" && docker compose up -d && echo "*** Following Log ***" && From d8a29952f62e47fb348ad725f6c99ff581faec59 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 21 Nov 2025 15:33:40 -0700 Subject: [PATCH 099/112] Move messaging apps to the end of the favorites bar. --- tasks/workstation/shared/settings/gnome.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tasks/workstation/shared/settings/gnome.yml b/tasks/workstation/shared/settings/gnome.yml index 7ae2d55..05a4628 100644 --- a/tasks/workstation/shared/settings/gnome.yml +++ b/tasks/workstation/shared/settings/gnome.yml @@ -12,9 +12,6 @@ , 'org.gnome.Nautilus.desktop' , 'io.gitlab.librewolf-community.desktop', 'librewolf.desktop' , 'org.mozilla.firefox.desktop', 'firefox.desktop' - , 'org.signal.Signal.desktop', 'signal-desktop.desktop' - , 'org.telegram.desktop.desktop' - , 'com.discordapp.Discord.desktop' , 'com.vscodium.codium.desktop' , 'codium.desktop' , 'org.shotcut.Shotcut.desktop' @@ -24,6 +21,9 @@ , 'com.valvesoftware.Steam.desktop' , 'net.lutris.Lutris.desktop' , 'mullvad-vpn.desktop' + , 'org.signal.Signal.desktop', 'signal-desktop.desktop' + , 'org.telegram.desktop.desktop' + , 'com.discordapp.Discord.desktop' ]" dconf_terminal: gnome-terminal dconf_theme: Adwaita-dark From 8b6e665db3723f763a72fbd1d5ae3eb292b487ba Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 21 Nov 2025 17:58:52 -0700 Subject: [PATCH 100/112] Update formatting of README. Add comments on which OS's are truly currently supported. --- README.md | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 72 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c74cf62..ffa7aa4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # ansible + Getting real with system management via ansible-pull. Per-system configuration is handled via local files to the provisioned machine, @@ -10,59 +11,124 @@ accessed via the show-config and edit-config aliases. This setup is specific to the maintainer's devices and needs. You're welcome to use it as an example for your needs, but do not expect it to work as-is. -## Currently Supported Linux Systems +## Currently Supported Systems + +This information is as of 2025-11-21. + +### Primary + +These are the operating systems used as my daily driver. + +#### Debian Trixie + +This has been used as my primary server and workstation OS since at least 2024. +The `apt` version of `ansible` in both Bookworm and Trixie are sufficient, +no longer need to use `ansible` out of `pip`. + +### Secondary + +These are tested via my Docker project's `ProvisionsTests` container but not currently used as daily drivers. + +#### Arch + +TBD + +#### Fedora + +TBD + +#### OpenSUSE + +TBD + +#### Ubuntu + +TBD + +## Previusly Supported Systems + ### Debian Family + #### Debian + 100%, but only if using a recent enough version of Ansible. `pip` usually has a better version than `apt`. + #### Ubuntu + 100%, both server and desktop. + #### Pop!_OS + 100%, have not used for a while though. + #### Mint + 100%, but not really used, just tested once for fun. + #### Parrot Security OS (MATE) + 100% for a while, but OS did not serve maintainer's needs and 404 errors were terrible while updating. Ubuntu Rolling Rhino filled the gap. ### Arch Family + +#### Arch + +100% at some point, including installation and configuration of a Desktop Environment. + #### Manjaro + 100% at some point. ### Fedora Family + #### Fedora 35 -Workstation: 100% + +Workstation: 100%, Server: 100% ## Suse Family + ### openSUSE Tumbleweed v2022-02-17 -Generic: 100% + +Generic: 100%, Workstation: 100% ### openSUSE Leap 15.4 + Generic: 100% Workstation: Currently failing at `[Workstation | Linux | Flatpak Distro | Package Manager | Install From Repo]` with message `Problem: nothing provides libedataserver-1.2.so.24 needed by the to be installed evolution-data-server-32bit-3.34.4-3.3.1.x86_64`. ### NixOS + 99%, still need to get Telegraf going and refactor local.yml but everything else is working well. It is automatically implementing git.hyperling.com/me/env-nixos. -## Currently Supported Unix Systems ### FreeBSD 12, 13 + 100%, although GUI is not working completely on 13 yet (dash-to-dock doesn't compile). Software choices are slightly more limited since not `flatpak`-enabled and not feeling a `ports` setup. ## Waiting To Be Tested + ### Kali Linux + ### Arch Linux ARM + Specifically for the Pinephone. + ### Arch Linux x86 + Would be great to have Arch get built up by this. Used for many years but left after update problems due to a long computer hiatus. + ### Fedora Mobile + Specifically for the Pinephone. ## Future Goals + Eventually some of the scripts and install files will be put into the files folder. This will allow initializing systems outside of the maintainer's home network. @@ -74,6 +140,8 @@ benefit has yet to be seen for some tasks. Shared facts will definitely continue to exist under the facts tree. ## Other Notes + ### Get Setup Values + Use this command to see the variables for a system: `ansible localhost -m setup --connection=local`. From f4c3cc8b8e45e917a5aa4f9f6ccdfd0ff69c5236 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 22 Nov 2025 10:19:30 -0700 Subject: [PATCH 101/112] Add a few small docker shortcuts. --- tasks/general/acct_mgmt/users.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index 87ca17b..db0e05b 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -554,6 +554,10 @@ return 0 } + alias_docker_other: | + alias docker-stop="docker compose down" + alias docker-start="docker compose up -d && docker compose start" + alias docker-prep="docker compose pull && docker compose build" alias_code_check: | alias code-check=' echo "Checking ~/Code directory for git changes." @@ -1104,6 +1108,7 @@ {{ alias_reload_bash }} {{ alias_hugo_server }} {{ global_functions }} + {{ alias_docker_other }} - name: General | Account Management | Users | Files | .bashrc blockinfile: From 650157478d126764f807eb8ffa3a9236a23133cf Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 22 Nov 2025 10:55:02 -0700 Subject: [PATCH 102/112] Add a TBD for preventing annoying behavior in gnome-terminal. --- tasks/workstation/shared/settings/gnome.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tasks/workstation/shared/settings/gnome.yml b/tasks/workstation/shared/settings/gnome.yml index 05a4628..f67ec0b 100644 --- a/tasks/workstation/shared/settings/gnome.yml +++ b/tasks/workstation/shared/settings/gnome.yml @@ -274,6 +274,13 @@ dconf write /org/gnome/desktop/media-handling/autorun-never true && inc_dconf && + ## Gnome Terminal ## + + # TBD: Do not start new tabs in previous tab's directory. + # The profile ID is likely unique and will need to be retrieved first. + #/org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/preserve-working-directory + #'never' + ## Success ## sleep 0 || From 7be9c3a82f54de989375074ff637cbe7f6a310d9 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 22 Nov 2025 12:13:50 -0700 Subject: [PATCH 103/112] Add alias for cleaning unused Flatpak dependencies. --- tasks/general/acct_mgmt/users.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index db0e05b..d9dbb9a 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -1028,6 +1028,8 @@ . "$global_function" fi done + alias_flatpak_clean: | + alias flatpak-clean="flatpak uninstall --unused" - name: General | Account Management | Users | Files | Common Variable set_fact: @@ -1109,6 +1111,7 @@ {{ alias_hugo_server }} {{ global_functions }} {{ alias_docker_other }} + {{ alias_flatpak_clean }} - name: General | Account Management | Users | Files | .bashrc blockinfile: From 0790da74dc60e653751a55e89f12ac209d6bd8c6 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 22 Nov 2025 12:21:07 -0700 Subject: [PATCH 104/112] Add flatpak Xournal++. Remove flatpak Simplex. Improve comments. --- tasks/workstation/linux/software/flatpaks.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tasks/workstation/linux/software/flatpaks.yml b/tasks/workstation/linux/software/flatpaks.yml index e89db37..b9f7a57 100644 --- a/tasks/workstation/linux/software/flatpaks.yml +++ b/tasks/workstation/linux/software/flatpaks.yml @@ -36,7 +36,6 @@ flatpaks_generic: - { app: "org.mozilla.firefox", name: "firefox-flatpak", extra: "" } - { app: "io.gitlab.librewolf-community", name: "librewolf", extra: "" } - - { app: "chat.simplex.simplex", name: "simplex", extra: "" } - { app: "org.signal.Signal", name: "signal", extra: "" } - { app: "im.riot.Riot", name: "element", extra: "" } - { app: "org.telegram.desktop", name: "telegram", extra: "" } @@ -44,6 +43,7 @@ - { app: "org.libreoffice.LibreOffice", name: "office", extra: "" } - { app: "com.transmissionbt.Transmission", name: "transmission", extra: "" } - { app: "app.grayjay.Grayjay", name: "grayjay", extra: "" } + - { app: "com.github.xournalpp.xournalpp", name: "xournal", extra: "" } flatpaks_coding: - { app: "com.vscodium.codium", name: "codium-flatpak", extra: "" } - { app: "com.google.AndroidStudio", name: "android-studio", extra: "" } @@ -72,11 +72,12 @@ # 2022-11-20 No longer using any of these and they're taking up a lot of space. # - { 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. - - { app: "org.gnome.Geary", name: "geary", extra: "" } # No longer used, removed 2024-12-15 + - { app: "io.lbry.lbry-app", name: "lbry", extra: "dbus-launch" } # 2023-09-01, Noticed it is no longer supported. + - { app: "chat.delta.desktop", name: "deltachat", extra: "" } # 2023-12-18, No longer used. + - { app: "org.gnome.Geary", name: "geary", extra: "" } # 2024-12-15, No longer used. - { app: "org.rncbc.qsynth", name: "qsynth", extra: "" } # 2024-12-15, Not worth the setup, use LMMS or VMPK. - - { app: "org.godotengine.Godot", name: "godot", extra: "" } # 20250831 Stopped playing with this months / years ago. + - { app: "org.godotengine.Godot", name: "godot", extra: "" } # 2025-08-31, Stopped playing with this months / years ago. Seemed cool but Flutter is working well for this purpose. + - { app: "chat.simplex.simplex", name: "simplex", extra: "" } # 2025-11-22, Takes a ton of space and does not work without interacting with phone. # Generic # From c36a689d8f3272140564ec256436fadcff229d5a Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 28 Nov 2025 13:50:03 -0700 Subject: [PATCH 105/112] Add TBD. --- tasks/general/acct_mgmt/users.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index d9dbb9a..296c181 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -1030,6 +1030,9 @@ done alias_flatpak_clean: | alias flatpak-clean="flatpak uninstall --unused" + alias_commit: | + # TBD function to git add, git commit, and git push in a single go. + # Already exists on Termux env. - name: General | Account Management | Users | Files | Common Variable set_fact: From 4a9cd066541cfeb1d146e31f8229c03e59349e6a Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 28 Nov 2025 14:07:34 -0700 Subject: [PATCH 106/112] Add code for commit function. --- tasks/general/acct_mgmt/users.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index 296c181..4c75853 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -1032,7 +1032,27 @@ alias flatpak-clean="flatpak uninstall --unused" alias_commit: | # TBD function to git add, git commit, and git push in a single go. - # Already exists on Termux env. + # Already exists on Termux env. Needs tested. + function commit_usage { + echo 'Usage: commit "This is a commit message"' + } + function commit { + if [[ -z "$1" ]]; then + echo "ERROR: Message must be provided." + commit_usage + return 1 + fi + if [[ "$1" == "-h"* || "$1" == "--h"* ]]; then + commit_usage + fi + message="$1" + git add . && + git commit -m "$message" && + git push + + status="$?" + return "$status" + } - name: General | Account Management | Users | Files | Common Variable set_fact: From c6e8290b433ba6cbb467d369c47c259f7ba06c8c Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 28 Nov 2025 14:57:22 -0700 Subject: [PATCH 107/112] Add `commit` function to bashrc. --- tasks/general/acct_mgmt/users.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index 4c75853..7dd7460 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -1031,8 +1031,7 @@ alias_flatpak_clean: | alias flatpak-clean="flatpak uninstall --unused" alias_commit: | - # TBD function to git add, git commit, and git push in a single go. - # Already exists on Termux env. Needs tested. + # TBD - Needs tested. function commit_usage { echo 'Usage: commit "This is a commit message"' } @@ -1135,6 +1134,7 @@ {{ global_functions }} {{ alias_docker_other }} {{ alias_flatpak_clean }} + {{ alias_commit }} - name: General | Account Management | Users | Files | .bashrc blockinfile: From ad6b9d47949006d9a0f16fc6bc640d6056c33006 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 28 Nov 2025 15:00:43 -0700 Subject: [PATCH 108/112] Remove TBD from commit code by using commit. :) --- tasks/general/acct_mgmt/users.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index 7dd7460..6a458b8 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -1031,7 +1031,6 @@ alias_flatpak_clean: | alias flatpak-clean="flatpak uninstall --unused" alias_commit: | - # TBD - Needs tested. function commit_usage { echo 'Usage: commit "This is a commit message"' } From 95212b1c7336b8c752fce4bbca9b9d05a90374ff Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sun, 30 Nov 2025 17:56:56 -0700 Subject: [PATCH 109/112] Add shortcuts for checking code project branches to easily see which have been promoted and which have dev/stage changes. --- tasks/general/acct_mgmt/users.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index 6a458b8..736f99c 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -1011,6 +1011,18 @@ alias reset-prod="load-branch prod main" alias reset-stage="load-branch stage main" alias reset-dev="load-branch dev main" + function check-code-branches { + for dir in ~/Code/*/; do + cd $dir + pwd + git ls-remote --heads + echo " " + cd .. + done + } + alias check-branches="check-code-branches" + alias check-branch="git ls-remote --heads" + alias branch-check="check-branch" alias_reload_bash: | alias reload-bash="source ~/.bashrc" alias bash-reload="reload-bash" From f7869fd453e20f2c44597c5feafd9cc97d12367f Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sun, 30 Nov 2025 19:16:50 -0700 Subject: [PATCH 110/112] Change the timestamp formatting to be optional. --- files/scripts/compress_image.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/files/scripts/compress_image.sh b/files/scripts/compress_image.sh index 7b48afb..e86f313 100755 --- a/files/scripts/compress_image.sh +++ b/files/scripts/compress_image.sh @@ -28,7 +28,7 @@ function usage() { # Parameters: # 1) The exit status to use. status=$1 - echo "Usage: $PROG [-s SIZE] [-l LOCATION] [-A | [-r] [-f] [-d] [-c]] [-h] [-x]" >&2 + echo "Usage: $PROG [-s SIZE] [-l LOCATION] [-A | [-r] [-f] [-d] [-c]] [-h] [-x] [-t]" >&2 cat <<- EOF Compress JPG or PNG image(s). Can handle folders and work recursively. @@ -45,13 +45,14 @@ function usage() { -A : Resursively Force, Delete, and Clean. -h : Display this usage text. -x : Enable BASH debugging. + -t : Format timestamp. EOF exit $status } ## Parameters ## -while getopts ":s:l:rfFdcAhx" opt; do +while getopts ":s:l:rfFdcAhxt" opt; do case $opt in s) in_size="$OPTARG" && size="$in_size" ;; l) location="$OPTARG" ;; @@ -64,6 +65,7 @@ while getopts ":s:l:rfFdcAhx" opt; do A) recurse="Y" && search="find" && force="Y" && delete="Y" && expand="Y" ;; h) usage 0 ;; x) set -x ;; + t) format_time="Y" ;; *) echo "ERROR: Option $OPTARG not recognized." >&2 && usage 1 ;; esac done @@ -130,7 +132,9 @@ $search "$location" | sort | while read image; do # Date Data new_image_exp="${TEMP:0:4}-${TEMP:4:2}-${TEMP:6:2}" # Time Data - new_image_exp="${new_image_exp}_${TEMP:8:2}-${TEMP:10:2}-${TEMP:12:2}" + if [[ "$format_time" == "Y" ]]; then + new_image_exp="${new_image_exp}_${TEMP:8:2}-${TEMP:10:2}-${TEMP:12:2}" + fi # Remainder Data if [[ "${TEMP:14:1}" == "." ]]; then SEP="" From 58525e2a5ccde0a33c765f5d024ae0101d8cc2c8 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 1 Dec 2025 09:05:20 -0700 Subject: [PATCH 111/112] Fix function exits to be returns. --- tasks/general/acct_mgmt/users.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index 736f99c..46d9a5b 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -957,7 +957,7 @@ if [[ "$rcvr" == "main" ]]; then echo "*** ERROR: Are you nuts, fool!? Not main! Do it manually! ***" - exit 1 + return 1 fi if [[ -z "$base" ]]; then @@ -967,7 +967,7 @@ base="dev" else echo "* Unsure which branch to use for '$rcvr'. Please specify." - exit 1 + return 1 fi echo "* Base was not specified, using '$base' for '$rcvr'." else From 71cf71e29b88c1a75fb134aa9937e07e9466e370 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 1 Dec 2025 09:47:43 -0700 Subject: [PATCH 112/112] Ignore the /srv/sftp directory when making system backups. --- files/scripts/backup_system.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/scripts/backup_system.sh b/files/scripts/backup_system.sh index 33ae498..4b0f85e 100755 --- a/files/scripts/backup_system.sh +++ b/files/scripts/backup_system.sh @@ -39,7 +39,7 @@ echo "*** Creating backup at '$BACKUP' ***" sudo zip -rv "$BACKUP" \ /etc /var/{log,mail,spool} /srv /boot \ /usr/local/etc $EXTRA \ - -x "/srv/backup/*" + -x "/srv/backup/*" -x "/srv/sftp/*" status="$?" if [[ "$status" != 0 ]]; then