mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-23 04:09:49 +01:00
added a dpms dispatcher
This commit is contained in:
parent
217ff1f401
commit
2e3d42a9a9
2 changed files with 15 additions and 1 deletions
|
@ -36,6 +36,7 @@ CKeybindManager::CKeybindManager() {
|
||||||
m_mDispatchers["pass"] = pass;
|
m_mDispatchers["pass"] = pass;
|
||||||
m_mDispatchers["layoutmsg"] = layoutmsg;
|
m_mDispatchers["layoutmsg"] = layoutmsg;
|
||||||
m_mDispatchers["toggleopaque"] = toggleOpaque;
|
m_mDispatchers["toggleopaque"] = toggleOpaque;
|
||||||
|
m_mDispatchers["dpms"] = dpms;
|
||||||
|
|
||||||
m_tScrollTimer.reset();
|
m_tScrollTimer.reset();
|
||||||
}
|
}
|
||||||
|
@ -1325,3 +1326,15 @@ void CKeybindManager::toggleOpaque(std::string unused) {
|
||||||
|
|
||||||
g_pHyprRenderer->damageWindow(PWINDOW);
|
g_pHyprRenderer->damageWindow(PWINDOW);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CKeybindManager::dpms(std::string arg) {
|
||||||
|
bool enable = arg == "on";
|
||||||
|
|
||||||
|
for (auto& m : g_pCompositor->m_vMonitors) {
|
||||||
|
wlr_output_enable(m->output, enable);
|
||||||
|
|
||||||
|
if (!wlr_output_commit(m->output)) {
|
||||||
|
Debug::log(ERR, "Couldn't commit output %s", m->szName.c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -98,6 +98,7 @@ private:
|
||||||
static void pass(std::string);
|
static void pass(std::string);
|
||||||
static void layoutmsg(std::string);
|
static void layoutmsg(std::string);
|
||||||
static void toggleOpaque(std::string);
|
static void toggleOpaque(std::string);
|
||||||
|
static void dpms(std::string);
|
||||||
|
|
||||||
friend class CCompositor;
|
friend class CCompositor;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue