diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2017-08-16 16:48:40 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2017-08-16 16:48:40 -0700 |
commit | 22983f8fdfd7bb13939eb5a6e97da564ca3e082a (patch) | |
tree | 30c8c1bdeaf8aba89bc1b0b77ba09221d7b7fd06 /.shenv | |
parent | 616dfeb0fa9ad2f3595b955dc9a62c54dad0f368 (diff) | |
download | dotfiles-22983f8fdfd7bb13939eb5a6e97da564ca3e082a.tar.gz |
$EDITOR launches graphical emacsclient within i3
Diffstat (limited to '.shenv')
-rwxr-xr-x | .shenv | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -8,16 +8,22 @@ set +e # ---- choose editor depending on what's available +if [ "$DESKTOP_SESSION" = "i3" ]; then + ec_args="-c" +else + ec_args="-t" +fi + emacsclient=$(which emacsclient 2>/dev/null) mg=$(which mg 2>/dev/null) # best case: emacsclient and mg available if [ -x "$emacsclient" -a -x "$mg" ]; then - EDITOR="emacsclient -amg -t" + EDITOR="emacsclient -amg $ec_args" ALTERNATE_EDITOR="mg" else # only emacsclient, so change alternate editor if [ -x "$emacsclient" ]; then - EDITOR="emacsclient -avi -t" + EDITOR="emacsclient -avi $ec_args" ALTERNATE_EDITOR="vi" else # no emacsclient, so see if we can fall back to mg @@ -30,6 +36,7 @@ else fi fi fi +unset ec_args unset emacsclient unset mg export EDITOR |