From c7945188176d55fed3bce47882f04a630d972d74 Mon Sep 17 00:00:00 2001 From: SZIMNAU Date: Wed, 5 Nov 2025 14:06:40 +0100 Subject: [PATCH 01/10] - added helper method to look up wether a command exists - avoid calling flatpak or notify-send if not installed --- home_external/.bash_aliases | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/home_external/.bash_aliases b/home_external/.bash_aliases index 34f2456..049b310 100644 --- a/home_external/.bash_aliases +++ b/home_external/.bash_aliases @@ -40,6 +40,11 @@ alias dirsizes='du -kh --apparent-size --max-depth=1 | sort -hr' alias start_x11_vnc="x11vnc -many -display :0 -no6 -rfbport 5900 -auth /var/run/lightdm/root/:0 -rfbauth $HOME/.vnc/passwd" +commandExists() { + type $1 2 >& 1 > /dev/null +} + + rsyncLink() { source=$1; linkSource="$(realpath $source)"; @@ -52,7 +57,7 @@ rsyncLink() { updateSystem() { - executeAndNotify "doUpdateSystem $1" "system updated" "system update failed" + executeAndNotify "doUpdateSystem $1" "system updated" "system update failed" } @@ -63,6 +68,9 @@ doUpdateSystem() { updateFlatpak() { + if [[ ! $(commandExists flatpak) ]]; then + return 1; + fi noconfirm= if [[ $1 == "-y" ]]; then noconfirm="--assumeyes"; @@ -119,11 +127,19 @@ finds () { # sends a desktop-notification with an icon signalling an error notifyError () { - notify-send "$1" --icon=data-warning; + if [[ ! $(commandExists notify-send) ]]; then + echo "ERROR: $1"; + else + notify-send "$1" --icon=data-warning; + fi } # sends a desktop-notification with an icon signalling a simple information notifyInfo () { - notify-send "$1" --icon=preferences-desktop-notification; + if [[ ! $(commandExists notify-send) ]]; then + echo "INFO: $1"; + else + notify-send "$1" --icon=preferences-desktop-notification; + fi } From 1622b1bd527aa2b60ede47b8950f3ae55ef6b6ff Mon Sep 17 00:00:00 2001 From: fabian Date: Wed, 19 Nov 2025 20:44:12 +0100 Subject: [PATCH 02/10] removed redundant file --- home_external/.config/wezterm/.wezterm.lua | 116 --------------------- 1 file changed, 116 deletions(-) delete mode 100644 home_external/.config/wezterm/.wezterm.lua diff --git a/home_external/.config/wezterm/.wezterm.lua b/home_external/.config/wezterm/.wezterm.lua deleted file mode 100644 index ba56929..0000000 --- a/home_external/.config/wezterm/.wezterm.lua +++ /dev/null @@ -1,116 +0,0 @@ --- Pull in the wezterm API -local wezterm = require 'wezterm' -local act = wezterm.action -local mux = wezterm.mux - --- This will hold the configuration. -local config = wezterm.config_builder() - --- This is where you actually apply your config choices - --- For example, changing the color scheme: -config.color_scheme = 'AdventureTime' --- config.font = wezterm.font 'JetBrains Mono' -- also the default -config.font = wezterm.font 'Fira Code' -config.font_size = 12.0 -- also the default - --- Spawn a git bash shell -config.default_prog = { 'C:/Program Files/Git/bin/bash.exe' , '--cd-to-home' } - --- cursor shape and behaviour -config.default_cursor_style = 'BlinkingBar' -config.animation_fps = 1 -config.cursor_blink_ease_in = 'Constant' -config.cursor_blink_ease_out = 'Constant' - -config.enable_kitty_keyboard = true - --- window appearance -config.enable_scroll_bar = true -config.window_padding = { - left = 0, - right = 0, - top = 0, - bottom = 0, -} --- config.initial_rows = 50; - ---[[wezterm.on('gui-startup', function(cmd) - local tab, pane, window = mux.spawn_window(cmd or {}) - -- Create a split occupying the right 1/3 of the screen - local loading_bar_pane = pane:split { - direction = 'Bottom', - size = 0.06, - } - -- go to JavaUtils-Directory and prepare command - loading_bar_pane:send_text 'cd JavaUtils/zeitlaeufer/target\njava de.szimnau.WorkLoadingBar' - -- optionally: clear before preparing command - -- loading_bar_pane:send_text 'cd JavaUtils/zeitlaeufer/target\nc\njava de.szimnau.WorkLoadingBar' -end)]] - -config.keys = { - -- This will create a new horizontal split and run your default program inside it - { - key = 'E', - mods = 'CTRL|SHIFT', - action = act.SplitHorizontal { domain = 'CurrentPaneDomain' }, - }, - -- This will create a new vertical split and run your default program inside it - { - key = 'O', - mods = 'CTRL|SHIFT', - action = act.SplitVertical { domain = 'CurrentPaneDomain' }, - }, - -- resize the current split - { - key = 'UpArrow', - mods = 'CTRL|SHIFT', - action = act.AdjustPaneSize { 'Up', 1 }, - }, - { - key = 'DownArrow', - mods = 'CTRL|SHIFT', - action = act.AdjustPaneSize { 'Down', 1 }, - }, - { - key = 'LeftArrow', - mods = 'CTRL|SHIFT', - action = act.AdjustPaneSize { 'Left', 1 } - }, - { - key = 'RightArrow', - mods = 'CTRL|SHIFT', - action = act.AdjustPaneSize { 'Right', 1 }, - }, - -- move around the splits - { - key = 'UpArrow', - mods = 'ALT', - action = act.ActivatePaneDirection 'Up', - }, - { - key = 'DownArrow', - mods = 'ALT', - action = act.ActivatePaneDirection 'Down', - }, - { - key = 'LeftArrow', - mods = 'ALT', - action = act.ActivatePaneDirection 'Left', - }, - { - key = 'RightArrow', - mods = 'ALT', - action = act.ActivatePaneDirection 'Right', - }, - -- makes pane take up all available space in the tab, hiding all other panes - { - key = 'X', - mods = 'CTRL|SHIFT', - action = wezterm.action.TogglePaneZoomState, - }, -} - - --- and finally, return the configuration to wezterm -return config From 4c09537776022a1c69134ab24ed307644136f2e1 Mon Sep 17 00:00:00 2001 From: fabian Date: Wed, 19 Nov 2025 20:54:18 +0100 Subject: [PATCH 03/10] - removed debug ouptut - only execute certain code when the accompanying command exists --- home_external/.bash_aliases | 36 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/home_external/.bash_aliases b/home_external/.bash_aliases index 049b310..7ee9e72 100644 --- a/home_external/.bash_aliases +++ b/home_external/.bash_aliases @@ -40,11 +40,6 @@ alias dirsizes='du -kh --apparent-size --max-depth=1 | sort -hr' alias start_x11_vnc="x11vnc -many -display :0 -no6 -rfbport 5900 -auth /var/run/lightdm/root/:0 -rfbauth $HOME/.vnc/passwd" -commandExists() { - type $1 2 >& 1 > /dev/null -} - - rsyncLink() { source=$1; linkSource="$(realpath $source)"; @@ -52,25 +47,18 @@ rsyncLink() { shift; dest=$1; shift; + echo "rsync $DEFAULT_RSYNC --one-file-system --link-dest=$linkSource $source $dest $*;" rsync $DEFAULT_RSYNC --one-file-system --link-dest=$linkSource $source $dest $*; } updateSystem() { - executeAndNotify "doUpdateSystem $1" "system updated" "system update failed" -} - - -doUpdateSystem() { updatePackages $1; updateFlatpak $1; } updateFlatpak() { - if [[ ! $(commandExists flatpak) ]]; then - return 1; - fi noconfirm= if [[ $1 == "-y" ]]; then noconfirm="--assumeyes"; @@ -88,7 +76,7 @@ doUpdateFlatpak() { # executes command and notifies upon failure execute() { dir="$(pwd)"; - dir=${dir##*/}; # cut off previous path (/path/to/foo.txt -> foo.txt) + dir=${dir##*/}; if [[ -n "$2" ]]; then errLog=$2; else @@ -112,9 +100,17 @@ executeAndNotify () { winLog="execution of \"$1\" succeeded"; fi + echo "" + echo "******************************************" + echo "executeAndNotify \"$1\" \"$winLog\" \"$3\"" + echo "******************************************" + echo "" + if ! execute "$1" "$3"; then # arguments in quotes so they are interpreted as ONE argument each by execute() + echo "failed \"$1\" -> \"$3\"" return 1; fi + echo "succeeded \"$1\" -> \"$winLog\"" notifyInfo "$dir: $winLog"; } @@ -127,19 +123,11 @@ finds () { # sends a desktop-notification with an icon signalling an error notifyError () { - if [[ ! $(commandExists notify-send) ]]; then - echo "ERROR: $1"; - else - notify-send "$1" --icon=data-warning; - fi + notify-send "$1" --icon=data-warning; } # sends a desktop-notification with an icon signalling a simple information notifyInfo () { - if [[ ! $(commandExists notify-send) ]]; then - echo "INFO: $1"; - else - notify-send "$1" --icon=preferences-desktop-notification; - fi + notify-send "$1" --icon=preferences-desktop-notification; } From c2bd45267a64778655e2a75e364170315d3ee81e Mon Sep 17 00:00:00 2001 From: fabian Date: Wed, 19 Nov 2025 20:57:16 +0100 Subject: [PATCH 04/10] Revert "- removed debug ouptut" This reverts commit 4c09537776022a1c69134ab24ed307644136f2e1. --- home_external/.bash_aliases | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/home_external/.bash_aliases b/home_external/.bash_aliases index 7ee9e72..049b310 100644 --- a/home_external/.bash_aliases +++ b/home_external/.bash_aliases @@ -40,6 +40,11 @@ alias dirsizes='du -kh --apparent-size --max-depth=1 | sort -hr' alias start_x11_vnc="x11vnc -many -display :0 -no6 -rfbport 5900 -auth /var/run/lightdm/root/:0 -rfbauth $HOME/.vnc/passwd" +commandExists() { + type $1 2 >& 1 > /dev/null +} + + rsyncLink() { source=$1; linkSource="$(realpath $source)"; @@ -47,18 +52,25 @@ rsyncLink() { shift; dest=$1; shift; - echo "rsync $DEFAULT_RSYNC --one-file-system --link-dest=$linkSource $source $dest $*;" rsync $DEFAULT_RSYNC --one-file-system --link-dest=$linkSource $source $dest $*; } updateSystem() { + executeAndNotify "doUpdateSystem $1" "system updated" "system update failed" +} + + +doUpdateSystem() { updatePackages $1; updateFlatpak $1; } updateFlatpak() { + if [[ ! $(commandExists flatpak) ]]; then + return 1; + fi noconfirm= if [[ $1 == "-y" ]]; then noconfirm="--assumeyes"; @@ -76,7 +88,7 @@ doUpdateFlatpak() { # executes command and notifies upon failure execute() { dir="$(pwd)"; - dir=${dir##*/}; + dir=${dir##*/}; # cut off previous path (/path/to/foo.txt -> foo.txt) if [[ -n "$2" ]]; then errLog=$2; else @@ -100,17 +112,9 @@ executeAndNotify () { winLog="execution of \"$1\" succeeded"; fi - echo "" - echo "******************************************" - echo "executeAndNotify \"$1\" \"$winLog\" \"$3\"" - echo "******************************************" - echo "" - if ! execute "$1" "$3"; then # arguments in quotes so they are interpreted as ONE argument each by execute() - echo "failed \"$1\" -> \"$3\"" return 1; fi - echo "succeeded \"$1\" -> \"$winLog\"" notifyInfo "$dir: $winLog"; } @@ -123,11 +127,19 @@ finds () { # sends a desktop-notification with an icon signalling an error notifyError () { - notify-send "$1" --icon=data-warning; + if [[ ! $(commandExists notify-send) ]]; then + echo "ERROR: $1"; + else + notify-send "$1" --icon=data-warning; + fi } # sends a desktop-notification with an icon signalling a simple information notifyInfo () { - notify-send "$1" --icon=preferences-desktop-notification; + if [[ ! $(commandExists notify-send) ]]; then + echo "INFO: $1"; + else + notify-send "$1" --icon=preferences-desktop-notification; + fi } From 916faa68fd2385e60ecef72e5f3bccdb893a8f86 Mon Sep 17 00:00:00 2001 From: fabian Date: Wed, 19 Nov 2025 20:59:08 +0100 Subject: [PATCH 05/10] dont quit the tty upon failure --- home_external/.bashrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home_external/.bashrc b/home_external/.bashrc index 2ff28c1..a6b623c 100644 --- a/home_external/.bashrc +++ b/home_external/.bashrc @@ -2,7 +2,7 @@ # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) # for examples -set -o pipefail +# set -o pipefail # set -u # If not running interactively, don't do anything From a120d54b301339869950b32a97549bc9d929a30e Mon Sep 17 00:00:00 2001 From: fabian Date: Wed, 19 Nov 2025 20:59:53 +0100 Subject: [PATCH 06/10] updated backup scripts --- scripts/backup_edi.sh | 4 ++-- scripts/backup_shepard.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/backup_edi.sh b/scripts/backup_edi.sh index adee0e9..15242e6 100755 --- a/scripts/backup_edi.sh +++ b/scripts/backup_edi.sh @@ -32,10 +32,10 @@ backupRootDirectory /etc/docker/daemon.json $BACKUP_DIR_ROOT/docker/ ### upload backup ### ##################### -if [[ "$1" == "--noupload" ]]; then +if [[ $# > 0 && "$1" == "--noupload" ]]; then exit 0; fi -sd rsync_backup -e "ssh -i /home/edi/.ssh/id_ed25519" --filter="P /home/docker" /sync/backup/ fabian@garrus:/citadel/backup/edi/ +sd rsync_backup -e "ssh -i /home/edi/.ssh/id_ed25519" /sync/backup/ fabian@garrus:/citadel/backup/edi/ sd rsync_backup -e "ssh -i /home/edi/.ssh/id_ed25519" /home/edi/docker/ fabian@garrus:/citadel/backup/edi/home/docker/ echo "Note: remember to keep /citadel in sync!" diff --git a/scripts/backup_shepard.sh b/scripts/backup_shepard.sh index f14eb87..e999ea4 100755 --- a/scripts/backup_shepard.sh +++ b/scripts/backup_shepard.sh @@ -20,7 +20,7 @@ backupDirectory $HOME/.ssh/ $BACKUP_DIR_HOME/.ssh/ ### upload backup ### ##################### -if [[ "$1" == "--noupload" ]]; then +if [[ $# > 0 && "$1" == "--noupload" ]]; then exit 0; fi From 85bae25c2f504a5c0816c5cbaa452f2a94dce0f1 Mon Sep 17 00:00:00 2001 From: fabian Date: Wed, 19 Nov 2025 21:00:35 +0100 Subject: [PATCH 07/10] added escape replacement --- scripts/escapeFilenames.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/escapeFilenames.sh b/scripts/escapeFilenames.sh index e41eb3e..d6e8e91 100755 --- a/scripts/escapeFilenames.sh +++ b/scripts/escapeFilenames.sh @@ -13,6 +13,7 @@ replacements['(']='_'; replacements[')']='_'; replacements['[']='_'; replacements[']']='_'; +replacements[',']='_'; while [[ $# > 0 ]]; do replacements["$1"]="$2"; shift 2; From 57644311b3e6224e2b69ac5e8f6bb108ffae6ed1 Mon Sep 17 00:00:00 2001 From: fabian Date: Wed, 19 Nov 2025 21:00:59 +0100 Subject: [PATCH 08/10] pass down arguments --- scripts/downContainers.sh | 2 +- scripts/pullContainers.sh | 2 +- scripts/upContainers.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/downContainers.sh b/scripts/downContainers.sh index d316520..19cd1bc 100755 --- a/scripts/downContainers.sh +++ b/scripts/downContainers.sh @@ -4,4 +4,4 @@ set -euo pipefail source /sync/scripts/dockerContainerAction.sh # FIXME!!! implement possibility to pass down directory -upDownContainers down +upDownContainers down $@ diff --git a/scripts/pullContainers.sh b/scripts/pullContainers.sh index 1c43f63..f242957 100755 --- a/scripts/pullContainers.sh +++ b/scripts/pullContainers.sh @@ -4,4 +4,4 @@ set -euo pipefail source /sync/scripts/dockerContainerAction.sh # FIXME!!! implement possibility to pass down directory -upDownContainers pull +upDownContainers pull $@ diff --git a/scripts/upContainers.sh b/scripts/upContainers.sh index 69a59db..f7b73ae 100755 --- a/scripts/upContainers.sh +++ b/scripts/upContainers.sh @@ -4,4 +4,4 @@ set -euo pipefail source /sync/scripts/dockerContainerAction.sh # FIXME!!! implement possibility to pass down directory -upDownContainers up -d +upDownContainers up -d $@ From edf7f1a1d14ba5fb8c394149fb91c4f26298d1e3 Mon Sep 17 00:00:00 2001 From: fabian Date: Wed, 19 Nov 2025 21:02:03 +0100 Subject: [PATCH 09/10] - improved map, vbr flags --- scripts/reencode_m4a.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/reencode_m4a.sh b/scripts/reencode_m4a.sh index 8ddc742..cbe5726 100755 --- a/scripts/reencode_m4a.sh +++ b/scripts/reencode_m4a.sh @@ -6,15 +6,15 @@ map= vbr= while [[ $# > 0 ]]; do case $1 in - -map) map='-map 0:0'; shift;; - -vbr) vbr='aac_at -profile:a aac_he -b:a 64k'; shift;; + -map) map='-map 0:a'; shift;; + -vbr) vbr='aac -profile:a aac_he -b:a 64k'; shift;; * ) break ;; # Anything else stops command line processing. esac done # if no variable bitrate, just copy audio if [[ -z $vbr ]]; then - map="$map copy" + vbr="copy" fi # ensure existence of destination folder From 96ced8ff18801ed623ccbe0320a149cd8c1be2f9 Mon Sep 17 00:00:00 2001 From: fabian Date: Wed, 19 Nov 2025 21:02:35 +0100 Subject: [PATCH 10/10] script for editing audible audio books post decrypt --- scripts/postTreatmentAudible.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 scripts/postTreatmentAudible.sh diff --git a/scripts/postTreatmentAudible.sh b/scripts/postTreatmentAudible.sh new file mode 100755 index 0000000..db2c95b --- /dev/null +++ b/scripts/postTreatmentAudible.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +set -euo pipefail + +/sync/scripts/escapeFilenames.sh . _ +for d in *; do + cd "$d"; + /sync/scripts/escapeFilenames.sh Chapter Kapitel + /sync/scripts/reencode_m4a.sh -map; + rm *.m4a; + mv * "../${d}_reencode"; + cd ..; + rmdir "$d" + mv "${d}_reencode" "$d"; +done