mirror of
https://github.com/Lissy93/dotfiles.git
synced 2024-11-21 23:13:09 +01:00
Add color theme section
This commit is contained in:
parent
47d9a140ef
commit
ff032b4b04
5
.github/README.md
vendored
5
.github/README.md
vendored
@ -17,6 +17,7 @@
|
|||||||
- [Directory Structure](#directory-structure)
|
- [Directory Structure](#directory-structure)
|
||||||
- [Install Script](#install-script)
|
- [Install Script](#install-script)
|
||||||
- [Configuring](#configuring)
|
- [Configuring](#configuring)
|
||||||
|
- [Colors](#color-theme)
|
||||||
- [Aliases](#aliases)
|
- [Aliases](#aliases)
|
||||||
- [Packages](#packages)
|
- [Packages](#packages)
|
||||||
- [System Preferences](#system-preferences)
|
- [System Preferences](#system-preferences)
|
||||||
@ -267,6 +268,10 @@ The locations for all symlinks are defined in [`symlinks.yaml`](https://github.c
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## Color Theme
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
### Aliases
|
### Aliases
|
||||||
|
|
||||||
#### Into to Aliases
|
#### Into to Aliases
|
||||||
|
@ -3,15 +3,25 @@ Lissy93/Dotfiles - Config ⚙️
|
|||||||
|
|
||||||
List of configuration files for various apps, utils and systems.
|
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)
|
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
|
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).
|
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
|
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
|
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 <https://aliciasykes.com>
|
Licensed under MIT (C) Alicia Sykes 2022 <https://aliciasykes.com>
|
||||||
|
23
install.sh
23
install.sh
@ -74,7 +74,7 @@ make_intro () {
|
|||||||
"${C2}(1) Pre-Setup Tasls\n"\
|
"${C2}(1) Pre-Setup Tasls\n"\
|
||||||
" ${C3}- Check that all requirements are met, and system is compatible\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}- 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"\
|
"${C2}(2) Setup Dotfiles\n"\
|
||||||
" ${C3}- Clone or update dotfiles from git\n"\
|
" ${C3}- Clone or update dotfiles from git\n"\
|
||||||
" ${C3}- Symlinks dotfiles to correct locations\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}- 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"\
|
" ${C3}- Checks that OS is up-to-date and criticial patches are installed\n"\
|
||||||
"${C2}(4) Configure sytstem\n"\
|
"${C2}(4) Configure sytstem\n"\
|
||||||
" ${C3}- Setup Vim, and install Vim plugins via Plug\n"\
|
" ${C3}- Setup Vim, and install / update Vim plugins via Plug\n"\
|
||||||
" ${C3}- Setup Tmux, and install Tmux plugins via TPM\n"\
|
" ${C3}- Setup Tmux, and install / update Tmux plugins via TPM\n"\
|
||||||
" ${C3}- Setup ZSH, and install ZSH plugins via Antigen\n"\
|
" ${C3}- Setup ZSH, and install / update ZSH plugins via Antigen\n"\
|
||||||
" ${C3}- Prompt to configure OS user preferences\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"\
|
"${C2}(5) Finishing Up\n"\
|
||||||
" ${C3}- Refresh current terminal session\n"\
|
" ${C3}- Refresh current terminal session\n"\
|
||||||
" ${C3}- Print summary of applied changes and time taken\n"\
|
" ${C3}- Print summary of applied changes and time taken\n"\
|
||||||
@ -172,6 +173,11 @@ function pre_setup_tasks () {
|
|||||||
fi
|
fi
|
||||||
echo
|
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
|
# Verify required packages are installed
|
||||||
system_verify "git" true
|
system_verify "git" true
|
||||||
system_verify "zsh" false
|
system_verify "zsh" false
|
||||||
@ -374,7 +380,12 @@ function finishing_up () {
|
|||||||
SKIP_WELCOME=true || exec zsh
|
SKIP_WELCOME=true || exec zsh
|
||||||
|
|
||||||
# Show popup
|
# 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
|
# Show press any key to exit
|
||||||
echo -e "${CYAN_B}Press any key to exit.${RESET}\n"
|
echo -e "${CYAN_B}Press any key to exit.${RESET}\n"
|
||||||
|
@ -25,6 +25,11 @@ echo -e "\033[1;35m""Lissy93/Dotfiles Installation Script 🧰
|
|||||||
- Into \033[4;35m${DOTFILES_DIR}\033[0;35m
|
- Into \033[4;35m${DOTFILES_DIR}\033[0;35m
|
||||||
Be sure you've read and understood the what will be applied.\033[0m\n"
|
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 dotfiles not yet present then clone
|
||||||
if [[ ! -d "$DOTFILES_DIR" ]]; then
|
if [[ ! -d "$DOTFILES_DIR" ]]; then
|
||||||
mkdir -p "${DOTFILES_DIR}" && \
|
mkdir -p "${DOTFILES_DIR}" && \
|
||||||
|
@ -341,6 +341,12 @@ defaults write com.apple.terminal StringEncodings -array 4
|
|||||||
log_msg "Enable secure entry for Terminal"
|
log_msg "Enable secure entry for Terminal"
|
||||||
defaults write com.apple.terminal SecureKeyboardEntry -bool true
|
defaults write com.apple.terminal SecureKeyboardEntry -bool true
|
||||||
|
|
||||||
|
log_msg "Apply custom Terminal theme"
|
||||||
|
theme=$(<config/desktop-apps/alicia-term.terminal)
|
||||||
|
plutil -replace Window\ Settings.Alicia-Term -xml "$theme" ~/Library/Preferences/com.apple.Terminal.plist
|
||||||
|
defaults write com.apple.terminal 'Default Window Settings' -string Alicia-Term
|
||||||
|
defaults write com.apple.terminal 'Startup Window Settings' -string Alicia-Term
|
||||||
|
echo 'tell application "Terminal" to set current settings of first window to settings set "Alicia-Term"' | osascript
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Time Machine #
|
# Time Machine #
|
||||||
|
@ -44,6 +44,12 @@
|
|||||||
~/.finicky.js:
|
~/.finicky.js:
|
||||||
if: '[ `uname` = Darwin ]'
|
if: '[ `uname` = Darwin ]'
|
||||||
path: config/macos/.finicky.js
|
path: config/macos/.finicky.js
|
||||||
|
~/Library/Application\ Support/iTerm2/DynamicProfiles:
|
||||||
|
if: '[ `uname` = Darwin ]'
|
||||||
|
path: config/macos/iterm.json
|
||||||
|
${XDG_CONFIG_HOME}/zsh/.iterm2_shell_integration.zsh:
|
||||||
|
if: '[ `uname` = Darwin ]'
|
||||||
|
path: config/macos/iterm-shell-integration.zsh
|
||||||
|
|
||||||
# If not already present, create home directories
|
# If not already present, create home directories
|
||||||
- create:
|
- create:
|
||||||
|
@ -10,6 +10,10 @@ pre_success=' \033[1;92m✔'
|
|||||||
pre_failure=' \033[1;91m✗'
|
pre_failure=' \033[1;91m✗'
|
||||||
post_string='\x1b[0m'
|
post_string='\x1b[0m'
|
||||||
|
|
||||||
|
function aio_http_host () {
|
||||||
|
wget -qO- github.com > /dev/null 2>&1 || { echo "Error: no active internet connection" >&2; return 1; }
|
||||||
|
}
|
||||||
|
|
||||||
# Checks if DNS gateway is online
|
# Checks if DNS gateway is online
|
||||||
function aio_check-dns() {
|
function aio_check-dns() {
|
||||||
: >/dev/tcp/1.1.1.1/53 > /dev/null && \
|
: >/dev/tcp/1.1.1.1/53 > /dev/null && \
|
||||||
@ -19,7 +23,7 @@ function aio_check-dns() {
|
|||||||
|
|
||||||
# Checks if can ping default getway
|
# Checks if can ping default getway
|
||||||
function aio_ping-gateway() {
|
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_success} Gateway Availible${post_string}" || \
|
||||||
echo -e "${pre_failure} Gateway Unavailible${post_string}"
|
echo -e "${pre_failure} Gateway Unavailible${post_string}"
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,3 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
|
53
utils/weather.sh
Normal file → Executable file
53
utils/weather.sh
Normal file → Executable file
@ -1,15 +1,22 @@
|
|||||||
#!/usr/bin/env bash
|
#!/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}"
|
# Weather - Prints current and forcasted weather in current location #
|
||||||
locale=$(echo "$LANG" | cut -c1-2)
|
######################################################################
|
||||||
unset configuredClient
|
# Data fetched from wttr.in provided by @chubin #
|
||||||
|
# This script is inspired by @alexanderepstein #
|
||||||
|
# #
|
||||||
|
# Licensed under MIT (C) Alicia Sykes 2022 <https://aliciasykes.com> #
|
||||||
|
######################################################################
|
||||||
|
|
||||||
|
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
|
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
|
# Determines which HTTP get tool to use, based on what's installed
|
||||||
getConfiguredClient()
|
getConfiguredClient() {
|
||||||
{
|
unset configuredClient
|
||||||
if command -v curl &>/dev/null; then
|
if command -v curl &>/dev/null; then
|
||||||
configuredClient="curl"
|
configuredClient="curl"
|
||||||
elif command -v wget &>/dev/null; then
|
elif command -v wget &>/dev/null; then
|
||||||
@ -24,9 +31,8 @@ getConfiguredClient()
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
## Allows to call the users configured client without if statements everywhere
|
# Make HTTP request, using installed HTTP client
|
||||||
httpGet()
|
httpGet() {
|
||||||
{
|
|
||||||
case "$configuredClient" in
|
case "$configuredClient" in
|
||||||
curl) curl -A curl -s "$@" ;;
|
curl) curl -A curl -s "$@" ;;
|
||||||
wget) wget -qO- "$@" ;;
|
wget) wget -qO- "$@" ;;
|
||||||
@ -35,8 +41,7 @@ httpGet()
|
|||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
getIPWeather()
|
getIPWeather() {
|
||||||
{
|
|
||||||
country=$(httpGet ipinfo.io/country) > /dev/null ## grab the country
|
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
|
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
|
city=$(httpGet ipinfo.io/city) > /dev/null
|
||||||
@ -44,26 +49,24 @@ getIPWeather()
|
|||||||
if [[ $(echo "$region" | wc -w) == 2 ]];then
|
if [[ $(echo "$region" | wc -w) == 2 ]];then
|
||||||
region=$(echo "$region" | grep -Eo "[A-Z]*" | tr -d "[:space:]")
|
region=$(echo "$region" | grep -Eo "[A-Z]*" | tr -d "[:space:]")
|
||||||
fi
|
fi
|
||||||
httpGet $locale.wttr.in/"$city","$region""$1"
|
httpGet $locale.$wttrHost/"$city","$region""$1"
|
||||||
else ## otherwise we are going to use longitude and latitude
|
else ## otherwise we are going to use longitude and latitude
|
||||||
location=$(httpGet ipinfo.io/loc) > /dev/null
|
location=$(httpGet ipinfo.io/loc) > /dev/null
|
||||||
httpGet $locale.wttr.in/"$location""$1"
|
httpGet $locale.$wttrHost/"$location""$1"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
getLocationWeather()
|
getLocationWeather() {
|
||||||
{
|
|
||||||
args=$(echo "$@" | tr " " + )
|
args=$(echo "$@" | tr " " + )
|
||||||
httpGet $locale.wttr.in/"${args}"
|
httpGet $locale.$wttrHost/"${args}"
|
||||||
}
|
}
|
||||||
|
|
||||||
checkInternet()
|
# Check connected to internet
|
||||||
{
|
checkInternet() {
|
||||||
httpGet github.com > /dev/null 2>&1 || { echo "Error: no active internet connection" >&2; return 1; } # query github with a get request
|
httpGet github.com > /dev/null 2>&1 || { echo "Error: no active internet connection" >&2; return 1; }
|
||||||
}
|
}
|
||||||
|
|
||||||
usage()
|
usage() {
|
||||||
{
|
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
Weather
|
Weather
|
||||||
Description: Provides a 3 day forecast on your current location or a specified location.
|
Description: Provides a 3 day forecast on your current location or a specified location.
|
||||||
@ -93,10 +96,10 @@ while getopts "uvh" opt; do
|
|||||||
h) usage
|
h) usage
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
v) echo "Version $currentVersion"
|
v) echo "Version $scriptVersion"
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
u) checkInternet || exit 1 # check if we have a valid internet connection if this isnt true the rest of the script will not work so stop here
|
u) checkInternet || exit 1 # Check connection, exit if fail
|
||||||
update || exit 1
|
update || exit 1
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
Loading…
Reference in New Issue
Block a user