Deleted: bin/renew_env.sh bin/tmux-plugins bin/weather bin/yank.sh config/bashrc con

bin/renew_env.sh
bin/tmux-plugins
bin/weather
bin/yank.sh
config/bashrc
config/resurrect
config/tmux.conf
This commit is contained in:
Jason 2022-07-06 07:14:49 -04:00
parent 4ec9719a1c
commit 010c19d217
No known key found for this signature in database
GPG Key ID: 4F765975C1F0EE5F
7 changed files with 0 additions and 516 deletions

View File

@ -1,12 +0,0 @@
#!/usr/bin/env bash
set -eu
pane_fmt="#{pane_id} #{pane_in_mode} #{pane_input_off} #{pane_dead} #{pane_current_command}"
tmux list-panes -s -F "$pane_fmt" | awk '
$2 == 0 && $3 == 0 && $4 == 0 && $5 ~ /(bash|zsh|ksh|fish)/ { print $1 }
' | while read -r pane_id; do
# renew environment variables according to update-environment tmux option
# also clear screen
tmux send-keys -t "$pane_id" 'Enter' 'eval "$(tmux show-env -s)"' 'Enter' 'C-l'
done

View File

@ -1,42 +0,0 @@
#!/usr/bin/env bash
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
APPNAME="$(basename "$0")"
VERSION="202108242343-git"
USER="${SUDO_USER:-${USER}}"
HOME="${USER_HOME:-${HOME}}"
SRC_DIR="${BASH_SOURCE%/*}"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Set bash options
[[ "$1" == "--debug" ]] && shift 1 && set -euo pipefail
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
##@Version : 202108242343-git
# @Author : Jason Hempstead
# @Contact : jason@casjaysdev.com
# @License : WTFPL
# @ReadME : install_plugins.sh
# @Copyright : Copyright: (c) 2021 Jason Hempstead, CasjaysDev
# @Created : Tuesday, Aug 24, 2021 23:43 EDT
# @File : install_plugins.sh
# @Description : Install tmux plugins
# @TODO :
# @Other :
# @Resource :
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TMUX_HOME="$HOME/.config/tmux"
TMUX_SHARE_DIR="$HOME/.local/share/tmux"
TMUX_PLUGIN_MANAGER_PATH="$TMUX_SHARE_DIR/tpm"
export TMUX_HOME TMUX_PLUGIN_MANAGER_PATH TMUX_SHARE_DIR
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[[ -d "$TMUX_PLUGIN_MANAGER_PATH/.git" ]] && git -C "$TMUX_PLUGIN_MANAGER_PATH" pull ||
git clone https://github.com/tmux-plugins/tpm "$TMUX_PLUGIN_MANAGER_PATH"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[ -x "$TMUX_PLUGIN_MANAGER_PATH/bin/install_plugins" ] &&
$TMUX_PLUGIN_MANAGER_PATH/bin/install_plugins
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
mkdir -p "$TMUX_SHARE_DIR/resurrect"
[[ -f "$TMUX_HOME/resurrect" ]] && ln -sf "$TMUX_HOME/resurrect" "$TMUX_SHARE_DIR/resurrect/last"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#[[ -f "$TMUX_PLUGIN_MANAGER_PATH/tpm" ]] && [[ -f "$TMUX_SHARE_DIR/resurrect/last" ]] && echo "Install completed"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
exit ${exitCode:-0}

View File

