diff --git a/script.py b/script.py index a74eede3..4aebb772 100755 --- a/script.py +++ b/script.py @@ -14,7 +14,10 @@ script_folder = "scripts" db_ext = ".txt" userhome = os.path.expanduser("~") -username = pwd.getpwuid( os.getuid() )[ 0 ] +if os.getuid() != 0: + username = pwd.getpwuid( os.getuid() )[ 0 ] +else: + username = os.getenv("SUDO_USER") useros = platform.linux_distribution() useros = useros[0].strip('"') theme = Gtk.IconTheme.get_default()