summaryrefslogtreecommitdiff
path: root/src/managers/KeybindManager.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-07-30 23:51:13 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-07-30 23:51:13 +0200
commit2e3d42a9a9999239c4151baa1900fa0e09b1a2ec (patch)
tree10f6c92278069223bd2149ecd34b2a01be2838ad /src/managers/KeybindManager.cpp
parent217ff1f4011336e51bc65bd98fd7b931547ac45c (diff)
added a dpms dispatcher
Diffstat (limited to 'src/managers/KeybindManager.cpp')
-rw-r--r--src/managers/KeybindManager.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp
index 42ce6b89..4c8e1d6f 100644
--- a/src/managers/KeybindManager.cpp
+++ b/src/managers/KeybindManager.cpp
@@ -36,6 +36,7 @@ CKeybindManager::CKeybindManager() {
m_mDispatchers["pass"] = pass;
m_mDispatchers["layoutmsg"] = layoutmsg;
m_mDispatchers["toggleopaque"] = toggleOpaque;
+ m_mDispatchers["dpms"] = dpms;
m_tScrollTimer.reset();
}
@@ -1324,4 +1325,16 @@ void CKeybindManager::toggleOpaque(std::string unused) {
PWINDOW->m_sAdditionalConfigData.forceOpaque = !PWINDOW->m_sAdditionalConfigData.forceOpaque;
g_pHyprRenderer->damageWindow(PWINDOW);
-} \ No newline at end of file
+}
+
+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());
+ }
+ }
+}