Compare commits

..

No commits in common. "3f4f5723306df0f899732fb9c4ef130e350dd775" and "4a555a79b15cb2e7d2d3ddd14d3d4733dc2de0ae" have entirely different histories.

9 changed files with 58 additions and 73 deletions

View File

@ -6,6 +6,7 @@ tap "homebrew/core"
tap "homebrew/services"
brew "asdf"
brew "cloc"
brew "cmake"
brew "git-lfs"
brew "git"
@ -33,6 +34,7 @@ cask "google-chrome"
cask "iina"
cask "iterm2"
cask "mongodb-compass"
cask "onyx"
cask "openemu"
cask "skype"
cask "spotify"

View File

@ -1,14 +0,0 @@
### ADB
# mnemonic [AD]b [I]nstall
# install apk via adb
apk=${1}
if [[ -z $apk ]]; then
apk=$(find . -maxdepth 5 -type f -name '*.apk' ! -iname ".*" | eval "fzf ${FZF_DEFAULT_OPTS} -m --header='[adb:install]'")
fi
if [[ $apk ]]; then
echo "Trying $apk"
adb install -g -r "$apk"
fi

View File

@ -1,14 +0,0 @@
### ADB
# mnemonic [AD]b [P]ush [O]BB
# pushes obb directory via adb
obbdir=${1}
if [[ -z $obbdir ]]; then
obbdir=$(find . -maxdepth 5 -name '*.obb' ! -iname ".*" -exec dirname {} \; | sort -u | eval "fzf ${FZF_DEFAULT_OPTS} -m --header='[adb:push]'")
fi
if [[ $obbdir ]]; then
echo "Trying $obbdir"
adb push "$obbdir" /sdcard/Android/obb/
fi

View File

@ -1,14 +0,0 @@
### ADB
# mnemonic [AD]b [U]nistall
# install apk via adb
apk=${1}
if [[ -z $apk ]]; then
apk=$(adb shell cmd package list packages | eval "fzf ${FZF_DEFAULT_OPTS} -m --header='[adb:uninstall]'" | sed 's/package://g')
fi
if [[ $apk ]]; then
echo "Trying $apk"
adb uninstall $apk
fi

View File

@ -1,5 +1,5 @@
### PASS
# mnemonic: [P]ass [F]ind
# mnemonic: [P]ass[F]ind
# search password in the passwotd store
# press [enter] to copy selected password
# press [escape] to exit
@ -32,6 +32,7 @@ candidates=$(list_entries)
res=$(candidate_selector "$query" "$candidates")
if [ -n "$res" ]; then
pass show "$res" | tail -n +2 || exit $?
pass show -c "$res"
else
exit 1

View File

@ -1,14 +0,0 @@
### SSH
# mnemonic [SS]h [F]ind and connect
# find ssh host from known hosts and connect
host=${1}
if [[ -z $host ]]; then
host=$(cat ~/.ssh/known_hosts | cut -f 1 -d ' ' | sed -e 's/,.*//g' | sort -u | eval "fzf ${FZF_DEFAULT_OPTS} -m --header='[ssh:connect]'" | awk '{print $1}')
fi
if [[ $host ]]; then
echo "Connecting to $host"
ssh $host
fi

View File

