From ce2e4a4558e8b811f803f7966a1fca0fd2c5047a Mon Sep 17 00:00:00 2001 From: Ari Sosnovsky Date: Sat, 12 Sep 2026 19:02:24 -0400 Subject: [PATCH] v0 of the first tvos --- configs/fwbook/hypr/conf/env.lua | 2 +- configs/fwbook/hypr/hyprland.lua | 1 + configs/hl-fws1/hypr/conf/apps.lua | 20 +++++++++----------- configs/hl-fws1/hypr/skygqts-carousel.json | 12 ++++++------ flake.lock | 8 ++++---- 5 files changed, 21 insertions(+), 22 deletions(-) diff --git a/configs/fwbook/hypr/conf/env.lua b/configs/fwbook/hypr/conf/env.lua index deff344..ff35167 100644 --- a/configs/fwbook/hypr/conf/env.lua +++ b/configs/fwbook/hypr/conf/env.lua @@ -23,7 +23,7 @@ end ---@param url string ---@return fun(w: HL.Window): boolean local function make_target_validation_for_chromium_apps(url) - local host = url:match("^https?://([^/]+)") + local host = url:match("^https?://([^/:]+)") local host_pattern = escape_pattern(host) ---@param w HL.Window ---@return boolean diff --git a/configs/fwbook/hypr/hyprland.lua b/configs/fwbook/hypr/hyprland.lua index e5af201..68adfae 100644 --- a/configs/fwbook/hypr/hyprland.lua +++ b/configs/fwbook/hypr/hyprland.lua @@ -10,3 +10,4 @@ require("conf/inputs") require("conf/window-rules") require("conf/keybindings") require("conf/autostart") +require("/home/ari/nixos-setup/configs/hl-fws1/hypr/conf/apps.lua") diff --git a/configs/hl-fws1/hypr/conf/apps.lua b/configs/hl-fws1/hypr/conf/apps.lua index 2df9d03..7c33bbe 100644 --- a/configs/hl-fws1/hypr/conf/apps.lua +++ b/configs/hl-fws1/hypr/conf/apps.lua @@ -7,7 +7,7 @@ end ---@param url string ---@return fun(w: HL.Window): boolean local function make_target_validation_for_chromium_apps(url) - local host = url:match("^https?://([^/]+)") + local host = url:match("^https?://([^/:]+)") local host_pattern = escape_pattern(host) ---@param w HL.Window ---@return boolean @@ -21,25 +21,24 @@ end ---Focus an already-tagged window if one exists. ---@param tag string ----@return boolean +---@return HL.Window | nil local function attempt_to_switch_to_existing(tag) local existing = hl.get_windows({ tag = tag }) - if existing and #existing > 0 then - hl.dispatch(hl.dsp.focus({ window = existing[1] })) - return true + return existing[1] end - return false + return nil end ---@param tag string ---@param cmd string ---@param is_target_window fun(w: HL.Window): boolean ----@return fun() +---@return fun(): hl.DispatcherValue local function make_commandable(tag, cmd, is_target_window) return function() - if attempt_to_switch_to_existing(tag) then - return + local existing = attempt_to_switch_to_existing(tag) + if existing ~= nil then + return hl.dsp.focus({ window = existing }) end ---@type HL.EventSubscription @@ -52,7 +51,6 @@ local function make_commandable(tag, cmd, is_target_window) if not is_target_window(w) then return -- not our window, keep listening end - hl.notification.create({ title = cmd, text = "Window opened", color = 1 }) sub:remove() timeout:set_enabled(false) hl.dispatch(hl.dsp.window.tag({ tag = "+" .. tag, window = w })) @@ -62,7 +60,7 @@ local function make_commandable(tag, cmd, is_target_window) sub:remove() end, { timeout = 5000, type = "oneshot" }) - hl.dispatch(hl.dsp.exec_cmd(cmd)) + return hl.dsp.exec_cmd(cmd) end end diff --git a/configs/hl-fws1/hypr/skygqts-carousel.json b/configs/hl-fws1/hypr/skygqts-carousel.json index d290947..92f5a2b 100644 --- a/configs/hl-fws1/hypr/skygqts-carousel.json +++ b/configs/hl-fws1/hypr/skygqts-carousel.json @@ -5,32 +5,32 @@ { "name": "Sosnovsky Video", "image": "/home/ari/.config/hypr/images/jellyfin.png", - "exec": ["hyprctl", "eval", "'CarouselApps.jellyfin()'"] + "hyprlandDispatch": "CarouselApps.jellyfin()" }, { "name": "Netflix", "image": "/home/ari/.config/hypr/images/Netflix.svg", - "exec": ["hyprctl", "eval", "'CarouselApps.netflix()'"] + "hyprlandDispatch": "CarouselApps.netflix()" }, { "name": "Paramount+", "image": "https://www.paramountplus.com/assets/pplus/PPlus_Logo_1200x630_BLUE.png", - "exec": ["hyprctl", "eval", "'CarouselApps.paramountplus()'"] + "hyprlandDispatch": "CarouselApps.paramountplus()" }, { "name": "Prime Video", "image": "https://m.media-amazon.com/images/G/01/digital/video/DVUI/favicons/mstile-310x150.png", - "exec": ["hyprctl", "eval", "'CarouselApps.primevideo()'"] + "hyprlandDispatch": "CarouselApps.primevideo()" }, { "name": "YouTube", "image": "/home/ari/.config/hypr/images/youtube.webp", - "exec": ["hyprctl", "eval", "'CarouselApps.youtube()'"] + "hyprlandDispatch": "CarouselApps.youtube()" }, { "name": "Chromium", "image": "/home/ari/.config/hypr/images/Chromium.svg", - "exec": ["hyprctl", "eval", "'CarouselApps.chromium()'"] + "hyprlandDispatch": "CarouselApps.chromium()" }, { "name": "Spotify", diff --git a/flake.lock b/flake.lock index cd70400..394f0fe 100644 --- a/flake.lock +++ b/flake.lock @@ -1824,11 +1824,11 @@ ] }, "locked": { - "lastModified": 1789155631, - "narHash": "sha256-a41FlYSbWsIv2qXO6NOmPPNpxwUpCTuDk/r/Gr9wrYs=", + "lastModified": 1789253894, + "narHash": "sha256-BeVVFNhJWN4TIci9Y+aC36ir8OlPzcMjerO7M4Bx2C4=", "ref": "refs/heads/main", - "rev": "ca9047901ad587772daa64fc6b0403e8607e6f2a", - "revCount": 9, + "rev": "70a6437c7f2e6914d956e07df33fb73d1f7cf251", + "revCount": 11, "type": "git", "url": "ssh://gitea@minipc1.lab.internal:22/ari/skygqts.git" },