feat: Remove the hyprmonitors-curl
This commit is contained in:
@@ -164,50 +164,5 @@ in {
|
|||||||
hyprmonitors-logs = "journalctl --user -u hyprmonitors.service -f";
|
hyprmonitors-logs = "journalctl --user -u hyprmonitors.service -f";
|
||||||
hyprmonitors-test = "curl http://${cfg.host}:${toString cfg.port}/health";
|
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
|
|
||||||
'')
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user