make imgcat work, remove zathura for the time being, remove unused it2setkeylabel command because it should be in ~/.iterm2 already

This commit is contained in:
JesseBot 2022-12-03 15:19:21 +01:00
parent c21be9de11
commit 78f69cb14c
6 changed files with 8 additions and 127 deletions

View file

@ -1,5 +1,4 @@
# This file exists just to make sure we always source .bashrc
source ~/.bashrc
test -e "${HOME}/.iterm2_shell_integration.bash" && source "${HOME}/.iterm2_shell_integration.bash" || true
source "${HOME}/.iterm2_shell_integration.bash"

View file

@ -113,6 +113,9 @@ alias cat='dog'
GOROOT=$HOME
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin
# this makes iterm2 stuff work better
export PATH=$PATH:$HOME/.iterm2
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Linux PATH ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
if [[ $(uname) == *"Linux"* ]]; then

View file

@ -7,5 +7,7 @@ image/*; img2sixel %s; needsterminal
# for displaying html files in a new split in iterm2 with w3m and sixel
text/html; (clear && w3m-splits %s); nametemplate=%s.html
# pdf files currently only work on macOS, using open (which defaults to preview)
# use default program (preview in macOS)
application/pdf; open %s
# pdf files open in zathura, a hackable document viewer with hotkeys
# application/pdf; zathura %s

View file

@ -649,4 +649,3 @@ fi
# -- END ITERM2 CUSTOMIZATIONS --
alias imgcat=~/.iterm2/imgcat;alias imgls=~/.iterm2/imgls;alias it2api=~/.iterm2/it2api;alias it2attention=~/.iterm2/it2attention;alias it2check=~/.iterm2/it2check;alias it2copy=~/.iterm2/it2copy;alias it2dl=~/.iterm2/it2dl;alias it2getvar=~/.iterm2/it2getvar;alias it2git=~/.iterm2/it2git;alias it2setcolor=~/.iterm2/it2setcolor;alias it2setkeylabel=~/.iterm2/it2setkeylabel;alias it2tip=~/.iterm2/it2tip;alias it2ul=~/.iterm2/it2ul;alias it2universion=~/.iterm2/it2universion;alias it2profile=~/.iterm2/it2profile

View file

@ -1,123 +0,0 @@
#!/usr/bin/env bash
# tmux requires unrecognized OSC sequences to be wrapped with DCS tmux;
# <sequence> ST, and for all ESCs in <sequence> to be replaced with ESC ESC. It
# only accepts ESC backslash for ST.
function print_osc() {
if [[ $TERM == screen* || $TERM == tmux* ]] ; then
printf "\033Ptmux;\033\033]"
else
printf "\033]"
fi
}
# More of the tmux workaround described above.
function print_st() {
if [[ $TERM == screen* || $TERM == tmux* ]] ; then
printf "\a\033\\"
else
printf "\a"
fi
}
function show_help() {
echo "Usage:" 1>& 2
echo " $(basename $0) set Fn Label" 1>& 2
echo " Where n is a value from 1 to 20" 1>& 2
echo " $(basename $0) set status Label" 1>& 2
echo " Sets the touch bar status button's label" 1>& 2
echo " $(basename $0) push [name]" 1>& 2
echo " Saves the current labels with an optional name. Resets labels to their default value, unless name begins with a "." character." 1>& 2
echo " $(basename $0) pop [name]" 1>& 2
echo " If name is given, all key labels up to and including the one with the matching name are popped." 1>& 2
echo "" 1>& 2
echo "Example:" 1>& 2
echo "#!/usr/bin/env bash" 1>& 2
echo "# Wrapper script for mc that sets function key labels" 1>& 2
echo "NAME=mc_\$RANDOM" 1>& 2
echo "# Save existing labels" 1>& 2
echo "$(basename $0) push \$NAME" 1>& 2
echo "$(basename $0) set F1 Help" 1>& 2
echo "$(basename $0) set F2 Menu" 1>& 2
echo "$(basename $0) set F3 View" 1>& 2
echo "$(basename $0) set F4 Edit" 1>& 2
echo "$(basename $0) set F5 Copy" 1>& 2
echo "$(basename $0) set F6 Move" 1>& 2
echo "$(basename $0) set F7 Mkdir" 1>& 2
echo "$(basename $0) set F8 Del" 1>& 2
echo "$(basename $0) set F9 Menu" 1>& 2
echo "$(basename $0) set F10 Quit" 1>& 2
echo "$(basename $0) set F11 Menu" 1>& 2
echo "$(basename $0) set F13 View" 1>& 2
echo "$(basename $0) set F14 Edit" 1>& 2
echo "$(basename $0) set F15 Copy" 1>& 2
echo "$(basename $0) set F16 Move" 1>& 2
echo "$(basename $0) set F17 Find" 1>& 2
echo "mc" 1>& 2
echo "# Restore labels to their previous state" 1>& 2
echo "$(basename $0) pop \$NAME" 1>& 2
}
## Main
if [[ $# == 0 ]]
then
show_help
exit 1
fi
if [[ $1 == set ]]
then
if [[ $# != 3 ]]
then
show_help
exit 1
fi
print_osc
printf "1337;SetKeyLabel=%s=%s" "$2" "$3"
print_st
elif [[ $1 == push ]]
then
if [[ $# == 1 ]]
then
print_osc
printf "1337;PushKeyLabels"
print_st
elif [[ $# == 2 ]]
then
if [[ $2 == "" ]]
then
echo "Name must not be empty" 1>& 2
exit 1
fi
print_osc
printf "1337;PushKeyLabels=%s" "$2"
print_st
else
show_help
exit 1
fi
elif [[ $1 == pop ]]
then
if [[ $# == 1 ]]
then
print_osc
printf "1337;PopKeyLabels"
print_st
elif [[ $# == 2 ]]
then
if [[ $2 == "" ]]
then
echo "Name must not be empty" 1>& 2
exit 1
fi
print_osc
printf "1337;PopKeyLabels=%s" "$2"
print_st
else
show_help
exit 1
fi
else
show_help
exit 1
fi

View file

@ -2,3 +2,4 @@ mailcap ~/.w3m/mailcap
auto_image TRUE
display_image 1
confirm_qq false
display_link 1