diff --git a/emails b/emails index aab9db4..a18ff00 100755 --- a/emails +++ b/emails @@ -1,5 +1,5 @@ #!/bin/sh # We setup xauthority file to display stuff -xauthority="$(cat ~/.Xauthority)" -exec sudo -u emails sh -c "echo \"$xauthority\" > ~/.Xauthority && . ~/.bashrc && exec aerc" +auth="$(xauth extract - "$DISPLAY" | base64)" +exec sudo -u emails sh -c "echo -n '$auth' | base64 -d > ~/.Xauthority && . ~/.bashrc && cd ~/attachements && exec aerc"