diff options
-rwxr-xr-x | e | 6 | ||||
-rwxr-xr-x | edit | 6 |
2 files changed, 8 insertions, 4 deletions
@@ -1,7 +1,9 @@ #!/bin/sh +FILE=$(readlink -f "$1") + if [ $(id -u) -eq 0 ]; then - exec sudo -u neoraider emacsclient -n /sudo::$(readlink -f $1) + exec sudo -u "$SUDO_USER" emacsclient -n "/sudo::$FILE" else - exec emacsclient -n $(readlink -f $1) + exec emacsclient -n "$FILE" fi @@ -1,7 +1,9 @@ #!/bin/sh +FILE=$(readlink -f "$1") + if [ $(id -u) -eq 0 ]; then - exec sudo -u neoraider emacsclient -nw /sudo::$(readlink -f $1) + exec sudo -u "$SUDO_USER" emacsclient -nw "/sudo::$FILE" else - exec emacsclient -nw $(readlink -f $1) + exec emacsclient -nw "$FILE" fi |