From baefc81a10dbf76f198ce45f1a306fc6fc7d0bad Mon Sep 17 00:00:00 2001 From: Paul Walker Date: Tue, 10 Jan 2023 10:10:27 +0000 Subject: [PATCH] ec: rework gui/text --- bin/ec | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/ec b/bin/ec index 0fe1352..1d55a26 100755 --- a/bin/ec +++ b/bin/ec @@ -1,6 +1,8 @@ #!/bin/bash -if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then - emacsclient -a "" -t "$@" +TEXT_FLAGS='-a "" -t' +GUI_FLAGS='-n -a "" -c' +if [ -z "$DISPLAY" ]; then + emacsclient $TEXT_FLAGS "$@" else - emacsclient -n -a "" -c "$@" + emacsclient $GUI_FLAGS "$@" fi