From 6bac784b51bc319bba7ab91bc1cc5ee8815a2cae Mon Sep 17 00:00:00 2001 From: eritque0arcus Date: Wed, 4 Dec 2024 12:46:09 -0600 Subject: [PATCH] fix: use auto and add self as fallback --- src/util/backlight_backend.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/util/backlight_backend.cpp b/src/util/backlight_backend.cpp index bb102cd93..41236462c 100644 --- a/src/util/backlight_backend.cpp +++ b/src/util/backlight_backend.cpp @@ -153,7 +153,13 @@ BacklightBackend::BacklightBackend(std::chrono::milliseconds interval, // Connect to the login interface login_proxy_ = Gio::DBus::Proxy::create_for_bus_sync( Gio::DBus::BusType::BUS_TYPE_SYSTEM, "org.freedesktop.login1", - "/org/freedesktop/login1/session/self", "org.freedesktop.login1.Session"); + "/org/freedesktop/login1/session/auto", "org.freedesktop.login1.Session"); + + if (!login_proxy_) { + login_proxy_ = Gio::DBus::Proxy::create_for_bus_sync( + Gio::DBus::BusType::BUS_TYPE_SYSTEM, "org.freedesktop.login1", + "/org/freedesktop/login1/session/self", "org.freedesktop.login1.Session"); + } udev_thread_ = [this] { std::unique_ptr udev{udev_new()};