feat: Remove the hyprmonitors-curl
Some checks failed
build / checks-build (push) Has been cancelled
build / codecov (push) Has been cancelled
build / checks-matrix (push) Has been cancelled
docs / docs (push) Has been cancelled

This commit is contained in:
uttarayan21
2025-08-16 19:51:03 +05:30
parent de11629969
commit 50f0d2173e

View File

@@ -164,50 +164,5 @@ in {
hyprmonitors-logs = "journalctl --user -u hyprmonitors.service -f";
hyprmonitors-test = "curl http://${cfg.host}:${toString cfg.port}/health";
};
# Add some helper scripts
home.packages = mkIf cfg.enable [
(pkgs.writeShellScriptBin "hyprmonitors-curl" ''
#!/usr/bin/env bash
# Helper script for testing hyprmonitors API
BASE_URL="http://${cfg.host}:${toString cfg.port}"
case "$1" in
health)
curl -s "$BASE_URL/health" | ${pkgs.jq}/bin/jq
;;
status)
curl -s "$BASE_URL/monitors/status" | ${pkgs.jq}/bin/jq
;;
on)
if [ -n "$2" ]; then
curl -s -X POST "$BASE_URL/monitors/$2/on" | ${pkgs.jq}/bin/jq
else
curl -s -X POST "$BASE_URL/monitors/on" | ${pkgs.jq}/bin/jq
fi
;;
off)
if [ -n "$2" ]; then
curl -s -X POST "$BASE_URL/monitors/$2/off" | ${pkgs.jq}/bin/jq
else
curl -s -X POST "$BASE_URL/monitors/off" | ${pkgs.jq}/bin/jq
fi
;;
*)
echo "Usage: hyprmonitors-curl {health|status|on [monitor]|off [monitor]}"
echo ""
echo "Examples:"
echo " hyprmonitors-curl health"
echo " hyprmonitors-curl status"
echo " hyprmonitors-curl on"
echo " hyprmonitors-curl off"
echo " hyprmonitors-curl on DP-1"
echo " hyprmonitors-curl off HDMI-A-1"
exit 1
;;
esac
'')
];
};
}