mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-09 23:25:57 +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["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);
|
||||
}
|
||||
}
|
||||
|
||||
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 layoutmsg(std::string);
|
||||
static void toggleOpaque(std::string);
|
||||
static void dpms(std::string);
|
||||
|
||||
friend class CCompositor;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue