diff --git a/_home/dot_sz.shrc.d/10_bin.path b/_home/dot_sz.shrc.d/10_bin.path new file mode 100644 index 0000000..d75f257 --- /dev/null +++ b/_home/dot_sz.shrc.d/10_bin.path @@ -0,0 +1,9 @@ +# set PATH so it includes user's private bin if it exists +if [[ -d "$HOME/bin" ]] ; then + export PATH="~/bin:$PATH" +fi + +# set PATH so it includes user's private bin if it exists +if [[ -d "$HOME/.local/bin" ]] ; then + export PATH="~/.local/bin:$PATH" +fi diff --git a/_home/dot_sz.shrc.d/21_aliases b/_home/dot_sz.shrc.d/21_aliases index 6e9f992..2a4a8db 100644 --- a/_home/dot_sz.shrc.d/21_aliases +++ b/_home/dot_sz.shrc.d/21_aliases @@ -1,22 +1,5 @@ alias sudo="/usr/bin/sudo " -PREFERED_VI=$(type -fP nvim vim | head -1) -if [[ -z "$PREFERED_VI" ]]; then - PREFERED_VI=$(type -fP vi | head -1) - - if [[ -z "$PREFERED_VI" ]]; then - alias vi_editor='eval $EDITOR ' - else - alias vi_editor="$PREFERED_VI " - fi -else - alias vi_editor="$PREFERED_VI -p " -fi -alias nvim="vi_editor " -alias vim="vi_editor " -alias vi="vi_editor " alias lessr="less --raw-control-chars " -alias ed="nvim " - alias sz-edshrc="ed ~/.sz.shrc.d ; exec $SHELL" diff --git a/_home/dot_sz.shrc.d/22_editor.aliases b/_home/dot_sz.shrc.d/22_editor.aliases new file mode 100644 index 0000000..fd267ef --- /dev/null +++ b/_home/dot_sz.shrc.d/22_editor.aliases @@ -0,0 +1,21 @@ +if [[ -n "$(type -fP emacsclient)" && -n "$(type -fP emacs)" && -n "$(type -fP edit-with-spacemacs)" ]]; then + alias vi_editor='edit-with-spacemacs' +else + PREFERED_VI=$(type -fP nvim vim | head -1) + if [[ -z "$PREFERED_VI" ]]; then + PREFERED_VI=$(type -fP vi | head -1) + + if [[ -z "$PREFERED_VI" ]]; then + alias vi_editor='eval $EDITOR ' + else + alias vi_editor="$PREFERED_VI" + fi + else + alias vi_editor="$PREFERED_VI -p" + fi +fi +alias nvim="vi_editor" +alias vim="vi_editor" +alias vi="vi_editor" + +alias ed="vi_editor" diff --git a/_home/dot_sz.shrc.d/21_gcp.shortcuts b/_home/dot_sz.shrc.d/32_gcp.shortcuts similarity index 100% rename from _home/dot_sz.shrc.d/21_gcp.shortcuts rename to _home/dot_sz.shrc.d/32_gcp.shortcuts diff --git a/_home/dot_sz.shrc.d/97_keyboard_mappings b/_home/dot_sz.shrc.d/97_keyboard_mappings new file mode 100644 index 0000000..6a475e6 --- /dev/null +++ b/_home/dot_sz.shrc.d/97_keyboard_mappings @@ -0,0 +1,5 @@ +if [[ -n "$(type -fP setxkbmap)" ]]; then + setxkbmap -option + setxkbmap -option caps:escape + setxkbmap -option caps:ctrl_modifier +fi diff --git a/_home/dot_sz.shrc.d/bash.post/99_oh-my-posh.complete b/_home/dot_sz.shrc.d/bash.post/99_oh-my-posh.complete new file mode 100644 index 0000000..c7a14fa --- /dev/null +++ b/_home/dot_sz.shrc.d/bash.post/99_oh-my-posh.complete @@ -0,0 +1 @@ +[[ -n "$(type -fP gcloud)" ]] && source <(oh-my-posh completion bash) diff --git a/_home/private_dot_local/bin/executable_edit-with-spacemacs b/_home/private_dot_local/bin/executable_edit-with-spacemacs new file mode 100644 index 0000000..93a9e81 --- /dev/null +++ b/_home/private_dot_local/bin/executable_edit-with-spacemacs @@ -0,0 +1,58 @@ +#!/bin/bash + +### +### edit-with-spacemacs, ensures a daemon named spacemacs is working +### if it's already running, the editor will open a new frame attached to it +### if it's not, it will first launch the daemon +### + +MY_EMACS_PROFILE=${CHEMACS_PROFILE:-spacemacs} +MY_SILENT="/dev/null" +MY_EMACS_CREATEFRAME="--create-frame" +MY_EMACS_NO_WAIT="--no-wait" + +# MY_SILENT="/dev/tty" +# MY_EMACS_NO_WAIT="" + +if [ "$DISPLAY" = "" ]; then + MY_EMACS_NO_WAIT="" +fi + +# set | grep '^MY_EMACS' 1>&2 + +function q_() { printf "'%s'\n" "${@}"; } + +function myemacs_full() { + + _cli="$(q_ "${@}")" + _cli="${_cli// /\\ }" + _cli=$(printf "$_cli") + # echo $_cli + _cli=$(printf "/usr/bin/emacsclient \ + --socket-name=\"$MY_EMACS_PROFILE\" \ + $MY_EMACS_CREATEFRAME \ + $MY_EMACS_NO_WAIT \ + --alternate-editor='sh -c \"( \ + /usr/bin/emacs --with-profile '$MY_EMACS_PROFILE' --daemon \ + ); echo ''Daemon started'' > $MY_SILENT; ( \ + /usr/bin/emacsclient \ + --socket-name='$MY_EMACS_PROFILE' \ + $MY_EMACS_NO_WAIT \ + --create-frame \ + ${_cli//\'/\'\'} \ + )\"' \ + $_cli" \ + ) + + # set -x + #echo $_cli + 2>$MY_SILENT eval $_cli +} + +# FRAMES was supposed to find existing frames, but it doesn't seem to work right now +# Requires more research +# +# FRAMES=$( 2>/dev/null /usr/bin/emacsclient -n -e "(if (> (length (frame-list)) 1) 't)" | grep t ) +# echo "FRAMES: {$FRAMES}" 1>&2 + +myemacs_full "${@}" diff --git a/_home/private_dot_poshtheme.omp.json b/_home/private_dot_poshtheme.omp.json index 00d7487..baf2025 100644 --- a/_home/private_dot_poshtheme.omp.json +++ b/_home/private_dot_poshtheme.omp.json @@ -12,6 +12,21 @@ "template": " {{ if .WSL }}WSL at {{ end }}{{.Icon}}", "type": "os" }, + { + "type": "command", + "foreground": "#d3d7cf", + "background": "red", + "background_templates": [ + "{{ if contains \"running\" .Output }}#FFA400{{ end }}" + ], + "powerline_symbol": "\ue0b0", + "style": "powerline", + "properties": { + "shell": "bash", + "command": "systemctl is-system-running || true" + }, + "template": "{{ if contains \"running\" .Output }}{{ else }} {{ .Output }} {{ end }}" + }, { "background": "#3465a4", "foreground": "#e4e4e4",