nix-config/run-emacsclient

19 lines
444 B
Text
Raw Normal View History

2020-11-28 15:08:09 -08:00
#!/usr/bin/env bash
if [ -z "$EMACSCLIENT_OPTS" ]; then
EMACSCLIENT_OPTS="-nc"
fi
if [ $# -eq 0 ]; then
COMMAND='/Users/salar/.nix-profile/bin/emacsclient '$EMACSCLIENT_OPTS' -e "(if (display-graphic-p) (x-focus-frame nil))"'
else
COMMAND='/Users/salar/.nix-profile/bin/emacsclient '$EMACSCLIENT_OPTS' "$@"'
fi
if [ -z "$(shopt | grep login_shell)" ]; then
echo "$COMMAND" | exec bash --login -s "$@"
else
eval "exec $COMMAND"
fi