Compare commits

..

9 Commits

Author SHA1 Message Date
Anton Zadvorny 3f4f572330 Update brewfile 2023-01-03 06:48:09 +03:00
Anton Zadvorny 5ba41b3e9e Update ADB related commands 2023-01-03 06:48:03 +03:00
Anton Zadvorny 4bfab68b72 Remove unused binaries 2023-01-03 06:47:48 +03:00
Anton Zadvorny 160f03d2f2 Update .zshenv 2022-06-04 23:27:22 +03:00
Anton Zadvorny ce705f4584 Add ssf command 2022-06-04 23:27:04 +03:00
Anton Zadvorny 6489dc0441 Update pf command 2022-06-04 23:26:56 +03:00
Anton Zadvorny a9eefee9ac Fix formatting 2022-06-04 23:26:41 +03:00
Anton Zadvorny cad3d15e55 Add ADB related commands 2022-06-04 23:25:45 +03:00
Anton Zadvorny bb8c792588 Update osx plugin name 2021-12-30 16:54:52 +03:00
9 changed files with 73 additions and 58 deletions

View File

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

14
home/.zsh/cmd/adi.sh Executable file
View File

@ -0,0 +1,14 @@
### 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

14
home/.zsh/cmd/adpo.sh Executable file
View File

@ -0,0 +1,14 @@
### 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

14
home/.zsh/cmd/adu.sh Executable file
View File

@ -0,0 +1,14 @@
### 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,7 +32,6 @@ 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

14
home/.zsh/cmd/ssf.sh Executable file
View File

@ -0,0 +1,14 @@
### 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

@ -1,41 +0,0 @@
_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,3 +7,9 @@ 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,14 +9,11 @@ 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 "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 "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 "b4b4r07/enhancd", use:init.sh
if zplug check "b4b4r07/enhancd"; then
@ -31,9 +28,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
@ -43,8 +40,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/osx", from:oh-my-zsh
zplug "plugins/pass", from:oh-my-zsh
zplug "plugins/pass", from:oh-my-zsh
zplug "plugins/macos", from:oh-my-zsh
fi
[ -s "$HOME/.zsh.local" ] && source $HOME/.zsh.local