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 diff --git a/config/zsh/.zshrc b/config/zsh/.zshrc index 113d1e3..353c6ee 100644 --- a/config/zsh/.zshrc +++ b/config/zsh/.zshrc @@ -17,34 +17,7 @@ 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 +# Import utility functions (if present) if [[ -d $utils_dir ]]; then source ${utils_dir}/transfer.sh source ${utils_dir}/matrix.sh @@ -55,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 @@ -80,11 +53,41 @@ 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" - 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 @@ -103,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 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 "$@" +} 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 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')"