diff --git a/README.md b/README.md index 463a7c2..bc3db6b 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,21 @@ Multiple scripts that are useful but don't deserve their own repository. A wrapper for youtube-dl to make easier (and automate) some things. +## copy_image.sh + +Use with CopyQ to get an image onto the clipboard and select it for pasting + +## tmux_devour.sh + +Launch a process in a new pane, zoom the pane, kill the pane when done. + +## tmux_sidebar.sh + +Create a sidebar (e.g. for reading manpages) and kill when done. + +## tmux_topbar.sh + +Create a vertical split (it's actually a bottombar) and kill when done. ## briefing.sh diff --git a/briefing.sh b/briefing.sh old mode 100644 new mode 100755 diff --git a/copy_image.sh b/copy_image.sh new file mode 100755 index 0000000..052b5e8 --- /dev/null +++ b/copy_image.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +#uses copyq to select image and copy it to clipboard for pasting + +filename=$(realpath $1) +if [ -f "$filename" ];then + mime=$(mimetype "$filename" | awk -F ': ' '{print $2}') + /usr/bin/copyq write 0 "$mime" - < "$filename" + /usr/bin/copyq select 0 +fi \ No newline at end of file diff --git a/tmux_devour.sh b/tmux_devour.sh new file mode 100755 index 0000000..10e5858 --- /dev/null +++ b/tmux_devour.sh @@ -0,0 +1,34 @@ +#!/bin/bash + + +#maybe use this as a setup for those programs and have a permanent sidebar? +#tmux send-keys -t "%74" "chafa " "/home/steven/downloads/images/big_keys_for_logo.jpg" "C-m" +# See the space!!! +#replaces man command - makes help a fallback +# use pick to deal with the output better +#TOD + + c_tmux=$(env | grep -c TMUX) + if [ $c_tmux -gt 0 ];then + command=$(echo "$@") + tmux split-window -h + #"$command" + c_pane=$(tmux ls -F "#D") + printf '\033]2;%s\033\\' 'devour' + tmux resize-pane -t "$c_pane" -R 20 + tmux select-pane -m -t "$c_pane" + #echo "$c_pane" + tmux send-keys -t "$c_pane" "$command && read && exit" C-m + tmux resize-pane -Z -t "$c_pane" + fi + + +# if [ $c_tmux -gt 0 ];then +# tmux kill-pane -t "$c_pane" +# fi + + + +# Is it tmux? +# Does the sidebar already exist in this window? +# if not, create sidebar and export variable \ No newline at end of file diff --git a/tmux_sidebar.sh b/tmux_sidebar.sh new file mode 100755 index 0000000..79abe22 --- /dev/null +++ b/tmux_sidebar.sh @@ -0,0 +1,33 @@ +#!/bin/bash + + +#maybe use this as a setup for those programs and have a permanent sidebar? +#tmux send-keys -t "%74" "chafa " "/home/steven/downloads/images/big_keys_for_logo.jpg" "C-m" +# See the space!!! +#replaces man command - makes help a fallback +# use pick to deal with the output better +#TOD + + c_tmux=$(env | grep -c TMUX) + if [ $c_tmux -gt 0 ];then + command=$(echo "$@") + tmux split-window -h + #"$command" + c_pane=$(tmux ls -F "#D") + printf '\033]2;%s\033\\' 'sidebar' + tmux resize-pane -t "$c_pane" -R 20 + tmux select-pane -m -t "$c_pane" + #echo "$c_pane" + tmux send-keys -t "$c_pane" "$command && exit" C-m + fi + + +# if [ $c_tmux -gt 0 ];then +# tmux kill-pane -t "$c_pane" +# fi + + + +# Is it tmux? +# Does the sidebar already exist in this window? +# if not, create sidebar and export variable \ No newline at end of file diff --git a/tmux_topbar.sh b/tmux_topbar.sh new file mode 100755 index 0000000..ac35ae4 --- /dev/null +++ b/tmux_topbar.sh @@ -0,0 +1,33 @@ +#!/bin/bash + + +#maybe use this as a setup for those programs and have a permanent sidebar? +#tmux send-keys -t "%74" "chafa " "/home/steven/downloads/images/big_keys_for_logo.jpg" "C-m" +# See the space!!! +#replaces man command - makes help a fallback +# use pick to deal with the output better +#TOD + + c_tmux=$(env | grep -c TMUX) + if [ $c_tmux -gt 0 ];then + command=$(echo "$@") + tmux split-window -v + #"$command" + c_pane=$(tmux ls -F "#D") + printf '\033]2;%s\033\\' 'topbar' + tmux resize-pane -t "$c_pane" -R 20 + tmux select-pane -m -t "$c_pane" + #echo "$c_pane" + tmux send-keys -t "$c_pane" "$command && exit" C-m + fi + + +# if [ $c_tmux -gt 0 ];then +# tmux kill-pane -t "$c_pane" +# fi + + + +# Is it tmux? +# Does the sidebar already exist in this window? +# if not, create sidebar and export variable \ No newline at end of file diff --git a/ytube b/ytube index f91a537..fb8d11d 100755 --- a/ytube +++ b/ytube @@ -8,7 +8,7 @@ GUI="" ############################################################################## display_help() { - echo "usage: thuit.sh [-h][-n][-e][-b][-x][-c]" + echo "usage: ytube.sh [-h][-n][-e][-b][-x][-c]" echo " " echo "optional arguments:" echo " -h show this help message and exit"