mirror of
https://github.com/end-4/dots-hyprland.git
synced 2026-06-05 14:59:27 -05:00
26 lines
916 B
Lua
26 lines
916 B
Lua
function is_file_exists(name)
|
|
local f = io.open(name, "r")
|
|
if f ~= nil then
|
|
io.close(f)
|
|
return true
|
|
else
|
|
return false
|
|
end
|
|
end
|
|
|
|
function create_if_not_exists(path)
|
|
if not is_file_exists(path) then
|
|
os.execute("mkdir -p \"$(dirname \"" .. path .. "\")\"")
|
|
os.execute("echo '-- This file will not be overwritten across dots-hyprland updates.\n-- The file name is for the sake of organization and does not matter\n-- See the corresponding files in ~/.config/hypr/hyprland for examples' > \"" .. path .. "\"")
|
|
return true
|
|
end
|
|
return false
|
|
end
|
|
|
|
function workspace_in_group(i)
|
|
local curr = hl.get_active_workspace().id
|
|
local newVal = math.floor((curr - 1) / workspaceGroupSize) * workspaceGroupSize + i
|
|
-- hl.notification.create({ text = "curr " .. curr .. " floor " .. math.floor(curr / 10) .. " new " .. newVal, duration = 5000 })
|
|
return newVal
|
|
end
|