summaryrefslogtreecommitdiffstats
path: root/edit
blob: 3e8d8ac9baf9f54f58e4a97a645a21281e753372 (plain)
1
2
3
4
5
6
7
8
9
#!/bin/sh

FILE=$(readlink -f "$1")

if [ $(id -u) -eq 0 ]; then
    exec sudo -u "$SUDO_USER" emacsclient -nw "/sudo::$FILE"
else
    exec emacsclient -nw "$FILE"
fi