diff --git a/README.md b/README.md index ad23bb0..264eadb 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/fzf_speed/_applauncher,--.start.programs.in.new.window b/fzf_speed/_applauncher,--.start.programs.in.new.window new file mode 100755 index 0000000..5f9f8fc --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_bluepill,--.copy.a.codeblock b/fzf_speed/_bluepill,--.copy.a.codeblock new file mode 100755 index 0000000..70ec1fc --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_bookmarks,--.open.surfraw.bookmarks b/fzf_speed/_bookmarks,--.open.surfraw.bookmarks new file mode 100755 index 0000000..caded37 --- /dev/null +++ b/fzf_speed/_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 +# # +# 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 and 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/fzf_speed/_calc,--.calculator.with.bc.or.python.(ctrl-d.to.exit) b/fzf_speed/_calc,--.calculator.with.bc.or.python.(ctrl-d.to.exit) new file mode 100755 index 0000000..c0f9ce5 --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_cmus_next,--.next.song b/fzf_speed/_cmus_next,--.next.song new file mode 100755 index 0000000..21720c8 --- /dev/null +++ b/fzf_speed/_cmus_next,--.next.song @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +cmus-remote --next diff --git a/fzf_speed/_cmus_playpause,--.toggle.play.and.pause b/fzf_speed/_cmus_playpause,--.toggle.play.and.pause new file mode 100755 index 0000000..3e381f2 --- /dev/null +++ b/fzf_speed/_cmus_playpause,--.toggle.play.and.pause @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +cmus-remote --pause diff --git a/fzf_speed/_cmus_prev,--.previous.song b/fzf_speed/_cmus_prev,--.previous.song new file mode 100755 index 0000000..f7011aa --- /dev/null +++ b/fzf_speed/_cmus_prev,--.previous.song @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +cmus-remote --prev diff --git a/fzf_speed/_cmus_queue,--.select.songs.and.queue b/fzf_speed/_cmus_queue,--.select.songs.and.queue new file mode 100755 index 0000000..521df3f --- /dev/null +++ b/fzf_speed/_cmus_queue,--.select.songs.and.queue @@ -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 diff --git a/fzf_speed/_cmus_stop,--.stop.playback b/fzf_speed/_cmus_stop,--.stop.playback new file mode 100755 index 0000000..6b77cbb --- /dev/null +++ b/fzf_speed/_cmus_stop,--.stop.playback @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +cmus-remote --stop diff --git a/fzf_speed/_emoji,--.copy.from.list.of.emojis b/fzf_speed/_emoji,--.copy.from.list.of.emojis new file mode 100755 index 0000000..9cc1588 --- /dev/null +++ b/fzf_speed/_emoji,--.copy.from.list.of.emojis @@ -0,0 +1,3793 @@ +#!/usr/bin/env sh +# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry) +# https://www.youtube.com/user/gotbletu +# DESC: copy emoji to clipboard +# DEPEND: fzf grep gawk coreutils xsel (or tmux) +# REFF: https://github.com/porras/dmenu-emoji/blob/master/dmenu-emoji.sh + +emoji_list() { +cat < /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/fzf_speed/_ranger_locate,--.search.local.files.using.locate.and.open.with.ranger.file.manager b/fzf_speed/_ranger_locate,--.search.local.files.using.locate.and.open.with.ranger.file.manager new file mode 100755 index 0000000..f3c6dac --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_redpill,--.open.cheatsheets.in.new.window b/fzf_speed/_redpill,--.open.cheatsheets.in.new.window new file mode 100755 index 0000000..95c314d --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_snippetline,--.copy.a.snippet.single.line b/fzf_speed/_snippetline,--.copy.a.snippet.single.line new file mode 100755 index 0000000..897ce3f --- /dev/null +++ b/fzf_speed/_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" +# # ;; 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/fzf_speed/_snippetmulti,--.copy.a.snippet.textblock b/fzf_speed/_snippetmulti,--.copy.a.snippet.textblock new file mode 100755 index 0000000..7b5525c --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_surfraw,--.search.the.internet b/fzf_speed/_surfraw,--.search.the.internet new file mode 100755 index 0000000..d2de789 --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_bell,--.list.and.jump.to.window.with.bell.alert b/fzf_speed/_tmux_bell,--.list.and.jump.to.window.with.bell.alert new file mode 100755 index 0000000..6f711e6 --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_bell_next,--.jump.to.next.window.with.bell.alert b/fzf_speed/_tmux_bell_next,--.jump.to.next.window.with.bell.alert new file mode 100755 index 0000000..8ed81a4 --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_choose_buffer,--.list.clipboard.history.with.preview b/fzf_speed/_tmux_choose_buffer,--.list.clipboard.history.with.preview new file mode 100755 index 0000000..0622840 --- /dev/null +++ b/fzf_speed/_tmux_choose_buffer,--.list.clipboard.history.with.preview @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux choose-buffer -Z diff --git a/fzf_speed/_tmux_choose_pane,--.list.panes.windows.or.sessions.with.preview b/fzf_speed/_tmux_choose_pane,--.list.panes.windows.or.sessions.with.preview new file mode 100755 index 0000000..21dde91 --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_choose_session,--.list.sessions.with.preview b/fzf_speed/_tmux_choose_session,--.list.sessions.with.preview new file mode 100755 index 0000000..a13aae3 --- /dev/null +++ b/fzf_speed/_tmux_choose_session,--.list.sessions.with.preview @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux choose-tree -Z -s diff --git a/fzf_speed/_tmux_choose_window,--.list.windows.with.preview b/fzf_speed/_tmux_choose_window,--.list.windows.with.preview new file mode 100755 index 0000000..a1b52e2 --- /dev/null +++ b/fzf_speed/_tmux_choose_window,--.list.windows.with.preview @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux choose-tree -Z -w diff --git a/fzf_speed/_tmux_clipboard_clear,--.clear.all.clipboard b/fzf_speed/_tmux_clipboard_clear,--.clear.all.clipboard new file mode 100755 index 0000000..dc2a22e --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_clipboard_delete,--.delete.current.clipboard b/fzf_speed/_tmux_clipboard_delete,--.delete.current.clipboard new file mode 100755 index 0000000..d2d123b --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_clipboard_history,--.search.and.paste.from.clipboard.history b/fzf_speed/_tmux_clipboard_history,--.search.and.paste.from.clipboard.history new file mode 100755 index 0000000..c64e009 --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_clipboard_paste,--.paste.current.clipboard b/fzf_speed/_tmux_clipboard_paste,--.paste.current.clipboard new file mode 100755 index 0000000..a96f61c --- /dev/null +++ b/fzf_speed/_tmux_clipboard_paste,--.paste.current.clipboard @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux paste-buffer diff --git a/fzf_speed/_tmux_copy_mode,--.enter.copy.mode b/fzf_speed/_tmux_copy_mode,--.enter.copy.mode new file mode 100755 index 0000000..b95f004 --- /dev/null +++ b/fzf_speed/_tmux_copy_mode,--.enter.copy.mode @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux copy-mode diff --git a/fzf_speed/_tmux_detach_client,--.detach.the.current.client b/fzf_speed/_tmux_detach_client,--.detach.the.current.client new file mode 100755 index 0000000..2ccd748 --- /dev/null +++ b/fzf_speed/_tmux_detach_client,--.detach.the.current.client @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux detach-client diff --git a/fzf_speed/_tmux_display_pane,--.display.pane.numbers.(press.number.keys.to.jump.to.a.pane) b/fzf_speed/_tmux_display_pane,--.display.pane.numbers.(press.number.keys.to.jump.to.a.pane) new file mode 100755 index 0000000..ede96df --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_find_panes,--.search.all.panes.and.jump b/fzf_speed/_tmux_find_panes,--.search.all.panes.and.jump new file mode 100755 index 0000000..787d9a6 --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_find_sessions,--.search.all.session.and.jump b/fzf_speed/_tmux_find_sessions,--.search.all.session.and.jump new file mode 100755 index 0000000..1ff9a23 --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_find_windows,--.search.all.window.and.jump b/fzf_speed/_tmux_find_windows,--.search.all.window.and.jump new file mode 100755 index 0000000..a191d9c --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_goto_aubk,--.jump.to.named.window.(audiobook.player) b/fzf_speed/_tmux_goto_aubk,--.jump.to.named.window.(audiobook.player) new file mode 100755 index 0000000..4ad505d --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_goto_bt,--.jump.to.named.window.(bit.torrent) b/fzf_speed/_tmux_goto_bt,--.jump.to.named.window.(bit.torrent) new file mode 100755 index 0000000..4ad505d --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_goto_cmd,--.jump.to.named.window.(free.space.to.run.commands) b/fzf_speed/_tmux_goto_cmd,--.jump.to.named.window.(free.space.to.run.commands) new file mode 100755 index 0000000..4ad505d --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_goto_dcc,--.jump.to.named.window.(DCC.direct.connect.client) b/fzf_speed/_tmux_goto_dcc,--.jump.to.named.window.(DCC.direct.connect.client) new file mode 100755 index 0000000..4ad505d --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_goto_demo,--.jump.to.named.window.(demo.window.empty.space) b/fzf_speed/_tmux_goto_demo,--.jump.to.named.window.(demo.window.empty.space) new file mode 100755 index 0000000..4ad505d --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_goto_dlmgr,--.jump.to.named.window.(download.manager) b/fzf_speed/_tmux_goto_dlmgr,--.jump.to.named.window.(download.manager) new file mode 100755 index 0000000..4ad505d --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_goto_email,--.jump.to.named.window.(email) b/fzf_speed/_tmux_goto_email,--.jump.to.named.window.(email) new file mode 100755 index 0000000..4ad505d --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_goto_fm,--.jump.to.named.window.(file.manager) b/fzf_speed/_tmux_goto_fm,--.jump.to.named.window.(file.manager) new file mode 100755 index 0000000..4ad505d --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_goto_im,--.jump.to.named.window.(instant.messenger.chat) b/fzf_speed/_tmux_goto_im,--.jump.to.named.window.(instant.messenger.chat) new file mode 100755 index 0000000..4ad505d --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_goto_irc,--.jump.to.named.window.(internet.relay.chat) b/fzf_speed/_tmux_goto_irc,--.jump.to.named.window.(internet.relay.chat) new file mode 100755 index 0000000..4ad505d --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_goto_music,--.jump.to.named.window.(music.player) b/fzf_speed/_tmux_goto_music,--.jump.to.named.window.(music.player) new file mode 100755 index 0000000..4ad505d --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_goto_nap,--.jump.to.named.window.(napster) b/fzf_speed/_tmux_goto_nap,--.jump.to.named.window.(napster) new file mode 100755 index 0000000..4ad505d --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_goto_pod,--.jump.to.named.window.(podcast.manager) b/fzf_speed/_tmux_goto_pod,--.jump.to.named.window.(podcast.manager) new file mode 100755 index 0000000..4ad505d --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_goto_radio,--.jump.to.named.window.(internet.radio) b/fzf_speed/_tmux_goto_radio,--.jump.to.named.window.(internet.radio) new file mode 100755 index 0000000..4ad505d --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_goto_rss,--.jump.to.named.window.(really.simple.syndication.reader) b/fzf_speed/_tmux_goto_rss,--.jump.to.named.window.(really.simple.syndication.reader) new file mode 100755 index 0000000..4ad505d --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_goto_spool,--.jump.to.named.window.(task.spooler) b/fzf_speed/_tmux_goto_spool,--.jump.to.named.window.(task.spooler) new file mode 100755 index 0000000..4ad505d --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_goto_vid,--.jump.to.named.window.(local.video.directory) b/fzf_speed/_tmux_goto_vid,--.jump.to.named.window.(local.video.directory) new file mode 100755 index 0000000..4ad505d --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_goto_web,--.jump.to.named.window.(web.browser) b/fzf_speed/_tmux_goto_web,--.jump.to.named.window.(web.browser) new file mode 100755 index 0000000..4ad505d --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_goto_xdcc,--.jump.to.named.window.(xdcc.eXtended.DCC) b/fzf_speed/_tmux_goto_xdcc,--.jump.to.named.window.(xdcc.eXtended.DCC) new file mode 100755 index 0000000..4ad505d --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_join_pane_from,--.join.pane.from b/fzf_speed/_tmux_join_pane_from,--.join.pane.from new file mode 100755 index 0000000..7ae331e --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_join_pane_to,--.send.pane.to b/fzf_speed/_tmux_join_pane_to,--.send.pane.to new file mode 100755 index 0000000..12e683f --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_kill_pane,--.close.current.pane b/fzf_speed/_tmux_kill_pane,--.close.current.pane new file mode 100755 index 0000000..6be39e6 --- /dev/null +++ b/fzf_speed/_tmux_kill_pane,--.close.current.pane @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux kill-pane diff --git a/fzf_speed/_tmux_kill_server,--.close.the.server.and.clients.and.destroy.all.sessions b/fzf_speed/_tmux_kill_server,--.close.the.server.and.clients.and.destroy.all.sessions new file mode 100755 index 0000000..7e6a8db --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_kill_session,--.close.current.session b/fzf_speed/_tmux_kill_session,--.close.current.session new file mode 100755 index 0000000..24b895a --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_kill_window,--.close.current.window b/fzf_speed/_tmux_kill_window,--.close.current.window new file mode 100755 index 0000000..b869b8d --- /dev/null +++ b/fzf_speed/_tmux_kill_window,--.close.current.window @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux kill-window diff --git a/fzf_speed/_tmux_last_pane,--.jump.to.last.used.pane b/fzf_speed/_tmux_last_pane,--.jump.to.last.used.pane new file mode 100755 index 0000000..534ffd9 --- /dev/null +++ b/fzf_speed/_tmux_last_pane,--.jump.to.last.used.pane @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux last-pane diff --git a/fzf_speed/_tmux_last_session,--.jump.to.last.used.session b/fzf_speed/_tmux_last_session,--.jump.to.last.used.session new file mode 100755 index 0000000..51b1adc --- /dev/null +++ b/fzf_speed/_tmux_last_session,--.jump.to.last.used.session @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux switch-client -l diff --git a/fzf_speed/_tmux_last_window,--.jump.to.last.used.window b/fzf_speed/_tmux_last_window,--.jump.to.last.used.window new file mode 100755 index 0000000..0077f0c --- /dev/null +++ b/fzf_speed/_tmux_last_window,--.jump.to.last.used.window @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux last-window diff --git a/fzf_speed/_tmux_move_pane,--.move.pane.using.choose-tree b/fzf_speed/_tmux_move_pane,--.move.pane.using.choose-tree new file mode 100755 index 0000000..e73a453 --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_move_window_left,--.move.window.left b/fzf_speed/_tmux_move_window_left,--.move.window.left new file mode 100755 index 0000000..5ce3dd1 --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_move_window_right,--.move.window.right b/fzf_speed/_tmux_move_window_right,--.move.window.right new file mode 100755 index 0000000..9bc5546 --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_new_session,--.create.a.new.session b/fzf_speed/_tmux_new_session,--.create.a.new.session new file mode 100755 index 0000000..d4a8637 --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_new_window,--.create.new.window b/fzf_speed/_tmux_new_window,--.create.new.window new file mode 100755 index 0000000..4443d70 --- /dev/null +++ b/fzf_speed/_tmux_new_window,--.create.new.window @@ -0,0 +1,3 @@ +#!/usr/bin/env sh +tmux new-window -c "#{pane_current_path}" + diff --git a/fzf_speed/_tmux_next_layout,--.change.to.next.layout.(requires.multiple.panes) b/fzf_speed/_tmux_next_layout,--.change.to.next.layout.(requires.multiple.panes) new file mode 100755 index 0000000..d44ebcb --- /dev/null +++ b/fzf_speed/_tmux_next_layout,--.change.to.next.layout.(requires.multiple.panes) @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux next-layout diff --git a/fzf_speed/_tmux_next_session,--.jump.to.next.session b/fzf_speed/_tmux_next_session,--.jump.to.next.session new file mode 100755 index 0000000..5c8dab1 --- /dev/null +++ b/fzf_speed/_tmux_next_session,--.jump.to.next.session @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux switch-client -n diff --git a/fzf_speed/_tmux_next_window,--.jump.to.next.window b/fzf_speed/_tmux_next_window,--.jump.to.next.window new file mode 100755 index 0000000..de222a3 --- /dev/null +++ b/fzf_speed/_tmux_next_window,--.jump.to.next.window @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux next-window diff --git a/fzf_speed/_tmux_previous_layout,--.change.to.previous.layout.(requires.multiple.panes) b/fzf_speed/_tmux_previous_layout,--.change.to.previous.layout.(requires.multiple.panes) new file mode 100755 index 0000000..399ce7b --- /dev/null +++ b/fzf_speed/_tmux_previous_layout,--.change.to.previous.layout.(requires.multiple.panes) @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux previous-layout diff --git a/fzf_speed/_tmux_previous_session,--.jump.to.previous.session b/fzf_speed/_tmux_previous_session,--.jump.to.previous.session new file mode 100755 index 0000000..0fd5466 --- /dev/null +++ b/fzf_speed/_tmux_previous_session,--.jump.to.previous.session @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux switch-client -p diff --git a/fzf_speed/_tmux_previous_window,--.jump.to.previous.window b/fzf_speed/_tmux_previous_window,--.jump.to.previous.window new file mode 100755 index 0000000..f689df1 --- /dev/null +++ b/fzf_speed/_tmux_previous_window,--.jump.to.previous.window @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux previous-window diff --git a/fzf_speed/_tmux_rename_pane,--.rename.current.pane b/fzf_speed/_tmux_rename_pane,--.rename.current.pane new file mode 100755 index 0000000..5dd9b09 --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_rename_session,--.rename.current.session b/fzf_speed/_tmux_rename_session,--.rename.current.session new file mode 100755 index 0000000..57d3638 --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_rename_window,--.rename.current.window b/fzf_speed/_tmux_rename_window,--.rename.current.window new file mode 100755 index 0000000..cf4160e --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_rotate_window,--.rotate.the.positions.of.the.panes.within.a.window b/fzf_speed/_tmux_rotate_window,--.rotate.the.positions.of.the.panes.within.a.window new file mode 100755 index 0000000..58239e0 --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_select_pane_down,--.select.pane.down b/fzf_speed/_tmux_select_pane_down,--.select.pane.down new file mode 100755 index 0000000..c8dffc0 --- /dev/null +++ b/fzf_speed/_tmux_select_pane_down,--.select.pane.down @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-pane -D diff --git a/fzf_speed/_tmux_select_pane_left,--.select.pane.left b/fzf_speed/_tmux_select_pane_left,--.select.pane.left new file mode 100755 index 0000000..c62ff1a --- /dev/null +++ b/fzf_speed/_tmux_select_pane_left,--.select.pane.left @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-pane -L diff --git a/fzf_speed/_tmux_select_pane_right,--.select.pane.right b/fzf_speed/_tmux_select_pane_right,--.select.pane.right new file mode 100755 index 0000000..dd2189c --- /dev/null +++ b/fzf_speed/_tmux_select_pane_right,--.select.pane.right @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-pane -R diff --git a/fzf_speed/_tmux_select_pane_up,--.select.pane.up b/fzf_speed/_tmux_select_pane_up,--.select.pane.up new file mode 100755 index 0000000..9ff6c16 --- /dev/null +++ b/fzf_speed/_tmux_select_pane_up,--.select.pane.up @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-pane -U diff --git a/fzf_speed/_tmux_select_window_00,--.jump.to.window.00 b/fzf_speed/_tmux_select_window_00,--.jump.to.window.00 new file mode 100755 index 0000000..03ad3a3 --- /dev/null +++ b/fzf_speed/_tmux_select_window_00,--.jump.to.window.00 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:0 diff --git a/fzf_speed/_tmux_select_window_01,--.jump.to.window.01 b/fzf_speed/_tmux_select_window_01,--.jump.to.window.01 new file mode 100755 index 0000000..43597ce --- /dev/null +++ b/fzf_speed/_tmux_select_window_01,--.jump.to.window.01 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:1 diff --git a/fzf_speed/_tmux_select_window_02,--.jump.to.window.02 b/fzf_speed/_tmux_select_window_02,--.jump.to.window.02 new file mode 100755 index 0000000..b2f5c2a --- /dev/null +++ b/fzf_speed/_tmux_select_window_02,--.jump.to.window.02 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:2 diff --git a/fzf_speed/_tmux_select_window_03,--.jump.to.window.03 b/fzf_speed/_tmux_select_window_03,--.jump.to.window.03 new file mode 100755 index 0000000..e8ae380 --- /dev/null +++ b/fzf_speed/_tmux_select_window_03,--.jump.to.window.03 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:3 diff --git a/fzf_speed/_tmux_select_window_04,--.jump.to.window.04 b/fzf_speed/_tmux_select_window_04,--.jump.to.window.04 new file mode 100755 index 0000000..229b8a8 --- /dev/null +++ b/fzf_speed/_tmux_select_window_04,--.jump.to.window.04 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:4 diff --git a/fzf_speed/_tmux_select_window_05,--.jump.to.window.05 b/fzf_speed/_tmux_select_window_05,--.jump.to.window.05 new file mode 100755 index 0000000..3de36ac --- /dev/null +++ b/fzf_speed/_tmux_select_window_05,--.jump.to.window.05 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:5 diff --git a/fzf_speed/_tmux_select_window_06,--.jump.to.window.06 b/fzf_speed/_tmux_select_window_06,--.jump.to.window.06 new file mode 100755 index 0000000..1c482fc --- /dev/null +++ b/fzf_speed/_tmux_select_window_06,--.jump.to.window.06 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:6 diff --git a/fzf_speed/_tmux_select_window_07,--.jump.to.window.07 b/fzf_speed/_tmux_select_window_07,--.jump.to.window.07 new file mode 100755 index 0000000..d44b06c --- /dev/null +++ b/fzf_speed/_tmux_select_window_07,--.jump.to.window.07 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:7 diff --git a/fzf_speed/_tmux_select_window_08,--.jump.to.window.08 b/fzf_speed/_tmux_select_window_08,--.jump.to.window.08 new file mode 100755 index 0000000..e02d2d2 --- /dev/null +++ b/fzf_speed/_tmux_select_window_08,--.jump.to.window.08 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:8 diff --git a/fzf_speed/_tmux_select_window_09,--.jump.to.window.09 b/fzf_speed/_tmux_select_window_09,--.jump.to.window.09 new file mode 100755 index 0000000..9a10668 --- /dev/null +++ b/fzf_speed/_tmux_select_window_09,--.jump.to.window.09 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:9 diff --git a/fzf_speed/_tmux_select_window_10,--.jump.to.window.10 b/fzf_speed/_tmux_select_window_10,--.jump.to.window.10 new file mode 100755 index 0000000..b6712f6 --- /dev/null +++ b/fzf_speed/_tmux_select_window_10,--.jump.to.window.10 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:10 diff --git a/fzf_speed/_tmux_select_window_11,--.jump.to.window.11 b/fzf_speed/_tmux_select_window_11,--.jump.to.window.11 new file mode 100755 index 0000000..f81cf85 --- /dev/null +++ b/fzf_speed/_tmux_select_window_11,--.jump.to.window.11 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:11 diff --git a/fzf_speed/_tmux_select_window_12,--.jump.to.window.12 b/fzf_speed/_tmux_select_window_12,--.jump.to.window.12 new file mode 100755 index 0000000..8c0816a --- /dev/null +++ b/fzf_speed/_tmux_select_window_12,--.jump.to.window.12 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:12 diff --git a/fzf_speed/_tmux_select_window_13,--.jump.to.window.13 b/fzf_speed/_tmux_select_window_13,--.jump.to.window.13 new file mode 100755 index 0000000..780f1a0 --- /dev/null +++ b/fzf_speed/_tmux_select_window_13,--.jump.to.window.13 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:13 diff --git a/fzf_speed/_tmux_select_window_14,--.jump.to.window.14 b/fzf_speed/_tmux_select_window_14,--.jump.to.window.14 new file mode 100755 index 0000000..323846e --- /dev/null +++ b/fzf_speed/_tmux_select_window_14,--.jump.to.window.14 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:14 diff --git a/fzf_speed/_tmux_select_window_15,--.jump.to.window.15 b/fzf_speed/_tmux_select_window_15,--.jump.to.window.15 new file mode 100755 index 0000000..b89fea8 --- /dev/null +++ b/fzf_speed/_tmux_select_window_15,--.jump.to.window.15 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:15 diff --git a/fzf_speed/_tmux_select_window_16,--.jump.to.window.16 b/fzf_speed/_tmux_select_window_16,--.jump.to.window.16 new file mode 100755 index 0000000..d5bcf70 --- /dev/null +++ b/fzf_speed/_tmux_select_window_16,--.jump.to.window.16 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:16 diff --git a/fzf_speed/_tmux_select_window_17,--.jump.to.window.17 b/fzf_speed/_tmux_select_window_17,--.jump.to.window.17 new file mode 100755 index 0000000..7cf5b7e --- /dev/null +++ b/fzf_speed/_tmux_select_window_17,--.jump.to.window.17 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:17 diff --git a/fzf_speed/_tmux_select_window_18,--.jump.to.window.18 b/fzf_speed/_tmux_select_window_18,--.jump.to.window.18 new file mode 100755 index 0000000..4eb1f10 --- /dev/null +++ b/fzf_speed/_tmux_select_window_18,--.jump.to.window.18 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:18 diff --git a/fzf_speed/_tmux_select_window_19,--.jump.to.window.19 b/fzf_speed/_tmux_select_window_19,--.jump.to.window.19 new file mode 100755 index 0000000..ffe5757 --- /dev/null +++ b/fzf_speed/_tmux_select_window_19,--.jump.to.window.19 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:19 diff --git a/fzf_speed/_tmux_select_window_20,--.jump.to.window.20 b/fzf_speed/_tmux_select_window_20,--.jump.to.window.20 new file mode 100755 index 0000000..99da66a --- /dev/null +++ b/fzf_speed/_tmux_select_window_20,--.jump.to.window.20 @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +tmux select-window -t:20 diff --git a/fzf_speed/_tmux_split_pane,--.split.current.pane.horizontal b/fzf_speed/_tmux_split_pane,--.split.current.pane.horizontal new file mode 100755 index 0000000..7572c10 --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_split_pane_vert,--.split.current.pane.vertical b/fzf_speed/_tmux_split_pane_vert,--.split.current.pane.vertical new file mode 100755 index 0000000..5c0b4db --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_split_window,--.split.current.window.horizontal b/fzf_speed/_tmux_split_window,--.split.current.window.horizontal new file mode 100755 index 0000000..a65c394 --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_split_window_vert,--.split.current.window.vertical b/fzf_speed/_tmux_split_window_vert,--.split.current.window.vertical new file mode 100755 index 0000000..0f14c46 --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_swap_pane,--.swap.pane.using.choose-tree b/fzf_speed/_tmux_swap_pane,--.swap.pane.using.choose-tree new file mode 100755 index 0000000..9456f39 --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_swap_window,--.swap.window.using.choose-tree b/fzf_speed/_tmux_swap_window,--.swap.window.using.choose-tree new file mode 100755 index 0000000..28229ac --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_switch_panes,--.search.and.jump.to.a.pane.in.the.current.session b/fzf_speed/_tmux_switch_panes,--.search.and.jump.to.a.pane.in.the.current.session new file mode 100755 index 0000000..12c5cfc --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_switch_windows,--.search.and.jump.to.a.window.in.the.current.session b/fzf_speed/_tmux_switch_windows,--.search.and.jump.to.a.window.in.the.current.session new file mode 100755 index 0000000..1192894 --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tmux_workspace_casting,--.goto.session.or.start.custom.session.layout b/fzf_speed/_tmux_workspace_casting,--.goto.session.or.start.custom.session.layout new file mode 100755 index 0000000..c01cb33 --- /dev/null +++ b/fzf_speed/_tmux_workspace_casting,--.goto.session.or.start.custom.session.layout @@ -0,0 +1,20 @@ +#!/usr/bin/env sh + +# Session Name from filename (e.g _tmux_workspace_name,-- description --> name) +SESSION="$(echo "${0##*/}" | cut -d ',' -f1 | cut -d '_' -f4)" +SESSIONEXISTS=$(tmux list-sessions | grep "$SESSION") + +# Only create tmux session if it doesn't already exist +if [ "$SESSIONEXISTS" = "" ]; then + # create new session + tmux new-session -d -s "$SESSION" -c "$HOME/Public/screencast" + + tmux rename-window -t "$SESSION":0 'cast' + tmux new-window -t "$SESSION":1 -n 'demo' -c "$HOME" + + # jump to session and window 0 + tmux switch-client -t "$SESSION":0 +else + # if exist then jump to session + tmux switch-client -t "$SESSION" +fi diff --git a/fzf_speed/_tmux_workspace_entertainment,--.goto.session.or.start.custom.session.layout b/fzf_speed/_tmux_workspace_entertainment,--.goto.session.or.start.custom.session.layout new file mode 100755 index 0000000..b6a0f97 --- /dev/null +++ b/fzf_speed/_tmux_workspace_entertainment,--.goto.session.or.start.custom.session.layout @@ -0,0 +1,41 @@ +#!/usr/bin/env sh + +# Session Name from filename (e.g _tmux_workspace_name,-- description --> name) +SESSION="$(echo "${0##*/}" | cut -d ',' -f1 | cut -d '_' -f4)" +SESSIONEXISTS=$(tmux list-sessions | grep "$SESSION") + +# Only create tmux session if it doesn't already exist +if [ "$SESSIONEXISTS" = "" ]; then + # create new session + tmux new-session -d -s "$SESSION" -c "$HOME" + + tmux rename-window -t "$SESSION":0 'vid' + # tmux send-keys -t "$SESSION":0 'ranger ~/.Torrent' C-m + tmux send-keys -t "$SESSION":0 'while true; do ranger ~/.Torrent ; done' C-m + + tmux new-window -t "$SESSION":1 -n 'music' -c "$HOME" + tmux send-keys -t "$SESSION":1 'cmus' C-m + + tmux new-window -t "$SESSION":2 -n 'radio' -c "$HOME" + tmux send-keys -t "$SESSION":2 'pyradio' C-m + tmux split-window -t "$SESSION":2 -v -c "$HOME" + tmux send-keys -t "$SESSION":2 'pianobar' + tmux split-window -t "$SESSION":2 -fh -p 70 -c "$HOME" + tmux send-keys -t "$SESSION":2 "w3m -N 'https://www.internet-radio.com/stations/90s/' 'https://www.internet-radio.com/stations/japanese/' 'https://www.internet-radio.com/stations/kpop/' 'https://www.internet-radio.com/stations/bollywood/' 'https://www.internet-radio.com/stations/bhangra/' 'https://dir.xiph.org/genres/DANCE'" C-m + + tmux new-window -t "$SESSION":3 -n 'pod' -c "$HOME" + tmux send-keys -t "$SESSION":3 'newsboat-viewer' C-m + tmux split-window -t "$SESSION":3 -v -c "$HOME" + tmux send-keys -t "$SESSION":3 'while true; do podboat ; done' C-m + tmux select-pane -t 0 + + tmux new-window -t "$SESSION":4 -n 'aubk' -c "$HOME" + # tmux send-keys -t "$SESSION":4 'while true; do ranger ~/Audiobooks ; done' C-m + tmux send-keys -t "$SESSION":4 'while true; do tmux rename-window -t "$SESSION":4 'aubk' && ranger ~/Audiobooks ; done' C-m + + # jump to session and window 0 + tmux switch-client -t "$SESSION":0 +else + # if exist then jump to session + tmux switch-client -t "$SESSION" +fi diff --git a/fzf_speed/_tmux_workspace_socialmedia,--.goto.session.or.start.custom.session.layout b/fzf_speed/_tmux_workspace_socialmedia,--.goto.session.or.start.custom.session.layout new file mode 100755 index 0000000..6fe28bd --- /dev/null +++ b/fzf_speed/_tmux_workspace_socialmedia,--.goto.session.or.start.custom.session.layout @@ -0,0 +1,30 @@ +#!/usr/bin/env sh + +# Set Session Name +# Session Name from filename (e.g _tmux_workspace_name,-- description --> name) +SESSION="$(echo "${0##*/}" | cut -d ',' -f1 | cut -d '_' -f4)" +SESSIONEXISTS=$(tmux list-sessions | grep "$SESSION") + +# Only create tmux session if it doesn't already exist +if [ "$SESSIONEXISTS" = "" ]; then + # create new session + tmux new-session -d -s "$SESSION" -c "$HOME" + + tmux rename-window -t "$SESSION":0 'rss' + tmux send-keys -t "$SESSION":0 "newsboat-viewer" C-m + + tmux new-window -t "$SESSION":1 -n 'email' -c "$HOME" + tmux send-keys -t "$SESSION":1 'mutt' C-m + + tmux new-window -t "$SESSION":2 -n 'irc' -c "$HOME" + tmux send-keys -t "$SESSION":2 'weechat' C-m + + tmux new-window -t "$SESSION":3 -n 'im' -c "$HOME" + tmux send-keys -t "$SESSION":3 'finch' C-m + + # jump to session and window 0 + tmux switch-client -t "$SESSION":0 +else + # if exist then jump to session + tmux switch-client -t "$SESSION" +fi diff --git a/fzf_speed/_tmux_workspace_system,--.goto.session.or.start.custom.session.layout b/fzf_speed/_tmux_workspace_system,--.goto.session.or.start.custom.session.layout new file mode 100755 index 0000000..278d06d --- /dev/null +++ b/fzf_speed/_tmux_workspace_system,--.goto.session.or.start.custom.session.layout @@ -0,0 +1,28 @@ +#!/usr/bin/env sh + +# Session Name from filename (e.g _tmux_workspace_name,-- description --> name) +SESSION="$(echo "${0##*/}" | cut -d ',' -f1 | cut -d '_' -f4)" +SESSIONEXISTS=$(tmux list-sessions | grep "$SESSION") + +# Only create tmux session if it doesn't already exist +if [ "$SESSIONEXISTS" = "" ]; then + # create new session + tmux new-session -d -s "$SESSION" -c "$HOME" + + tmux rename-window -t "$SESSION":0 'fm' + tmux send-keys -t "$SESSION":0 'ranger ~/Downloads' C-m + + tmux new-window -t "$SESSION":1 -n 'spool' -c "$HOME" + tmux send-keys -t "$SESSION":1 'watch tsp' C-m + tmux split-window -t "$SESSION":1 -v -c "$HOME" + tmux send-keys -t "$SESSION":1 'watch TS_SOCKET=/tmp/fm tsp' C-m + tmux split-window -t "$SESSION":1 -v -p 10 -c "$HOME" + + tmux new-window -t "$SESSION":2 -n 'cmd' -c "$HOME" + + # jump to session and window 0 + tmux switch-client -t "$SESSION":0 +else + # if exist then jump to session + tmux switch-client -t "$SESSION" +fi diff --git a/fzf_speed/_tmux_zoom_pane,--.toggle.zoom.current.pane.(requires.multiple.panes) b/fzf_speed/_tmux_zoom_pane,--.toggle.zoom.current.pane.(requires.multiple.panes) new file mode 100755 index 0000000..00cbaad --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_translate_eng_to_en,--.translate.english.to.spanish b/fzf_speed/_translate_eng_to_en,--.translate.english.to.spanish new file mode 100755 index 0000000..fb9a4be --- /dev/null +++ b/fzf_speed/_translate_eng_to_en,--.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/fzf_speed/_translate_shell,--.translate.any.language.to.english b/fzf_speed/_translate_shell,--.translate.any.language.to.english new file mode 100755 index 0000000..8745388 --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_tuxi,--.ask.google.questions b/fzf_speed/_tuxi,--.ask.google.questions new file mode 100755 index 0000000..3edc73d --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_urlscan,--.extract.on.screen.urls.and.generate.clickable.url.list.with.context b/fzf_speed/_urlscan,--.extract.on.screen.urls.and.generate.clickable.url.list.with.context new file mode 100755 index 0000000..671ed64 --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_urlscan_compact,--.extract.on.screen.urls.and.generate.clickable.url.list b/fzf_speed/_urlscan_compact,--.extract.on.screen.urls.and.generate.clickable.url.list new file mode 100755 index 0000000..eaffa79 --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_urlview,--.extract.on.screen.urls.and.generate.clickable.url.list b/fzf_speed/_urlview,--.extract.on.screen.urls.and.generate.clickable.url.list new file mode 100755 index 0000000..7a918e5 --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_urlw3m,--.extract.on.screen.urls.and.generate.clickable.url.with.full.context b/fzf_speed/_urlw3m,--.extract.on.screen.urls.and.generate.clickable.url.with.full.context new file mode 100755 index 0000000..e1fc48c --- /dev/null +++ b/fzf_speed/_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/fzf_speed/_volume_mute,--.toggle.volume.mute b/fzf_speed/_volume_mute,--.toggle.volume.mute new file mode 100755 index 0000000..16b4583 --- /dev/null +++ b/fzf_speed/_volume_mute,--.toggle.volume.mute @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +amixer set Master toggle diff --git a/fzf_speed/_ytfzf,--.search.youtube.with.fzf b/fzf_speed/_ytfzf,--.search.youtube.with.fzf new file mode 100755 index 0000000..2562f42 --- /dev/null +++ b/fzf_speed/_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/fzf_speed/fzf-speed b/fzf_speed/fzf-speed new file mode 100755 index 0000000..8b72762 --- /dev/null +++ b/fzf_speed/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},*" diff --git a/w3m_extern_link.md b/w3m_extern_link.md index 3ec80fa..27b8af4 100644 --- a/w3m_extern_link.md +++ b/w3m_extern_link.md @@ -17,7 +17,7 @@ custom keybindings for the terminal web browser w3m # yank url to multiple clipboard keymap yy EXTERN_LINK "url=%s ; printf "%b" "$url" > /tmp/clipbrd.txt ; printf "%b" "$url" | xsel -b ; printf "%b" "$url" | tmux load-buffer -" - keymap YY EXTERN_LINK "url=%s ; printf "%b" "$url" > /tmp/clipbrd.txt ; printf "%b" "$url" | xsel -b ; printf "%b" "$url" | tmux load-buffer -" + keymap YY EXTERN "url=%s ; printf "%b" "$url" > /tmp/clipbrd.txt ; printf "%b" "$url" | xsel -b ; printf "%b" "$url" | tmux load-buffer -" # open gui browser keymap xw EXTERN_LINK '$BROWSER' diff --git a/w3m_prefix_search.md b/w3m_prefix_search.md index 06b917e..946c091 100644 --- a/w3m_prefix_search.md +++ b/w3m_prefix_search.md @@ -32,7 +32,7 @@ tags: linux w3m omnibar address bar quick w3m smart search fzf fuzzy finder surf # yank url to multiple clipboard keymap yy EXTERN_LINK "url=%s ; printf "%b" "$url" > /tmp/clipbrd.txt ; printf "%b" "$url" | xsel -b ; printf "%b" "$url" | tmux load-buffer -" - keymap YY EXTERN_LINK "url=%s ; printf "%b" "$url" > /tmp/clipbrd.txt ; printf "%b" "$url" | xsel -b ; printf "%b" "$url" | tmux load-buffer -" + keymap YY EXTERN "url=%s ; printf "%b" "$url" > /tmp/clipbrd.txt ; printf "%b" "$url" | xsel -b ; printf "%b" "$url" | tmux load-buffer -" # paste url and go keymap pp GOTO file:/cgi-bin/goto_clipboard.cgi