From ab1f68a71272aedec97fd45ff583f8f9e9942d51 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Fri, 18 Dec 2020 22:05:10 +0100 Subject: [PATCH] rotation support --- node.json | 13 +++++++++++++ node.lua | 2 ++ 2 files changed, 15 insertions(+) diff --git a/node.json b/node.json index fb64c62..b4e185e 100644 --- a/node.json +++ b/node.json @@ -41,5 +41,18 @@ "type": "string", "default": "https://icinga2/api/v1/objects/services?filter=service.state!=ServiceOK", "hint": "Full URL to the API endpoint which returns a list of monitored services. Keeping the filter is strongly recommended!" + }, { + "title": "Screen Rotation", + "ui_width": 4, + "name": "rotate", + "type": "select", + "default": 0, + "hint": "Rotation of screen (clockwise)", + "options": [ + [0, "0°"], + [90, "90°"], + [180, "180°"], + [270, "270°"] + ] }] } diff --git a/node.lua b/node.lua index 370f269..825e829 100644 --- a/node.lua +++ b/node.lua @@ -23,6 +23,7 @@ c_text[2] = {1, 1, 1} c_text[3] = {1, 1, 1} gl.setup(NATIVE_WIDTH, NATIVE_HEIGHT) +local transform = util.screen_transform(CONFIG.rotate) util.file_watch("services.json", function(content) services = json.decode(content) @@ -39,6 +40,7 @@ local white = resource.create_colored_texture(1,1,1,1) local base_time = N.base_time or 0 function node.render() + transform() CONFIG.background_color.clear() CONFIG.font:write(NATIVE_WIDTH/2-time_width/2, 10, services.prettytime, 30, 1,1,1,1)