diff options
| author | Aaron Tulino <13600347+aaronjamt@users.noreply.github.com> | 2025-02-21 07:20:11 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-21 15:20:11 +0100 |
| commit | 2cfa5d2408cd3e213aa0c87076ce9ada0dc08e20 (patch) | |
| tree | 79bcf5d54bcb9700292ef116a1376b9da0112e12 /hyprctl | |
| parent | fa246cb6ed5f486aad27c11dd46b3a26768a15d1 (diff) | |
hyprctl: Add IPC support for Hyprsunset (#9315)
* Add IPC support for Hyprsunset
* clang-format
* Add documentation
Diffstat (limited to 'hyprctl')
| -rw-r--r-- | hyprctl/Strings.hpp | 11 | ||||
| -rw-r--r-- | hyprctl/main.cpp | 8 |
2 files changed, 19 insertions, 0 deletions
diff --git a/hyprctl/Strings.hpp b/hyprctl/Strings.hpp index f77626a5..c70ca737 100644 --- a/hyprctl/Strings.hpp +++ b/hyprctl/Strings.hpp @@ -22,6 +22,7 @@ commands: getoption <option> → Gets the config option status (values) globalshortcuts → Lists all global shortcuts hyprpaper ... → Issue a hyprpaper request + hyprsunset ... → Issue a hyprsunset request instances → Lists all running instances of Hyprland with their info keyword <name> <value> → Issue a keyword to call a config keyword @@ -81,6 +82,16 @@ requests: flags: See 'hyprctl --help')#"; +const std::string_view HYPRSUNSET_HELP = R"#(usage: hyprctl [flags] hyprsunset <request> + +requests: + temperature <temp> → Enable blue-light filter + identity → Disable blue-light filter + gamma <gamma> → Enable gamma filter + +flags: + See 'hyprctl --help')#"; + const std::string_view NOTIFY_HELP = R"#(usage: hyprctl [flags] notify <icon> <time_ms> <color> <message...> icon: diff --git a/hyprctl/main.cpp b/hyprctl/main.cpp index ac88f1da..517773d3 100644 --- a/hyprctl/main.cpp +++ b/hyprctl/main.cpp @@ -282,6 +282,10 @@ int requestHyprpaper(std::string arg) { return requestIPC(".hyprpaper.sock", arg); } +int requestHyprsunset(std::string arg) { + return requestIPC(".hyprsunset.sock", arg); +} + void batchRequest(std::string arg, bool json) { std::string commands = arg.substr(arg.find_first_of(' ') + 1); @@ -386,6 +390,8 @@ int main(int argc, char** argv) { if (cmd == "hyprpaper") { std::println("{}", HYPRPAPER_HELP); + } else if (cmd == "hyprsunset") { + std::println("{}", HYPRSUNSET_HELP); } else if (cmd == "notify") { std::println("{}", NOTIFY_HELP); } else if (cmd == "output") { @@ -467,6 +473,8 @@ int main(int argc, char** argv) { batchRequest(fullRequest, json); else if (fullRequest.contains("/hyprpaper")) exitStatus = requestHyprpaper(fullRequest); + else if (fullRequest.contains("/hyprsunset")) + exitStatus = requestHyprsunset(fullRequest); else if (fullRequest.contains("/switchxkblayout")) exitStatus = request(fullRequest, 2); else if (fullRequest.contains("/seterror")) |
