Merge pull request #483 from rubyist/json-when-no-activewindow

Have hyprctl -j activewindows return empty json object if there are no activewindows
This commit is contained in:
Vaxry 2022-08-06 21:56:16 +02:00 committed by GitHub
commit 3829b1626e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -157,7 +157,7 @@ std::string activeWindowRequest(HyprCtl::eHyprCtlOutputFormat format) {
const auto PWINDOW = g_pCompositor->m_pLastWindow;
if (!g_pCompositor->windowValidMapped(PWINDOW))
return "Invalid";
return format == HyprCtl::FORMAT_JSON ? "{}" : "Invalid";
if (format == HyprCtl::FORMAT_JSON) {
return getFormat(