Specify the display before the application: DISPLAY=:0 btdownloadgui.py