diff --git a/.github/README.md b/.github/README.md index c3f806d..1cad4a6 100644 --- a/.github/README.md +++ b/.github/README.md @@ -17,6 +17,7 @@ - [Directory Structure](#directory-structure) - [Install Script](#install-script) - [Configuring](#configuring) + - [Colors](#color-theme) - [Aliases](#aliases) - [Packages](#packages) - [System Preferences](#system-preferences) @@ -267,6 +268,10 @@ The locations for all symlinks are defined in [`symlinks.yaml`](https://github.c --- +## Color Theme + +--- + ### Aliases #### Into to Aliases diff --git a/config/README.txt b/config/README.txt index 96ffa3c..ea64f38 100644 --- a/config/README.txt +++ b/config/README.txt @@ -3,15 +3,25 @@ Lissy93/Dotfiles - Config ⚙️ List of configuration files for various apps, utils and systems. +└── config/ + ├── tmux/ # Tmux (multiplexer) config + ├── vim/ # Vim (text editor) config + ├── zsh/ # ZSH (shell) config + ├── macos/ # Config files for Mac-specific apps + └── desktop-apps/ # Config files for GUI apps + + Generic configs which are used across all systems (e.g. .gitconfig, .bashrc, .wgetrc) -are stored in the root of the config directory, whereas files which are only used on +are stored in the root of the config directory, whereas groups of config files, for like +ZSH, Vim, Tmux etc are organized into directories. +files which are only used on certain systems (like MacOS) or by certain applications (like Firefox's user.js) are kept in category-specific directories (e.g. macos, desktop-apps, gnome, etc). The location on disk that files should be symlinked to is specified in symlinks.yml Run the install.sh script to apply settings based on system type and user preferences -Important: Take care to read through files thouroughly before applying any changes. +Important: Take care to read through files thoroughly before applying any changes. -For full documentation, see: https://github.com/Lissy93/dotfiles +Full source and documentation: https://github.com/Lissy93/dotfiles Licensed under MIT (C) Alicia Sykes 2022 diff --git a/install.sh b/install.sh index a9277ff..853af48 100755 --- a/install.sh +++ b/install.sh @@ -74,7 +74,7 @@ make_intro () { "${C2}(1) Pre-Setup Tasls\n"\ " ${C3}- Check that all requirements are met, and system is compatible\n"\ " ${C3}- Sets environmental variables from params, or uses sensible defaults\n"\ - " ${C3}- Output welcome message\n"\ + " ${C3}- Output welcome message and summary of changes\n"\ "${C2}(2) Setup Dotfiles\n"\ " ${C3}- Clone or update dotfiles from git\n"\ " ${C3}- Symlinks dotfiles to correct locations\n"\ @@ -86,10 +86,11 @@ make_intro () { " ${C3}- On Linux desktop systems, prompt to install desktop apps via Flatpak\n"\ " ${C3}- Checks that OS is up-to-date and criticial patches are installed\n"\ "${C2}(4) Configure sytstem\n"\ - " ${C3}- Setup Vim, and install Vim plugins via Plug\n"\ - " ${C3}- Setup Tmux, and install Tmux plugins via TPM\n"\ - " ${C3}- Setup ZSH, and install ZSH plugins via Antigen\n"\ - " ${C3}- Prompt to configure OS user preferences\n"\ + " ${C3}- Setup Vim, and install / update Vim plugins via Plug\n"\ + " ${C3}- Setup Tmux, and install / update Tmux plugins via TPM\n"\ + " ${C3}- Setup ZSH, and install / update ZSH plugins via Antigen\n"\ + " ${C3}- Apply system settings (via NSDefaults on Mac, dconf on Linux)\n"\ + " ${C3}- Apply assets, wallpaper, fonts, screensaver, etc\n"\ "${C2}(5) Finishing Up\n"\ " ${C3}- Refresh current terminal session\n"\ " ${C3}- Print summary of applied changes and time taken\n"\ @@ -172,6 +173,11 @@ function pre_setup_tasks () { fi echo + # If pre-requsite packages not found, prompt to install + if ! command_exists git; then + bash <(curl -s -L 'https://alicia.url.lol/prerequisite-installs') $PARAMS + fi + # Verify required packages are installed system_verify "git" true system_verify "zsh" false @@ -374,7 +380,12 @@ function finishing_up () { SKIP_WELCOME=true || exec zsh # Show popup - show_notification "All Tasks Complete" "Your dotfiles are now configured and ready to use 🥳" + if command_exists terminal-notifier; then + terminal-notifier -group 'dotfiles' -title $TITLE -subtitle 'All Tasks Complete' \ + -message "Your dotfiles are now configured and ready to use 🥳" \ + -appIcon ./.github/logo.png -contentImage ./.github/logo.png \ + -remove 'ALL' -sound 'Sosumi' &> /dev/null + fi # Show press any key to exit echo -e "${CYAN_B}Press any key to exit.${RESET}\n" diff --git a/lets-go.sh b/lets-go.sh index 32b4ad0..995876d 100755 --- a/lets-go.sh +++ b/lets-go.sh @@ -25,6 +25,11 @@ echo -e "\033[1;35m""Lissy93/Dotfiles Installation Script 🧰 - Into \033[4;35m${DOTFILES_DIR}\033[0;35m Be sure you've read and understood the what will be applied.\033[0m\n" +# If dependencies not met, install them +if ! hash git 2> /dev/null; then + bash <(curl -s -L 'https://alicia.url.lol/prerequisite-installs') +fi + # If dotfiles not yet present then clone if [[ ! -d "$DOTFILES_DIR" ]]; then mkdir -p "${DOTFILES_DIR}" && \ diff --git a/scripts/macos-setup/macos-apps.sh b/scripts/macos-setup/macos-apps.sh index 3964aa1..69fb4ad 100755 --- a/scripts/macos-setup/macos-apps.sh +++ b/scripts/macos-setup/macos-apps.sh @@ -341,6 +341,12 @@ defaults write com.apple.terminal StringEncodings -array 4 log_msg "Enable secure entry for Terminal" defaults write com.apple.terminal SecureKeyboardEntry -bool true +log_msg "Apply custom Terminal theme" +theme=$( /dev/null 2>&1 || { echo "Error: no active internet connection" >&2; return 1; } +} + # Checks if DNS gateway is online function aio_check-dns() { : >/dev/tcp/1.1.1.1/53 > /dev/null && \ @@ -19,7 +23,7 @@ function aio_check-dns() { # Checks if can ping default getway function aio_ping-gateway() { - ping -q -c 1 `ip r | grep default | cut -d ' ' -f 3` > /dev/null && \ + ping -q -c 1 `ip r | grep default | cut -d ' ' -f 3 | head -1` > /dev/null && \ echo -e "${pre_success} Gateway Availible${post_string}" || \ echo -e "${pre_failure} Gateway Unavailible${post_string}" } diff --git a/utils/test.sh b/utils/test.sh index e69de29..1329677 100755 --- a/utils/test.sh +++ b/utils/test.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + + diff --git a/utils/weather.sh b/utils/weather.sh old mode 100644 new mode 100755 index 4482fdc..05eb2a4 --- a/utils/weather.sh +++ b/utils/weather.sh @@ -1,15 +1,22 @@ #!/usr/bin/env bash -# Author: Alexander Epstein https://github.com/alexanderepstein -currentVersion="1.23.0" #This version variable should not have a v but should contain all other characters ex Github release tag is v1.2.4 currentVersion is 1.2.4 -LANG="${LANG:-en}" -locale=$(echo "$LANG" | cut -c1-2) -unset configuredClient +###################################################################### +# Weather - Prints current and forcasted weather in current location # +###################################################################### +# Data fetched from wttr.in provided by @chubin # +# This script is inspired by @alexanderepstein # +# # +# Licensed under MIT (C) Alicia Sykes 2022 # +###################################################################### + +scriptVersion="0.9.1" +locale=$(echo "${LANG:-en}" | cut -c1-2) # Language to use if [[ $(echo "$locale" | grep -Eo "[a-z A-Z]*" | wc -c) != 3 ]]; then locale="en"; fi +wttrHost="wttr.in" -## This function determines which http get tool the system has installed and returns an error if there isnt one -getConfiguredClient() -{ +# Determines which HTTP get tool to use, based on what's installed +getConfiguredClient() { + unset configuredClient if command -v curl &>/dev/null; then configuredClient="curl" elif command -v wget &>/dev/null; then @@ -24,9 +31,8 @@ getConfiguredClient() fi } -## Allows to call the users configured client without if statements everywhere -httpGet() -{ +# Make HTTP request, using installed HTTP client +httpGet() { case "$configuredClient" in curl) curl -A curl -s "$@" ;; wget) wget -qO- "$@" ;; @@ -35,8 +41,7 @@ httpGet() esac } -getIPWeather() -{ +getIPWeather() { country=$(httpGet ipinfo.io/country) > /dev/null ## grab the country if [[ $country == "US" ]]; then ## if were in the us id rather not use longitude and latitude so the output is nicer city=$(httpGet ipinfo.io/city) > /dev/null @@ -44,26 +49,24 @@ getIPWeather() if [[ $(echo "$region" | wc -w) == 2 ]];then region=$(echo "$region" | grep -Eo "[A-Z]*" | tr -d "[:space:]") fi - httpGet $locale.wttr.in/"$city","$region""$1" + httpGet $locale.$wttrHost/"$city","$region""$1" else ## otherwise we are going to use longitude and latitude location=$(httpGet ipinfo.io/loc) > /dev/null - httpGet $locale.wttr.in/"$location""$1" + httpGet $locale.$wttrHost/"$location""$1" fi } -getLocationWeather() -{ +getLocationWeather() { args=$(echo "$@" | tr " " + ) - httpGet $locale.wttr.in/"${args}" + httpGet $locale.$wttrHost/"${args}" } -checkInternet() -{ - httpGet github.com > /dev/null 2>&1 || { echo "Error: no active internet connection" >&2; return 1; } # query github with a get request +# Check connected to internet +checkInternet() { + httpGet github.com > /dev/null 2>&1 || { echo "Error: no active internet connection" >&2; return 1; } } -usage() -{ +usage() { cat <