dotfiles

My dotfiles, nothing really interesting to see ...
git clone https://git.onna.be/dotfiles.git
Log | Files | Refs | README

commit 8752bd0b8989e81b2695adf665b3ed5f9a156b53
parent b9106be93920fc7f90cd7bf0051ba7fbfc4ff324
Author: Paco Esteban <paco@onna.be>
Date:   Sun,  1 Jul 2018 19:11:15 +0200

alias rearrangement and mods to be more compatible between systems

Diffstat:
zsh/.zsh/aliases.zsh | 46+++++++++++-----------------------------------
zsh/.zsh/gcloud_helpers.zsh | 25+++++++++++++++++++++++++
zsh/.zsh/includes.zsh | 5++++-
3 files changed, 40 insertions(+), 36 deletions(-)

diff --git a/zsh/.zsh/aliases.zsh b/zsh/.zsh/aliases.zsh @@ -2,11 +2,13 @@ MYOS=$(uname) if [[ "$MYOS" == "Linux" ]]; then alias ls='ls -F --color' alias open="xdg-open" + alias tree='tree -C' CLIP_COMMAND="xclip -f -selection clipboard" fi -if [[ "$MYOS" == "FreeBSD" ]]; then - alias ls='ls -F -G' - CLIP_COMMAND="" +if [[ "$MYOS" == "OpenBSD" ]]; then + alias open="xdg-open" + alias ls='ls -F' + CLIP_COMMAND="xclip -f -selection clipboard" fi if [[ "$MYOS" == "Darwin" ]]; then alias ls='ls -F' @@ -15,7 +17,6 @@ fi alias lst='ls -latr' alias cp='cp -v' -alias tree='tree -C' alias tm='tmux attach' alias g='git' alias k='kubectl' @@ -41,7 +42,6 @@ alias gcil='gcloud compute instances list' alias gcssh='gcloud compute ssh' alias gcscp='gcloud compute scp' alias vim='nvim' -alias cal='cal -m' alias d='docker' alias dps='docker ps -a' alias dim='docker images' @@ -79,17 +79,19 @@ cfg-ssh-authorized-keys() { $EDITOR $HOME/.ssh/authorized_keys } cfg-ssh-known-hosts() { $EDITOR $HOME/.ssh/known_hosts } # directory definitions -e=$HOME/Sync/electronica s=$HOME/src +sp=$HOME/Sync/bitbucket.org/powerspace +so=$HOME/src/git.onna.be +sg=$HOME/src/galadriel +Sp=$HOME/Sync/powerspace S=$HOME/Sync -p=$HOME/Sync/powerspace +M=$HOME/Mobile d=$HOME/Documents D=$HOME/Downloads f=/mnt/fotos m=/mnt/media M=/mnt/mirror h=/mnt/home -cad=/mnt/home/src/CAD # transmission stuff alias trls='transmission-remote 10.42.10.55 --authenv -l' @@ -192,36 +194,10 @@ function pubkey () { function pastesrv() { FILENAME="$1" if [[ -z "$FILENAME" ]]; then - FILENAME=$(tr -cd '[:alnum:]' < /dev/urandom |head -c 8) + FILENAME=$(tr -cd '[:alnum:]' < /dev/urandom |dd bs=1 count=8 2>/dev/null) fi ssh r1 "cat > /var/www/pastes/$FILENAME" echo -n "https://onna.be/paste/$FILENAME" |\ ${=CLIP_COMMAND} echo '' } - -# google cloud prompt helper -function gctx () { - local context c_raw - context=$1 - if [[ -n "$context" ]]; then - gcloud config configurations activate $context && \ - echo $context > $HOME/.config/gcloud/current_context - else - c_raw=$(gcloud config configurations list) - context=$(echo $c_raw | awk '$2=="True" {print $1}') - echo "Available context: " - echo $c_raw | awk '{print $1}' | sed '1d' - echo "\nActive: $context" - fi -} -function gCon () { - export GCLOUD_PROMPT="true" -} - -function gCoff () { - unset GCLOUD_PROMPT -} -function gcloud_active_config () { - echo "(gC:$(cat $HOME/.config/gcloud/current_context))" -} diff --git a/zsh/.zsh/gcloud_helpers.zsh b/zsh/.zsh/gcloud_helpers.zsh @@ -0,0 +1,25 @@ +# google cloud prompt helper +function gctx () { + local context c_raw + context=$1 + if [[ -n "$context" ]]; then + gcloud config configurations activate $context && \ + echo $context > $HOME/.config/gcloud/current_context + else + c_raw=$(gcloud config configurations list) + context=$(echo $c_raw | awk '$2=="True" {print $1}') + echo "Available context: " + echo $c_raw | awk '{print $1}' | sed '1d' + echo "\nActive: $context" + fi +} +function gCon () { + export GCLOUD_PROMPT="true" +} + +function gCoff () { + unset GCLOUD_PROMPT +} +function gcloud_active_config () { + echo "(gC:$(cat $HOME/.config/gcloud/current_context))" +} diff --git a/zsh/.zsh/includes.zsh b/zsh/.zsh/includes.zsh @@ -2,7 +2,10 @@ if which plenv > /dev/null; then eval "$(plenv init - zsh)"; fi # gcloud completion -[ -f /opt/google-cloud-sdk/completion.zsh.inc ] && source /opt/google-cloud-sdk/completion.zsh.inc +if [ -f /opt/google-cloud-sdk/completion.zsh.inc ]; then + source /opt/google-cloud-sdk/completion.zsh.inc + source $HOME/.zsh/gcloud_helpers.zsh +fi # nice 'x' command for all kinds of compressed file extraction [ -f $HOME/.zsh_plugins/extract.plugin.zsh ] && source $HOME/.zsh_plugins/extract.plugin.zsh