bash: fkill function

This commit is contained in:
2019-04-23 22:23:39 +03:00
parent 8cbaecd65f
commit e3663e342d

View File

@@ -22,7 +22,7 @@ export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8 export LC_ALL=en_US.UTF-8
# Creds # Creds
export HOMEBREW_GITHUB_API_TOKEN="2a4fad8fb1b5ff1de5fdf043aeea7d6cf0c5b101" export HOMEBREW_GITHUB_API_TOKEN="ea82cdedd1d5d45d4a5dfc6ec62137ca83bec6ee"
# fzf # fzf
export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git' export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git'
@@ -70,6 +70,17 @@ yta() {
streamlink $1 audio_mp4 streamlink $1 audio_mp4
} }
fzf_kill() {
local pids=$(
ps -f -u $USER | sed 1d | fzf --multi | tr -s [:blank:] | cut -d' ' -f3
)
if [[ -n $pids ]]; then
echo "$pids" | xargs kill -9 "$@"
fi
}
alias fkill='fzf_kill'
# Homebrew stuff # Homebrew stuff
if [ -x /usr/local/bin/brew ]; then if [ -x /usr/local/bin/brew ]; then
export PATH=/usr/local/bin:/usr/local/sbin:$PATH export PATH=/usr/local/bin:/usr/local/sbin:$PATH