diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/check_os.sh | 27 | ||||
-rwxr-xr-x | scripts/color_palette.sh | 14 | ||||
-rwxr-xr-x | scripts/path_search.sh | 3 | ||||
-rwxr-xr-x | scripts/powerline.sh | 21 | ||||
-rwxr-xr-x | scripts/rolodex.sh | 24 | ||||
-rwxr-xr-x | scripts/url_search.sh | 3 | ||||
-rwxr-xr-x | scripts/window_renum.sh | 8 |
7 files changed, 35 insertions, 65 deletions
diff --git a/scripts/check_os.sh b/scripts/check_os.sh deleted file mode 100755 index 6b654af..0000000 --- a/scripts/check_os.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash -# vim: set filetype=sh : -# -# Author: Cody Hiar -# Date: 2017-06-09 -# -# Description:: Check the operatig system of the host and load the os specific -# options -# -# Set options: -# e: Stop script if command fails -# u: Stop script if unset variable is referenced -# x: Debug, print commands as they are executed -# o pipeline: If any command in a pipeline fails it all fails -# -set -euo pipefail - -# Main loop of program -main() { - if [ "$(uname)" == "Darwin" ]; then - tmux source-file "$HOME/.tmux/tmux-darwin.config" - elif [ "$(uname)" == "Linux" ]; then - tmux source-file "$HOME/.tmux/tmux-linux.config" - fi -} -main - diff --git a/scripts/color_palette.sh b/scripts/color_palette.sh deleted file mode 100755 index 3762fae..0000000 --- a/scripts/color_palette.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash -# Print tmux color palette. -# Idea from http://superuser.com/questions/285381/how-does-the-tmux-color-palette-work - -for i in $(seq 0 4 255); do - for j in $(seq $i $(expr $i + 3)); do - for k in $(seq 1 $(expr 3 - ${#j})); do - printf " " - done - printf "\x1b[38;5;${j}mcolour${j}" - [[ $(expr $j % 4) != 3 ]] && printf " " - done - printf "\n" -done diff --git a/scripts/path_search.sh b/scripts/path_search.sh index c6ee062..d473607 100755 --- a/scripts/path_search.sh +++ b/scripts/path_search.sh @@ -4,7 +4,8 @@ # Author: Cody Hiar # Date: 2019-04-26 # -# Description: Search buffer for unix filepaths +# Description: Search buffer for unix paths in current tmux pane and send +# results to fzf to copy to clipboard URL=$(tmux capture-pane -pS -30000 | perl -wnl -e '/\S*(html|py|md|txt|pdf|js|ini|json)$/ and print $&' | awk '!x[$0]++' | fzf-tmux) if [[ -n "$URL" ]]; then diff --git a/scripts/powerline.sh b/scripts/powerline.sh deleted file mode 100755 index cf1fb5b..0000000 --- a/scripts/powerline.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash -RS='\ue0b4' -LS='\ue0b4' -WAN_SYMBOL='\uf0ee' -LAN_SYMBOL='\uf0ed' - -if [[ "$1" == "left" ]]; then - echo "$(tmux display-message -p '#S') [$(hostname)]" - # echo -ne "#[fg=colour235, bg=colour66] $(tmux display-message -p '#S') #[fg=colour66, bg=colour241]$LS#[default]" - # echo -ne "#[fg=colour223, bg=colour241] $(hostname) #[fg=colour241, bg=default]$LS#[default]" -fi - -# Disable right prompt for now, i3 bar has all this info -# if [[ "$1" == "right" ]]; then -# IP_ADDRESS=$(ip addr show | grep "inet[^6]" | grep -v "\(127.0.0.1\|docker\)" | tr -s ' ' | cut -d ' ' -f3 | cut -d '/' -f1) -# echo -ne "#[fg=colour235, bg=colour241]$RS#[fg=colour223, bg=colour241] $LAN_SYMBOL $IP_ADDRESS" -# WAN_IP=$(curl --max-time 2 -s http://whatismyip.akamai.com/) -# echo -ne " $WAN_SYMBOL $WAN_IP #[default]" -# DATE=$(date +"%b %d, %H:%M") -# echo -ne "#[fg=colour241, bg=colour142]$RS#[fg=colour235] $DATE #[default]" -# fi diff --git a/scripts/rolodex.sh b/scripts/rolodex.sh index ddc6ba0..00cc1ce 100755 --- a/scripts/rolodex.sh +++ b/scripts/rolodex.sh @@ -4,7 +4,29 @@ # Author: Cody Hiar # Date: 2019-01-11 # -# Description: Rolodex script +# Description: Rolodex script. Consider the following setup +# +# +------------------------------+-----------------------------+ +# | | | +# | | Pane 3 | +# | | | +# | Pane 1 +-----------------------------+ +# | | | +# | | Pane 4 | +# +------------------------------+ | +# | | | +# | +-----------------------------+ +# | Pane 2 | | +# | | | +# | | Pane 5 | +# | | | +# +------------------------------+-----------------------------+ +# Window 1 Window 2 +# +# This is my standard setup. Pane 1 is vim, pane 2-5 are just used for docker +# or w/e else. I almost always want to stick on Window 1 but I want to cycle +# between pane 2-5. This script will simply rotate them in either direction so +# I can stay in window 1 but have a sort of "tabbed" bottom window # # Set options: # e: Stop script if command fails diff --git a/scripts/url_search.sh b/scripts/url_search.sh index 497b09c..4320a83 100755 --- a/scripts/url_search.sh +++ b/scripts/url_search.sh @@ -4,7 +4,8 @@ # Author: Cody Hiar # Date: 2019-04-25 # -# Description: Search buffer for url results +# Description: Search tmux pane for urls then pass to fzf +# for copying to clipboard PANE_HISTORY="$(tmux capture-pane -J -p)" URL=$(echo "$PANE_HISTORY" | perl -wnl -e '/https?\:\/\/[^\s]+[\/\w]/ and print $&' | fzf-tmux) diff --git a/scripts/window_renum.sh b/scripts/window_renum.sh index 19e5825..ef0a87f 100755 --- a/scripts/window_renum.sh +++ b/scripts/window_renum.sh @@ -1,3 +1,11 @@ +#!/usr/bin/env bash +# vim: set filetype=sh +# +# Author: Unknown +# Date: 2016-11-09 +# +# Description: Renumber tmux windows (1, 3, 4, 6) -> (1, 2, 3, 4) + for session in $(tmux ls | awk -F: '{print $1}') ; do active_window=$(tmux lsw -t ${session} | awk -F: '/\(active\)$/ {print $1}') inum=1 |