Skip to content

Instantly share code, notes, and snippets.

@njenan
njenan / gist:8627f54b1ac089915d67582c0bf40a79
Created September 6, 2023 02:12
OSX Zsh Desktop Notify and Wait and Notify Functions
function notify() {
osascript -e "display notification \"$1\" with title \"Alert\""
}
function wait-and-notify() {
until eval "$1"
do
sleep 2
done
MSG="${2:-$1 returned 0}"
# get 256 colors to work in tmux
set -g default-terminal "screen-256color"
# bind r to reload config file
bind r source-file ~/.tmux.conf \; display ​"Reloaded!"
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
# get 256 colors to work in tmux
set -g default-terminal "screen-256color"
# bind r to reload config file
bind r source-file ~/.tmux.conf \; display ​"Reloaded!"
# vim-like pane navigation
bind -T root C-h select-pane -L
bind -T root C-j select-pane -U
# See this wiki page for more info:
# https://github.com/dylanaraps/neofetch/wiki/Customizing-Info
print_info() {
info title
info underline
info "OS" distro
info "Host" model
info "Kernel" kernel
info "Uptime" uptime
@njenan
njenan / gist:81f6adf222ba70aef757643aa686c132
Created December 30, 2020 04:15
iterm2 v3.4.0 neofetch output
+ verbose=on
+ shift
+ [[ -n '' ]]
+ [[ on != on ]]
+ get_simple -vv
+ [[ -n -vv ]]
++ type -t get_-vv
+ [[ '' == \f\u\n\c\t\i\o\n ]]
+ shift
+ [[ -n '' ]]
@njenan
njenan / gist:216534f7e4451229c0f435672afc61d7
Created December 30, 2020 04:13
neofetch output iterm2 v3.3.12
+ verbose=on
+ shift
+ [[ -n '' ]]
+ [[ on != on ]]
+ get_simple -vv
+ [[ -n -vv ]]
++ type -t get_-vv
+ [[ '' == \f\u\n\c\t\i\o\n ]]
+ shift
+ [[ -n '' ]]
i=1; for FILENAME in *; do sudo mv -i "$FILENAME" "Seinfeld_s05e$i.mkv"; i=$((i+1)); done
{
"Ansi 7 Color" : {
"Green Component" : 0.73333334922790527,
"Blue Component" : 0.73333334922790527,
"Red Component" : 0.73333334922790527
},
"Tags" : [
],
"Ansi 12 Color" : {
PROMPT="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )"
PROMPT+=' %{$fg[cyan]%}%c%{$reset_color%} ⚓️ %F{002}$(kubectl config current-context 2>/dev/null)/$(kubens -c 2>/dev/null)%{$reset_color%} $(git_prompt_info)'
set smoothscroll
map ; :