Compare commits

14 Commits

Author SHA1 Message Date
fabian 8a26bd37d2 avoid ConcurrentModificationException-esque error by saving directory names beforehand 2026-02-01 17:10:43 +01:00
fabian 73f5fe2e45 fixed commandExists 2025-11-20 21:28:53 +01:00
fabian 96ced8ff18 script for editing audible audio books post decrypt 2025-11-19 21:02:35 +01:00
fabian edf7f1a1d1 - improved map, vbr flags 2025-11-19 21:02:03 +01:00
fabian 57644311b3 pass down arguments 2025-11-19 21:00:59 +01:00
fabian 85bae25c2f added escape replacement 2025-11-19 21:00:35 +01:00
fabian a120d54b30 updated backup scripts 2025-11-19 20:59:53 +01:00
fabian 916faa68fd dont quit the tty upon failure 2025-11-19 20:59:08 +01:00
fabian c2bd45267a Revert "- removed debug ouptut"
This reverts commit 4c09537776.
2025-11-19 20:57:16 +01:00
fabian 4c09537776 - removed debug ouptut
- only execute certain code when the accompanying command exists
2025-11-19 20:54:18 +01:00
fabian d5ff6f3332 Merge branch 'master' of ssh://git.szimnau.de:222/fabian/sync 2025-11-19 20:45:03 +01:00
fabian 1622b1bd52 removed redundant file 2025-11-19 20:44:12 +01:00
SZIMNAU c794518817 - added helper method to look up wether a command exists
- avoid calling flatpak or notify-send if not installed
2025-11-05 14:06:40 +01:00
fszimnau 48bda2be2d additions from msys64 2025-10-16 13:04:36 +02:00
17 changed files with 68 additions and 34 deletions
+20 -4
View File
@@ -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";
@@ -80,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
@@ -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
}
+4 -9
View File
@@ -4,18 +4,13 @@
updatePackages() {
noconfirm=
if [[ $1 == "-y" ]]; then
noconfirm="--assume-yes"
noconfirm="--no-confirm";
fi
full=
if [[ $2 == "--full" ]]; then
full="full-"
fi
executeAndNotify "doUpdatePackages $noconfirm $full" "system updated" "system update failed";
executeAndNotify "doUpdatePackages $noconfirm" "packages updated" "package update failed";
}
doUpdatePackages() {
sudo apt update;
sudo apt ${2}upgrade $1;
sudo apt autoremove $1;
pamac update $1;
pamac remove --orphans --cascade $1;
}
+1
View File
@@ -2,4 +2,5 @@
# ~/.bash_profile
#
[[ -f ~/.profile ]] && . ~/.profile
[[ -f ~/.bashrc ]] && . ~/.bashrc
+1 -1
View File
@@ -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
+1 -1
View File
@@ -89,7 +89,7 @@ set linenumbers
set matchbrackets "(<[{)>]}"
## Suppress title bar and show file name and editor state at the bottom.
# set minibar
set minibar
## Enable mouse support, if available for your system. When enabled,
## mouse clicks can be used to place the cursor, set the mark (with a
+2 -2
View File
@@ -139,13 +139,13 @@ configuration {
/* me-select-entry: "MousePrimary";*/
/* me-accept-entry: "MouseDPrimary";*/
/* me-accept-custom: "Control+MouseDPrimary";*/
/* timeout {
timeout {
action: "kb-cancel";
delay: 0;
}
filebrowser {
directories-first: true;
sorting-method: "name";
}*/
}
}
@theme "/usr/share/rofi/themes/Arc-Dark.rasi"
+2
View File
@@ -0,0 +1,2 @@
.crlf off
.mode box
@@ -15,7 +15,10 @@ 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' }
-- config.default_prog = { 'C:/Program Files/Git/bin/bash.exe' , '--cd-to-home' }
-- config.default_prog = { 'C:/theo_dev/bin/msys64/usr/bin/bash.exe' }
-- config.default_prog = { 'C:/theo_dev/bin/msys64/msys2_shell.cmd', '-defterm', '-where', 'G:\\', '-no-start', '-ucrt64', '-use-full-path' }
config.default_prog = { 'C:/theo_dev/bin/msys64/msys2_shell.cmd', '-defterm', '-no-start', '-ucrt64', '-use-full-path' }
-- cursor shape and behaviour
config.default_cursor_style = 'BlinkingBar'
@@ -33,20 +36,18 @@ config.window_padding = {
top = 0,
bottom = 0,
}
-- config.initial_rows = 50;
config.initial_rows = 50;
--[[wezterm.on('gui-startup', function(cmd)
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)]]
-- prepare command (\n possible to send command)
loading_bar_pane:send_text '. /g/zeitlaeufer/runProject.sh de.szimnau.zeitlaeufer.WorkLoadingBar'
end)
config.keys = {
-- This will create a new horizontal split and run your default program inside it
+1 -1
View File
@@ -36,6 +36,6 @@ 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!"
+1 -1
View File
@@ -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
+1 -1
View File
@@ -16,7 +16,7 @@ upDownContainers() {
continue;
fi
cd $subdir;
docker compose $@;
docker-compose $@;
done
}
+1 -1
View File
@@ -4,4 +4,4 @@ set -euo pipefail
source /sync/scripts/dockerContainerAction.sh
# FIXME!!! implement possibility to pass down directory
upDownContainers down
upDownContainers down $@
+1
View File
@@ -13,6 +13,7 @@ replacements['(']='_';
replacements[')']='_';
replacements['[']='_';
replacements[']']='_';
replacements[',']='_';
while [[ $# > 0 ]]; do
replacements["$1"]="$2";
shift 2;
+18
View File
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -euo pipefail
/sync/scripts/escapeFilenames.sh . _
declare -a dirs=();
for d in *; do
dirs+=($d);
done
for d in "${dirs[@]}"; 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
+1 -1
View File
@@ -4,4 +4,4 @@ set -euo pipefail
source /sync/scripts/dockerContainerAction.sh
# FIXME!!! implement possibility to pass down directory
upDownContainers pull
upDownContainers pull $@
+3 -3
View File
@@ -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
+1 -1
View File
@@ -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 $@