A mixed bad of updates
= Housekeeping, missing shrc.d and some changing in order. Most notably, split of editor aliases to separate file. + The missing .shrc.d files that were added: * keyboard mappings * bin.path - which includes cleanup * oh-my-posh compltions + edit-with-spacemacs ready for us, almost feature complete I still plan on making it resue existing frames is possible. + oh-my-posh config to include `systemctl is-system-running` to prompt when stat is not 'running' (mostly it will be shown when 'degraded')
This commit is contained in:
parent
8cb6f49db9
commit
f445d39fc6
8 changed files with 109 additions and 17 deletions
58
_home/private_dot_local/bin/executable_edit-with-spacemacs
Normal file
58
_home/private_dot_local/bin/executable_edit-with-spacemacs
Normal file
|
@ -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 "${@}"
|
Loading…
Add table
Add a link
Reference in a new issue