-macro index <F8> "\
- <enter-command>set my_old_pipe_decode=\$pipe_decode my_old_wait_key=\$wait_key nopipe_decode nowait_key<enter>\
- <shell-escape>notmuch-mutt -r --prompt search<enter>\
- <change-folder-readonly>`echo ${XDG_CACHE_HOME:-$HOME/.cache}/notmuch/mutt/results`<enter>\
- <enter-command>set pipe_decode=\$my_old_pipe_decode wait_key=\$my_old_wait_key<enter>" \
- "notmuch: search mail"
+macro index <F8> \
+"<enter-command>set my_old_pipe_decode=\$pipe_decode my_old_wait_key=\$wait_key nopipe_decode nowait_key<enter>\
+<shell-escape>notmuch-mutt -r --prompt search<enter>\
+<change-folder-readonly>`echo ${XDG_CACHE_HOME:-$HOME/.cache}/notmuch/mutt/results`<enter>\
+<enter-command>set pipe_decode=\$my_old_pipe_decode wait_key=\$my_old_wait_key<enter>" \
+ "notmuch: search mail"
-macro index <F9> "\
- <enter-command>set my_old_pipe_decode=\$pipe_decode my_old_wait_key=\$wait_key nopipe_decode nowait_key<enter>\
- <pipe-message>notmuch-mutt -r thread<enter>\
- <change-folder-readonly>`echo ${XDG_CACHE_HOME:-$HOME/.cache}/notmuch/mutt/results`<enter>\
- <enter-command>set pipe_decode=\$my_old_pipe_decode wait_key=\$my_old_wait_key<enter>" \
- "notmuch: reconstruct thread"
+macro index <F9> \
+"<enter-command>set my_old_pipe_decode=\$pipe_decode my_old_wait_key=\$wait_key nopipe_decode nowait_key<enter>\
+<pipe-message>notmuch-mutt -r thread<enter>\
+<change-folder-readonly>`echo ${XDG_CACHE_HOME:-$HOME/.cache}/notmuch/mutt/results`<enter>\
+<enter-command>set pipe_decode=\$my_old_pipe_decode wait_key=\$my_old_wait_key<enter>" \
+ "notmuch: reconstruct thread"
-macro index <F6> "\
- <enter-command>set my_old_pipe_decode=\$pipe_decode my_old_wait_key=\$wait_key nopipe_decode nowait_key<enter>\
- <pipe-message>notmuch-mutt tag -- -inbox<enter>\
- <enter-command>set pipe_decode=\$my_old_pipe_decode wait_key=\$my_old_wait_key<enter>" \
- "notmuch: remove message from inbox"
+macro index <F6> \
+"<enter-command>set my_old_pipe_decode=\$pipe_decode my_old_wait_key=\$wait_key nopipe_decode nowait_key<enter>\
+<pipe-message>notmuch-mutt tag -- -inbox<enter>\
+<enter-command>set pipe_decode=\$my_old_pipe_decode wait_key=\$my_old_wait_key<enter>" \
+ "notmuch: remove message from inbox"
export PATH=~/.local/bin:$PATH
export PATH=$PATH:$CLEAN_HOME/lib/exe:$CLEAN_HOME/bin
export PATH=$PATH:~/projects/esp-open-sdk/xtensa-lx106-elf/bin
-export PATH=$PATH:/opt/texlive/2016/bin/x86_64-linux
-export PATH=$PATH:~/.local/texlive/2016/bin/x86_64-linux
+export PATH=$PATH:/opt/texlive/2017/bin/x86_64-linux
export GTK_IM_MODULE=xim
export QT_IM_MODULE=xim
--- /dev/null
+#!/usr/bin/expect
+spawn pdflatex {*}$argv
+set latexpid $spawn_id
+set oldresult ""
+expect -re "^.*File .(.*). not found.*$|^.*language definition file (.*) was not foun" {
+ set result $expect_out(1,string)
+ send_user "\nTrying to install missing package\n"
+ if {$oldresult == $result} {
+ send_user "$result has been tried twice with no results\n"
+ send_user "Is this not an image? Aborting...\n"
+ exit
+ } {
+ spawn tlmgri $result
+ interact
+ set spawn_id $latexpid
+ close
+ wait
+ spawn pdflatex {*}$argv
+ set oldresult $result
+ exp_continue
+ }
+ }
--- /dev/null
+#!/bin/bash
+if [ "$#" -ne 1 ]
+then
+ echo "Usage: $0 FILE"
+ exit 1
+fi
+
+PKGS="$(tlmgr search --global --file "/$1" 2>/dev/null | grep -Po "^.*(?=:$)")"
+if [[ -z "$PKGS" ]]; then exit 1; fi
+if [[ $(wc -w <<< "$PKGS") -eq 1 ]]
+then
+ tlmgr install "$PKGS"
+else
+ select package in $PKGS; do
+ INDEX=1
+ for p in $PKGS; do
+ if [ $((INDEX++)) -eq $REPLY ]; then
+ tlmgr install "$p"
+ fi
+ done
+ break;
+ done
+fi