mirror of
https://github.com/hyprwm/hypridle.git
synced 2024-11-17 07:35:58 +01:00
e
This commit is contained in:
parent
e27b45cebe
commit
87b13086c3
1 changed files with 5 additions and 2 deletions
|
@ -487,16 +487,19 @@ void CHypridle::setupDBUS() {
|
||||||
static auto const IGNORE_DBUS_INHIBIT = **(Hyprlang::INT* const*)g_pConfigManager->getValuePtr("general:ignore_dbus_inhibit");
|
static auto const IGNORE_DBUS_INHIBIT = **(Hyprlang::INT* const*)g_pConfigManager->getValuePtr("general:ignore_dbus_inhibit");
|
||||||
static auto const IGNORE_SYSTEMD_INHIBIT = **(Hyprlang::INT* const*)g_pConfigManager->getValuePtr("general:ignore_systemd_inhibit");
|
static auto const IGNORE_SYSTEMD_INHIBIT = **(Hyprlang::INT* const*)g_pConfigManager->getValuePtr("general:ignore_systemd_inhibit");
|
||||||
|
|
||||||
auto proxy = sdbus::createProxy(sdbus::ServiceName{"org.freedesktop.login1"}, sdbus::ObjectPath{"/org/freedesktop/login1"});
|
auto systemConnection = sdbus::createSystemBusConnection();
|
||||||
|
auto proxy = sdbus::createProxy(*systemConnection, sdbus::ServiceName{"org.freedesktop.login1"}, sdbus::ObjectPath{"/org/freedesktop/login1"});
|
||||||
sdbus::ObjectPath path;
|
sdbus::ObjectPath path;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
proxy->callMethod("GetSession").onInterface("org.freedesktop.login1.Manager").storeResultsTo(path);
|
proxy->callMethod("GetSession").onInterface("org.freedesktop.login1.Manager").withArguments(std::string{"auto"}).storeResultsTo(path);
|
||||||
|
|
||||||
m_sDBUSState.connection->addMatch("type='signal',path='" + path + "',interface='org.freedesktop.login1.Session'", ::handleDbusLogin);
|
m_sDBUSState.connection->addMatch("type='signal',path='" + path + "',interface='org.freedesktop.login1.Session'", ::handleDbusLogin);
|
||||||
m_sDBUSState.connection->addMatch("type='signal',path='/org/freedesktop/login1',interface='org.freedesktop.login1.Manager'", ::handleDbusSleep);
|
m_sDBUSState.connection->addMatch("type='signal',path='/org/freedesktop/login1',interface='org.freedesktop.login1.Manager'", ::handleDbusSleep);
|
||||||
} catch (std::exception& e) { Debug::log(WARN, "Couldn't connect to logind service ({})", e.what()); }
|
} catch (std::exception& e) { Debug::log(WARN, "Couldn't connect to logind service ({})", e.what()); }
|
||||||
|
|
||||||
|
systemConnection.reset();
|
||||||
|
|
||||||
Debug::log(LOG, "Using dbus path {}", path.c_str());
|
Debug::log(LOG, "Using dbus path {}", path.c_str());
|
||||||
|
|
||||||
if (!IGNORE_SYSTEMD_INHIBIT) {
|
if (!IGNORE_SYSTEMD_INHIBIT) {
|
||||||
|
|
Loading…
Reference in a new issue