mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-22 23:49:49 +01:00
add dpms per output
This commit is contained in:
parent
71e2562a41
commit
0e4a894edb
1 changed files with 10 additions and 1 deletions
|
@ -1568,9 +1568,18 @@ void CKeybindManager::toggleOpaque(std::string unused) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CKeybindManager::dpms(std::string arg) {
|
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) {
|
for (auto& m : g_pCompositor->m_vMonitors) {
|
||||||
|
|
||||||
|
if (!port.empty() && m->szName != port)
|
||||||
|
continue;
|
||||||
|
|
||||||
wlr_output_enable(m->output, enable);
|
wlr_output_enable(m->output, enable);
|
||||||
|
|
||||||
if (!wlr_output_commit(m->output)) {
|
if (!wlr_output_commit(m->output)) {
|
||||||
|
|
Loading…
Reference in a new issue