From 0e4a894edb44f4fedfca597f41889d3668b36b17 Mon Sep 17 00:00:00 2001 From: vaxerski Date: Wed, 5 Oct 2022 10:31:47 +0100 Subject: [PATCH] add dpms per output --- src/managers/KeybindManager.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index 5a2d10a3..476ad9d5 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -1568,9 +1568,18 @@ void CKeybindManager::toggleOpaque(std::string unused) { } void CKeybindManager::dpms(std::string arg) { - bool enable = arg == "on"; + bool enable = arg.find("on") == 0; + std::string port = ""; + + if (arg.find_first_of(' ') != std::string::npos) { + port = arg.substr(arg.find_first_of(' ') + 1); + } for (auto& m : g_pCompositor->m_vMonitors) { + + if (!port.empty() && m->szName != port) + continue; + wlr_output_enable(m->output, enable); if (!wlr_output_commit(m->output)) {