#!/bin/sh # We setup xauthority file to display stuff auth="$(xauth extract - "$DISPLAY" | base64)" exec sudo -u emails sh -c "echo -n '$auth' | base64 -d > ~/.Xauthority && . ~/.bashrc && cd ~/attachements && exec aerc"