diff options
Diffstat (limited to 'tmuxsh')
113 files changed, 686 insertions, 0 deletions
diff --git a/tmuxsh/_applauncher,--.start.programs.in.new.window b/tmuxsh/_applauncher,--.start.programs.in.new.window new file mode 100755 index 0000000..5f9f8fc --- /dev/null +++ b/tmuxsh/_applauncher,--.start.programs.in.new.window @@ -0,0 +1,27 @@ +#!/usr/bin/env sh +TMPFILE="/tmp/fzfspeed_applauncher.txt" +FZF_ARG() { + fzf -e -i -m --delimiter '/' --with-nth -1 --prompt="Select program(s) to open: " --info=default --layout=reverse --tiebreak=index +} + +selected=$( + # delete if database is older than 1day + if test "$(find "$TMPFILE" -mtime +1 2>/dev/null)" ; then + rm "$TMPFILE" + elif [ -f "$TMPFILE" ]; then + FZF_ARG < "$TMPFILE" | awk '{print $1}' + else + # if file does not exist then generate new database + find $(echo "$PATH" | sed 's@:@\n@g' | sed 's:/*$::' | awk '!x[$0]++' | sed ':a;N;$!ba;s/\n/\/* /g' ) -type f 2>/dev/null | + awk '!x[$0]++' | while read -r line + do + printf '%s\n' "$(basename "$line") $line" + done | sort > "$TMPFILE" + FZF_ARG < "$TMPFILE" | awk '{print $1}' + fi +) +[ -z "$selected" ] && exit +echo "$selected" | while read -r line; do + tmux new-window -n "${line}" + tmux send-keys -t "${line}" "$line" C-m +done diff --git a/tmuxsh/_bluepill,--.copy.a.codeblock b/tmuxsh/_bluepill,--.copy.a.codeblock new file mode 100755 index 0000000..70ec1fc --- /dev/null +++ b/tmuxsh/_bluepill,--.copy.a.codeblock @@ -0,0 +1,19 @@ +#!/usr/bin/env sh +selected="$(find ~/.config/bluepill/ -type f | sort | fzf -e -i --delimiter / --with-nth -1 --preview 'cat {}' --prompt="Copy a codeblock to clipboard: " --info=default --layout=reverse --tiebreak=index)" +[ -z "$selected" ] && exit + +# copy to X11 (linux,bsd) +xsel -b < "$selected" || xclip -selection clipboard "$selected" +# copy to Wayland (linux,bsd) +wl-copy < "$selected" +# copy to WindowsOS (Vista+) +clip < "$selected" +# copy to Cygwin (WindowsOS) +cat "$selected" > /dev/clipboard +# copy to MacOS +pbcopy < "$selected" +# copy to Termux (Android) +cat "$selected" | termux-clipboard-set +# copy to tmux +tmux load-buffer "$selected" +tmux display-message "Copied codeblock to clipboard" diff --git a/tmuxsh/_bookmarks,--.open.surfraw.bookmarks b/tmuxsh/_bookmarks,--.open.surfraw.bookmarks new file mode 100755 index 0000000..caded37 --- /dev/null +++ b/tmuxsh/_bookmarks,--.open.surfraw.bookmarks @@ -0,0 +1,21 @@ +#!/usr/bin/env sh +# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry) +# https://www.youtube.com/user/gotbletu +# DESC: open surfraw bookmarks with your deafult web browser ($BROWSER) +# DEPEND: fzf surfraw grep gawk coreutils +# REQD: 1. set default terminal web browser +# $EDITOR ~/.bashrc +# export BROWSERCLI=w3m +# 2. add new bookmark to surfraw +# $EDITOR ~/.config/surfraw/bookmarks +# # <bookmark_name(20char_max)> <url> <tags|tag2|tag3|tag4|...> +# hackernews https://news.ycombinator.com/ textonly|news|tech|linux +# npr https://text.npr.org/ textonly|news|world|politics|current|events +# cnn http://lite.cnn.io/en textonly|news|world|politics|current|events|main|stories + +# display order <bookmark_name> <tags> and <url> last +selected=$(grep -E '^([[:alnum:]])' ~/.config/surfraw/bookmarks | sort | awk -F' ' '{printf "%-20.20s %-80.80s %s \n", $1,$3,$2}' | tr '|' ' ' | fzf -e -i -m --delimiter=' ' --prompt="Select bookmark(s) to open: " --info=default --layout=reverse --tiebreak=index | awk '{print $1}') +[ -z "$selected" ] && exit +echo "$selected" | while read -r line; do + tmux new-window -n "www-${line}" "surfraw -browser=$BROWSERCLI $line" +done diff --git a/tmuxsh/_calc,--.calculator.with.bc.or.python.(ctrl-d.to.exit) b/tmuxsh/_calc,--.calculator.with.bc.or.python.(ctrl-d.to.exit) new file mode 100755 index 0000000..c0f9ce5 --- /dev/null +++ b/tmuxsh/_calc,--.calculator.with.bc.or.python.(ctrl-d.to.exit) @@ -0,0 +1,21 @@ +#!/usr/bin/env sh +helpmsg() { + printf "%s\n" "desc: commandline calculator (ctrl+d to exit)" + printf "%s\n" "demo: http://www.youtube.com/watch?v=JkyodHenTuc" + printf "%s\n" "depends: python2, python3 or bc" + printf "\n" + printf "%s\n" "usage: ${0##*/}" +} +if [ "$1" = -h ] || [ "$1" = --help ]; then + helpmsg + exit 0 +elif command -v python3 >/dev/null; then + python3 -ic "from math import *; import cmath" +elif command -v python2 >/dev/null; then + python2 -ic "from __future__ import division; from math import *; from random import *" +elif command -v bc >/dev/null; then + bc -q -l +else + printf "%s\n" "missing python2, python3 or bc" + exit 1 +fi diff --git a/tmuxsh/_emoji,--.copy.from.list.of.emojis b/tmuxsh/_emoji,--.copy.from.list.of.emojis new file mode 120000 index 0000000..e6def07 --- /dev/null +++ b/tmuxsh/_emoji,--.copy.from.list.of.emojis @@ -0,0 +1 @@ +../.git/annex/objects/98/Xw/SHA256E-s119651--ac52498908f0bfb397a5611628d11e27533df118f569d3e595fdebcff12e4704/SHA256E-s119651--ac52498908f0bfb397a5611628d11e27533df118f569d3e595fdebcff12e4704
\ No newline at end of file diff --git a/tmuxsh/_ranger_locate,--.search.local.files.using.locate.and.open.with.ranger.file.manager b/tmuxsh/_ranger_locate,--.search.local.files.using.locate.and.open.with.ranger.file.manager new file mode 100755 index 0000000..f3c6dac --- /dev/null +++ b/tmuxsh/_ranger_locate,--.search.local.files.using.locate.and.open.with.ranger.file.manager @@ -0,0 +1,28 @@ +#!/usr/bin/env sh +# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry) +# https://www.youtube.com/user/gotbletu +# DESC: locate a file and go to that directory with ranger file manager +# DEMO: https://www.youtube.com/watch?v=C64LKCZFzME +# REQD: add code to ranger file manager +# $EDITOR ~/.config/ranger/commands.py +# class fzf_locate(Command): +# """ +# :fzf_locate +# Locate a file using fzf. +# """ +# def execute(self): +# import subprocess +# if self.quantifier: +# command="locate home media | fzf -e -i --prompt='Select to open with ranger: ' --info=default --layout=reverse --tiebreak=index" +# else: +# command="locate home media | fzf -e -i --prompt='Select to open with ranger: ' --info=default --layout=reverse --tiebreak=index" +# fzf = self.fm.execute_command(command, stdout=subprocess.PIPE) +# stdout, stderr = fzf.communicate() +# if fzf.returncode == 0: +# fzf_file = os.path.abspath(stdout.decode('utf-8').rstrip('\n')) +# if os.path.isdir(fzf_file): +# self.fm.cd(fzf_file) +# else: +# self.fm.select_file(fzf_file) + +tmux new-window -n locate 'ranger --cmd=fzf_locate' diff --git a/tmuxsh/_redpill,--.open.cheatsheets.in.new.window b/tmuxsh/_redpill,--.open.cheatsheets.in.new.window new file mode 100755 index 0000000..95c314d --- /dev/null +++ b/tmuxsh/_redpill,--.open.cheatsheets.in.new.window @@ -0,0 +1,13 @@ +#!/usr/bin/env sh +# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry) +# https://www.youtube.com/user/gotbletu +# DESC: open a cheatsheet to read notes +# DEPEND: fzf findutils coreutils + +selected="$(find ~/.config/redpill/ -type f | sort | fzf -e -i -m --delimiter / --with-nth -1 --preview 'cat {}' --prompt="Select cheatsheet(s) to open: " --info=default --layout=reverse --tiebreak=index)" +[ -z "$selected" ] && exit +echo "$selected" | while read -r line; do + filename="$(basename "$line")" + tmux new-window -n "${filename}-pill" + tmux send-keys -t "${filename}-pill" "$EDITOR $line && tmux kill-pane" C-m +done diff --git a/tmuxsh/_snippetline,--.copy.a.snippet.single.line b/tmuxsh/_snippetline,--.copy.a.snippet.single.line new file mode 100755 index 0000000..897ce3f --- /dev/null +++ b/tmuxsh/_snippetline,--.copy.a.snippet.single.line @@ -0,0 +1,36 @@ +#!/usr/bin/env sh +# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry) +# https://www.youtube.com/user/gotbletu +# DESC: copy text snippet to clipboard +# DEMO: https://www.youtube.com/watch?v=Zew0mgJwAh8 +# REQD: add some snippets +# $EDITOR ~/.config/snippetline/snippetrc" +# # <your line> ;; tags +# Negative In The Freedom Dimension ;; RMS Richard Stallman GNU linux Freedom Software Open Source +# A Ninja Must See Through Deception ;; Anime Naruto Ninja Kakashi Hatake +# Rule Of Acquisition #106 There is no honor in poverty. ;; star trek deep space nine ds9 ferengi quark tvshow series + +FILE="$HOME/.config/snippetline/snippetrc" +FZF_ARG() { + fzf -e -i --prompt="Copy a snippet to clipboard: " --info=default --layout=reverse --tiebreak=index +} + +# sort, delete empty line, remove tags, leading and trailing spaces, also no newline +selected="$(sort -n "$FILE" | sed '/^$/d' | FZF_ARG | sed -e s/\;\;\.\*\$// | sed 's/^[ \t]*//;s/[ \t]*$//' | tr -d '\n' )" +[ -z "$selected" ] && exit + +# copy to X11 (linux,bsd) +printf '%s' "$selected" | xsel -b || printf '%s' "$selected" | xclip -selection clipboard +# copy to Wayland (linux,bsd) +printf '%s' "$selected" | wl-copy +# copy to WindowsOS (Vista+) +printf '%s' "$selected" | clip +# copy to Cygwin (WindowsOS) +printf '%s' "$selected" > /dev/clipboard +# copy to MacOS +printf '%s' "$selected" | pbcopy +# copy to Termux (Android) +printf '%s' "$selected" | termux-clipboard-set +# copy to tmux +printf '%s' "$selected" | tmux load-buffer - +tmux display-message "Copied to clipboard" diff --git a/tmuxsh/_snippetmulti,--.copy.a.snippet.textblock b/tmuxsh/_snippetmulti,--.copy.a.snippet.textblock new file mode 100755 index 0000000..7b5525c --- /dev/null +++ b/tmuxsh/_snippetmulti,--.copy.a.snippet.textblock @@ -0,0 +1,28 @@ +#!/usr/bin/env sh +# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry) +# https://www.youtube.com/user/gotbletu +# DESC: copy textblock to clipboard +# DEMO: https://www.youtube.com/watch?v=Zew0mgJwAh8 + +DIR="$HOME/.config/snippetmulti" +FZF_ARG() { + fzf -e -i --delimiter / --with-nth -1 --preview 'cat {}' --prompt="Copy textblock to clipboard: " --info=hidden --layout=reverse --tiebreak=index +} +selected="$(find "$DIR"/ -type f | sort | FZF_ARG)" +[ -z "$selected" ] && exit + +# copy to X11 (linux,bsd) +xsel -b < "$selected" || xclip -selection clipboard "$selected" +# copy to Wayland (linux,bsd) +wl-copy < "$selected" +# copy to WindowsOS (Vista+) +clip < "$selected" +# copy to Cygwin (WindowsOS) +cat "$selected" > /dev/clipboard +# copy to MacOS +pbcopy < "$selected" +# copy to Termux (Android) +cat "$selected" | termux-clipboard-set +# copy to tmux +tmux load-buffer "$selected" +tmux display-message "Copied contents to clipboard" diff --git a/tmuxsh/_surfraw,--.search.the.internet b/tmuxsh/_surfraw,--.search.the.internet new file mode 100755 index 0000000..d2de789 --- /dev/null +++ b/tmuxsh/_surfraw,--.search.the.internet @@ -0,0 +1,16 @@ +#!/usr/bin/env sh +# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry) +# https://www.youtube.com/user/gotbletu +# DESC: search internet from a list of search engines +# REQD: set a default terminal web browser +# $EDITOR ~/.bashrc +# export BROWSERCLI=w3m + +PREFIX=$(surfraw -elvi | grep -v 'LOCAL\|GLOBAL' | fzf -e -i -m --prompt='Select search engine(s): ' --info=default --layout=reverse --tiebreak=index | awk '{print $1}') +[ -z "$PREFIX" ] && exit +ENGINES=$(echo "$PREFIX" | tr '\n' ' ') +INPUT=$(echo | fzf --print-query --prompt="Enter keyword(s) to search ${ENGINES}: " --info=default --layout=reverse) +[ -z "$INPUT" ] && exit +echo "$PREFIX" | while read -r line; do + tmux new-window -n "sr-${line}" "$BROWSERCLI '"$(surfraw -p $line $INPUT)"'" +done diff --git a/tmuxsh/_tmux_bell,--.list.and.jump.to.window.with.bell.alert b/tmuxsh/_tmux_bell,--.list.and.jump.to.window.with.bell.alert new file mode 100755 index 0000000..6f711e6 --- /dev/null +++ b/tmuxsh/_tmux_bell,--.list.and.jump.to.window.with.bell.alert @@ -0,0 +1,20 @@ +#!/usr/bin/env sh +# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry|odysee) +# https://www.youtube.com/user/gotbletu +# NOTE: simulate a bell alert on a window: $ sleep 3 && echo -e "\a" + +# tmux list-pane formating +TARGET_SPEC="#{session_name}:#{window_id}:#{pane_id}:" +LIST_DATA="#{window_name} #{pane_title} #{window_bell_flag} #{pane_current_path} #{pane_current_command}" + +FZF_COMMAND() { + fzf -e -i --prompt="Go to bell alert pane: " --info=default --layout=reverse --tiebreak=index +} + +# select pane +LINE="$(tmux list-panes -a -F "$TARGET_SPEC $LIST_DATA" | awk '$4 == "1" {print $0}' | FZF_COMMAND)" || exit 0 +SESSION="$(echo "$LINE" | cut -d ':' -f1)" +WINDOW_NUM="$(echo "$LINE" | cut -d ':' -f2)" +PANE_NUM="$(echo "$LINE" | cut -d ':' -f3)" + +tmux select-pane -t "$PANE_NUM" && tmux select-window -t "$WINDOW_NUM" && tmux switch-client -t "$SESSION" diff --git a/tmuxsh/_tmux_bell_next,--.jump.to.next.window.with.bell.alert b/tmuxsh/_tmux_bell_next,--.jump.to.next.window.with.bell.alert new file mode 100755 index 0000000..8ed81a4 --- /dev/null +++ b/tmuxsh/_tmux_bell_next,--.jump.to.next.window.with.bell.alert @@ -0,0 +1,16 @@ +#!/usr/bin/env sh +# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry|odysee) +# https://www.youtube.com/user/gotbletu +# NOTE: simulate a bell alert on a window: $ sleep 3 && echo -e "\a" + +# tmux list-pane formating +TARGET_SPEC="#{session_name}:#{window_id}:#{pane_id}:" +LIST_DATA="#{window_name} #{pane_title} #{window_bell_flag} #{pane_current_path} #{pane_current_command}" + +# select pane +LINE="$(tmux list-panes -a -F "$TARGET_SPEC $LIST_DATA" | awk '$4 == "1" {print $0}' | head -n 1)" || exit 0 +SESSION="$(echo "$LINE" | cut -d ':' -f1)" +WINDOW_NUM="$(echo "$LINE" | cut -d ':' -f2)" +PANE_NUM="$(echo "$LINE" | cut -d ':' -f3)" + +tmux select-pane -t "$PANE_NUM" && tmux select-window -t "$WINDOW_NUM" && tmux switch-client -t "$SESSION" diff --git a/tmuxsh/_tmux_choose_buffer,--.list.clipboard.history.with.preview b/tmuxsh/_tmux_choose_buffer,--.list.clipboard.history.with.preview new file mode 100755 index 0000000..0622840 --- /dev/null +++ b/tmuxsh/_tmux_choose_buffer,--.list.clipboard.history.with.preview @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux choose-buffer -Z diff --git a/tmuxsh/_tmux_choose_pane,--.list.panes.windows.or.sessions.with.preview b/tmuxsh/_tmux_choose_pane,--.list.panes.windows.or.sessions.with.preview new file mode 100755 index 0000000..21dde91 --- /dev/null +++ b/tmuxsh/_tmux_choose_pane,--.list.panes.windows.or.sessions.with.preview @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux choose-tree -Z diff --git a/tmuxsh/_tmux_choose_session,--.list.sessions.with.preview b/tmuxsh/_tmux_choose_session,--.list.sessions.with.preview new file mode 100755 index 0000000..a13aae3 --- /dev/null +++ b/tmuxsh/_tmux_choose_session,--.list.sessions.with.preview @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux choose-tree -Z -s diff --git a/tmuxsh/_tmux_choose_window,--.list.windows.with.preview b/tmuxsh/_tmux_choose_window,--.list.windows.with.preview new file mode 100755 index 0000000..a1b52e2 --- /dev/null +++ b/tmuxsh/_tmux_choose_window,--.list.windows.with.preview @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux choose-tree -Z -w diff --git a/tmuxsh/_tmux_clipboard_clear,--.clear.all.clipboard b/tmuxsh/_tmux_clipboard_clear,--.clear.all.clipboard new file mode 100755 index 0000000..dc2a22e --- /dev/null +++ b/tmuxsh/_tmux_clipboard_clear,--.clear.all.clipboard @@ -0,0 +1,3 @@ +#!/usr/bin/env sh +while tmux delete-buffer; do :; done +tmux display-message "cleared all tmux clipboard history" diff --git a/tmuxsh/_tmux_clipboard_delete,--.delete.current.clipboard b/tmuxsh/_tmux_clipboard_delete,--.delete.current.clipboard new file mode 100755 index 0000000..d2d123b --- /dev/null +++ b/tmuxsh/_tmux_clipboard_delete,--.delete.current.clipboard @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +tmux delete-buffer +tmux display-message "deleted current tmux clipboard from history" + + diff --git a/tmuxsh/_tmux_clipboard_history,--.search.and.paste.from.clipboard.history b/tmuxsh/_tmux_clipboard_history,--.search.and.paste.from.clipboard.history new file mode 100755 index 0000000..c64e009 --- /dev/null +++ b/tmuxsh/_tmux_clipboard_history,--.search.and.paste.from.clipboard.history @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux paste-buffer -b "$(tmux list-buffers | fzf -e -i | cut -d ':' -f1)" diff --git a/tmuxsh/_tmux_clipboard_paste,--.paste.current.clipboard b/tmuxsh/_tmux_clipboard_paste,--.paste.current.clipboard new file mode 100755 index 0000000..a96f61c --- /dev/null +++ b/tmuxsh/_tmux_clipboard_paste,--.paste.current.clipboard @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux paste-buffer diff --git a/tmuxsh/_tmux_copy_mode,--.enter.copy.mode b/tmuxsh/_tmux_copy_mode,--.enter.copy.mode new file mode 100755 index 0000000..b95f004 --- /dev/null +++ b/tmuxsh/_tmux_copy_mode,--.enter.copy.mode @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux copy-mode diff --git a/tmuxsh/_tmux_detach_client,--.detach.the.current.client b/tmuxsh/_tmux_detach_client,--.detach.the.current.client new file mode 100755 index 0000000..2ccd748 --- /dev/null +++ b/tmuxsh/_tmux_detach_client,--.detach.the.current.client @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux detach-client diff --git a/tmuxsh/_tmux_display_pane,--.display.pane.numbers.(press.number.keys.to.jump.to.a.pane) b/tmuxsh/_tmux_display_pane,--.display.pane.numbers.(press.number.keys.to.jump.to.a.pane) new file mode 100755 index 0000000..ede96df --- /dev/null +++ b/tmuxsh/_tmux_display_pane,--.display.pane.numbers.(press.number.keys.to.jump.to.a.pane) @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux command-prompt -p "Press {Enter} then {Number} to jump to pane:" "display-panes" diff --git a/tmuxsh/_tmux_find_panes,--.search.all.panes.and.jump b/tmuxsh/_tmux_find_panes,--.search.all.panes.and.jump new file mode 100755 index 0000000..787d9a6 --- /dev/null +++ b/tmuxsh/_tmux_find_panes,--.search.all.panes.and.jump @@ -0,0 +1,22 @@ +#!/usr/bin/env sh +# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry|odysee) +# https://www.youtube.com/user/gotbletu +# REFF: https://gist.github.com/thugcee/41d1ba786fa5e66167ed6ee45e4f6346 +# https://eioki.eu/2021/01/12/tmux-and-fzf-fuzzy-tmux-session-window-pane-switcher +# CLOG: changed from bash to posix + +# tmux list-pane formating +TARGET_SPEC="#{session_name}:#{window_id}:#{pane_id}:" +LIST_DATA="#{window_name} #{pane_title} #{pane_current_path} #{pane_current_command}" + +FZF_COMMAND() { + fzf -e -i --prompt="Select a pane: " --info=default --layout=reverse --tiebreak=index +} + +# select pane +LINE="$(tmux list-panes -a -F "$TARGET_SPEC $LIST_DATA" | FZF_COMMAND)" || exit 0 +SESSION="$(echo "$LINE" | cut -d ':' -f1)" +WINDOW_NUM="$(echo "$LINE" | cut -d ':' -f2)" +PANE_NUM="$(echo "$LINE" | cut -d ':' -f3)" + +tmux select-pane -t "$PANE_NUM" && tmux select-window -t "$WINDOW_NUM" && tmux switch-client -t "$SESSION" diff --git a/tmuxsh/_tmux_find_sessions,--.search.all.session.and.jump b/tmuxsh/_tmux_find_sessions,--.search.all.session.and.jump new file mode 100755 index 0000000..1ff9a23 --- /dev/null +++ b/tmuxsh/_tmux_find_sessions,--.search.all.session.and.jump @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux switch-client -t "$(tmux list-sessions | fzf -e -i --prompt="Select a session: " --info=default --layout=reverse --tiebreak=index | cut -d ':' -f1)" diff --git a/tmuxsh/_tmux_find_windows,--.search.all.window.and.jump b/tmuxsh/_tmux_find_windows,--.search.all.window.and.jump new file mode 100755 index 0000000..a191d9c --- /dev/null +++ b/tmuxsh/_tmux_find_windows,--.search.all.window.and.jump @@ -0,0 +1,21 @@ +#!/usr/bin/env sh +# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry|odysee) +# https://www.youtube.com/user/gotbletu +# REFF: https://gist.github.com/thugcee/41d1ba786fa5e66167ed6ee45e4f6346 +# https://eioki.eu/2021/01/12/tmux-and-fzf-fuzzy-tmux-session-window-pane-switcher +# CLOG: changed from bash to posix + +# tmux list-windows formating +TARGET_SPEC="#{session_name}:#{window_id}:" +LIST_DATA="#{window_name} #{pane_title} #{pane_current_path} #{pane_current_command}" + +FZF_COMMAND() { + fzf -e -i --prompt="Select a window: " --info=default --layout=reverse --tiebreak=index +} + +# select window +LINE="$(tmux list-windows -a -F "$TARGET_SPEC $LIST_DATA" | FZF_COMMAND)" || exit 0 +SESSION="$(echo "$LINE" | cut -d ':' -f1)" +WINDOW_NUM="$(echo "$LINE" | cut -d ':' -f2)" + +tmux select-window -t "$WINDOW_NUM" && tmux switch-client -t "$SESSION" diff --git a/tmuxsh/_tmux_goto_aubk,--.jump.to.named.window.(audiobook.player) b/tmuxsh/_tmux_goto_aubk,--.jump.to.named.window.(audiobook.player) new file mode 100755 index 0000000..4ad505d --- /dev/null +++ b/tmuxsh/_tmux_goto_aubk,--.jump.to.named.window.(audiobook.player) @@ -0,0 +1,7 @@ +#!/usr/bin/env sh +# Window Name from filename (e.g _tmux_goto_name,-- description --> name) +WIN_NAME="$(echo "${0##*/}" | cut -d ',' -f1 | cut -d '_' -f4)" +LINE=$(tmux list-windows -a -F "#{session_name}:#{window_id}: #{window_name}" | grep ": ${WIN_NAME}$") || exit 0 +SESSION="$(echo "$LINE" | cut -d ':' -f1)" +WINDOW_NUM="$(echo "$LINE" | cut -d ':' -f2)" +tmux select-window -t "$WINDOW_NUM" && tmux switch-client -t "$SESSION" diff --git a/tmuxsh/_tmux_goto_bt,--.jump.to.named.window.(bit.torrent) b/tmuxsh/_tmux_goto_bt,--.jump.to.named.window.(bit.torrent) new file mode 100755 index 0000000..4ad505d --- /dev/null +++ b/tmuxsh/_tmux_goto_bt,--.jump.to.named.window.(bit.torrent) @@ -0,0 +1,7 @@ +#!/usr/bin/env sh +# Window Name from filename (e.g _tmux_goto_name,-- description --> name) +WIN_NAME="$(echo "${0##*/}" | cut -d ',' -f1 | cut -d '_' -f4)" +LINE=$(tmux list-windows -a -F "#{session_name}:#{window_id}: #{window_name}" | grep ": ${WIN_NAME}$") || exit 0 +SESSION="$(echo "$LINE" | cut -d ':' -f1)" +WINDOW_NUM="$(echo "$LINE" | cut -d ':' -f2)" +tmux select-window -t "$WINDOW_NUM" && tmux switch-client -t "$SESSION" diff --git a/tmuxsh/_tmux_goto_cmd,--.jump.to.named.window.(free.space.to.run.commands) b/tmuxsh/_tmux_goto_cmd,--.jump.to.named.window.(free.space.to.run.commands) new file mode 100755 index 0000000..4ad505d --- /dev/null +++ b/tmuxsh/_tmux_goto_cmd,--.jump.to.named.window.(free.space.to.run.commands) @@ -0,0 +1,7 @@ +#!/usr/bin/env sh +# Window Name from filename (e.g _tmux_goto_name,-- description --> name) +WIN_NAME="$(echo "${0##*/}" | cut -d ',' -f1 | cut -d '_' -f4)" +LINE=$(tmux list-windows -a -F "#{session_name}:#{window_id}: #{window_name}" | grep ": ${WIN_NAME}$") || exit 0 +SESSION="$(echo "$LINE" | cut -d ':' -f1)" +WINDOW_NUM="$(echo "$LINE" | cut -d ':' -f2)" +tmux select-window -t "$WINDOW_NUM" && tmux switch-client -t "$SESSION" diff --git a/tmuxsh/_tmux_goto_dcc,--.jump.to.named.window.(DCC.direct.connect.client) b/tmuxsh/_tmux_goto_dcc,--.jump.to.named.window.(DCC.direct.connect.client) new file mode 100755 index 0000000..4ad505d --- /dev/null +++ b/tmuxsh/_tmux_goto_dcc,--.jump.to.named.window.(DCC.direct.connect.client) @@ -0,0 +1,7 @@ +#!/usr/bin/env sh +# Window Name from filename (e.g _tmux_goto_name,-- description --> name) +WIN_NAME="$(echo "${0##*/}" | cut -d ',' -f1 | cut -d '_' -f4)" +LINE=$(tmux list-windows -a -F "#{session_name}:#{window_id}: #{window_name}" | grep ": ${WIN_NAME}$") || exit 0 +SESSION="$(echo "$LINE" | cut -d ':' -f1)" +WINDOW_NUM="$(echo "$LINE" | cut -d ':' -f2)" +tmux select-window -t "$WINDOW_NUM" && tmux switch-client -t "$SESSION" diff --git a/tmuxsh/_tmux_goto_demo,--.jump.to.named.window.(demo.window.empty.space) b/tmuxsh/_tmux_goto_demo,--.jump.to.named.window.(demo.window.empty.space) new file mode 100755 index 0000000..4ad505d --- /dev/null +++ b/tmuxsh/_tmux_goto_demo,--.jump.to.named.window.(demo.window.empty.space) @@ -0,0 +1,7 @@ +#!/usr/bin/env sh +# Window Name from filename (e.g _tmux_goto_name,-- description --> name) +WIN_NAME="$(echo "${0##*/}" | cut -d ',' -f1 | cut -d '_' -f4)" +LINE=$(tmux list-windows -a -F "#{session_name}:#{window_id}: #{window_name}" | grep ": ${WIN_NAME}$") || exit 0 +SESSION="$(echo "$LINE" | cut -d ':' -f1)" +WINDOW_NUM="$(echo "$LINE" | cut -d ':' -f2)" +tmux select-window -t "$WINDOW_NUM" && tmux switch-client -t "$SESSION" diff --git a/tmuxsh/_tmux_goto_dlmgr,--.jump.to.named.window.(download.manager) b/tmuxsh/_tmux_goto_dlmgr,--.jump.to.named.window.(download.manager) new file mode 100755 index 0000000..4ad505d --- /dev/null +++ b/tmuxsh/_tmux_goto_dlmgr,--.jump.to.named.window.(download.manager) @@ -0,0 +1,7 @@ +#!/usr/bin/env sh +# Window Name from filename (e.g _tmux_goto_name,-- description --> name) +WIN_NAME="$(echo "${0##*/}" | cut -d ',' -f1 | cut -d '_' -f4)" +LINE=$(tmux list-windows -a -F "#{session_name}:#{window_id}: #{window_name}" | grep ": ${WIN_NAME}$") || exit 0 +SESSION="$(echo "$LINE" | cut -d ':' -f1)" +WINDOW_NUM="$(echo "$LINE" | cut -d ':' -f2)" +tmux select-window -t "$WINDOW_NUM" && tmux switch-client -t "$SESSION" diff --git a/tmuxsh/_tmux_goto_email,--.jump.to.named.window.(email) b/tmuxsh/_tmux_goto_email,--.jump.to.named.window.(email) new file mode 100755 index 0000000..4ad505d --- /dev/null +++ b/tmuxsh/_tmux_goto_email,--.jump.to.named.window.(email) @@ -0,0 +1,7 @@ +#!/usr/bin/env sh +# Window Name from filename (e.g _tmux_goto_name,-- description --> name) +WIN_NAME="$(echo "${0##*/}" | cut -d ',' -f1 | cut -d '_' -f4)" +LINE=$(tmux list-windows -a -F "#{session_name}:#{window_id}: #{window_name}" | grep ": ${WIN_NAME}$") || exit 0 +SESSION="$(echo "$LINE" | cut -d ':' -f1)" +WINDOW_NUM="$(echo "$LINE" | cut -d ':' -f2)" +tmux select-window -t "$WINDOW_NUM" && tmux switch-client -t "$SESSION" diff --git a/tmuxsh/_tmux_goto_fm,--.jump.to.named.window.(file.manager) b/tmuxsh/_tmux_goto_fm,--.jump.to.named.window.(file.manager) new file mode 100755 index 0000000..4ad505d --- /dev/null +++ b/tmuxsh/_tmux_goto_fm,--.jump.to.named.window.(file.manager) @@ -0,0 +1,7 @@ +#!/usr/bin/env sh +# Window Name from filename (e.g _tmux_goto_name,-- description --> name) +WIN_NAME="$(echo "${0##*/}" | cut -d ',' -f1 | cut -d '_' -f4)" +LINE=$(tmux list-windows -a -F "#{session_name}:#{window_id}: #{window_name}" | grep ": ${WIN_NAME}$") || exit 0 +SESSION="$(echo "$LINE" | cut -d ':' -f1)" +WINDOW_NUM="$(echo "$LINE" | cut -d ':' -f2)" +tmux select-window -t "$WINDOW_NUM" && tmux switch-client -t "$SESSION" diff --git a/tmuxsh/_tmux_goto_im,--.jump.to.named.window.(instant.messenger.chat) b/tmuxsh/_tmux_goto_im,--.jump.to.named.window.(instant.messenger.chat) new file mode 100755 index 0000000..4ad505d --- /dev/null +++ b/tmuxsh/_tmux_goto_im,--.jump.to.named.window.(instant.messenger.chat) @@ -0,0 +1,7 @@ +#!/usr/bin/env sh +# Window Name from filename (e.g _tmux_goto_name,-- description --> name) +WIN_NAME="$(echo "${0##*/}" | cut -d ',' -f1 | cut -d '_' -f4)" +LINE=$(tmux list-windows -a -F "#{session_name}:#{window_id}: #{window_name}" | grep ": ${WIN_NAME}$") || exit 0 +SESSION="$(echo "$LINE" | cut -d ':' -f1)" +WINDOW_NUM="$(echo "$LINE" | cut -d ':' -f2)" +tmux select-window -t "$WINDOW_NUM" && tmux switch-client -t "$SESSION" diff --git a/tmuxsh/_tmux_goto_irc,--.jump.to.named.window.(internet.relay.chat) b/tmuxsh/_tmux_goto_irc,--.jump.to.named.window.(internet.relay.chat) new file mode 100755 index 0000000..4ad505d --- /dev/null +++ b/tmuxsh/_tmux_goto_irc,--.jump.to.named.window.(internet.relay.chat) @@ -0,0 +1,7 @@ +#!/usr/bin/env sh +# Window Name from filename (e.g _tmux_goto_name,-- description --> name) +WIN_NAME="$(echo "${0##*/}" | cut -d ',' -f1 | cut -d '_' -f4)" +LINE=$(tmux list-windows -a -F "#{session_name}:#{window_id}: #{window_name}" | grep ": ${WIN_NAME}$") || exit 0 +SESSION="$(echo "$LINE" | cut -d ':' -f1)" +WINDOW_NUM="$(echo "$LINE" | cut -d ':' -f2)" +tmux select-window -t "$WINDOW_NUM" && tmux switch-client -t "$SESSION" diff --git a/tmuxsh/_tmux_goto_music,--.jump.to.named.window.(music.player) b/tmuxsh/_tmux_goto_music,--.jump.to.named.window.(music.player) new file mode 100755 index 0000000..4ad505d --- /dev/null +++ b/tmuxsh/_tmux_goto_music,--.jump.to.named.window.(music.player) @@ -0,0 +1,7 @@ +#!/usr/bin/env sh +# Window Name from filename (e.g _tmux_goto_name,-- description --> name) +WIN_NAME="$(echo "${0##*/}" | cut -d ',' -f1 | cut -d '_' -f4)" +LINE=$(tmux list-windows -a -F "#{session_name}:#{window_id}: #{window_name}" | grep ": ${WIN_NAME}$") || exit 0 +SESSION="$(echo "$LINE" | cut -d ':' -f1)" +WINDOW_NUM="$(echo "$LINE" | cut -d ':' -f2)" +tmux select-window -t "$WINDOW_NUM" && tmux switch-client -t "$SESSION" diff --git a/tmuxsh/_tmux_goto_nap,--.jump.to.named.window.(napster) b/tmuxsh/_tmux_goto_nap,--.jump.to.named.window.(napster) new file mode 100755 index 0000000..4ad505d --- /dev/null +++ b/tmuxsh/_tmux_goto_nap,--.jump.to.named.window.(napster) @@ -0,0 +1,7 @@ +#!/usr/bin/env sh +# Window Name from filename (e.g _tmux_goto_name,-- description --> name) +WIN_NAME="$(echo "${0##*/}" | cut -d ',' -f1 | cut -d '_' -f4)" +LINE=$(tmux list-windows -a -F "#{session_name}:#{window_id}: #{window_name}" | grep ": ${WIN_NAME}$") || exit 0 +SESSION="$(echo "$LINE" | cut -d ':' -f1)" +WINDOW_NUM="$(echo "$LINE" | cut -d ':' -f2)" +tmux select-window -t "$WINDOW_NUM" && tmux switch-client -t "$SESSION" diff --git a/tmuxsh/_tmux_goto_pod,--.jump.to.named.window.(podcast.manager) b/tmuxsh/_tmux_goto_pod,--.jump.to.named.window.(podcast.manager) new file mode 100755 index 0000000..4ad505d --- /dev/null +++ b/tmuxsh/_tmux_goto_pod,--.jump.to.named.window.(podcast.manager) @@ -0,0 +1,7 @@ +#!/usr/bin/env sh +# Window Name from filename (e.g _tmux_goto_name,-- description --> name) +WIN_NAME="$(echo "${0##*/}" | cut -d ',' -f1 | cut -d '_' -f4)" +LINE=$(tmux list-windows -a -F "#{session_name}:#{window_id}: #{window_name}" | grep ": ${WIN_NAME}$") || exit 0 +SESSION="$(echo "$LINE" | cut -d ':' -f1)" +WINDOW_NUM="$(echo "$LINE" | cut -d ':' -f2)" +tmux select-window -t "$WINDOW_NUM" && tmux switch-client -t "$SESSION" diff --git a/tmuxsh/_tmux_goto_radio,--.jump.to.named.window.(internet.radio) b/tmuxsh/_tmux_goto_radio,--.jump.to.named.window.(internet.radio) new file mode 100755 index 0000000..4ad505d --- /dev/null +++ b/tmuxsh/_tmux_goto_radio,--.jump.to.named.window.(internet.radio) @@ -0,0 +1,7 @@ +#!/usr/bin/env sh +# Window Name from filename (e.g _tmux_goto_name,-- description --> name) +WIN_NAME="$(echo "${0##*/}" | cut -d ',' -f1 | cut -d '_' -f4)" +LINE=$(tmux list-windows -a -F "#{session_name}:#{window_id}: #{window_name}" | grep ": ${WIN_NAME}$") || exit 0 +SESSION="$(echo "$LINE" | cut -d ':' -f1)" +WINDOW_NUM="$(echo "$LINE" | cut -d ':' -f2)" +tmux select-window -t "$WINDOW_NUM" && tmux switch-client -t "$SESSION" diff --git a/tmuxsh/_tmux_goto_rss,--.jump.to.named.window.(really.simple.syndication.reader) b/tmuxsh/_tmux_goto_rss,--.jump.to.named.window.(really.simple.syndication.reader) new file mode 100755 index 0000000..4ad505d --- /dev/null +++ b/tmuxsh/_tmux_goto_rss,--.jump.to.named.window.(really.simple.syndication.reader) @@ -0,0 +1,7 @@ +#!/usr/bin/env sh +# Window Name from filename (e.g _tmux_goto_name,-- description --> name) +WIN_NAME="$(echo "${0##*/}" | cut -d ',' -f1 | cut -d '_' -f4)" +LINE=$(tmux list-windows -a -F "#{session_name}:#{window_id}: #{window_name}" | grep ": ${WIN_NAME}$") || exit 0 +SESSION="$(echo "$LINE" | cut -d ':' -f1)" +WINDOW_NUM="$(echo "$LINE" | cut -d ':' -f2)" +tmux select-window -t "$WINDOW_NUM" && tmux switch-client -t "$SESSION" diff --git a/tmuxsh/_tmux_goto_spool,--.jump.to.named.window.(task.spooler) b/tmuxsh/_tmux_goto_spool,--.jump.to.named.window.(task.spooler) new file mode 100755 index 0000000..4ad505d --- /dev/null +++ b/tmuxsh/_tmux_goto_spool,--.jump.to.named.window.(task.spooler) @@ -0,0 +1,7 @@ +#!/usr/bin/env sh +# Window Name from filename (e.g _tmux_goto_name,-- description --> name) +WIN_NAME="$(echo "${0##*/}" | cut -d ',' -f1 | cut -d '_' -f4)" +LINE=$(tmux list-windows -a -F "#{session_name}:#{window_id}: #{window_name}" | grep ": ${WIN_NAME}$") || exit 0 +SESSION="$(echo "$LINE" | cut -d ':' -f1)" +WINDOW_NUM="$(echo "$LINE" | cut -d ':' -f2)" +tmux select-window -t "$WINDOW_NUM" && tmux switch-client -t "$SESSION" diff --git a/tmuxsh/_tmux_goto_vid,--.jump.to.named.window.(local.video.directory) b/tmuxsh/_tmux_goto_vid,--.jump.to.named.window.(local.video.directory) new file mode 100755 index 0000000..4ad505d --- /dev/null +++ b/tmuxsh/_tmux_goto_vid,--.jump.to.named.window.(local.video.directory) @@ -0,0 +1,7 @@ +#!/usr/bin/env sh +# Window Name from filename (e.g _tmux_goto_name,-- description --> name) +WIN_NAME="$(echo "${0##*/}" | cut -d ',' -f1 | cut -d '_' -f4)" +LINE=$(tmux list-windows -a -F "#{session_name}:#{window_id}: #{window_name}" | grep ": ${WIN_NAME}$") || exit 0 +SESSION="$(echo "$LINE" | cut -d ':' -f1)" +WINDOW_NUM="$(echo "$LINE" | cut -d ':' -f2)" +tmux select-window -t "$WINDOW_NUM" && tmux switch-client -t "$SESSION" diff --git a/tmuxsh/_tmux_goto_web,--.jump.to.named.window.(web.browser) b/tmuxsh/_tmux_goto_web,--.jump.to.named.window.(web.browser) new file mode 100755 index 0000000..4ad505d --- /dev/null +++ b/tmuxsh/_tmux_goto_web,--.jump.to.named.window.(web.browser) @@ -0,0 +1,7 @@ +#!/usr/bin/env sh +# Window Name from filename (e.g _tmux_goto_name,-- description --> name) +WIN_NAME="$(echo "${0##*/}" | cut -d ',' -f1 | cut -d '_' -f4)" +LINE=$(tmux list-windows -a -F "#{session_name}:#{window_id}: #{window_name}" | grep ": ${WIN_NAME}$") || exit 0 +SESSION="$(echo "$LINE" | cut -d ':' -f1)" +WINDOW_NUM="$(echo "$LINE" | cut -d ':' -f2)" +tmux select-window -t "$WINDOW_NUM" && tmux switch-client -t "$SESSION" diff --git a/tmuxsh/_tmux_goto_xdcc,--.jump.to.named.window.(xdcc.eXtended.DCC) b/tmuxsh/_tmux_goto_xdcc,--.jump.to.named.window.(xdcc.eXtended.DCC) new file mode 100755 index 0000000..4ad505d --- /dev/null +++ b/tmuxsh/_tmux_goto_xdcc,--.jump.to.named.window.(xdcc.eXtended.DCC) @@ -0,0 +1,7 @@ +#!/usr/bin/env sh +# Window Name from filename (e.g _tmux_goto_name,-- description --> name) +WIN_NAME="$(echo "${0##*/}" | cut -d ',' -f1 | cut -d '_' -f4)" +LINE=$(tmux list-windows -a -F "#{session_name}:#{window_id}: #{window_name}" | grep ": ${WIN_NAME}$") || exit 0 +SESSION="$(echo "$LINE" | cut -d ':' -f1)" +WINDOW_NUM="$(echo "$LINE" | cut -d ':' -f2)" +tmux select-window -t "$WINDOW_NUM" && tmux switch-client -t "$SESSION" diff --git a/tmuxsh/_tmux_join_pane_from,--.join.pane.from b/tmuxsh/_tmux_join_pane_from,--.join.pane.from new file mode 100755 index 0000000..7ae331e --- /dev/null +++ b/tmuxsh/_tmux_join_pane_from,--.join.pane.from @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux command-prompt -p "join pane from:" "join-pane -s '%%'" diff --git a/tmuxsh/_tmux_join_pane_to,--.send.pane.to b/tmuxsh/_tmux_join_pane_to,--.send.pane.to new file mode 100755 index 0000000..12e683f --- /dev/null +++ b/tmuxsh/_tmux_join_pane_to,--.send.pane.to @@ -0,0 +1,3 @@ +#!/usr/bin/env sh +tmux command-prompt -p "send current pane to?" "join-pane -t '%%'" + diff --git a/tmuxsh/_tmux_kill_pane,--.close.current.pane b/tmuxsh/_tmux_kill_pane,--.close.current.pane new file mode 100755 index 0000000..6be39e6 --- /dev/null +++ b/tmuxsh/_tmux_kill_pane,--.close.current.pane @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux kill-pane diff --git a/tmuxsh/_tmux_kill_server,--.close.the.server.and.clients.and.destroy.all.sessions b/tmuxsh/_tmux_kill_server,--.close.the.server.and.clients.and.destroy.all.sessions new file mode 100755 index 0000000..7e6a8db --- /dev/null +++ b/tmuxsh/_tmux_kill_server,--.close.the.server.and.clients.and.destroy.all.sessions @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux confirm-before -p "kill the tmux server, clients and destroy all sessions? (y/n)" kill-server diff --git a/tmuxsh/_tmux_kill_session,--.close.current.session b/tmuxsh/_tmux_kill_session,--.close.current.session new file mode 100755 index 0000000..24b895a --- /dev/null +++ b/tmuxsh/_tmux_kill_session,--.close.current.session @@ -0,0 +1,7 @@ +#!/usr/bin/env sh +if [ "$(tmux list-sessions | wc -l)" = 1 ]; then + tmux confirm-before -p "Only single session active, kill-server instead (y/n)?" kill-server +else + tmux confirm-before -p "Kill #S session (y/n)?" "run-shell 'tmux switch-client -p \; kill-session -t \"#S\"'" + # tmux confirm-before -p "Kill #S session (y/n)?" "run-shell 'tmux switch-client -l \; kill-session -t \"#S\"'" +fi diff --git a/tmuxsh/_tmux_kill_window,--.close.current.window b/tmuxsh/_tmux_kill_window,--.close.current.window new file mode 100755 index 0000000..b869b8d --- /dev/null +++ b/tmuxsh/_tmux_kill_window,--.close.current.window @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux kill-window diff --git a/tmuxsh/_tmux_last_pane,--.jump.to.last.used.pane b/tmuxsh/_tmux_last_pane,--.jump.to.last.used.pane new file mode 100755 index 0000000..534ffd9 --- /dev/null +++ b/tmuxsh/_tmux_last_pane,--.jump.to.last.used.pane @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux last-pane diff --git a/tmuxsh/_tmux_last_session,--.jump.to.last.used.session b/tmuxsh/_tmux_last_session,--.jump.to.last.used.session new file mode 100755 index 0000000..51b1adc --- /dev/null +++ b/tmuxsh/_tmux_last_session,--.jump.to.last.used.session @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux switch-client -l diff --git a/tmuxsh/_tmux_last_window,--.jump.to.last.used.window b/tmuxsh/_tmux_last_window,--.jump.to.last.used.window new file mode 100755 index 0000000..0077f0c --- /dev/null +++ b/tmuxsh/_tmux_last_window,--.jump.to.last.used.window @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux last-window diff --git a/tmuxsh/_tmux_move_pane,--.move.pane.using.choose-tree b/tmuxsh/_tmux_move_pane,--.move.pane.using.choose-tree new file mode 100755 index 0000000..e73a453 --- /dev/null +++ b/tmuxsh/_tmux_move_pane,--.move.pane.using.choose-tree @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux choose-tree -Zw "move-pane -t '%%'" diff --git a/tmuxsh/_tmux_move_window_left,--.move.window.left b/tmuxsh/_tmux_move_window_left,--.move.window.left new file mode 100755 index 0000000..5ce3dd1 --- /dev/null +++ b/tmuxsh/_tmux_move_window_left,--.move.window.left @@ -0,0 +1,3 @@ +#!/usr/bin/env sh +tmux swap-window -t -1 +tmux select-window -t -1 diff --git a/tmuxsh/_tmux_move_window_right,--.move.window.right b/tmuxsh/_tmux_move_window_right,--.move.window.right new file mode 100755 index 0000000..9bc5546 --- /dev/null +++ b/tmuxsh/_tmux_move_window_right,--.move.window.right @@ -0,0 +1,3 @@ +#!/usr/bin/env sh +tmux swap-window -t +1 +tmux select-window -t +1 diff --git a/tmuxsh/_tmux_new_session,--.create.a.new.session b/tmuxsh/_tmux_new_session,--.create.a.new.session new file mode 100755 index 0000000..d4a8637 --- /dev/null +++ b/tmuxsh/_tmux_new_session,--.create.a.new.session @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux command-prompt -p "Enter new session name:" "new-session -s '%%'" diff --git a/tmuxsh/_tmux_new_window,--.create.new.window b/tmuxsh/_tmux_new_window,--.create.new.window new file mode 100755 index 0000000..4443d70 --- /dev/null +++ b/tmuxsh/_tmux_new_window,--.create.new.window @@ -0,0 +1,3 @@ +#!/usr/bin/env sh +tmux new-window -c "#{pane_current_path}" + diff --git a/tmuxsh/_tmux_next_layout,--.change.to.next.layout.(requires.multiple.panes) b/tmuxsh/_tmux_next_layout,--.change.to.next.layout.(requires.multiple.panes) new file mode 100755 index 0000000..d44ebcb --- /dev/null +++ b/tmuxsh/_tmux_next_layout,--.change.to.next.layout.(requires.multiple.panes) @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux next-layout diff --git a/tmuxsh/_tmux_next_session,--.jump.to.next.session b/tmuxsh/_tmux_next_session,--.jump.to.next.session new file mode 100755 index 0000000..5c8dab1 --- /dev/null +++ b/tmuxsh/_tmux_next_session,--.jump.to.next.session @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux switch-client -n diff --git a/tmuxsh/_tmux_next_window,--.jump.to.next.window b/tmuxsh/_tmux_next_window,--.jump.to.next.window new file mode 100755 index 0000000..de222a3 --- /dev/null +++ b/tmuxsh/_tmux_next_window,--.jump.to.next.window @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux next-window diff --git a/tmuxsh/_tmux_previous_layout,--.change.to.previous.layout.(requires.multiple.panes) b/tmuxsh/_tmux_previous_layout,--.change.to.previous.layout.(requires.multiple.panes) new file mode 100755 index 0000000..399ce7b --- /dev/null +++ b/tmuxsh/_tmux_previous_layout,--.change.to.previous.layout.(requires.multiple.panes) @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux previous-layout diff --git a/tmuxsh/_tmux_previous_session,--.jump.to.previous.session b/tmuxsh/_tmux_previous_session,--.jump.to.previous.session new file mode 100755 index 0000000..0fd5466 --- /dev/null +++ b/tmuxsh/_tmux_previous_session,--.jump.to.previous.session @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux switch-client -p diff --git a/tmuxsh/_tmux_previous_window,--.jump.to.previous.window b/tmuxsh/_tmux_previous_window,--.jump.to.previous.window new file mode 100755 index 0000000..f689df1 --- /dev/null +++ b/tmuxsh/_tmux_previous_window,--.jump.to.previous.window @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux previous-window diff --git a/tmuxsh/_tmux_rename_pane,--.rename.current.pane b/tmuxsh/_tmux_rename_pane,--.rename.current.pane new file mode 100755 index 0000000..5dd9b09 --- /dev/null +++ b/tmuxsh/_tmux_rename_pane,--.rename.current.pane @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux command-prompt -p "Rename pane:" "select-pane -T '%%'" diff --git a/tmuxsh/_tmux_rename_session,--.rename.current.session b/tmuxsh/_tmux_rename_session,--.rename.current.session new file mode 100755 index 0000000..57d3638 --- /dev/null +++ b/tmuxsh/_tmux_rename_session,--.rename.current.session @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux command-prompt -p "Rename session:" "rename-session '%%'" diff --git a/tmuxsh/_tmux_rename_window,--.rename.current.window b/tmuxsh/_tmux_rename_window,--.rename.current.window new file mode 100755 index 0000000..cf4160e --- /dev/null +++ b/tmuxsh/_tmux_rename_window,--.rename.current.window @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux command-prompt -p "Rename window:" "rename-window '%%'" diff --git a/tmuxsh/_tmux_rotate_window,--.rotate.the.positions.of.the.panes.within.a.window b/tmuxsh/_tmux_rotate_window,--.rotate.the.positions.of.the.panes.within.a.window new file mode 100755 index 0000000..58239e0 --- /dev/null +++ b/tmuxsh/_tmux_rotate_window,--.rotate.the.positions.of.the.panes.within.a.window @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux rotate-window -Z diff --git a/tmuxsh/_tmux_select_pane_down,--.select.pane.down b/tmuxsh/_tmux_select_pane_down,--.select.pane.down new file mode 100755 index 0000000..c8dffc0 --- /dev/null +++ b/tmuxsh/_tmux_select_pane_down,--.select.pane.down @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-pane -D diff --git a/tmuxsh/_tmux_select_pane_left,--.select.pane.left b/tmuxsh/_tmux_select_pane_left,--.select.pane.left new file mode 100755 index 0000000..c62ff1a --- /dev/null +++ b/tmuxsh/_tmux_select_pane_left,--.select.pane.left @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-pane -L diff --git a/tmuxsh/_tmux_select_pane_right,--.select.pane.right b/tmuxsh/_tmux_select_pane_right,--.select.pane.right new file mode 100755 index 0000000..dd2189c --- /dev/null +++ b/tmuxsh/_tmux_select_pane_right,--.select.pane.right @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-pane -R diff --git a/tmuxsh/_tmux_select_pane_up,--.select.pane.up b/tmuxsh/_tmux_select_pane_up,--.select.pane.up new file mode 100755 index 0000000..9ff6c16 --- /dev/null +++ b/tmuxsh/_tmux_select_pane_up,--.select.pane.up @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-pane -U diff --git a/tmuxsh/_tmux_select_window_00,--.jump.to.window.00 b/tmuxsh/_tmux_select_window_00,--.jump.to.window.00 new file mode 100755 index 0000000..03ad3a3 --- /dev/null +++ b/tmuxsh/_tmux_select_window_00,--.jump.to.window.00 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:0 diff --git a/tmuxsh/_tmux_select_window_01,--.jump.to.window.01 b/tmuxsh/_tmux_select_window_01,--.jump.to.window.01 new file mode 100755 index 0000000..43597ce --- /dev/null +++ b/tmuxsh/_tmux_select_window_01,--.jump.to.window.01 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:1 diff --git a/tmuxsh/_tmux_select_window_02,--.jump.to.window.02 b/tmuxsh/_tmux_select_window_02,--.jump.to.window.02 new file mode 100755 index 0000000..b2f5c2a --- /dev/null +++ b/tmuxsh/_tmux_select_window_02,--.jump.to.window.02 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:2 diff --git a/tmuxsh/_tmux_select_window_03,--.jump.to.window.03 b/tmuxsh/_tmux_select_window_03,--.jump.to.window.03 new file mode 100755 index 0000000..e8ae380 --- /dev/null +++ b/tmuxsh/_tmux_select_window_03,--.jump.to.window.03 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:3 diff --git a/tmuxsh/_tmux_select_window_04,--.jump.to.window.04 b/tmuxsh/_tmux_select_window_04,--.jump.to.window.04 new file mode 100755 index 0000000..229b8a8 --- /dev/null +++ b/tmuxsh/_tmux_select_window_04,--.jump.to.window.04 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:4 diff --git a/tmuxsh/_tmux_select_window_05,--.jump.to.window.05 b/tmuxsh/_tmux_select_window_05,--.jump.to.window.05 new file mode 100755 index 0000000..3de36ac --- /dev/null +++ b/tmuxsh/_tmux_select_window_05,--.jump.to.window.05 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:5 diff --git a/tmuxsh/_tmux_select_window_06,--.jump.to.window.06 b/tmuxsh/_tmux_select_window_06,--.jump.to.window.06 new file mode 100755 index 0000000..1c482fc --- /dev/null +++ b/tmuxsh/_tmux_select_window_06,--.jump.to.window.06 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:6 diff --git a/tmuxsh/_tmux_select_window_07,--.jump.to.window.07 b/tmuxsh/_tmux_select_window_07,--.jump.to.window.07 new file mode 100755 index 0000000..d44b06c --- /dev/null +++ b/tmuxsh/_tmux_select_window_07,--.jump.to.window.07 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:7 diff --git a/tmuxsh/_tmux_select_window_08,--.jump.to.window.08 b/tmuxsh/_tmux_select_window_08,--.jump.to.window.08 new file mode 100755 index 0000000..e02d2d2 --- /dev/null +++ b/tmuxsh/_tmux_select_window_08,--.jump.to.window.08 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:8 diff --git a/tmuxsh/_tmux_select_window_09,--.jump.to.window.09 b/tmuxsh/_tmux_select_window_09,--.jump.to.window.09 new file mode 100755 index 0000000..9a10668 --- /dev/null +++ b/tmuxsh/_tmux_select_window_09,--.jump.to.window.09 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:9 diff --git a/tmuxsh/_tmux_select_window_10,--.jump.to.window.10 b/tmuxsh/_tmux_select_window_10,--.jump.to.window.10 new file mode 100755 index 0000000..b6712f6 --- /dev/null +++ b/tmuxsh/_tmux_select_window_10,--.jump.to.window.10 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:10 diff --git a/tmuxsh/_tmux_select_window_11,--.jump.to.window.11 b/tmuxsh/_tmux_select_window_11,--.jump.to.window.11 new file mode 100755 index 0000000..f81cf85 --- /dev/null +++ b/tmuxsh/_tmux_select_window_11,--.jump.to.window.11 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:11 diff --git a/tmuxsh/_tmux_select_window_12,--.jump.to.window.12 b/tmuxsh/_tmux_select_window_12,--.jump.to.window.12 new file mode 100755 index 0000000..8c0816a --- /dev/null +++ b/tmuxsh/_tmux_select_window_12,--.jump.to.window.12 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:12 diff --git a/tmuxsh/_tmux_select_window_13,--.jump.to.window.13 b/tmuxsh/_tmux_select_window_13,--.jump.to.window.13 new file mode 100755 index 0000000..780f1a0 --- /dev/null +++ b/tmuxsh/_tmux_select_window_13,--.jump.to.window.13 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:13 diff --git a/tmuxsh/_tmux_select_window_14,--.jump.to.window.14 b/tmuxsh/_tmux_select_window_14,--.jump.to.window.14 new file mode 100755 index 0000000..323846e --- /dev/null +++ b/tmuxsh/_tmux_select_window_14,--.jump.to.window.14 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:14 diff --git a/tmuxsh/_tmux_select_window_15,--.jump.to.window.15 b/tmuxsh/_tmux_select_window_15,--.jump.to.window.15 new file mode 100755 index 0000000..b89fea8 --- /dev/null +++ b/tmuxsh/_tmux_select_window_15,--.jump.to.window.15 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:15 diff --git a/tmuxsh/_tmux_select_window_16,--.jump.to.window.16 b/tmuxsh/_tmux_select_window_16,--.jump.to.window.16 new file mode 100755 index 0000000..d5bcf70 --- /dev/null +++ b/tmuxsh/_tmux_select_window_16,--.jump.to.window.16 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:16 diff --git a/tmuxsh/_tmux_select_window_17,--.jump.to.window.17 b/tmuxsh/_tmux_select_window_17,--.jump.to.window.17 new file mode 100755 index 0000000..7cf5b7e --- /dev/null +++ b/tmuxsh/_tmux_select_window_17,--.jump.to.window.17 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:17 diff --git a/tmuxsh/_tmux_select_window_18,--.jump.to.window.18 b/tmuxsh/_tmux_select_window_18,--.jump.to.window.18 new file mode 100755 index 0000000..4eb1f10 --- /dev/null +++ b/tmuxsh/_tmux_select_window_18,--.jump.to.window.18 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:18 diff --git a/tmuxsh/_tmux_select_window_19,--.jump.to.window.19 b/tmuxsh/_tmux_select_window_19,--.jump.to.window.19 new file mode 100755 index 0000000..ffe5757 --- /dev/null +++ b/tmuxsh/_tmux_select_window_19,--.jump.to.window.19 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:19 diff --git a/tmuxsh/_tmux_select_window_20,--.jump.to.window.20 b/tmuxsh/_tmux_select_window_20,--.jump.to.window.20 new file mode 100755 index 0000000..99da66a --- /dev/null +++ b/tmuxsh/_tmux_select_window_20,--.jump.to.window.20 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:20 diff --git a/tmuxsh/_tmux_split_pane,--.split.current.pane.horizontal b/tmuxsh/_tmux_split_pane,--.split.current.pane.horizontal new file mode 100755 index 0000000..7572c10 --- /dev/null +++ b/tmuxsh/_tmux_split_pane,--.split.current.pane.horizontal @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux split-window -c "#{pane_current_path}" diff --git a/tmuxsh/_tmux_split_pane_vert,--.split.current.pane.vertical b/tmuxsh/_tmux_split_pane_vert,--.split.current.pane.vertical new file mode 100755 index 0000000..5c0b4db --- /dev/null +++ b/tmuxsh/_tmux_split_pane_vert,--.split.current.pane.vertical @@ -0,0 +1,3 @@ +#!/usr/bin/env sh +tmux split-window -h -c "#{pane_current_path}" + diff --git a/tmuxsh/_tmux_split_window,--.split.current.window.horizontal b/tmuxsh/_tmux_split_window,--.split.current.window.horizontal new file mode 100755 index 0000000..a65c394 --- /dev/null +++ b/tmuxsh/_tmux_split_window,--.split.current.window.horizontal @@ -0,0 +1,3 @@ +#!/usr/bin/env sh +tmux split-window -fv -c "#{pane_current_path}" + diff --git a/tmuxsh/_tmux_split_window_vert,--.split.current.window.vertical b/tmuxsh/_tmux_split_window_vert,--.split.current.window.vertical new file mode 100755 index 0000000..0f14c46 --- /dev/null +++ b/tmuxsh/_tmux_split_window_vert,--.split.current.window.vertical @@ -0,0 +1,3 @@ +#!/usr/bin/env sh +tmux split-window -hfv -c "#{pane_current_path}" + diff --git a/tmuxsh/_tmux_swap_pane,--.swap.pane.using.choose-tree b/tmuxsh/_tmux_swap_pane,--.swap.pane.using.choose-tree new file mode 100755 index 0000000..9456f39 --- /dev/null +++ b/tmuxsh/_tmux_swap_pane,--.swap.pane.using.choose-tree @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux choose-tree -Zw "swap-pane -t '%%'" diff --git a/tmuxsh/_tmux_swap_window,--.swap.window.using.choose-tree b/tmuxsh/_tmux_swap_window,--.swap.window.using.choose-tree new file mode 100755 index 0000000..28229ac --- /dev/null +++ b/tmuxsh/_tmux_swap_window,--.swap.window.using.choose-tree @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux choose-tree -Zw "swap-window -t '%%'" diff --git a/tmuxsh/_tmux_switch_panes,--.search.and.jump.to.a.pane.in.the.current.session b/tmuxsh/_tmux_switch_panes,--.search.and.jump.to.a.pane.in.the.current.session new file mode 100755 index 0000000..12c5cfc --- /dev/null +++ b/tmuxsh/_tmux_switch_panes,--.search.and.jump.to.a.pane.in.the.current.session @@ -0,0 +1,19 @@ +#!/usr/bin/env sh +# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry|odysee) +# https://www.youtube.com/user/gotbletu + +# tmux list-pane formating +TARGET_SPEC="#{session_name}:#{window_id}:#{pane_id}:" +LIST_DATA="#{window_name} #{pane_title} #{pane_current_path} #{pane_current_command}" + +FZF_COMMAND() { + fzf -e -i --prompt="Select a pane (current session): " --info=default --layout=reverse --tiebreak=index +} + +# select pane +LINE="$(tmux list-panes -s -F "$TARGET_SPEC $LIST_DATA" | FZF_COMMAND)" || exit 0 +SESSION="$(echo "$LINE" | cut -d ':' -f1)" +WINDOW_NUM="$(echo "$LINE" | cut -d ':' -f2)" +PANE_NUM="$(echo "$LINE" | cut -d ':' -f3)" + +tmux select-pane -t "$PANE_NUM" && tmux select-window -t "$WINDOW_NUM" && tmux switch-client -t "$SESSION" diff --git a/tmuxsh/_tmux_switch_windows,--.search.and.jump.to.a.window.in.the.current.session b/tmuxsh/_tmux_switch_windows,--.search.and.jump.to.a.window.in.the.current.session new file mode 100755 index 0000000..1192894 --- /dev/null +++ b/tmuxsh/_tmux_switch_windows,--.search.and.jump.to.a.window.in.the.current.session @@ -0,0 +1,18 @@ +#!/usr/bin/env sh +# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry|odysee) +# https://www.youtube.com/user/gotbletu + +# tmux list-windows formating +TARGET_SPEC="#{session_name}:#{window_id}:" +LIST_DATA="#{window_name} #{pane_title} #{pane_current_path} #{pane_current_command}" + +FZF_COMMAND() { + fzf -e -i --prompt="Select a window (current session): " --info=default --layout=reverse --tiebreak=index +} + +# select window +LINE="$(tmux list-windows -F "$TARGET_SPEC $LIST_DATA" | FZF_COMMAND)" || exit 0 +SESSION="$(echo "$LINE" | cut -d ':' -f1)" +WINDOW_NUM="$(echo "$LINE" | cut -d ':' -f2)" + +tmux select-window -t "$WINDOW_NUM" && tmux switch-client -t "$SESSION" diff --git a/tmuxsh/_tmux_zoom_pane,--.toggle.zoom.current.pane.(requires.multiple.panes) b/tmuxsh/_tmux_zoom_pane,--.toggle.zoom.current.pane.(requires.multiple.panes) new file mode 100755 index 0000000..00cbaad --- /dev/null +++ b/tmuxsh/_tmux_zoom_pane,--.toggle.zoom.current.pane.(requires.multiple.panes) @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux resize-pane -Z diff --git a/tmuxsh/_translate_eng_to_es,--.translate.english.to.spanish b/tmuxsh/_translate_eng_to_es,--.translate.english.to.spanish new file mode 100755 index 0000000..fb9a4be --- /dev/null +++ b/tmuxsh/_translate_eng_to_es,--.translate.english.to.spanish @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry) +# https://www.youtube.com/user/gotbletu +set -o vi +while true +do + read -rep ">>> Translate English to Spanish: " INPUT + history -s "$INPUT" + trans en:es "$INPUT" + printf "\n" +done diff --git a/tmuxsh/_translate_shell,--.translate.any.language.to.english b/tmuxsh/_translate_shell,--.translate.any.language.to.english new file mode 100755 index 0000000..8745388 --- /dev/null +++ b/tmuxsh/_translate_shell,--.translate.any.language.to.english @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry) +# https://www.youtube.com/user/gotbletu +set -o vi +while true +do + read -rep ">>> Translate Text: " INPUT + history -s "$INPUT" + trans "$INPUT" + printf "\n" +done + diff --git a/tmuxsh/_tuxi,--.ask.google.questions b/tmuxsh/_tuxi,--.ask.google.questions new file mode 100755 index 0000000..3edc73d --- /dev/null +++ b/tmuxsh/_tuxi,--.ask.google.questions @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry) +# https://www.youtube.com/user/gotbletu +# DESC: google top answers to your questions +# DEMO: https://youtu.be/mWJBlkHwZy8 +# DEPEND: tuxi (https://github.com/Bugswriter/tuxi) +# REFF: read with history https://unix.stackexchange.com/a/302923/430298 + +set -o vi +while true +do + read -rep ">>> Ask Google A Question: " INPUT + history -s "$INPUT" + tuxi -r "$INPUT" + printf "\n" +done diff --git a/tmuxsh/_urlscan,--.extract.on.screen.urls.and.generate.clickable.url.list.with.context b/tmuxsh/_urlscan,--.extract.on.screen.urls.and.generate.clickable.url.list.with.context new file mode 100755 index 0000000..671ed64 --- /dev/null +++ b/tmuxsh/_urlscan,--.extract.on.screen.urls.and.generate.clickable.url.list.with.context @@ -0,0 +1,3 @@ +#!/usr/bin/env sh +tmux new-window -n 'urlscan' -c "$HOME" +tmux send-keys 'urlscan /tmp/tmux-buffer && tmux kill-pane' C-m diff --git a/tmuxsh/_urlscan_compact,--.extract.on.screen.urls.and.generate.clickable.url.list b/tmuxsh/_urlscan_compact,--.extract.on.screen.urls.and.generate.clickable.url.list new file mode 100755 index 0000000..eaffa79 --- /dev/null +++ b/tmuxsh/_urlscan_compact,--.extract.on.screen.urls.and.generate.clickable.url.list @@ -0,0 +1,3 @@ +#!/usr/bin/env sh +tmux new-window -n 'urlscan' -c "$HOME" +tmux send-keys 'urlscan --compact /tmp/tmux-buffer && tmux kill-pane' C-m diff --git a/tmuxsh/_urlview,--.extract.on.screen.urls.and.generate.clickable.url.list b/tmuxsh/_urlview,--.extract.on.screen.urls.and.generate.clickable.url.list new file mode 100755 index 0000000..7a918e5 --- /dev/null +++ b/tmuxsh/_urlview,--.extract.on.screen.urls.and.generate.clickable.url.list @@ -0,0 +1,3 @@ +#!/usr/bin/env sh +tmux new-window -n 'urlview' -c "$HOME" +tmux send-keys 'urlview /tmp/tmux-buffer && tmux kill-pane' C-m diff --git a/tmuxsh/_urlw3m,--.extract.on.screen.urls.and.generate.clickable.url.with.full.context b/tmuxsh/_urlw3m,--.extract.on.screen.urls.and.generate.clickable.url.with.full.context new file mode 100755 index 0000000..e1fc48c --- /dev/null +++ b/tmuxsh/_urlw3m,--.extract.on.screen.urls.and.generate.clickable.url.with.full.context @@ -0,0 +1,3 @@ +#!/usr/bin/env sh +tmux new-window -n 'urlw3mcontext' -c "$HOME" +tmux send-keys 'w3m -o mark_all_pages=1 /tmp/tmux-buffer && tmux kill-pane' C-m diff --git a/tmuxsh/_volume_mute,--.toggle.volume.mute b/tmuxsh/_volume_mute,--.toggle.volume.mute new file mode 100755 index 0000000..16b4583 --- /dev/null +++ b/tmuxsh/_volume_mute,--.toggle.volume.mute @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +amixer set Master toggle diff --git a/tmuxsh/_ytfzf,--.search.youtube.with.fzf b/tmuxsh/_ytfzf,--.search.youtube.with.fzf new file mode 100755 index 0000000..2562f42 --- /dev/null +++ b/tmuxsh/_ytfzf,--.search.youtube.with.fzf @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +# DESC: A posix script that helps you find Youtube videos (with out API) and opens/downloads using mpv/youtube-dl. +# DEPEND: https://github.com/pystardust/ytfzf + +ytfzf -l diff --git a/tmuxsh/fzf-speed b/tmuxsh/fzf-speed new file mode 100755 index 0000000..8b72762 --- /dev/null +++ b/tmuxsh/fzf-speed @@ -0,0 +1,17 @@ +#!/usr/bin/env sh +# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry|odysee) +# https://www.youtube.com/user/gotbletu +# DESC: launch other fzf scripts in tmux +# DEMO: https://youtu.be/41JxYe70Xwo +# REQD: bind-key for tmux +# $EDITOR ~/.tmux.conf +# # tmux -V >= 3.2+ +# bind-key Tab capture-pane \; save-buffer /tmp/tmux-buffer \; delete-buffer \; display-popup -w 80% -h 60% -E "/path/to/fzf-speed" +# +# # tmux -V < 3.2 +# bind-key Tab capture-pane \; save-buffer /tmp/tmux-buffer \; delete-buffer \; split-window -Z "/path/to/fzf-speed" +# bind-key Tab capture-pane \; save-buffer /tmp/tmux-buffer \; delete-buffer \; split-window "/path/to/fzf-speed" + +DIR="${0%/*}" +SELECTED="$(find "$DIR" -maxdepth 1 -type f -exec basename {} \; | sort | grep '^_' | sed 's@\.@ @g' | column -s ',' -t | fzf -e -i --delimiter _ --with-nth='2..' --prompt="fzf-speed: " --info=default --layout=reverse --tiebreak=index | cut -d ' ' -f1)" +eval "${DIR}/${SELECTED},*" |