From 7ed7836a6b075369de67bb1c6092cd8612ff3849 Mon Sep 17 00:00:00 2001 From: Adam <24621027+adoyle0@users.noreply.github.com> Date: Wed, 10 Jan 2024 00:21:14 -0500 Subject: [PATCH] ye --- configs/shell/profile | 40 +++++++++++++++++----------------------- scripts/copy_and_link | 16 +++++++++------- setup | 36 +++++++++++++++++++----------------- 3 files changed, 45 insertions(+), 47 deletions(-) diff --git a/configs/shell/profile b/configs/shell/profile index 3055575..ccdbcc5 100644 --- a/configs/shell/profile +++ b/configs/shell/profile @@ -34,30 +34,24 @@ export ZDOTDIR="${XDG_CONFIG_HOME:-$HOME/.config}/shell/zsh" # Other program settings: export FZF_DEFAULT_OPTS="--layout=reverse --height 40%" -export LESS=-R -export LESSOPEN="| /usr/bin/highlight -O ansi %s 2>/dev/null" export QT_QPA_PLATFORMTHEME="gtk2" # Have QT use gtk2 theme. -export LESS_TERMCAP_mb -LESS_TERMCAP_mb="$(printf '%b' '')" - -export LESS_TERMCAP_md -LESS_TERMCAP_md="$(printf '%b' '')" - -export LESS_TERMCAP_me -LESS_TERMCAP_me="$(printf '%b' '')" - -export LESS_TERMCAP_se -LESS_TERMCAP_se="$(printf '%b' '')" - -export LESS_TERMCAP_so -LESS_TERMCAP_so="$(printf '%b' '')" - -export LESS_TERMCAP_ue -LESS_TERMCAP_ue="$(printf '%b' '')" - -export LESS_TERMCAP_us -LESS_TERMCAP_us="$(printf '%b' '')" - +# export LESS=-R +# export LESSOPEN="| /usr/bin/highlight -O ansi %s 2>/dev/null" +# export LESS_TERMCAP_mb +# LESS_TERMCAP_mb="$(printf '%b' '')" +# export LESS_TERMCAP_md +# LESS_TERMCAP_md="$(printf '%b' '')" +# export LESS_TERMCAP_me +# LESS_TERMCAP_me="$(printf '%b' '')" +# export LESS_TERMCAP_se +# LESS_TERMCAP_se="$(printf '%b' '')" +# export LESS_TERMCAP_so +# LESS_TERMCAP_so="$(printf '%b' '')" +# export LESS_TERMCAP_ue +# LESS_TERMCAP_ue="$(printf '%b' '')" +# export LESS_TERMCAP_us +# LESS_TERMCAP_us="$(printf '%b' '')" +# # Multithreading export XZ_DEFAULTS="-T 0" diff --git a/scripts/copy_and_link b/scripts/copy_and_link index 1275a6a..b9aa629 100755 --- a/scripts/copy_and_link +++ b/scripts/copy_and_link @@ -4,22 +4,24 @@ set -e # Copy configs and make a backup if it already exists printf "\nInstalling Configs..." -for file in configs/* +cd configs +for file in * do printf "\n%s..." "$file" - cp -rbv "$file" "$HOME"/.config/ + cp -rb "$file" "$HOME"/.config/ done # Copy scripts and make a backup if it already exists -printf "\nInstalling Scripts..." +printf "\n\nInstalling Scripts..." +cd ../ if [ ! -d "$HOME/.local/bin" ]; then mkdir "$HOME/.local/bin" fi -cp -rbv bin "$HOME"/.local +cp -rb bin "$HOME"/.local # Link shell files and make a backup if it already exists -printf "\nLinking shell..." -cp -sbv "$HOME"/.config/shell/profile ~/.zprofile -cp -sbv "$HOME"/.config/x11/xinitrc ~/.xinitrc +printf "\nLinking shell...\n" +cp -sb "$HOME"/.config/shell/profile ~/.zprofile +cp -sb "$HOME"/.config/x11/xinitrc ~/.xinitrc diff --git a/setup b/setup index bf81913..933b0d9 100755 --- a/setup +++ b/setup @@ -1,6 +1,7 @@ #!/bin/sh set -e +cd clear && echo "Choose your adventure: @@ -32,33 +33,34 @@ sudo echo '' . /etc/os-release OS=$NAME -# Check for less and install if not found -if ! type "less" > /dev/null 2>&1; then - echo "less not found, installing..." - sudo pacman -S --noconfirm less # <<< should handle other distros here -fi - -clear && -# Execute in less with a header for style points -exec > >(less +F --header 8) 2>&1 -trap 'exec >&- 2>&-; wait' EXIT - -echo ':::::::-. ... ... :::::::.. .::::::. +HEADER=':::::::-. ... ... :::::::.. .::::::. ;;, `'\'';, .;;;;;;;. .;;;;;;;. ;;;;``;;;; ;;;` ` `[[ [[,[[ \[[,,[[ \[[,[[[,/[[['\'' '\''[==/[[[[, $$, $$$$$, $$$$$$, $$$$$$$$$c '\'''\'''\'' $ 888_,o8P'\''"888,_ _,88P"888,_ _,88P888b "88bo,88b dP - MMMMP"` "YMMMMMP" "YMMMMMP" MMMM "W" "YMmMY" ' -echo "Doors are sturdier than windows. --------------------------------------------------------" + MMMMP"` "YMMMMMP" "YMMMMMP" MMMM "W" "YMmMY" +Doors are sturdier than windows. +-------------------------------------------------------' printf "\nSetup for %s\n" "$OS" case "$OS" in *Arch*) - cd + # Check for less and install if not found + if ! type "less" > /dev/null 2>&1; then + echo "less not found, installing..." + sudo pacman -S --noconfirm less # <<< should handle other distros here + fi + clear && + # Execute in less with a header for style points + exec > >(less +F -X --header 8) 2>&1 + trap 'exec >&- 2>&-; wait' EXIT + echo "$HEADER" echo "Enabling Pacman colors..." sudo sed '/Color/s/^#//' -i /etc/pacman.conf + printf "Upgrading system...\n" + sudo pacman -Syyu --noconfirm + printf '\nVerifying base requirements...' sudo pacman -S --needed --noconfirm git base-devel @@ -120,4 +122,4 @@ fi printf "\nDone!\nLog out and back in for changes to take effect." # Give less time to catch up and tell it we're done -sleep 1 && killall -s SIGINT less +sleep .5 && killall -s SIGINT less