diff --git a/.gitignore b/.gitignore index 0bf64c9..4397dfb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *.swp pull.log +update.tbl \ No newline at end of file diff --git a/base/updates.zsh b/base/updates.zsh index aa47735..cac47fb 100644 --- a/base/updates.zsh +++ b/base/updates.zsh @@ -19,12 +19,26 @@ function zeesh_update () { fi [[ _zshrc_updates_pending -eq 1 ]] && ticker_message "zeesh: stub updates pending" + + echo "lastchk=$(date +%s)" > ~/.local/share/zeesh/update.tbl fi } if [[ $_zeeshdev_ignore_updates != 1 ]]; then ticker_message "zeesh: checking network" - curl -s http://lavacano.net --connect-timeout 1 --max-time 3 > /dev/null && zeesh_update + curl -s https://vcs.otl-hga.net --connect-timeout 1 --max-time 3 > /dev/null + network_ok=$? + + if [[ $network_ok ]]; then + if [[ -f ~/.local/share/zeesh/update.tbl ]]; then + eval $(cat ~/.local/share/zeesh/update.tbl) + else + lastchk=0 + fi + curtime=$(date +%s) + # if it's been fifteen minutes since the last update, do the update + [[ ${curtime} -gt $(( lastchk + 900 )) ]] && zeesh_update + fi else ticker_message "zeesh: skipping updates (fuse blown)" fi \ No newline at end of file diff --git a/modules/compinstall.zsh b/modules/compinstall.zsh index a6cfede..12b68b7 100644 --- a/modules/compinstall.zsh +++ b/modules/compinstall.zsh @@ -17,7 +17,7 @@ zstyle ':completion:*' select-prompt '%F{blue}%B%l%b \(%p\)%f' zstyle ':completion:*' squeeze-slashes true zstyle ':completion:*' use-compctl true zstyle ':completion:*' verbose true -zstyle :compinstall filename '/home/nicole/.local/share/zeesh/compinstall.zsh' +zstyle :compinstall filename '/home/nicole/.local/share/zeesh/modules/compinstall.zsh' autoload -Uz compinit compinit diff --git a/modules/kbd.zsh b/modules/kbd.zsh new file mode 100644 index 0000000..896a72b --- /dev/null +++ b/modules/kbd.zsh @@ -0,0 +1,42 @@ +# stolen from ArchWiki + +# create a zkbd compatible hash; +# to add other keys to this hash, see: man 5 terminfo +typeset -g -A key + +key[Home]="${terminfo[khome]}" +key[End]="${terminfo[kend]}" +key[Insert]="${terminfo[kich1]}" +key[Backspace]="${terminfo[kbs]}" +key[Delete]="${terminfo[kdch1]}" +key[Up]="${terminfo[kcuu1]}" +key[Down]="${terminfo[kcud1]}" +key[Left]="${terminfo[kcub1]}" +key[Right]="${terminfo[kcuf1]}" +key[PageUp]="${terminfo[kpp]}" +key[PageDown]="${terminfo[knp]}" +key[Shift-Tab]="${terminfo[kcbt]}" + +# setup key accordingly +[[ -n "${key[Home]}" ]] && bindkey -- "${key[Home]}" beginning-of-line +[[ -n "${key[End]}" ]] && bindkey -- "${key[End]}" end-of-line +[[ -n "${key[Insert]}" ]] && bindkey -- "${key[Insert]}" overwrite-mode +[[ -n "${key[Backspace]}" ]] && bindkey -- "${key[Backspace]}" backward-delete-char +[[ -n "${key[Delete]}" ]] && bindkey -- "${key[Delete]}" delete-char +[[ -n "${key[Up]}" ]] && bindkey -- "${key[Up]}" up-line-or-history +[[ -n "${key[Down]}" ]] && bindkey -- "${key[Down]}" down-line-or-history +[[ -n "${key[Left]}" ]] && bindkey -- "${key[Left]}" backward-char +[[ -n "${key[Right]}" ]] && bindkey -- "${key[Right]}" forward-char +[[ -n "${key[PageUp]}" ]] && bindkey -- "${key[PageUp]}" beginning-of-buffer-or-history +[[ -n "${key[PageDown]}" ]] && bindkey -- "${key[PageDown]}" end-of-buffer-or-history +[[ -n "${key[Shift-Tab]}" ]] && bindkey -- "${key[Shift-Tab]}" reverse-menu-complete + +# Finally, make sure the terminal is in application mode, when zle is +# active. Only then are the values from $terminfo valid. +if (( ${+terminfo[smkx]} && ${+terminfo[rmkx]} )); then + autoload -Uz add-zle-hook-widget + function zle_application_mode_start { echoti smkx } + function zle_application_mode_stop { echoti rmkx } + add-zle-hook-widget -Uz zle-line-init zle_application_mode_start + add-zle-hook-widget -Uz zle-line-finish zle_application_mode_stop +fi diff --git a/modules/opam.zsh b/modules/opam.zsh new file mode 100644 index 0000000..282f276 --- /dev/null +++ b/modules/opam.zsh @@ -0,0 +1,4 @@ + + +# opam configuration +[[ ! -r /home/nicole/.opam/opam-init/init.zsh ]] || source /home/nicole/.opam/opam-init/init.zsh > /dev/null 2> /dev/null