diff options
Diffstat (limited to 'home-manager')
35 files changed, 0 insertions, 1324 deletions
diff --git a/home-manager/packages/scripts/apps/deprecated/riR/compare_all_files(has_been_riR) b/home-manager/packages/scripts/apps/deprecated/riR/compare_all_files(has_been_riR) deleted file mode 100755 index 023a2bbf..00000000 --- a/home-manager/packages/scripts/apps/deprecated/riR/compare_all_files(has_been_riR) +++ /dev/null @@ -1,87 +0,0 @@ -#! /bin/bash - -tmp=$(mktemp) -tmp2=$(mktemp) -pstr="[=======================================================================]" -printf "Path to filter: " -read path - -## USE FIND INSTEAD OF LS -cd $path -results -echo "" > results - -declare weirdchars=" &\'" - -function normalise_and_rename() { - declare -a list=("${!1}") - for fileordir in "${list[@]}"; - do - newname="${fileordir//[${weirdchars}]/_}" - [[ ! -a "$newname" ]] && \ - mv "$fileordir" "$newname" || \ - echo "Skipping existing file, $newname." - done -} - -declare -a dirs files - -while IFS= read -r -d '' dir; do - dirs+=("$dir") -done < <(find -type d -print0 | sort -z) - -normalise_and_rename dirs[@] - -while IFS= read -r -d '' file; do - files+=("$file") -done < <(find -type f -print0 | sort -z) - -normalise_and_rename files[@] - -find $path > $tmp -total=$(cat $tmp | wc -l) -#ls -RAx1 --group-directories-first $path | awk NF | awk ' !/\//' > $tmp -#cat $tmp -#exit -for ((i = 1; i <= $(cat $tmp | wc -l); i++)) -do - FILE1=$(cat $tmp | awk -v n=$i 'NR == n {printf $0}') - printf "\r%3d.%1d%% %.${pd}s" $(( $i * 100 / $total )) $(( ($i * 1000 / $total) % 10 )) $pstr - if [ -d ${FILE1} ]; then - printf '%s is a Directory\n' "$FILE1" - else - echo ${FILE1} >> $tmp2 - fi -done -echo "##########################################################################################################################################" -echo "changing to search" -total=$(cat $tmp2 | wc -l) - -for ((i = 1; i <= $(cat $tmp2 | wc -l); i++)) -do - FILE1=$(cat $tmp2 | awk -v n=$i 'NR == n {printf $0}') - printf "total : %3d.%1d%% %.${pd}s\n" $(( $i * 100 / $total )) $(( ($i * 1000 / $total) % 10 )) $pstr - - for ((x = 1; x <= $(cat $tmp2 | wc -l); x++)) - do - FILE2=$(cat $tmp2 | awk -v n=$x 'NR == n {printf $0}') - printf "\r%3d.%1d%% %.${pd}s" $(( $x * 100 / $total )) $(( ($x * 1000 / $total) % 10 )) $pstr - if [ $x -eq $i ]; then - ((x=x+1)) - FILE2=$(cat $tmp2 | awk -v n=$x 'NR == n {printf $0}') - elif [ $(wc -c $FILE2 | awk '{print $1}') != $(wc -c $FILE1 | awk '{print $1}') ]; then - : - else - if cmp --silent "$FILE1" "$FILE2"; then - printf ' %s \n' "$FILE2" >> results - - fi - fi - done -done -echo -echo "#########################################################################" - -cat $dir -rm $tmp -rm $tmp2 diff --git a/home-manager/packages/scripts/apps/deprecated/riR/config b/home-manager/packages/scripts/apps/deprecated/riR/config deleted file mode 100755 index fd6cbc89..00000000 --- a/home-manager/packages/scripts/apps/deprecated/riR/config +++ /dev/null @@ -1,147 +0,0 @@ -#! /usr/bin/env dash -# shellcheck source=/dev/null -. %SHELL_LIBRARY_PATH - -git_repo_home="$XDG_CONFIG_HOME"/git_repo -[ -d "$git_repo_home" ] || mkdir "$git_repo_home" -launch_dir="$(dirname "$(readlink -f "$0")")" - -. "$launch_dir"/utils - -add() { - name=$(basename "$1") - while clean files | awk '{print $1}' | grep -w "^$name$" > /dev/null;do - printf "\"%s\" already exists, new name for link: " "$name" - read -r name - done - cp "$1" "$git_repo_home"/"$name" - { - printf "%s " "$name"; - printf "%s " "$1"; - printf "%s\n" "$(stat -c "%a" "$1")" - } >> "$git_repo_home"/files -} - -remove() { - tmp=$(grepw "$1") - if pre_check "$tmp";then - file_path="$(awk '{print $2}' "$tmp")" - file_name="$(awk '{print $1}' "$tmp")" - - rm "$git_repo_home"/"$file_name" - grep -v "$1" "$git_repo_home"/files > "$tmp" - cat "$tmp" > "$git_repo_home"/files - fi -} - -gitw() { - git --git-dir="$git_repo_home"/.git --work-tree="$git_repo_home" "$@" -} - -deploy_files() { - tmp=$(grepw "$1") - if pre_check "$tmp";then - file_path="$(awk '{print $2}' "$tmp")" - file_name="$(awk '{print $1}' "$tmp")" - file_bits="$(awk '{print $3}' "$tmp")" - - if [ -e "$file_path" ] && ! cmp "$git_repo_home"/"$file_name" "$file_path" > /dev/null;then - if overwrite_check "$file_path" "$file_name" "file" ;then - cp -f "$git_repo_home"/"$file_name" "$file_path" - fi - elif cmp "$git_repo_home"/"$file_name" "$file_path" > /dev/null;then - [ "$AUTO_GEN" = "Y" ] || msg "File is already deployed" - else - cp "$git_repo_home"/"$file_name" "$file_path" - chmod "$file_bits" "$file_path" - fi - fi -} - -update() { - tmp=$(grepw "$1") - if pre_check "$tmp";then - file_path="$(awk '{print $2}' "$tmp")" - file_name="$(awk '{print $1}' "$tmp")" - - if [ -e "$file_path" ] && ! cmp "$git_repo_home"/"$file_name" "$file_path" > /dev/null;then - if overwrite_check "$file_path" "$file_name" "backup" ;then - cp -f "$file_path" "$git_repo_home"/"$file_name" - fi - elif cmp "$git_repo_home"/"$file_name" "$file_path" > /dev/null;then - [ "$AUTO_GEN" = "Y" ] || msg "File does not need to be updated" - else - die "File does not exist on the system!" - fi - fi -} - -usage() { - cat << EO -This is config, an easy dotfiles backup service! - -help Outputs this help -add Adds the specified files -remove Removes the specified files -commit Same as 'config git commit' -git Runs git with the arguments in the backup directory -deploy Copies the specified file, or all files to their location -dump Dumps the 'files' file -update Updates the specified file, or all files if none are supplied -grep Searches for the supplied string in the 'files' file -EO -exit "$1" -} - -case "$1" in - "help") - shift 1 - usage 0 - ;; - "add") - shift 1 - while [ "$1" != "" ];do - add "$(readlink -f "$1")" - shift 1 - done - ;; - "remove") - shift 1 - shift_througth "remove" "$@" - ;; - "commit") - shift 1 - gitw commit - ;; - "git") - shift 1 - gitw "$@" - ;; - "deploy") - shift 1 - shift_througth "deploy_files" "$@" - ;; - "dump") - shift 1 - cat "$git_repo_home"/files - ;; - "update") - shift 1 - shift_througth "update" "$@" - ;; - "grep") - shift 1 - tmp=$(grepw "$1") - cat "$tmp" - ;; - *) - echo "Option $1 not recognized!" - usage 1 - ;; - - esac - - - - - if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/home-manager/packages/scripts/apps/deprecated/riR/lf-move-fill(has_been_riR) b/home-manager/packages/scripts/apps/deprecated/riR/lf-move-fill(has_been_riR) deleted file mode 100755 index 8071dfa7..00000000 --- a/home-manager/packages/scripts/apps/deprecated/riR/lf-move-fill(has_been_riR) +++ /dev/null @@ -1,40 +0,0 @@ -#! /usr/bin/env dash -# shellcheck disable=SC2086 -# shellcheck source=/dev/null -. %SHELL_LIBRARY_PATH - -tmp=$(mktemp); -out=$(mktemp); -clean $XDG_CONFIG_HOME/lf/rel_dirs > $tmp; - -get_hot_key() { - printf g - if ! [ "$i" = "$(readlink -f "$(cat $tmp | sed -n -e ${a}p)")" ];then - printf "%s" "$(basename "$(cat $tmp | sed -n -e ${a}p)" | cut -c 1)"; # i.e. /home/dt/school - fi - #if ! [ "$(realpath i)" = "$(cat $tmp | sed -n -e ${a}p)" ];then - # i = /home/dt/school/informatik - printf "%s" "$(basename $i | cut -c 1)"; - printf "%s" "$(basename $i | cut -c 2)"; - #fi - if [ $i = "$(cat $tmp | sed -n -e ${1}p)" ];then - printf '.'; - fi - -} - - -for a in $(seq "$(cat $tmp | wc -l )");do - echo $a >> $out; - - while IFS= read -r i;do - printf "map %s cd %s\n" "$(get_hot_key "$a")" "$i" >> $out; - done < "$(tmp find "$(cat $tmp | sed -n -e ${a}p)" -maxdepth 1)" - echo >> $out; -done - -cat $out # | awk '{print $2}' | sort | uniq -d; - -rm $tmp; -rm $out; -if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/home-manager/packages/scripts/apps/deprecated/walldl b/home-manager/packages/scripts/apps/deprecated/walldl deleted file mode 100755 index 3b6752db..00000000 --- a/home-manager/packages/scripts/apps/deprecated/walldl +++ /dev/null @@ -1,174 +0,0 @@ -#!/bin/bash -############################################################ -# Help # -############################################################ -Help() -{ - # Display Help - echo "Fetch all images accociated with a given URL." - echo - echo "options:" - echo "-h Print this Help." - echo "-H For Sites with hrefs" - echo "-L For Sites without hrefs" - echo "-C For generated Code" - echo -} - -############################################################ -############################################################ -# Main program # -############################################################ -############################################################ -############################################################ -# Create all needed tmp files and variables. # -############################################################ -Tav() { - pstr="[=======================================================================]" - out="$(mktemp)" - html="$(mktemp)" - NR="$(mktemp)" - printf "URL for Website: " - read url - dir=$(echo "$url" | awk '{ gsub(":|https",""); print $0 }') - try=HighRes -} -############################################################ -# Define downloader engines # -############################################################ -HighRes() { - # For Websites that have hrefs for bigger images - curl -sS $url | awk 'BEGIN { FS="\"";} /href=/ && /img src/ && !/index.html/ { print $2 } ' | awk '!a[$0]++' | sort > $out -} -LowRes() { - # For Websites that don't have hrefs - wget --quiet --output-document=${html} $url - cat $html | tidy --custom-tags pre --show-warnings no -q -output $html - cat $html | awk 'BEGIN { FS="\"";} /src=/ {print $2}' > $out -} -GenCode() { - # For Generated Code blocks - wget --quiet --output-document=${html} $url - cat $html | tidy --custom-tags pre --show-warnings no -q -output $html - - cat $html | awk ' /<img/ {print NR}' > $NR - for ((i = 1; i <= $(cat $NR | wc -l); i++)) - do - lnNums=$(cat $NR | awk -v n=$i ' NR == n {print $0} ') - let "lnNums++" - cat $html | awk -v n=$lnNums 'BEGIN { FS="\"";} NR == n { print $2 } ' >> $out - done -} -############################################################ -# Process the input options. Add options as needed. # -############################################################ -# Get the options -while getopts ":hHLGV" option; do - case $option in - H) - proc=HighRes - ;; - L) - proc=LowRes - ;; - G) - proc=GenCode - ;; - V) - ver=true - ;; - \?) # Invalid option - echo "Error: Invalid option" - ;; - * | h) - Help - exit;; - esac -done -############################################################ -# Download it # -############################################################ -Down() { - total=$(cat $out | wc -l) - if [ $total -eq 0 ]; - then - case $try in - HighRes) - if [ ver ]; - then - echo "trying HighRes engine" - fi - HighRes - try="GenCode" - Down - ;; - LowRes) - if [ ver ]; - then - echo "trying LowRes engine" - fi - LowRes - try=":(" - Down - ;; - GenCode) - if [ ver ]; - then - echo "trying GenCode engine" - fi - GenCode - try="LowRes" - Down - ;; - *) - echo "Nothing found" - exit - ;; - esac - - else - cat $out - read -p "Do you want to download this to ${WALLPAPERDIR}/${dir}?(y/n) " -n 1 -r - echo - - if [[ $REPLY =~ ^[Yy]$ ]]; - then - mkdir -p ${WALLPAPERDIR}/${dir} - cd ${WALLPAPERDIR}/${dir} - url=$(echo $url | awk ' BEGIN {FS="/";} {printf "%s//%s/", $1, $3 } ' ) - # cycle throught all pictures and download them - for ((i = 0; i <= $total; i++ )) - do - awk -v n=$i 'FNR == n ' ${out} | xargs printf "$url%s\n" | xargs curl -OsS - pd=$(( $i * 73 / $total )) - printf "\r%3d.%1d%% %.${pd}s" $(( $i * 100 / $total )) $(( ($i * 1000 / $total) % 10 )) $pstr - done - printf "\n" - echo "downloaded to ${WALLPAPERDIR}${dir}" - rm -f "$out" - rm -f "$html" - rm -f "$NR" - fi - fi -} -############################################################ -# Call the functions # -############################################################ - -Tav -# case $proc in -# HighRes) -# HighRes -# ;; -# LowRes) -# LowRes -# ;; -# GenCode) -# GenCode -# ;; -# *) -# echo "No engine specified" -# exit -# ;; -# esac -Down diff --git a/home-manager/packages/scripts/deprecated/clear_systemd b/home-manager/packages/scripts/deprecated/clear_systemd deleted file mode 100755 index 56cfe95e..00000000 --- a/home-manager/packages/scripts/deprecated/clear_systemd +++ /dev/null @@ -1,27 +0,0 @@ -#! /bin/bash - -tmp=$(mktemp) -tmp2=$(mktemp) -tmp3=$(mktemp) - -cat /mnt/pack > $tmp -cat /mnt/pack2 > $tmp2 - -if [ $(cat $tmp2 | wc -l) -gt $(cat $tmp | wc -l) ];then - cat $tmp2 > $tmp3 - cat $tmp > $tmp2 - cat $tmp3 > $tmp -fi - -for ((i=1; i<=$(cat $tmp | wc -l) ; i++)) -do - if grep -Fxq "$(awk -v n=$i 'NR==n' $tmp)" $tmp2; then - : - else - echo "$(awk -v n=$i 'NR==n' $tmp)" - fi -done - -rm $tmp -rm $tmp2 -rm $tmp3 diff --git a/home-manager/packages/scripts/deprecated/comp b/home-manager/packages/scripts/deprecated/comp deleted file mode 100755 index 15b005c8..00000000 --- a/home-manager/packages/scripts/deprecated/comp +++ /dev/null @@ -1,32 +0,0 @@ -#! /usr/bin/env dash -# shellcheck disable=SC2086 -# shellcheck source=/dev/null -. %SHELL_LIBRARY_PATH - -file=$HOME/hi -tmp=$(mktemp) - -file2=$HOME/hi2 -tmp2=$(mktemp) -cat $file | awk -F "," '{ - for (i = 1; i <= 100; i++) { - if ($i == 0) { - } else { - print $i - } - } -}' | clean > $tmp - -cat $file2 | awk -F "," '{ - for (i = 1; i <= 100; i++) { - if ($i == 0) { - } else { - print $i - } - } -}' | clean > $tmp2 - -diff -y $tmp $tmp2 - -rm $tmp -if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/home-manager/packages/scripts/deprecated/csd b/home-manager/packages/scripts/deprecated/csd deleted file mode 100755 index 33105314..00000000 --- a/home-manager/packages/scripts/deprecated/csd +++ /dev/null @@ -1,11 +0,0 @@ -#! /bin/zsh -function cd () { - if (( ${#argv} == 1 )) && [[ -f ${1} ]]; then - [[ ! -e ${1:h} ]] && return 1 - print "Correcting ${1} to ${1:h}" - builtin cd ${1:h} - else - builtin cd "$@" - fi -} - diff --git a/home-manager/packages/scripts/deprecated/dua b/home-manager/packages/scripts/deprecated/dua deleted file mode 100755 index 628fa6f2..00000000 --- a/home-manager/packages/scripts/deprecated/dua +++ /dev/null @@ -1,6 +0,0 @@ -#! /bin/bash - -tmp=$(mktemp) -cat $DUA_DATABASE > $tmp - -cat $tmp | awk '{print $1}' | sort diff --git a/home-manager/packages/scripts/deprecated/dua-up b/home-manager/packages/scripts/deprecated/dua-up deleted file mode 100755 index 2201f351..00000000 --- a/home-manager/packages/scripts/deprecated/dua-up +++ /dev/null @@ -1,3 +0,0 @@ -#! /bin/bash -sudo btrfs filesystem du --raw / > $DUA_DATABASE -echo "done" diff --git a/home-manager/packages/scripts/deprecated/enhanched_neofetch b/home-manager/packages/scripts/deprecated/enhanched_neofetch deleted file mode 100755 index 2026341f..00000000 --- a/home-manager/packages/scripts/deprecated/enhanched_neofetch +++ /dev/null @@ -1,3 +0,0 @@ -#! /bin/bash - -export ENHANCHED_NEOFETCH='$(pacman -Qn | wc -l) (pacman), $(pacman -Qm | wc -l) (aur), $(($(cargo install --list | wc -l ) / 2)) (cargo)' diff --git a/home-manager/packages/scripts/deprecated/git-init b/home-manager/packages/scripts/deprecated/git-init deleted file mode 100755 index 1d007b6f..00000000 --- a/home-manager/packages/scripts/deprecated/git-init +++ /dev/null @@ -1,11 +0,0 @@ -#! /usr/bin/env dash -# shellcheck disable=SC2086 -# shellcheck source=/dev/null -. %SHELL_LIBRARY_PATH - -cp -R $HOME/.local/share/git-template/* "$(pwd)" -[ -d ./.git ] || git init - - - -if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/home-manager/packages/scripts/deprecated/java_compiler/clpa b/home-manager/packages/scripts/deprecated/java_compiler/clpa deleted file mode 100755 index 0c8ba47a..00000000 --- a/home-manager/packages/scripts/deprecated/java_compiler/clpa +++ /dev/null @@ -1,15 +0,0 @@ -#! /usr/bin/env dash -# shellcheck disable=SC2086 -# shellcheck source=/dev/null -pw=$(pwd) -[ "$n" = "n" ] || cd .. -noColor=yes . ./lib - -unset CLASSPATH - -while IFS= read -r i;do - export CLASSPATH=$CLASSPATH$i: -done < "$(tmp cat "$(tmp "find $(pwd)/libs | sed 1d") $(tmp "find $(pwd)/scr | sed 1d")")" -cd $pw - -if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/home-manager/packages/scripts/deprecated/java_compiler/fmt b/home-manager/packages/scripts/deprecated/java_compiler/fmt deleted file mode 100755 index 7bfe920b..00000000 --- a/home-manager/packages/scripts/deprecated/java_compiler/fmt +++ /dev/null @@ -1,16 +0,0 @@ -#! /usr/bin/env dash -# shellcheck disable=SC2086 -# shellcheck source=/dev/null -. %SHELL_LIBRARY_PATH - -cd ..; -pw=$(pwd); -cd ..; - -while IFS= read -r i;do - java -jar google-java-format-1.15.0-all-deps.jar -i $i -done < "$(tmp "find $pw/scr | sed 1d")" - - - -if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/home-manager/packages/scripts/deprecated/java_compiler/jc b/home-manager/packages/scripts/deprecated/java_compiler/jc deleted file mode 100755 index d1c867d4..00000000 --- a/home-manager/packages/scripts/deprecated/java_compiler/jc +++ /dev/null @@ -1,34 +0,0 @@ -#! /usr/bin/env dash -# shellcheck disable=SC2086 - -cd .. -noColor=yes . ./lib - -export CLASSPATH= -scr=$(mktemp) - -while IFS= read -r a;do - export CLASSPATH=$CLASSPATH$a: -done < "$(tmp "find libs/ | sed 1d")" - -while IFS= read -r a;do - echo "$a" >> $scr -done < "$(tmp "find scr/ | sed 1d")" - -n=n . ./clpa - -#while IFS= read -r a;do -# rm "$a" -#done < "$(tmp "find target/ | sed 1d")" - -javac -d target/ $(cat $scr | tr '\n' ' ') -if [ "$1" = "r" ];then - cd target || die "bug" - java Main - cd .. -else - ./jj target/ libs/ -fi - -rm $scr -if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/home-manager/packages/scripts/deprecated/java_compiler/jj b/home-manager/packages/scripts/deprecated/java_compiler/jj deleted file mode 100755 index 3f3254ba..00000000 --- a/home-manager/packages/scripts/deprecated/java_compiler/jj +++ /dev/null @@ -1,58 +0,0 @@ -#! /usr/bin/env dash -# shellcheck disable=SC2086 -noColor=yes . ./lib - -help() { -cat << EOF -Add all dirs with trailing / - -\$1 = java .class files dir -\$2 = java .jar files dir - -if you want to update libs delete this: -$wd/libs.cache - -EOF -exit 0 -} - - -class=$(mktemp) -jar=$(mktemp) -pwd=$(pwd) - -mkdir "$pwd"/out/cache 2> /dev/null -wd="$pwd"/out/cache -[ "$1" = "-h" ] && help -[ "$1" = "--help" ] && help - -[ -z "$1" ] && error "no args" && help && exit 1 -[ -z "$2" ] && error "no args" && help && exit 1 - -while IFS= read -r i;do - cp "$i" $wd/"$(basename $i)" -done < "$(tmp "find $1 | sed 1d" )" - -while IFS= read -r i;do - if ! grep "^$i$" "$wd"/libs.cache;then - echo "$i" | sed "s|$2||" >> "$wd"/libs.cache - cd $wd - jar -xf "$pwd"/"$i" - cd $pwd - fi -done < "$(tmp "find $2 | sed 1d" )" - -while IFS= read -r a;do - echo "$a" | sed "s|$wd/||" >> $jar -done < "$(tmp "find $wd | sed 1d")" - - - -cd "$wd" || die "No $wd" -jar -c -f myJar.jar -e Main $(cat $jar | tr '\n' ' ') - -mv myJar.jar "$pwd"/out/myJar.jar - -rm $jar -rm $class -if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/home-manager/packages/scripts/deprecated/java_compiler/lib b/home-manager/packages/scripts/deprecated/java_compiler/lib deleted file mode 100755 index cf3e0203..00000000 --- a/home-manager/packages/scripts/deprecated/java_compiler/lib +++ /dev/null @@ -1,41 +0,0 @@ -#! /usr/bin/env dash -# shellcheck disable=SC2059,SC2066 - - - -out() { printf "$1 $2\n" "$(out2 "$@")"; } -out2() { shift 2; for i in "$*";do printf "$i";done; } - - -if [ "$noColor" = "yes" ];then -error() { >&2 out "==> ERROR:" "$*"; } >&2 -warning() { >&2 out "==> WARNING:" "$*"; } >&2 -msg() { out "==>" "$*"; } -msg2() { out " ->" "$*"; } - -readp() { printf "..> $1"; read -r "$2"; } - -else -error() { >&2 out "\033[1;91m==> ERROR:\033[0m" "\033[1;93m$*\033[0m"; } >&2 -warning() { >&2 out "\033[1;91m==> WARNING:\033[0m" "\033[1;93m$*\033[0m"; } >&2 -msg() { out "\033[1;96m==>\033[0m" "\033[1;93m$*\033[0m"; } -msg2() { out "\033[1;96m ->\033[0m" "\033[1;93m$*\033[0m"; } - -readp() { printf "\033[1;96m..>\033[0m \033[1;93m$1\033[0m"; read -r "$2"; } -fi - - - - - -dien() { error "$@" "failed"; exit 1; } -die() { error "$@"; exit 1; } - -clean() { awk '{if (NF) {if (!/^#/) {if (!/^[[:blank:]]*#/) {print $0}}}}' "$1"; } -# shellcheck disable=SC2294 -tmp() { - [ -d /tmp/LIB_FILE_TEMP_DIR/ ] || mkdir /tmp/LIB_FILE_TEMP_DIR/ - tmp=$(mktemp -p /tmp/LIB_FILE_TEMP_DIR/); - eval "$@" 1> "$tmp"; - echo "$tmp"; -} diff --git a/home-manager/packages/scripts/deprecated/java_compiler/new b/home-manager/packages/scripts/deprecated/java_compiler/new deleted file mode 100755 index 22f871f5..00000000 --- a/home-manager/packages/scripts/deprecated/java_compiler/new +++ /dev/null @@ -1,37 +0,0 @@ -#! /usr/bin/env dash -# shellcheck disable=SC2086 -# shellcheck source=/dev/null -. ./lib - - -[ -z "$1" ] && die "Requires name" -mkdir "$1" -pw="$1" - -ln -sr jc ./$pw/jc -ln -sr jj ./$pw/jj -ln -sr clpa ./$pw/clpa -ln -sr lib ./$pw/lib -ln -sr fmt ./$pw/fmt - -cd $pw -mkdir libs -mkdir -p out/cache -mkdir scr -mkdir target - -cat > scr/Main.java << EOL -public class Main { - public static void main(String[] args) { - System.out.println("Hello, world!"); - } -} -EOL -cat > .gitignore << EOL -/target -.gitignore -/out -EOL -git init > /dev/null -[ -d /tmp/LIB_FILE_TEMP_DIR/ ] && rm -r /tmp/LIB_FILE_TEMP_DIR/ -exit 0 diff --git a/home-manager/packages/scripts/deprecated/java_compiler/no-pack/jc-no-pack b/home-manager/packages/scripts/deprecated/java_compiler/no-pack/jc-no-pack deleted file mode 100755 index 0cd9864e..00000000 --- a/home-manager/packages/scripts/deprecated/java_compiler/no-pack/jc-no-pack +++ /dev/null @@ -1,22 +0,0 @@ -#! /usr/bin/env dash -# shellcheck disable=SC2086 - -. ./lib -cd .. - -export CLASSPATH= -scr=$(mktemp) - -while IFS= read -r a;do - export CLASSPATH=$CLASSPATH$a: -done < "$(tmp "find libs/ | sed 1d")" - -while IFS= read -r a;do - echo "$a" >> $scr -done < "$(tmp "find scr/ | sed 1d")" - -javac -d target/ $(cat $scr | tr '\n' ' ') -../jj target/ libs/ -[ "$1" = "r" ] && java -jar out/myJar.jar - -rm $scr diff --git a/home-manager/packages/scripts/deprecated/java_compiler/no-pack/jj-no-pack b/home-manager/packages/scripts/deprecated/java_compiler/no-pack/jj-no-pack deleted file mode 100755 index d476ce52..00000000 --- a/home-manager/packages/scripts/deprecated/java_compiler/no-pack/jj-no-pack +++ /dev/null @@ -1,57 +0,0 @@ -#! /usr/bin/env dash -# shellcheck disable=SC2086 -. ./lib - -help() { -cat << EOF -Add all dirs with trailing / - -\$1 = java .class files dir -\$2 = java .jar files dir - -if you want to update libs delete this: -"$wd"/libs.cache - -EOF -exit 0 -} - - -class=$(mktemp) -jar=$(mktemp) -pwd=$(pwd) - -mkdir "$pwd"/out/cache 2> /dev/null -wd="$pwd"/out/cache -[ "$1" = "-h" ] && help -[ "$1" = "--help" ] && help - -[ -z "$1" ] && echo "no args" && help && exit 1 -[ -z "$2" ] && echo "no args" && help && exit 1 - -while IFS= read -r i;do - cp "$i" $wd/"$(basename $i)" -done < "$(tmp "find $1 | sed 1d" )" - -while IFS= read -r i;do - if ! grep "^$i$" "$wd"/libs.cache;then - echo "$i" | sed "s|$2||" >> "$wd"/libs.cache - cd $wd - jar -xf "$pwd"/"$i" - cd $pwd - fi -done < "$(tmp "find $2 | sed 1d" )" - -while IFS= read -r a;do - echo "$a" | sed "s|$wd/||" >> $jar -done < "$(tmp "find $wd | sed 1d")" - - - -cd "$wd" || die "No $wd" -jar -c -f myJar.jar -e Main $(cat $jar | tr '\n' ' ') - -mv myJar.jar "$pwd"/out/myJar.jar - -rm $jar -rm $class diff --git a/home-manager/packages/scripts/deprecated/remove_start b/home-manager/packages/scripts/deprecated/remove_start deleted file mode 100755 index 1b4c4e6e..00000000 --- a/home-manager/packages/scripts/deprecated/remove_start +++ /dev/null @@ -1,29 +0,0 @@ -#! /bin/bash - -cd "$i" || exit 1 -rm -r /tmp/scr -mkdir /tmp/scr/ -star='#! /usr/bin/env dash\n\n# shellcheck source=/dev/null\n. /root/.local/lib/shell/lib' - -for i in "$1"/*;do - awk ' - !/out2\(/ && - !/readp\(/ && - !/# shellcheck/ && - !/^#!\/bin\/sh/ && - !/^#! \/bin\/sh/ && - !/^#! \/bin\/bash/ && - !/^#!\/bin\/bash/ && - !/^out\(/ && - !/^error\(/ && - !/^warning\(/ && - !/^msg\(/ && - !/msg2\(/ && - !/^die\(/ && - !/^dien\(/ - ' "$i" > /tmp/scr/"$(basename "$i")" - sed -i "1 s|.*|$star\n&|" /tmp/scr/"$(basename "$i")" - -done - - diff --git a/home-manager/packages/scripts/deprecated/shell_script_os_setup/lo b/home-manager/packages/scripts/deprecated/shell_script_os_setup/lo deleted file mode 100755 index f61e297d..00000000 --- a/home-manager/packages/scripts/deprecated/shell_script_os_setup/lo +++ /dev/null @@ -1,11 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -. %SHELL_LIBRARY_PATH - - -stty -ctlecho -sudo loadkeys $HOME/keymap.map - -sh -c "$*" -sudo loadkeys "$(awk 'BEGIN {FS="="} {if (NR==1) {print $2;}}' /etc/vconsole.conf)" diff --git a/home-manager/packages/scripts/small_functions/deprecated/locate_rewrite/locate b/home-manager/packages/scripts/small_functions/deprecated/locate_rewrite/locate deleted file mode 100755 index 3dbddae9..00000000 --- a/home-manager/packages/scripts/small_functions/deprecated/locate_rewrite/locate +++ /dev/null @@ -1,2 +0,0 @@ -#! /bin/bash -awk --assign=se=$1 ' $0 ~ se {print $0} ' "${LOCATE_DATABASE}" diff --git a/home-manager/packages/scripts/small_functions/deprecated/locate_rewrite/update_locate_database b/home-manager/packages/scripts/small_functions/deprecated/locate_rewrite/update_locate_database deleted file mode 100755 index 88330ff6..00000000 --- a/home-manager/packages/scripts/small_functions/deprecated/locate_rewrite/update_locate_database +++ /dev/null @@ -1,8 +0,0 @@ -#! /bin/bash -LOCATE_DATABASE="/home/dt/.cache/locate.db" -if [ ! -e ${LOCATE_DATABASE} ]; then - touch ${LOCATE_DATABASE} -fi -echo $(date) > ${LOCATE_DATABASE} -sudo find / >> ${LOCATE_DATABASE} - diff --git a/home-manager/packages/scripts/small_functions/deprecated/order b/home-manager/packages/scripts/small_functions/deprecated/order deleted file mode 100755 index e87d409d..00000000 --- a/home-manager/packages/scripts/small_functions/deprecated/order +++ /dev/null @@ -1,12 +0,0 @@ -#! /usr/bin/env dash -# shellcheck disable=SC2086 -# shellcheck source=/dev/null -. %SHELL_LIBRARY_PATH - -file=$HOME/hi3 -cat $file | clean | awk '{ - print (""$2" => {println!(\""$1"\")}") -}' - - -if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/home-manager/packages/scripts/small_functions/deprecated/ply-pre b/home-manager/packages/scripts/small_functions/deprecated/ply-pre deleted file mode 100755 index 7053ac62..00000000 --- a/home-manager/packages/scripts/small_functions/deprecated/ply-pre +++ /dev/null @@ -1,33 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -. %SHELL_LIBRARY_PATH - - -## Preview Plymouth Splash ## -## by _khAttAm_ ## -## www.khattam.info ## -## License: GPL v3 ## - -chk_root () { - - if [ ! "$( id -u )" -eq 0 ]; then - echo Must be run as root - exit 1 - fi - -} - -chk_root - -DURATION=$1 - -if [ $# -ne 1 ]; then - DURATION=5 -fi - -plymouthd; plymouth --show-splash ; -for i in $(seq 1 $DURATION); do - plymouth --update=test"$i" ; sleep 1; -done; -plymouth quit diff --git a/home-manager/packages/scripts/small_functions/screen_shot b/home-manager/packages/scripts/small_functions/screen_shot index 732f3e76..92c37fdd 100755 --- a/home-manager/packages/scripts/small_functions/screen_shot +++ b/home-manager/packages/scripts/small_functions/screen_shot @@ -7,5 +7,3 @@ grim -g "$(slurp)" ~/media/pictures/screenshots/"$(date +%s)".png && alacritty -e llp -command ":{{ set sortby atime; set reverse!; }}" ~/media/pictures/screenshots - -if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/home-manager/packages/scripts/wrappers/deprecated/clippy b/home-manager/packages/scripts/wrappers/deprecated/clippy deleted file mode 100755 index ec21ba07..00000000 --- a/home-manager/packages/scripts/wrappers/deprecated/clippy +++ /dev/null @@ -1,56 +0,0 @@ -#! /usr/bin/env dash -# shellcheck disable=SC2086 -# shellcheck source=/dev/null -. %SHELL_LIBRARY_PATH - -tmp=$(mktemp); -cat << EOF > $tmp; --W clippy::allow_attributes_without_reason --W clippy::clone_on_ref_ptr --W clippy::create_dir --W clippy::decimal_literal_representation --W clippy::filetype_is_file --W clippy::get_unwrap --W clippy::if_then_some_else_none --W clippy::large_include_file --W clippy::let_underscore_must_use --W clippy::missing_enforced_import_renames --W clippy::mixed_read_write_in_expression --W clippy::mod_module_files --W clippy::multiple_inherent_impl --W clippy::rc_mutex --W clippy::rc_buffer --W clippy::rest_pat_in_fully_bound_structs --W clippy::same_name_method --W clippy::single_char_lifetime_names --W clippy::str_to_string --W clippy::string_to_string --W clippy::unneeded_field_pattern --W clippy::unseparated_literal_suffix --W clippy::verbose_file_reads --W clippy::wildcard_enum_match_arm - -# debugging remnants --W clippy::unwrap_used -#-W clippy::use_debug -#-W clippy::unreachable -#-W clippy::unimplemented -#-W clippy::todo -#-W clippy::panic -#-W clippy::panic_in_result_fn -#-W clippy::expect_used -#-W clippy::dbg_macro - -# Docs --W clippy::missing_docs_in_private_items --W clippy::undocumented_unsafe_blocks - - -EOF - - -cargo clippy -- -W clippy::pedantic -W clippy::nursery -W clippy::unwrap_used -W clippy::expect_used -W clippy::cargo $(clean "$tmp") - - - -if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/home-manager/packages/scripts/wrappers/deprecated/ll.old b/home-manager/packages/scripts/wrappers/deprecated/ll.old deleted file mode 100755 index d177b341..00000000 --- a/home-manager/packages/scripts/wrappers/deprecated/ll.old +++ /dev/null @@ -1,13 +0,0 @@ -#! /bin/bash -export LLP=0 -tmp="$(mktemp)" -lf -last-dir-path="$tmp" "$@" -if [ -f "$tmp" ]; then - dir="$(cat "$tmp")" - rm -f "$tmp" - if [ -d "$dir" ]; then - if [ "$dir" != "$(pwd)" ]; then - cd "$dir" - fi - fi -fi diff --git a/home-manager/packages/scripts/wrappers/deprecated/pacman/pacComp b/home-manager/packages/scripts/wrappers/deprecated/pacman/pacComp deleted file mode 100755 index 5c451ad8..00000000 --- a/home-manager/packages/scripts/wrappers/deprecated/pacman/pacComp +++ /dev/null @@ -1,28 +0,0 @@ -#! /usr/bin/env dash -# shellcheck disable=SC2086 -# shellcheck source=/dev/null -. %SHELL_LIBRARY_PATH - - - -for i in $(cat ~/pacsaves);do - - a=$(echo $i | sed 's|.pacsave||') - - printf "%s AND %s\n" "$a" "$i" - sudo diff -y "$a" "$i" - a= - readp "Delete .pacsave? [N/y]" ans - if [ "$ans" = y ];then - sudo rm $i - sed -i "s|$i||" ~/pacsaves - fi - - -done - - - - - -if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/home-manager/packages/scripts/wrappers/deprecated/pacman/pacF b/home-manager/packages/scripts/wrappers/deprecated/pacman/pacF deleted file mode 100755 index 09ea8ae5..00000000 --- a/home-manager/packages/scripts/wrappers/deprecated/pacman/pacF +++ /dev/null @@ -1,19 +0,0 @@ -#! /usr/bin/env dash -# shellcheck disable=SC2086 -# shellcheck source=/dev/null -. %SHELL_LIBRARY_PATH - - -while true -do - tmp=$(mktmp) - readp "Input: " pac - pacman -F --color=always $pac > $tmp - cat "$tmp" - cat $tmp | awk -F "/" 'NR==1 {print $2}' - rm $tmp -done - - - -if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/home-manager/packages/scripts/wrappers/deprecated/pacman/pacS b/home-manager/packages/scripts/wrappers/deprecated/pacman/pacS deleted file mode 100755 index 99b0e9a5..00000000 --- a/home-manager/packages/scripts/wrappers/deprecated/pacman/pacS +++ /dev/null @@ -1,14 +0,0 @@ -#! /usr/bin/env dash -# shellcheck disable=SC2086 -# shellcheck source=/dev/null -. %SHELL_LIBRARY_PATH - -while true -do - readp "Package Name: " pac - pacman -Si --color=always "$pac" -done - - - -if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/home-manager/packages/scripts/wrappers/deprecated/pacman/packages_scan b/home-manager/packages/scripts/wrappers/deprecated/pacman/packages_scan deleted file mode 100755 index 8beef249..00000000 --- a/home-manager/packages/scripts/wrappers/deprecated/pacman/packages_scan +++ /dev/null @@ -1,20 +0,0 @@ -#! /usr/bin/env dash -# shellcheck disable=SC2086 -# shellcheck source=/dev/null -. %SHELL_LIBRARY_PATH - -tmp=$(tmp 'pacman -Qq'); -output=$(mktmp); - - -while read -r line; do - msg2 reading $line; - pacman_out=$(tmp "pacman -Qi $line"); - description=$(awk -F ":" '/Description/ {print $2}' $pacman_out); - printf "%s # " $line >> $output; - echo $description >> $output; -done < $tmp - -cat $output; - -if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/home-manager/packages/scripts/wrappers/deprecated/tidal-dl b/home-manager/packages/scripts/wrappers/deprecated/tidal-dl deleted file mode 100755 index c709a63d..00000000 --- a/home-manager/packages/scripts/wrappers/deprecated/tidal-dl +++ /dev/null @@ -1,11 +0,0 @@ -#! /bin/bash -tmp=$(mktemp) - -scrap > $tmp - -for ((i=0; i < $( cat $tmp | wc -l); i++)) -do - out=$(awk -v n=$i 'NR == n {print $0}' $tmp) - spotdl --output /home/dt/media/playlist/down --output-format mp3 --lyrics-provider genius --dt 16 --st 16 "${out}" -done - diff --git a/home-manager/packages/scripts/wrappers/deprecated/xi b/home-manager/packages/scripts/wrappers/deprecated/xi deleted file mode 100755 index 7d8e2639..00000000 --- a/home-manager/packages/scripts/wrappers/deprecated/xi +++ /dev/null @@ -1,12 +0,0 @@ -#! /usr/bin/env dash -# shellcheck disable=SC2086 -# shellcheck source=/dev/null -. %SHELL_LIBRARY_PATH - -export XKB_DEFAULT_LAYOUT="mykeys" -exec river - - - - -# if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/home-manager/packages/scripts/wrappers/deprecated/xs b/home-manager/packages/scripts/wrappers/deprecated/xs deleted file mode 100755 index 954cbca9..00000000 --- a/home-manager/packages/scripts/wrappers/deprecated/xs +++ /dev/null @@ -1,233 +0,0 @@ -#! /usr/bin/env dash - -# -# This is just a sample implementation of a slightly less primitive -# interface than xinit. It looks for user .xinitrc and .xserverrc -# files, then system xinitrc and xserverrc files, else lets xinit choose -# its default. The system xinitrc should probably do things like check -# for .Xresources files and merge them in, start up a window manager, -# and pop a clock and several xterms. -# -# Site administrators are STRONGLY urged to write nicer versions. -# - -unset SESSION_MANAGER -userclientrc=$XDG_CONFIG_HOME/X11/xinitrc -sysclientrc=/etc/X11/xinit/xinitrc - -userserverrc=$HOME/.xserverrc -sysserverrc=/etc/X11/xinit/xserverrc -defaultclient=xterm -defaultserver=/usr/bin/X -defaultclientargs="" -defaultserverargs="" -defaultdisplay="" -clientargs="" -serverargs="" -vtarg="" -enable_xauth=1 - - -# Automatically determine an unused $DISPLAY -d=0 -while true ; do - [ -e "/tmp/.X$d-lock" -o -S "/tmp/.X11-unix/X$d" ] || break - d=$(($d + 1)) -done -defaultdisplay=":$d" -unset d - -whoseargs="client" -while [ x"$1" != x ]; do - case "$1" in - # '' required to prevent cpp from treating "/*" as a C comment. - /''*|\./''*) - if [ "$whoseargs" = "client" ]; then - if [ x"$client" = x ] && [ x"$clientargs" = x ]; then - client="$1" - else - clientargs="$clientargs $1" - fi - else - if [ x"$server" = x ] && [ x"$serverargs" = x ]; then - server="$1" - else - serverargs="$serverargs $1" - fi - fi - ;; - --) - whoseargs="server" - ;; - *) - if [ "$whoseargs" = "client" ]; then - clientargs="$clientargs $1" - else - # display must be the FIRST server argument - if [ x"$serverargs" = x ] && \ - expr "$1" : ':[0-9][0-9]*$' > /dev/null 2>&1; then - display="$1" - else - serverargs="$serverargs $1" - fi - fi - ;; - esac - shift -done - -# process client arguments -if [ x"$client" = x ]; then - client=$defaultclient - - # For compatibility reasons, only use startxrc if there were no client command line arguments - if [ x"$clientargs" = x ]; then - if [ -f "$userclientrc" ]; then - client=$userclientrc - elif [ -f "$sysclientrc" ]; then - client=$sysclientrc - fi - fi -fi - -# if no client arguments, use defaults -if [ x"$clientargs" = x ]; then - clientargs=$defaultclientargs -fi - -# process server arguments -if [ x"$server" = x ]; then - server=$defaultserver - - - # When starting the defaultserver start X on the current tty to avoid - # the startx session being seen as inactive: - # "https://bugzilla.redhat.com/show_bug.cgi?id=806491" - tty=$(tty) - if expr "$tty" : '/dev/tty[0-9][0-9]*$' > /dev/null; then - tty_num=$(echo "$tty" | grep -oE '[0-9]+$') - vtarg="vt$tty_num -keeptty" - fi - - - # For compatibility reasons, only use xserverrc if there were no server command line arguments - if [ x"$serverargs" = x -a x"$display" = x ]; then - if [ -f "$userserverrc" ]; then - server=$userserverrc - elif [ -f "$sysserverrc" ]; then - server=$sysserverrc - fi - fi -fi - -# if no server arguments, use defaults -if [ x"$serverargs" = x ]; then - serverargs=$defaultserverargs -fi - -# if no vt is specified add vtarg (which may be empty) -have_vtarg="no" -for i in $serverargs; do - if expr "$i" : 'vt[0-9][0-9]*$' > /dev/null; then - have_vtarg="yes" - fi -done -if [ "$have_vtarg" = "no" ]; then - serverargs="$serverargs $vtarg" -fi - -# if no display, use default -if [ x"$display" = x ]; then - display=$defaultdisplay -fi - -if [ x"$enable_xauth" = x1 ] ; then - if [ x"$XAUTHORITY" = x ]; then - XAUTHORITY=$HOME/.Xauthority - export XAUTHORITY - fi - - removelist= - - # set up default Xauth info for this machine - hostname=`uname -n` - - authdisplay=${display:-:0} - - mcookie=`/usr/bin/mcookie` - - - - - - - - if test x"$mcookie" = x; then - echo "Couldn't create cookie" - exit 1 - fi - dummy=0 - - # create a file with auth information for the server. ':0' is a dummy. - xserverauthfile=`mktemp -p /tmp serverauth.XXXXXXXXXX` - trap "rm -f '$xserverauthfile'" HUP INT QUIT ILL TRAP KILL BUS TERM - xauth -q -f "$xserverauthfile" << EOF -add :$dummy . $mcookie -EOF - - - - - serverargs=${serverargs}" -auth "${xserverauthfile} - - - # now add the same credentials to the client authority file - # if '$displayname' already exists do not overwrite it as another - # server may need it. Add them to the '$xserverauthfile' instead. - for displayname in $authdisplay $hostname/unix$authdisplay; do - authcookie=`xauth list "$displayname" \ - | sed -n "s/.*$hostname\/unix$authdisplay[[:space:]*].*[[:space:]*]//p"` 2>/dev/null; - if [ "z${authcookie}" = "z" ] ; then - xauth -q << EOF -add $displayname . $mcookie -EOF - removelist="$displayname $removelist" - else - dummy=$(($dummy+1)); - xauth -q -f "$xserverauthfile" << EOF -add :$dummy . $authcookie -EOF - fi - done -fi - - - - -xinit "$client" $clientargs -- "$server" $display $serverargs - -retval=$? - -if [ x"$enable_xauth" = x1 ] ; then - if [ x"$removelist" != x ]; then - xauth remove $removelist - fi - if [ x"$xserverauthfile" != x ]; then - rm -f "$xserverauthfile" - fi -fi - - - - - -if command -v deallocvt > /dev/null 2>&1; then - deallocvt -fi - - - - - - -exit $retval |