fzf-speed and w3m notes update

pull/45/head
gotbletu 3 years ago
parent c4bb2e1639
commit 6ec3f0a8ea

@ -48,6 +48,7 @@ If you find my videos feature on other site let me know also, I always need an E
- Archwiki: xbacklight / xcalib - backlight utilities [Link](https://wiki.archlinux.org/index.php/backlight)
- FZF Fuzzy Finder - A command-line fuzzy finder written in Go [Link](http://junegunn.kr/2015/02/fzf-in-go/)
- Hackaday: linux-fu running commands [Link](https://hackaday.com/2017/07/07/linux-fu-running-commands/)
- Linuxaria: poor mans sportify [Link](http://linuxaria.com/pills/linux-terminal-poor-mans-spotify?lang=en)
- Linuxaria: Reptyr attach a running process to a new terminal [Link](https://linuxaria.com/pills/linux-terminal-reptyr-attach-a-running-process-to-a-new-terminal)
- nixCraft: vim as a manpager [Link](https://twitter.com/nixcraft/status/973221210589925385)

@ -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

@ -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"

@ -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

@ -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

@ -0,0 +1,2 @@
#!/usr/bin/env sh
cmus-remote --next

@ -0,0 +1,2 @@
#!/usr/bin/env sh
cmus-remote --pause

@ -0,0 +1,2 @@
#!/usr/bin/env sh
cmus-remote --prev

@ -0,0 +1,12 @@
#!/usr/bin/env sh
selected="$( sort ~/.cmus/lib.pl | fzf -e -i +s -m --delimiter / --with-nth -2,-1 --prompt="Select song(s) to queue in cmus: " --info=hidden --layout=reverse --tiebreak=index)"
[ -z "$selected" ] && exit
# clear cmus queue
cmus-remote -c -q
# add songs
echo "$selected" | while read -r line ; do cmus-remote -q "$line" ; done
# play queued song
cmus-remote -n -p

@ -0,0 +1,2 @@
#!/usr/bin/env sh
cmus-remote --stop

File diff suppressed because it is too large Load Diff

@ -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'

@ -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

@ -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"

@ -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"

@ -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

@ -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"

@ -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"

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux choose-tree -Z -s

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux choose-tree -Z -w

@ -0,0 +1,3 @@
#!/usr/bin/env sh
while tmux delete-buffer; do :; done
tmux display-message "cleared all tmux clipboard history"

@ -0,0 +1,5 @@
#!/usr/bin/env sh
tmux delete-buffer
tmux display-message "deleted current tmux clipboard from history"

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux paste-buffer -b "$(tmux list-buffers | fzf -e -i | cut -d ':' -f1)"

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux paste-buffer

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux copy-mode

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux detach-client

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux command-prompt -p "Press {Enter} then {Number} to jump to pane:" "display-panes"

@ -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"

@ -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)"

@ -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"

@ -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"

@ -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"

@ -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"

@ -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"

@ -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"

@ -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"

@ -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"

@ -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"

@ -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"

@ -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"

@ -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"

@ -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"

@ -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"

@ -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"

@ -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"

@ -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"

@ -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"

@ -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"

@ -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"

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux command-prompt -p "join pane from:" "join-pane -s '%%'"

@ -0,0 +1,3 @@
#!/usr/bin/env sh
tmux command-prompt -p "send current pane to?" "join-pane -t '%%'"

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux kill-pane

@ -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

@ -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

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux kill-window

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux last-pane

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux switch-client -l

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux last-window

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux choose-tree -Zw "move-pane -t '%%'"

@ -0,0 +1,3 @@
#!/usr/bin/env sh
tmux swap-window -t -1
tmux select-window -t -1

@ -0,0 +1,3 @@
#!/usr/bin/env sh
tmux swap-window -t +1
tmux select-window -t +1

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux command-prompt -p "Enter new session name:" "new-session -s '%%'"

@ -0,0 +1,3 @@
#!/usr/bin/env sh
tmux new-window -c "#{pane_current_path}"

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux switch-client -n

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux next-window

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux switch-client -p

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux previous-window

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux command-prompt -p "Rename pane:" "select-pane -T '%%'"

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux command-prompt -p "Rename session:" "rename-session '%%'"

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux command-prompt -p "Rename window:" "rename-window '%%'"

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux select-pane -D

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux select-pane -L

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux select-pane -R

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux select-pane -U

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux select-window -t:0

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux select-window -t:1

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux select-window -t:2

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux select-window -t:3

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux select-window -t:4

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux select-window -t:5

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux select-window -t:6

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux select-window -t:7

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux select-window -t:8

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux select-window -t:9

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux select-window -t:10

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux select-window -t:11

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux select-window -t:12

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux select-window -t:13

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux select-window -t:14

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux select-window -t:15

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux select-window -t:16

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux select-window -t:17

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux select-window -t:18

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux select-window -t:19

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux select-window -t:20

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save