@ -0,0 +1,41 @@
_zplug-check-interval() {
now=$(date +%s)
if [ -f "${1}" ]; then
last_update=$(cat "${1}")
else
last_update=0
fi
interval=$(expr ${now} - ${last_update})
echo "${interval}"
}
_zplug-check-for-updates() {
if [ -z "${ZPLUG_PLUGIN_UPDATE_DAYS}" ]; then
ZPLUG_PLUGIN_UPDATE_DAYS=14
fi
if [ -z "${ZPLUG_PLUGIN_UPDATE_FILE}" ]; then
ZPLUG_PLUGIN_UPDATE_FILE="${ZPLUG_HOME:-}/.zplug_plugin_lastupdate"
fi
local day_seconds=$(expr 24 \* 60 \* 60)
local plugins_seconds=$(expr ${day_seconds} \* ${ZPLUG_PLUGIN_UPDATE_DAYS})
local last_plugin=$(_zplug-check-interval ${ZPLUG_PLUGIN_UPDATE_FILE})
if [ ${last_plugin} -gt ${plugins_seconds} ]; then
echo "It has been $(expr ${last_plugin} / $day_seconds) days since your zplug plugins were updated"
zplug update
date +%s >! ${ZPLUG_PLUGIN_UPDATE_FILE}
zplug clean --force
fi
}
zmodload zsh/system
lockfile=${ZPLUG_HOME:-~}/.zplug_autoupdate_lock
touch $lockfile
if ! which zsystem &> /dev/null || zsystem flock -t 1 $lockfile; then
_zplug-check-for-updates
command rm -f $lockfile
fi

View File

@ -7,9 +7,3 @@ export FZF_DEFAULT_COMMAND='rg --files --no-ignore-vcs --hidden'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export GOPRIVATE="go.pkg.cx"
if [[ "$(uname -m)" == "arm64" ]]; then
export PATH="/opt/homebrew/bin:/opt/homebrew/sbin:${PATH}"
fi
source "$HOME/.cargo/env"

View File

@ -9,11 +9,14 @@ fi
zplug "zplug/zplug", hook-build:'zplug --self-manage'
zplug "BurntSushi/ripgrep", from:gh-r, as:command, rename-to:rg
zplug "junegunn/fzf-bin", from:gh-r, as:command, rename-to:fzf
zplug "r-darwish/topgrade", from:gh-r, as:command, rename-to:topgrade
zplug "sharkdp/bat", from:gh-r, as:command, rename-to:bat
zplug "stedolan/jq", from:gh-r, as:command, rename-to:jq
zplug "BurntSushi/ripgrep", from:gh-r, as:command, rename-to:rg
zplug "junegunn/fzf-bin", from:gh-r, as:command, rename-to:fzf
zplug "r-darwish/topgrade", from:gh-r, as:command, rename-to:topgrade
zplug "regclient/regclient", from:gh-r, as:command, rename-to:regctl
zplug "sharkdp/bat", from:gh-r, as:command, rename-to:bat
zplug "sharkdp/hexyl", from:gh-r, as:command, rename-to:hexyl
zplug "stedolan/jq", from:gh-r, as:command, rename-to:jq
zplug "wagoodman/dive", from:gh-r, as:command, rename-to:dive
zplug "b4b4r07/enhancd", use:init.sh
if zplug check "b4b4r07/enhancd"; then
@ -28,9 +31,9 @@ zplug "lib/grep", from:oh-my-zsh
zplug "lib/directories", from:oh-my-zsh
zplug "lib/completion", from:oh-my-zsh
zplug "plugins/git", from:oh-my-zsh
zplug "plugins/docker", from:oh-my-zsh
zplug "plugins/asdf", from:oh-my-zsh
zplug "plugins/git", from:oh-my-zsh
zplug "plugins/docker", from:oh-my-zsh
zplug "plugins/asdf", from:oh-my-zsh
zplug "zsh-users/zsh-completions"
zplug "zsh-users/zsh-syntax-highlighting", defer:2
@ -40,8 +43,8 @@ zplug "~/.zsh/cmd", from:local, use:'(*).sh', as:command, rename-to
zplug "~/.zsh/themes", from:local, use:cheetah.zsh-theme, as:theme
if [[ $OSTYPE == *darwin* ]]; then
zplug "plugins/pass", from:oh-my-zsh
zplug "plugins/macos", from:oh-my-zsh
zplug "plugins/osx", from:oh-my-zsh
zplug "plugins/pass", from:oh-my-zsh
fi
[ -s "$HOME/.zsh.local" ] && source $HOME/.zsh.local