mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-23 04:29:48 +01:00
add dpms status info in hyprctl
This commit is contained in:
parent
9c5023ab1a
commit
11ce468996
3 changed files with 10 additions and 4 deletions
|
@ -36,7 +36,8 @@ R"#({
|
||||||
"reserved": [%i, %i, %i, %i],
|
"reserved": [%i, %i, %i, %i],
|
||||||
"scale": %.2f,
|
"scale": %.2f,
|
||||||
"transform": %i,
|
"transform": %i,
|
||||||
"focused": %s
|
"focused": %s,
|
||||||
|
"dpmsStatus": %s
|
||||||
},)#",
|
},)#",
|
||||||
m->ID,
|
m->ID,
|
||||||
escapeJSONStrings(m->szName).c_str(),
|
escapeJSONStrings(m->szName).c_str(),
|
||||||
|
@ -48,7 +49,8 @@ R"#({
|
||||||
(int)m->vecReservedTopLeft.x, (int)m->vecReservedTopLeft.y, (int)m->vecReservedBottomRight.x, (int)m->vecReservedBottomRight.y,
|
(int)m->vecReservedTopLeft.x, (int)m->vecReservedTopLeft.y, (int)m->vecReservedBottomRight.x, (int)m->vecReservedBottomRight.y,
|
||||||
m->scale,
|
m->scale,
|
||||||
(int)m->transform,
|
(int)m->transform,
|
||||||
(m.get() == g_pCompositor->m_pLastMonitor ? "true" : "false")
|
(m.get() == g_pCompositor->m_pLastMonitor ? "true" : "false"),
|
||||||
|
(m->dpmsStatus ? "true" : "false")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,8 +60,8 @@ R"#({
|
||||||
result += "]";
|
result += "]";
|
||||||
} else {
|
} else {
|
||||||
for (auto& m : g_pCompositor->m_vMonitors) {
|
for (auto& m : g_pCompositor->m_vMonitors) {
|
||||||
result += getFormat("Monitor %s (ID %i):\n\t%ix%i@%f at %ix%i\n\tdescription: %s\n\tactive workspace: %i (%s)\n\treserved: %i %i %i %i\n\tscale: %.2f\n\ttransform: %i\n\tfocused: %s\n\n",
|
result += getFormat("Monitor %s (ID %i):\n\t%ix%i@%f at %ix%i\n\tdescription: %s\n\tactive workspace: %i (%s)\n\treserved: %i %i %i %i\n\tscale: %.2f\n\ttransform: %i\n\tfocused: %s\n\tdpmsStatus: %i\n\n",
|
||||||
m->szName.c_str(), m->ID, (int)m->vecPixelSize.x, (int)m->vecPixelSize.y, m->refreshRate, (int)m->vecPosition.x, (int)m->vecPosition.y, (m->output->description ? m->output->description : ""), m->activeWorkspace, g_pCompositor->getWorkspaceByID(m->activeWorkspace)->m_szName.c_str(), (int)m->vecReservedTopLeft.x, (int)m->vecReservedTopLeft.y, (int)m->vecReservedBottomRight.x, (int)m->vecReservedBottomRight.y, m->scale, (int)m->transform, (m.get() == g_pCompositor->m_pLastMonitor ? "yes" : "no"));
|
m->szName.c_str(), m->ID, (int)m->vecPixelSize.x, (int)m->vecPixelSize.y, m->refreshRate, (int)m->vecPosition.x, (int)m->vecPosition.y, (m->output->description ? m->output->description : ""), m->activeWorkspace, g_pCompositor->getWorkspaceByID(m->activeWorkspace)->m_szName.c_str(), (int)m->vecReservedTopLeft.x, (int)m->vecReservedTopLeft.y, (int)m->vecReservedBottomRight.x, (int)m->vecReservedBottomRight.y, m->scale, (int)m->transform, (m.get() == g_pCompositor->m_pLastMonitor ? "yes" : "no"), (int)m->dpmsStatus);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,8 @@ public:
|
||||||
bool scheduledRecalc = false;
|
bool scheduledRecalc = false;
|
||||||
wl_output_transform transform = WL_OUTPUT_TRANSFORM_NORMAL;
|
wl_output_transform transform = WL_OUTPUT_TRANSFORM_NORMAL;
|
||||||
|
|
||||||
|
bool dpmsStatus = true;
|
||||||
|
|
||||||
// mirroring
|
// mirroring
|
||||||
CMonitor* pMirrorOf = nullptr;
|
CMonitor* pMirrorOf = nullptr;
|
||||||
std::vector<CMonitor*> mirrors;
|
std::vector<CMonitor*> mirrors;
|
||||||
|
|
|
@ -1582,6 +1582,8 @@ void CKeybindManager::dpms(std::string arg) {
|
||||||
|
|
||||||
wlr_output_enable(m->output, enable);
|
wlr_output_enable(m->output, enable);
|
||||||
|
|
||||||
|
m->dpmsStatus = enable;
|
||||||
|
|
||||||
if (!wlr_output_commit(m->output)) {
|
if (!wlr_output_commit(m->output)) {
|
||||||
Debug::log(ERR, "Couldn't commit output %s", m->szName.c_str());
|
Debug::log(ERR, "Couldn't commit output %s", m->szName.c_str());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue