diff options
author | zsmith <zsmith@newhopechurch.tv> | 2025-08-11 09:26:05 -0500 |
---|---|---|
committer | zsmith <zsmith@newhopechurch.tv> | 2025-08-11 09:26:05 -0500 |
commit | 15e94d2694f8e84b0fa4454200c1c5bd0c449089 (patch) | |
tree | d25464c3943ecf7e608f7121c8912ec8aeaad39f /scroll/scripts/scratchpad.lua | |
parent | 1fc7faa161550f0b43fcfa5b31f58035ddcbd2bc (diff) |
Remove everything not Mac compatible
Diffstat (limited to 'scroll/scripts/scratchpad.lua')
-rw-r--r-- | scroll/scripts/scratchpad.lua | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/scroll/scripts/scratchpad.lua b/scroll/scripts/scratchpad.lua deleted file mode 100644 index 0afaa97..0000000 --- a/scroll/scripts/scratchpad.lua +++ /dev/null @@ -1,66 +0,0 @@ -local args, _ = ... -local id = "" -local terminal = false -local command = nil - -for i, arg in ipairs(args) do - if i <= 1 then - id = arg - if #args == 1 then - command = arg - end - elseif i == 2 then - if (arg == "kitty") then - terminal = true - else - command = arg - end - elseif (terminal == true) then - command = arg - break - end -end - -command = command or "kitty" - -local function exists(id) - local is_in_scratchpad = false - local cons = scroll.scratchpad_get_containers() - for _, con in ipairs(cons) do - local views = scroll.container_get_views(con) - for _, view in ipairs(views) do - local app_id = scroll.view_get_app_id(view) - if (app_id == id) then - is_in_scratchpad = true - end - end - end - return is_in_scratchpad -end - -local function is_focused(id) - local view = scroll.focused_view() - local app_id = scroll.view_get_app_id(view) - return app_id == id -end - -local function spawn(term, comm) - if (term) then - if (comm) then - scroll.command(nil, "exec kitty --class " .. id .. " -e " .. comm) - else - scroll.command(nil, "exec kitty --class " .. id) - end - else - scroll.command(nil, "exec " .. comm) - end -end - -if (not exists(id)) then - spawn(terminal, command) -end -if (is_focused(id)) then - scroll.command(nil, "scratchpad show") -else - scroll.command(nil, "[app_id=\"" .. id .. "\"] scratchpad show") -end |