hyprctl: don't return empty str if there are no global shortcuts
fixes #6043
This commit is contained in:
parent
d01f9943e1
commit
e59623d1d5
1 changed files with 4 additions and 1 deletions
|
|
@ -811,8 +811,11 @@ static std::string globalShortcutsRequest(eHyprCtlOutputFormat format, std::stri
|
||||||
std::string ret = "";
|
std::string ret = "";
|
||||||
const auto SHORTCUTS = PROTO::globalShortcuts->getAllShortcuts();
|
const auto SHORTCUTS = PROTO::globalShortcuts->getAllShortcuts();
|
||||||
if (format == eHyprCtlOutputFormat::FORMAT_NORMAL) {
|
if (format == eHyprCtlOutputFormat::FORMAT_NORMAL) {
|
||||||
for (auto const& sh : SHORTCUTS)
|
for (auto const& sh : SHORTCUTS) {
|
||||||
ret += std::format("{}:{} -> {}\n", sh.appid, sh.id, sh.description);
|
ret += std::format("{}:{} -> {}\n", sh.appid, sh.id, sh.description);
|
||||||
|
}
|
||||||
|
if (ret.empty())
|
||||||
|
ret = "none";
|
||||||
} else {
|
} else {
|
||||||
ret += "[";
|
ret += "[";
|
||||||
for (auto const& sh : SHORTCUTS) {
|
for (auto const& sh : SHORTCUTS) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue