mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-07 22:26:00 +01:00
keybinds: add toggle to dpms
This commit is contained in:
parent
bf0d8ab4a3
commit
08651736ad
1 changed files with 3 additions and 0 deletions
|
@ -1837,6 +1837,9 @@ void CKeybindManager::dpms(std::string arg) {
|
||||||
bool enable = arg.find("on") == 0;
|
bool enable = arg.find("on") == 0;
|
||||||
std::string port = "";
|
std::string port = "";
|
||||||
|
|
||||||
|
if (arg.find("toggle") == 0)
|
||||||
|
enable = !std::any_of(g_pCompositor->m_vMonitors.begin(), g_pCompositor->m_vMonitors.end(), [&](const auto& other) { return !other->dpmsStatus; }); // enable if any is off
|
||||||
|
|
||||||
if (arg.find_first_of(' ') != std::string::npos)
|
if (arg.find_first_of(' ') != std::string::npos)
|
||||||
port = arg.substr(arg.find_first_of(' ') + 1);
|
port = arg.substr(arg.find_first_of(' ') + 1);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue