summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-10-05 18:14:11 +0100
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-10-05 18:14:11 +0100
commit11ce4689963f52a72817a9395ecccc1b034447a7 (patch)
treeb4acc7b835f85669ab73b71f75aab32d4c8c55ad /src
parent9c5023ab1acf2297e4bbcc3bcb008bbc818a1972 (diff)
add dpms status info in hyprctl
Diffstat (limited to 'src')
-rw-r--r--src/debug/HyprCtl.cpp10
-rw-r--r--src/helpers/Monitor.hpp2
-rw-r--r--src/managers/KeybindManager.cpp2
3 files changed, 10 insertions, 4 deletions
diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp
index 5dc20f22..dea74b6c 100644
--- a/src/debug/HyprCtl.cpp
+++ b/src/debug/HyprCtl.cpp
@@ -36,7 +36,8 @@ R"#({
"reserved": [%i, %i, %i, %i],
"scale": %.2f,
"transform": %i,
- "focused": %s
+ "focused": %s,
+ "dpmsStatus": %s
},)#",
m->ID,
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,
m->scale,
(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 += "]";
} else {
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",
- 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"));
+ 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"), (int)m->dpmsStatus);
}
}
diff --git a/src/helpers/Monitor.hpp b/src/helpers/Monitor.hpp
index 475dd752..a8c44bfb 100644
--- a/src/helpers/Monitor.hpp
+++ b/src/helpers/Monitor.hpp
@@ -37,6 +37,8 @@ public:
bool scheduledRecalc = false;
wl_output_transform transform = WL_OUTPUT_TRANSFORM_NORMAL;
+ bool dpmsStatus = true;
+
// mirroring
CMonitor* pMirrorOf = nullptr;
std::vector<CMonitor*> mirrors;
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp
index 476ad9d5..44124e81 100644
--- a/src/managers/KeybindManager.cpp
+++ b/src/managers/KeybindManager.cpp
@@ -1582,6 +1582,8 @@ void CKeybindManager::dpms(std::string arg) {
wlr_output_enable(m->output, enable);
+ m->dpmsStatus = enable;
+
if (!wlr_output_commit(m->output)) {
Debug::log(ERR, "Couldn't commit output %s", m->szName.c_str());
}