@ -1,85 +0,0 @@
#!/usr/bin/env sh
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
##@Version : 202207060010-git
# @Author : Jason Hempstead
# @Contact : jason@casjaysdev.com
# @License : LICENSE.md
# @ReadME : weather --help
# @Copyright : Copyright: (c) 2022 Jason Hempstead, Casjays Developments
# @Created : Wednesday, Jul 06, 2022 00:10 EDT
# @File : weather
# @Description : get weather - used by tmux
# @TODO :
# @Other :
# @Resource :
# @sudo/root : no
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PROG="$(basename "$0" 2>/dev/null)"
USER="${SUDO_USER:-${USER}}"
HOME="${USER_HOME:-${HOME}}"
SRC_DIR="$(dirname "$PROG")"
VERSION="202207060012-git"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Set bash options
if [ "$1" = "--debug" ]; then shift 1 && set -xo && export SCRIPT_OPTS="--debug" && export _DEBUG="on"; fi
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Check for needed applications
#type -P sh &>/dev/null || exit 1 # exit if not found
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Set variables
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Set functions
__version() { echo "$VERSION"; }
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Set additional variables
exitCode=""
GEN_SCRIPT_ARRAY_DIR="$HOME/.config/weather"
WEATHER_CONFIG_DIR="$HOME/.config/weather"
WEATHER_CONFIG_FILE="settings.conf"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# bring in user config
[ -f "$WEATHER_CONFIG_DIR/$WEATHER_CONFIG_FILE" ] && . "$WEATHER_CONFIG_DIR/$WEATHER_CONFIG_FILE"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Argument/Option settings
SETARGS="$*"
SHORTOPTS="v,h"
LONGOPTS="options,config,version,help"
ARRAY=""
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Setup application options
setopts=$(getopt -o "$SHORTOPTS" --long "$LONGOPTS" -n "$APPNAME" -- "$@" 2>/dev/null)
eval set -- "${setopts}" 2>/dev/null
while :; do
case $1 in
--version)
shift 1
__version
;;
--help)
shift 1
printf 'Display current weather in your terminal'
;;
--config)
shift 1
__gen_config
;;
--)
shift 1
break
;;
esac
done
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Main application
curl -q -LSsf "http://wttr.in/?format=3" | awk '{print $1,$(NF-1),$NF}' | sed 's|, |: |g' || echo N/A
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# End application
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# lets exit with code
exit ${exitCode:-$?}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# end

View File

@ -1,67 +0,0 @@
#!/usr/bin/env bash
set -eu
cmd_exists() {
type "$1" &>/dev/null || return 1
}
# get data either form stdin or from file
buf=$(cat "$@")
copy_backend_remote_tunnel_port=$(tmux show-option -gvq "@copy_backend_remote_tunnel_port")
copy_use_osc52_fallback=$(tmux show-option -gvq "@copy_use_osc52_fallback")
# Resolve copy backend: pbcopy (OSX), reattach-to-user-namespace (OSX), xclip/xsel (Linux)
copy_backend=""
if cmd_exists pbcopy; then
copy_backend="pbcopy"
elif cmd_exists reattach-to-user-namespace; then
copy_backend="reattach-to-user-namespace pbcopy"
elif [ -n "${DISPLAY-}" ] && cmd_exists xsel; then
copy_backend="xsel -i --clipboard"
elif [ -n "${DISPLAY-}" ] && cmd_exists xclip; then
copy_backend="xclip -i -f -selection primary | xclip -i -selection clipboard"
elif [ -n "${copy_backend_remote_tunnel_port-}" ] &&
(netstat -f inet -nl 2>/dev/null || netstat -4 -nl 2>/dev/null) |
grep -q "[.:]$copy_backend_remote_tunnel_port"; then
copy_backend="nc localhost $copy_backend_remote_tunnel_port"
fi
# if copy backend is resolved, copy and exit
if [ -n "$copy_backend" ]; then
printf "%s" "$buf" | eval "$copy_backend"
exit
fi
# If no copy backends were eligible, decide to fallback to OSC 52 escape sequences
# Note, most terminals do not handle OSC
if [ "$copy_use_osc52_fallback" == "off" ]; then
exit
fi
# Copy via OSC 52 ANSI escape sequence to controlling terminal
buflen=$(printf %s "$buf" | wc -c)
# https://sunaku.github.io/tmux-yank-osc52.html
# The maximum length of an OSC 52 escape sequence is 100_000 bytes, of which
# 7 bytes are occupied by a "\033]52;c;" header, 1 byte by a "\a" footer, and
# 99_992 bytes by the base64-encoded result of 74_994 bytes of copyable text
maxlen=74994
# warn if exceeds maxlen
if [ "$buflen" -gt "$maxlen" ]; then
printf "input is %d bytes too long" "$((buflen - maxlen))" >&2
fi
# build up OSC 52 ANSI escape sequence
esc="\033]52;c;$(printf %s "$buf" | head -c $maxlen | base64 | tr -d '\r\n')\a"
esc="\033Ptmux;\033$esc\033\\"
# resolve target terminal to send escape sequence
# if we are on remote machine, send directly to SSH_TTY to transport escape sequence
# to terminal on local machine, so data lands in clipboard on our local machine
pane_active_tty=$(tmux list-panes -F "#{pane_active} #{pane_tty}" | awk '$1=="1" { print $2 }')
target_tty="${SSH_TTY:-$pane_active_tty}"
printf '%s' "$esc" >"$target_tty"

