mirror of
https://github.com/Lissy93/dotfiles.git
synced 2024-11-21 15:03:15 +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)
|
||||
- [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
|
||||
|
@ -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 <https://aliciasykes.com>
|
||||
|
23
install.sh
23
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"
|
||||
|
@ -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}" && \
|
||||
|
@ -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=$(<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 #
|
||||
|
@ -44,6 +44,12 @@
|
||||
~/.finicky.js:
|
||||
if: '[ `uname` = Darwin ]'
|
||||
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
|
||||
- create:
|
||||
|
@ -10,6 +10,10 @@ pre_success=' \033[1;92m✔'
|
||||
pre_failure=' \033[1;91m✗'
|
||||
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
|
||||
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}"
|
||||
}
|
||||
|
@ -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
|
||||
# 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 <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
|
||||
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 <<EOF
|
||||
Weather
|
||||
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
|
||||
exit 0
|
||||
;;
|
||||
v) echo "Version $currentVersion"
|
||||
v) echo "Version $scriptVersion"
|
||||
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
|
||||
exit 0
|
||||
;;
|
||||
|
Loading…
Reference in New Issue
Block a user