hyprctl: add getprop (#11394)

This commit is contained in:
Luke Barkess 2025-08-18 16:41:17 +01:00 committed by GitHub
parent d890178610
commit 21953ddf3d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 272 additions and 0 deletions

View file

@ -49,6 +49,7 @@ commands:
the same format as in colors in config. Will reset
when Hyprland's config is reloaded
setprop ... Sets a window property
getprop ... Gets a window property
splash Get the current splash
switchxkblayout ... Sets the xkb layout index for a keyboard
systeminfo Get system info
@ -159,6 +160,18 @@ lock:
flags:
See 'hyprctl --help')#";
const std::string_view GETPROP_HELP = R"#(usage: hyprctl [flags] getprop <regex> <property>
regex:
Regular expression by which a window will be searched
property:
See https://wiki.hypr.land/Configuring/Using-hyprctl/#setprop for list
of properties
flags:
See 'hyprctl --help')#";
const std::string_view SWITCHXKBLAYOUT_HELP = R"#(usage: [flags] switchxkblayout <device> <cmd>
device:

View file

@ -427,6 +427,8 @@ int main(int argc, char** argv) {
std::println("{}", PLUGIN_HELP);
} else if (cmd == "setprop") {
std::println("{}", SETPROP_HELP);
} else if (cmd == "getprop") {
std::println("{}", GETPROP_HELP);
} else if (cmd == "switchxkblayout") {
std::println("{}", SWITCHXKBLAYOUT_HELP);
} else {