View File

@ -1,50 +0,0 @@
#!/usr/bin/env bash
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
##@Version : 202207052258-git
# @Author : Jason Hempstead
# @Contact : jason@casjaysdev.com
# @License : LICENSE.md
# @ReadME : bashrc --help
# @Copyright : Copyright: (c) 2022 Jason Hempstead, Casjays Developments
# @Created : Tuesday, Jul 05, 2022 22:58 EDT
# @File : bashrc
# @Description :
# @TODO :
# @Other :
# @Resource :
# @sudo/root : no
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
export HISTCONTROL='ignoreboth'
export HISTFILE="$HOME/.bash_history"
export HISTSIZE=1000
export HISTTIMEFORMAT='[%F (%X)]: '
export TIMEFORMAT='%3R'
export LS_COLORS='fi=37:di=1;97:ln=90:mh=90:ex=3;2;37:no=1;97:mi=90:ow=91'
export GREP_COLOR='1;91'
export SUDO_EDITOR='/usr/bin/vim'
export TERM='xterm-256color'
# Pretty-print man(1) pages.
export LESS_TERMCAP_mb=$'\e[1;91m'
export LESS_TERMCAP_md=$'\e[1;91m'
export LESS_TERMCAP_me=$'\e[0m'
export LESS_TERMCAP_ue=$'\e[0m'
export LESS_TERMCAP_so=$'\e[1;93m'
export LESS_TERMCAP_se=$'\e[0m'
export LESS_TERMCAP_us=$'\e[1;92m'
# aliases
alias :q='exit'
alias q='exit'
alias t='tmux '
alias v='vim '
alias sv='sudo vim '
# completions
UsrBashComp='/usr/share/bash-completion/bash_completion'
[[ -f $UsrBashComp && -r $UsrBashComp ]] && . "$UsrBashComp"
BCFuncs="$HOME/.bash_functions"
[[ -f $BCFuncs && -r $BCFuncs ]] && . "$BCFuncs"
unset BCAliases BCFuncs UsrBashComp

View File

@ -1,20 +0,0 @@
pane 0 1 1 :* 1 :~ 1 bash :
pane 0 2 0 :- 1 :~ 1 bash :
pane 0 3 0 : 1 :~ 1 bash :
pane 0 4 0 : 1 :~ 1 bash :
pane 0 5 0 : 1 :~ 1 bash :
pane 0 6 0 : 1 :~ 1 bash :
pane 0 7 0 : 1 :~ 1 bash :
pane 0 8 0 : 1 :~ 1 bash :
pane 0 9 0 : 1 :~ 0 bash :
pane 0 9 0 : 2 :~ 1 bash :
window 0 1 :main 1 :* ac3e,170x40,0,0,1 off
window 0 2 :dev 0 :- ac3f,170x40,0,0,2 off
window 0 3 :dev 0 : ac40,170x40,0,0,3 off
window 0 4 :test 0 : ac41,170x40,0,0,4 off
window 0 5 :www 0 : ac42,170x40,0,0,5 off
window 0 6 :ssh 0 : ac43,170x40,0,0,6 off
window 0 7 :ssh 0 : ac44,170x40,0,0,7 off
window 0 8 :media 0 : ac45,170x40,0,0,8 off
window 0 9 :other 0 : 070d,170x40,0,0[170x20,0,0,9,170x19,0,21,10] off
state 0

View File

