From 181289473b9981bb6a55f847b68631300a33a84b Mon Sep 17 00:00:00 2001 From: octospacc Date: Fri, 19 May 2023 19:54:24 +0200 Subject: [PATCH] Misc updates --- Install.sh | 9 +++---- Lib.sh | 24 +++++++++++++++---- Misc/Home/{.bashrc.part => .bashrc.part.tail} | 0 Misc/Home/.config/micro/settings.json | 1 + Misc/Home/.dotfiles/aliasrc | 13 +++++++--- Misc/Home/.dotfiles/exportrc | 9 ++++++- Misc/Home/.dotfiles/functrc | 20 +++++++--------- Misc/Repo.Update.sh | 9 +++++++ README.md | 4 ++-- Server/Repo.Update.sh | 2 ++ 10 files changed, 65 insertions(+), 26 deletions(-) rename Misc/Home/{.bashrc.part => .bashrc.part.tail} (100%) create mode 100755 Misc/Repo.Update.sh diff --git a/Install.sh b/Install.sh index de8219d..f21310d 100755 --- a/Install.sh +++ b/Install.sh @@ -5,14 +5,15 @@ CopyCfg() { for Type in "" "." do [ "$(whoami)" = "root" ] && [ -d "$1/Root" ] && \ - cp -r $(find "$1/Root" -maxdepth 1 -mindepth 1 -name "$Type*") / - [ -d "$1/Home" ] && \ - cp -r $(find "$1/Home" -maxdepth 1 -mindepth 1 -name "$Type*") ~/ + cp -r $(find "$1/Root" -maxdepth 1 -mindepth 1 -name "${Type}*") / + [ "$(whoami)" != "root" ] && [ -d "$1/Home" ] && \ + cp -r $(find "$1/Home" -maxdepth 1 -mindepth 1 -name "${Type}*") ~/ + # TODO: && cat all *.part.{head,tail} files into their respective one done } Cur="$1" -while [ ! -z "$Cur" ] +while [ -n "$Cur" ] do if [ -d "$Cur" ] then diff --git a/Lib.sh b/Lib.sh index 6999973..1fed703 100644 --- a/Lib.sh +++ b/Lib.sh @@ -1,12 +1,26 @@ #!/bin/sh +ScopePath="" +SetScope(){ + [ "$1" = "Root" ] && ScopePath="/" + [ "$1" = "Home" ] && ScopePath="${HOME}/" +} + mkcd(){ - mkdir -vp "$1" && \ + mkdir -vp "./$1" && \ cd "$1" } -cpdir(){ - echo "'$1'" - mkdir -p "$1" && \ - cp -rT "/$1" "./$1" +cpfile(){ + echo "$1" + rm -rf "./$1" && \ + mkdir -p "./$1" && \ + rm -rf "./$1" && \ + cp --no-target-directory "${ScopePath}$1" "./$1" +} + +cpdir(){ + echo "$1" + mkdir -p "./$1" && \ + cp --recursive --no-target-directory "${ScopePath}$1" "./$1" } diff --git a/Misc/Home/.bashrc.part b/Misc/Home/.bashrc.part.tail similarity index 100% rename from Misc/Home/.bashrc.part rename to Misc/Home/.bashrc.part.tail diff --git a/Misc/Home/.config/micro/settings.json b/Misc/Home/.config/micro/settings.json index 11d937d..0c43079 100644 --- a/Misc/Home/.config/micro/settings.json +++ b/Misc/Home/.config/micro/settings.json @@ -1,5 +1,6 @@ { "colorscheme": "simple", + "mkparents": true, "softwrap": true, "wordwrap": true } diff --git a/Misc/Home/.dotfiles/aliasrc b/Misc/Home/.dotfiles/aliasrc index de280f7..3787437 100644 --- a/Misc/Home/.dotfiles/aliasrc +++ b/Misc/Home/.dotfiles/aliasrc @@ -1,11 +1,18 @@ +#!/bin/sh + alias cd..="cd .." -alias miclisten="pactl load-module module-loopback latency_msec=1" -alias micunlisten="pactl unload-module module-loopback" +alias MicListen="pactl load-module module-loopback latency_msec=1" +alias MicUnlisten="pactl unload-module module-loopback" # alias tcpdumpeth="sudo tcpdump -i enp37s0 -l -Q in" alias termbin="nc termbin.com 9999" alias gitclone1="git clone --depth 1" +alias gitclone9="git clone --depth 2147483647" -alias pngcrs="pngcrush -brute" +alias pngcrs="pngcrush -brute -reduce" +alias pngqnt100="pngquant -v --strip --speed=1 --quality=100-100" +alias pngqnt="pngquant -v --strip --speed=1" + +#alias chrootrun-jammy="sudo chrootrun /opt/rootfs/UbuntuJammy" diff --git a/Misc/Home/.dotfiles/exportrc b/Misc/Home/.dotfiles/exportrc index fb5007f..5ec27cd 100644 --- a/Misc/Home/.dotfiles/exportrc +++ b/Misc/Home/.dotfiles/exportrc @@ -1,9 +1,16 @@ +#!/bin/sh + export EDITOR=micro +export PATH=$PATH:$HOME/.local/bin +export PATH=$PATH:$HOME/.local/sbin export ANDROID_HOME=$HOME/Android/Sdk export ANDROID_SDK_ROOT=$HOME/Android/Sdk export PATH=$PATH:$ANDROID_HOME/tools export PATH=$PATH:$ANDROID_HOME/platform-tools + export PATH=$PATH:$HOME/.cargo/bin -export PATH=$PATH:$HOME/.local/bin +export DOTNET_CLI_TELEMETRY_OPTOUT=1 +export DOTNET_ROOT=$HOME/dotnet +export PATH=$PATH:$HOME/dotnet diff --git a/Misc/Home/.dotfiles/functrc b/Misc/Home/.dotfiles/functrc index 3ebd051..e083099 100644 --- a/Misc/Home/.dotfiles/functrc +++ b/Misc/Home/.dotfiles/functrc @@ -1,7 +1,9 @@ -function cdexec() { - cd "$( dirname "$( realpath "$@" )" )" - basename "$@" -} +#!/bin/sh + +#function cdexec() { +# cd "$( dirname "$( realpath "$@" )" )" +# basename "$@" +#} function touchx() { touch "$@" @@ -11,17 +13,13 @@ function touchx() { function ccr() { gcc "$@" && ./a.out } - function cxxr() { g++ "$@" && ./a.out } function gitacp() { - git add . - git commit -m "$1" && git push + git add . && git commit -m "$1" && git push } - function gitacpc() { - git add . - git commit && git push -} \ No newline at end of file + git add . && git commit && git push +} diff --git a/Misc/Repo.Update.sh b/Misc/Repo.Update.sh new file mode 100755 index 0000000..82854f0 --- /dev/null +++ b/Misc/Repo.Update.sh @@ -0,0 +1,9 @@ +#!/bin/sh +cd "$( dirname "$( realpath "$0" )" )" +. ../Lib.sh + +SetScope Home +mkcd ./Home + cpdir .dotfiles + cpfile .tmux.conf + cpfile .config/micro/settings.json diff --git a/README.md b/README.md index 3ed874b..a2a6f99 100644 --- a/README.md +++ b/README.md @@ -9,5 +9,5 @@ Install oneliner (run as root to install system components) (as I just said, don --> elif [ -n "$(which wget)" ]; then wget -O - "$Url" | sh; else echo "Missing tools. Install \`curl\` or \`wget\`."; fi - +--> fi; diff --git a/Server/Repo.Update.sh b/Server/Repo.Update.sh index b798c34..3169468 100755 --- a/Server/Repo.Update.sh +++ b/Server/Repo.Update.sh @@ -4,6 +4,7 @@ cd "$( dirname "$( realpath "$0" )" )" h=home/pi +SetScope Root mkcd ./Root mkdir -vp ./etc for p in \ @@ -34,6 +35,7 @@ mkcd ./Root cd .. +SetScope Home mkcd ./Home #mkdir -vp ./.config #for p in \