Add Omarchy Hyprland bindings
This commit is contained in:
@@ -1,3 +1,21 @@
|
||||
sjb = sjb or {}
|
||||
|
||||
local function file_exists(path)
|
||||
local file = io.open(path, "r")
|
||||
if file then
|
||||
file:close()
|
||||
return true
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
function sjb.omarchy_tools_available()
|
||||
return file_exists("/usr/bin/omarchy-menu")
|
||||
end
|
||||
|
||||
sjb.HYPR = "SUPER + CONTROL + SHIFT + ALT + "
|
||||
|
||||
function sysinfo()
|
||||
local mem = io.popen("free -h | awk '/^Mem/ {print $3 \"/\" $2}'"):read("*a")
|
||||
local cpu = io.popen("top -bn1 | grep 'Cpu(s)' | awk '{print $2 + $4 \"%\"}'"):read("*a")
|
||||
@@ -191,8 +209,9 @@ function window_resize_percentage(px, py)
|
||||
end
|
||||
|
||||
function toggle_master_scrolling()
|
||||
local current = hl.get_config("general.layout")
|
||||
local next_layout = current == "master" and "scrolling" or "master"
|
||||
local ws = hl.get_active_workspace()
|
||||
|
||||
hl.config({ general = { layout = next_layout } })
|
||||
local next_layout = ws.tiled_layout == "master" and "scrolling" or "master"
|
||||
hl.notification.create({ text = "Workspace layout set to " .. next_layout, icon = "hint", duration = 5000 })
|
||||
hl.workspace_rule({ workspace = ws.id, layout = next_layout })
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user