@ -1,240 +0,0 @@
# Override LC and LANG
set-environment -g LANG 'en_US.UTF-8'
set-environment -g LC_ALL 'en_US.UTF-8'
set-environment -g LC_CTYPE 'en_US.UTF-8'
# plugins
set-environment -g TMUX_PLUGIN_MANAGER_PATH '~/.local/share/tmux/plugins'
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'jabirali/tmux-tilish'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
set -g @plugin 'tmux-plugins/tmux-online-status'
set -g @plugin 'tmux-plugins/tmux-sidebar'
set -g @plugin 'tmux-plugins/tmux-open'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-pain-control'
set -g @plugin 'christoomey/tmux-navigator'
set -g @plugin 'kristijanhusak/tmux-simple-git-status'
set -g @plugin 'chriszarate/tmux-tasks'
# Set the prefix to Ctrl+a
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# nested tmux, obey me
bind-key a send-prefix
# set default shell
set -g default-command bash
# set theme
color_orange="colour166" # 208, 166
color_purple="colour134" # 135, 134
color_green="colour076" # 070
color_blue="colour39"
color_yellow="colour220"
color_red="colour160"
color_black="colour232"
color_white="white" # 015
# Change values, but not remove/rename variables itself
color_dark="$color_black"
color_light="$color_white"
color_session_text="$color_blue"
color_status_text="colour245"
color_main="$color_orange"
color_secondary="$color_purple"
color_level_ok="$color_green"
color_level_warn="$color_yellow"
color_level_stress="$color_red"
color_window_off_indicator="colour088"
color_window_off_status_bg="colour238"
color_window_off_status_current_bg="colour254"
set-option -g mode-style "fg=default,bg=$color_main"
set-option -g message-style "fg=$color_main,bg=$color_dark"
# All kind of nice options
set-option -g default-terminal "screen-256color"
set-option -g history-limit 100000
set-option -g repeat-time 500
set-option -g terminal-overrides 'xterm*:smcup@:rmcup@'
set-option -ga terminal-overrides ',xterm*:smcup@:rmcup@'
set-option -g base-index 1
set-option -g update-environment -r
# titles
set-option -g set-titles on
set-option -g set-titles-string "#T"
# Window options
set-option -g allow-rename on
set-option -g base-index 1
set-window-option -g pane-base-index 1
set-window-option -g renumber-windows on
set-window-option -g monitor-activity on
set-window-option -g xterm-keys on
set-window-option -g automatic-rename on
set-window-option -g aggressive-resize off
set-window-option -g pane-base-index 1
# Remap keys to my settings
unbind-key d ; bind-key d detach-client
unbind-key Tab ; bind-key Tab choose-window
unbind-key t ; bind-key t new-window
unbind-key ` ; bind-key ` last-window
unbind-key n ; bind-key n next-window
unbind-key p ; bind-key p previous-window
#unbind-key , ; bind-key , rename-window
# Window selection
unbind-key 1 ; bind-key 1 select-window -t 1
unbind-key 2 ; bind-key 2 select-window -t 2
unbind-key 3 ; bind-key 3 select-window -t 3
unbind-key 4 ; bind-key 4 select-window -t 4
unbind-key 5 ; bind-key 5 select-window -t 5
unbind-key 6 ; bind-key 6 select-window -t 6
unbind-key 7 ; bind-key 7 select-window -t 7
unbind-key 8 ; bind-key 8 select-window -t 8
unbind-key 9 ; bind-key 9 select-window -t 9
# Window splitting
unbind-key \ ; bind-key \ split-window -c "#{pane_current_path}" -h
unbind-key / ; bind-key / split-window -c "#{pane_current_path}" -v
# Pane selection and resizing
unbind-key left ; bind-key left select-pane -L
unbind-key up ; bind-key up select-pane -U
unbind-key down ; bind-key down select-pane -D
unbind-key right ; bind-key right select-pane -R
unbind-key C-h ; bind-key C-h select-pane -L
unbind-key C-k ; bind-key C-k select-pane -U
unbind-key C-j ; bind-key C-j select-pane -D
unbind-key C-l ; bind-key C-l select-pane -R
unbind-key j ; bind-key -r j resize-pane -D 5
unbind-key k ; bind-key -r k resize-pane -U 5
unbind-key h ; bind-key -r h resize-pane -L 5
unbind-key l ; bind-key -r l resize-pane -R 5
unbind-key C-left ; bind-key -r C-left resize-pane -L 1
unbind-key C-right ; bind-key -r C-right resize-pane -R 1
unbind-key C-up ; bind-key -r C-up resize-pane -U 1
unbind-key C-down ; bind-key -r C-down resize-pane -D 1
unbind-key @ ; bind-key @ confirm-before kill-window
unbind-key ? ; bind-key ? list-keys
# Set that stupid Esc-Wait off, so VI works again
set-option -sg escape-time 0
# set mode either vi or emacs
set-window-option -g mode-keys emacs
# Source setup file
bind-key r source-file ~/.tmux.conf \; display-message 'source ~/.tmux.conf'
bind-key C-r source-file ~/.tmux.conf \; display-message 'source ~/.tmux.conf'
# Shift arrow to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window
# system clipboard
#bind C-c run "tmux save-buffer - | xclip -i -sel clipboard"
#bind C-v run "tmux set-buffer \"$(xclip -o -sel clipboard)\"; tmux paste-buffer"
# copy/paste
set-option -g @copy_use_osc52_fallback on
# mouse support
set-window-option -g mouse on
unbind-key m ; bind-key m run "mouse-toggle"
# Select layout
bind-key w command-prompt -p "tiled/even-horizontal/even-vertical/main-horizontal/main-vertical?" "select-layout '%%'"
# Zoom tmux pane with '+' key
bind + resize-pane -Z
# Message display time (ms)
set-option -g display-time 2000
# Notification
set-window-option -g monitor-activity on
set-option -g visual-activity on
set-option -g bell-action any
set-option -g visual-bell on
# Plugin properties
set -g @tilish-navigate 'on'
set -g @sidebar-tree 't'
set -g @sidebar-tree-focus 'T'
set -g @sidebar-tree-command 'tree -C'
set -g @sidebar-tree-position 'right'
## tmux prefix highlight
set -g @prefix_highlight_show_copy_mode 'on'
set -g @prefix_highlight_prefix_prompt 'PRE'
set -g @prefix_highlight_copy_prompt 'COPY'
set -g @prefix_highlight_sync_prompt 'SYNC'
set -g @prefix_highlight_empty_prompt 'TMUX'
# tmux continuum
set -g @continuum-restore 'on'
set -g @continuum-save-interval '5'
# tmux resurrect
set -g @resurrect-dir '~/.cache/resurrect'
set -g @resurrect-save 'S'
set -g @resurrect-restore 'R'
set -g @resurrect-hook-post-save-all 'eval $(xdotool getwindowgeometry --shell $WINDOWID); echo 0,$X,$Y,$WIDTH,$HEIGHT > ~/.cache/resurrect/geometry'
set -g @resurrect-hook-pre-restore-all 'wmctrl -i -r $WINDOWID -e $(cat ~/.cache/resurrect/geometry)'
# Task manager
set -g @tasks_manager 'taskwarrior'
set -g @tasks_format_begin '#[fg=orange,bg=#f8f8f2]'
set -g @tasks_format_end '#[fg=white,bg=#44475a]'
set -g @tasks_icon_urgent '🔥'
set -g @tasks_icon_outstanding '+'
# 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}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R'
tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'"
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'"
bind-key -T copy-mode-vi 'C-h' select-pane -L
bind-key -T copy-mode-vi 'C-j' select-pane -D
bind-key -T copy-mode-vi 'C-k' select-pane -U
bind-key -T copy-mode-vi 'C-l' select-pane -R
bind-key -T copy-mode-vi 'C-\' select-pane -l
# general status bar settings
set-option -g status on
set-option -g status-interval 2
set-option -g status-position "bottom"
set-option -g status-justify "centre"
set-option -g status-left-length 120
set-option -g status-right-length 120
set -g status-style "fg=$color_status_text,bg=$color_dark"
set -g window-status-separator ''
set -g status-left ' #{prefix_highlight} | Sess:#S | #(whoami)@#H | #{tasks_status} |#{simple_git_status}'
set -g status-right '#(echo -n "$(weather)" | Continuum: #{continuum_status} | %a %m/%d %H:%M '
set -g window-status-format ' #I:#W '
set -g window-status-current-format ' #W '
setw -g window-status-activity-style "fg=$color_main"
setw -g window-status-current-style "fg=$color_light,bold,bg=$color_main"
# import user config
if '[ -f ~/.tmux.local ]' 'source ~/.tmux.local'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
if "test ! -d ~/.local/share/tmux/tpm/.git" "run '/usr/local/bin/tmux-plugins'"
if "test -f ~/.local/share/tmux/tpm/tpm" "run '~/usr/local/bin/tmux-plugins'"