Suppress message "Unable to init server: Could not connect: Connection refused"
BleachBit uses Gtk.RecentManager
to remove items. RecentManager
works without GUI, but importing it still shows this confusing connection error to users.
In [1]: import gi
...: gi.require_version('Gtk', '3.0')
...: from gi.repository.Gtk import RecentManager
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused
In [2]: RecentManager().get_items()
Out[2]: [<Gtk.RecentInfo object at 0x7f0b020e6880 (GtkRecentInfo at 0x55ee4122bc30)>]
BleachBit runs in CLI mode, and this warning is shown when people run cleaners with sudo
.
Is it possible to suppress the warning? Or delay the connection (lazy load) until it is needed?