Misc updates

This commit is contained in:
octospacc 2023-05-19 19:54:24 +02:00
parent ac6caf5fb9
commit 181289473b
10 changed files with 65 additions and 26 deletions

View File

@ -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

24
Lib.sh
View File

@ -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"
}

View File

@ -1,5 +1,6 @@
{
"colorscheme": "simple",
"mkparents": true,
"softwrap": true,
"wordwrap": true
}

View File

@ -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"

View File

@ -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

View File

@ -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
}
git add . && git commit && git push
}

9
Misc/Repo.Update.sh Executable file
View File

@ -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

View File

@ -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
</pre>
--> fi; <!--
--></pre>

View File

@ -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 \