From 9a0db85bbe3c7e514b798e76eb139a96774f3f81 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Tue, 14 Nov 2023 14:42:28 +0000 Subject: [PATCH 1/6] Removes popclip --- scripts/installs/Brewfile | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/installs/Brewfile b/scripts/installs/Brewfile index b4539d1..59361ea 100644 --- a/scripts/installs/Brewfile +++ b/scripts/installs/Brewfile @@ -238,7 +238,6 @@ brew 'lporg' # Backup and restore launchpad layout brew 'm-cli' # All in one MacOS management CLI app cask 'mjolnir' # Util for loading Lua automations cask 'openinterminal' # Finder button, opens directory in terminal -cask 'popclip' # Popup options for text on highlight cask 'raycast', args: { require_sha: false } # Spotlight alternative cask 'santa' # Binary authorization for security cask 'shottr' # Better screenshot utility From faf767244b43c7ee3d1c5c8392ba5e81b31713fc Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Wed, 13 Dec 2023 10:50:11 +0000 Subject: [PATCH 2/6] Re-orders imports, so aliases are set after Brew is added to path --- config/zsh/.zshrc | 56 ++++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/config/zsh/.zshrc b/config/zsh/.zshrc index 113d1e3..ff3df8a 100644 --- a/config/zsh/.zshrc +++ b/config/zsh/.zshrc @@ -17,33 +17,6 @@ utils_dir="${XDG_CONFIG_HOME}/utils" # If not running interactively, don't do anything [[ $- != *i* ]] && return -# Source all ZSH config files (if present) -if [[ -d $zsh_dir ]]; then - # Import alias files - source ${zsh_dir}/aliases/general.zsh - source ${zsh_dir}/aliases/git.zsh - source ${zsh_dir}/aliases/node-js.zsh - source ${zsh_dir}/aliases/rust.zsh - source ${zsh_dir}/aliases/flutter.zsh - source ${zsh_dir}/aliases/alias-tips.zsh - - # Setup Antigen, and import plugins - source ${zsh_dir}/helpers/setup-antigen.zsh - source ${zsh_dir}/helpers/import-plugins.zsh - source ${zsh_dir}/helpers/misc-stuff.zsh - - # Configure ZSH stuff - source ${zsh_dir}/lib/colors.zsh - source ${zsh_dir}/lib/cursor.zsh - source ${zsh_dir}/lib/history.zsh - source ${zsh_dir}/lib/surround.zsh - source ${zsh_dir}/lib/completion.zsh - source ${zsh_dir}/lib/term-title.zsh - source ${zsh_dir}/lib/navigation.zsh - source ${zsh_dir}/lib/expansions.zsh - source ${zsh_dir}/lib/key-bindings.zsh -fi - # Import utility functions if [[ -d $utils_dir ]]; then source ${utils_dir}/transfer.sh @@ -80,6 +53,35 @@ if [ "$(uname -s)" = "Darwin" ]; then fi fi + +# Source all ZSH config files (if present) +if [[ -d $zsh_dir ]]; then + # Import alias files + source ${zsh_dir}/aliases/general.zsh + source ${zsh_dir}/aliases/git.zsh + source ${zsh_dir}/aliases/node-js.zsh + source ${zsh_dir}/aliases/rust.zsh + source ${zsh_dir}/aliases/flutter.zsh + source ${zsh_dir}/aliases/tmux.zsh + source ${zsh_dir}/aliases/alias-tips.zsh + + # Setup Antigen, and import plugins + source ${zsh_dir}/helpers/setup-antigen.zsh + source ${zsh_dir}/helpers/import-plugins.zsh + source ${zsh_dir}/helpers/misc-stuff.zsh + + # Configure ZSH stuff + source ${zsh_dir}/lib/colors.zsh + source ${zsh_dir}/lib/cursor.zsh + source ${zsh_dir}/lib/history.zsh + source ${zsh_dir}/lib/surround.zsh + source ${zsh_dir}/lib/completion.zsh + source ${zsh_dir}/lib/term-title.zsh + source ${zsh_dir}/lib/navigation.zsh + source ${zsh_dir}/lib/expansions.zsh + source ${zsh_dir}/lib/key-bindings.zsh +fi + # If using Pyenv, import the shell integration if availible if [[ -d "$PYENV_ROOT" ]]; then command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH" From 26c30ee90d4dc05a105af98edcc719a63d2146d4 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Wed, 13 Dec 2023 18:11:54 +0000 Subject: [PATCH 3/6] Updates default browsers --- config/macos/.finicky.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/config/macos/.finicky.js b/config/macos/.finicky.js index fe07b2d..f6e6441 100644 --- a/config/macos/.finicky.js +++ b/config/macos/.finicky.js @@ -11,7 +11,9 @@ module.exports = { ], handlers: [ { // Open work non-coding stuff in Chromium - browser: "/Applications/Chromium.app", + // browser: "/Applications/Chromium.app", + // We must use Chrome, because IT is evil. + browser: "/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome", match: [ "*.google.com/*", "*and-digital.okta.com/*", @@ -22,6 +24,7 @@ module.exports = { "*luna.and-digital.com/*", "*miro.com/*", "*zoom.com/*", + "*.atlassian.net/*" ], }, { // Open coding stuff in Firefox From 02279f6d7250495b04cb9229f093144189f1fdd8 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Thu, 14 Dec 2023 18:12:18 +0000 Subject: [PATCH 4/6] Adds aliases for Tmux --- config/zsh/aliases/tmux.zsh | 57 +++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 config/zsh/aliases/tmux.zsh diff --git a/config/zsh/aliases/tmux.zsh b/config/zsh/aliases/tmux.zsh new file mode 100644 index 0000000..3c32819 --- /dev/null +++ b/config/zsh/aliases/tmux.zsh @@ -0,0 +1,57 @@ +###################################################################### +# ZSH aliases and helper functions for Tmux and common Tmux tasks # +# Licensed under MIT (C) Alicia Sykes 2022 # +###################################################################### + +# Tmux shortcuts +alias tmux='tmux -u' +alias t='tmux' +alias ta='tmux attach-session -t' +alias tn='tmux new-session -s' +alias tl='tmux list-sessions' +alias tk='tmux kill-session -t' + +# Tmux helpers +function tsplit() { + tmux split-window -v "$@" +} + +function tvsplit() { + tmux split-window -h "$@" +} + +function tresize() { + tmux resize-pane -D "$@" +} + +function tresizeh() { + tmux resize-pane -R "$@" +} + +function tresizev() { + tmux resize-pane -U "$@" +} + +function tresizeleft() { + tmux resize-pane -L "$@" +} + +function tresizeup() { + tmux resize-pane -U "$@" +} + +function tresizedown() { + tmux resize-pane -D "$@" +} + +function tresizeup() { + tmux resize-pane -U "$@" +} + +function tresizeleft() { + tmux resize-pane -L "$@" +} + +function tresizeright() { + tmux resize-pane -R "$@" +} From 7bfa652d6338e626f6abe8a37036bfb1bc981299 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Thu, 14 Dec 2023 18:12:45 +0000 Subject: [PATCH 5/6] Import Tmux aliases --- config/zsh/.zshrc | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/config/zsh/.zshrc b/config/zsh/.zshrc index ff3df8a..353c6ee 100644 --- a/config/zsh/.zshrc +++ b/config/zsh/.zshrc @@ -17,7 +17,7 @@ utils_dir="${XDG_CONFIG_HOME}/utils" # If not running interactively, don't do anything [[ $- != *i* ]] && return -# Import utility functions +# Import utility functions (if present) if [[ -d $utils_dir ]]; then source ${utils_dir}/transfer.sh source ${utils_dir}/matrix.sh @@ -28,7 +28,7 @@ if [[ -d $utils_dir ]]; then source ${utils_dir}/color-map.sh fi -# Import P10k config for command prompt, run `p10k configure` or edit +# Import P10k config for command prompt [[ ! -f ${zsh_dir}/.p10k.zsh ]] || source ${zsh_dir}/.p10k.zsh # MacOS-specific services @@ -83,10 +83,11 @@ if [[ -d $zsh_dir ]]; then fi # If using Pyenv, import the shell integration if availible -if [[ -d "$PYENV_ROOT" ]]; then - command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH" - eval "$(pyenv init -)" - eval "$(pyenv virtualenv-init -)" +if [[ -d "$PYENV_ROOT" ]] && \ + command -v pyenv >/dev/null 2>&1 && \ + command -v pyenv-virtualenv-init >/dev/null; then + eval "$(pyenv init -)" + eval "$(pyenv virtualenv-init -)" fi # If using Tilix, import the shell integration if availible @@ -105,6 +106,7 @@ if hash zoxide 2> /dev/null; then fi # If not running in nested shell, then show welcome message :) -if [[ "${SHLVL}" -lt 2 ]] && [[ -z "$SKIP_WELCOME" ]]; then +if [[ "${SHLVL}" -lt 2 ]] && \ + { [[ -z "$SKIP_WELCOME" ]] || [[ "$SKIP_WELCOME" == "false" ]]; }; then welcome fi From 18582d49b5f7f0f8d80f5ad44c68a7b06858af12 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Fri, 15 Dec 2023 18:13:32 +0000 Subject: [PATCH 6/6] Updates welcome banner, with date comparison and last login --- utils/welcome-banner.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/utils/welcome-banner.sh b/utils/welcome-banner.sh index f757482..7dad666 100755 --- a/utils/welcome-banner.sh +++ b/utils/welcome-banner.sh @@ -17,8 +17,9 @@ RESET='\033[0m' # Print time-based personalized message, using figlet & lolcat if availible function welcome_greeting () { - h=`date +%H` - if [ $h -lt 04 ] || [[ $h -gt 22 ]]; + h=$(date +%H) + h=$((10#$h)) + if [ $h -lt 4 ] || [ $h -gt 22 ]; then greeting="Good Night" elif [ $h -lt 12 ]; then greeting="Good morning" @@ -37,6 +38,7 @@ function welcome_greeting () { fi } + # Print system information with neofetch, if it's installed function welcome_sysinfo () { if hash neofetch 2>/dev/null; then @@ -54,6 +56,10 @@ function welcome_today () { timeout=0.5 echo -e "\033[1;34mToday\n------" + # Print last login in the format: "Last Login: Day Month Date HH:MM on tty" + last_login=$(last | grep "^$USER " | head -1 | awk '{print "⏲️ Last Login: "$4" "$5" "$6" "$7" on "$2}') + echo -e "${COLOR_S}${last_login}" + # Print date time echo -e "$COLOR_S$(date '+🗓️ Date: %A, %B %d, %Y at %H:%M')"