diff --git a/dot_local/bin/executable_kc b/dot_config/zsh/kc.zsh similarity index 88% rename from dot_local/bin/executable_kc rename to dot_config/zsh/kc.zsh index 7757ed4..7bcac5e 100644 --- a/dot_local/bin/executable_kc +++ b/dot_config/zsh/kc.zsh @@ -1,10 +1,4 @@ -#!/usr/bin/env bash - -[[ -n $DEBUG ]] && set -x - -set -eou pipefail -IFS=$'\n\t' - +#!/bin/zsh usage() { local SELF @@ -32,7 +26,7 @@ current_context() { get_configs() { #kubectl config get-contexts -o=name | sort -n - ls -p --color=never -1 $HOME/.kube | grep -v '/$' + ls -p --color=never -1 $HOME/.kube | \grep -v '/$' } list_configs() { @@ -77,19 +71,15 @@ choose_context_interactive() { } set_context() { - echo "Set context to ${1}." >&2 export KUBECONFIG="$HOME/.kube/${1}" - echo -e "\n\nYou are in a subshell. Press Ctrl+d for exit!\n\n" - $SHELL } unset_context() { - echo "Unsetting current context." >&2 + unset $KUBECONFIG kubectl config unset current-context - echo "Ctrl+d for exiting subshell." >&2 } -main() { +kc() { if [[ "$#" -eq 0 ]]; then if [[ -t 1 && -z "${KUBECTX_IGNORE_FZF:-}" && "$(type fzf &>/dev/null; echo $?)" -eq 0 ]]; then choose_context_interactive @@ -124,5 +114,3 @@ main() { exit 1 fi } - -main "$@" diff --git a/dot_local/bin/executable_flac2mp3 b/dot_local/bin/executable_flac2mp3 deleted file mode 100644 index 1dbafe4..0000000 --- a/dot_local/bin/executable_flac2mp3 +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/zsh - -ffmpeg -n -i "$1" -acodec libmp3lame -ab 320k -map_metadata 0 -id3v2_version 3 "$2" &> /dev/null diff --git a/dot_zshrc.tmpl b/dot_zshrc.tmpl index 2ec4e64..957ffd5 100644 --- a/dot_zshrc.tmpl +++ b/dot_zshrc.tmpl @@ -42,6 +42,7 @@ bindkey -v source ${CUSTOM}/completions/*.zsh source ~/.aliases +source ~/.config/zsh/kc.zsh # Variable exports export DEFAULT_USER="pavle" @@ -94,8 +95,5 @@ if which pyenv &> /dev/null; then eval "$(pyenv init -)" fi -# Nvm settings -[[ -f /usr/share/nvm/init-nvm.sh ]] && source /usr/share/nvm/init-nvm.sh - # startx on tty1 if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then exec startx -- vt1; fi