Reply To: Fix App-select XDG_RUNTIME_DIR Error

Forum › Forums › General › Tips and Tricks › Fix App-select XDG_RUNTIME_DIR Error › Reply To: Fix App-select XDG_RUNTIME_DIR Error

#206194
sybok
Member

    One could also make the following extension:

    if 'XDG_RUNTIME_DIR' not in os.environ:
        # Display a pop-up message Gtk.MessageDialog(..., message_type=Gtk.MessageType.INFO, ...)?
        print('\nBang the drum loudly - something is wrong, "XDG_RUNTIME_DIR" not in "os.environ"!\n')
    elif os.environ['XDG_RUNTIME_DIR']:
        # Proceed as before
    else:
        # Proceed as before

    This would allow not passing the situation (and possible issue) silently.