155 lines
3.5 KiB
Lua
155 lines
3.5 KiB
Lua
hl.config({ autogenerated = false })
|
|
|
|
debug_flag = true
|
|
|
|
-------------------
|
|
---- FUNCTIONS ----
|
|
-------------------
|
|
function debug_notify(message)
|
|
if debug_flag and message ~= nil then
|
|
-- hl.notification.create({text = message, timeout = 30000})
|
|
hl.exec_cmd("echo '" .. message .. "' >> /tmp/hyprland-notify.log")
|
|
end
|
|
end
|
|
|
|
function map(list, fn)
|
|
local out = {}
|
|
for i, v in ipairs(list) do
|
|
out[i] = fn(v, i)
|
|
end
|
|
return out
|
|
end
|
|
|
|
function any(values, predicate)
|
|
if values == nil then
|
|
return false
|
|
end
|
|
|
|
for _, value in ipairs(values) do
|
|
if predicate(value) then
|
|
return true
|
|
end
|
|
end
|
|
|
|
return false
|
|
end
|
|
|
|
function all(values, predicate)
|
|
return not any(values, function(v)
|
|
return not predicate(v)
|
|
end)
|
|
end
|
|
|
|
function starts_with(haystack, needle)
|
|
if haystack == nil then
|
|
return false
|
|
elseif needle == nil then
|
|
return true
|
|
end
|
|
return string.sub(haystack, 1, #needle) == needle
|
|
end
|
|
|
|
---------------
|
|
---- HOOKS ----
|
|
---------------
|
|
|
|
function on_start()
|
|
hl.exec_cmd("dbus-update-activation-environment --systemd --all")
|
|
end
|
|
|
|
function submap_toast(submap)
|
|
submap = submap or hl.get_current_submap()
|
|
|
|
if submap ~= "" then
|
|
message = "Submap: " .. submap
|
|
hl.exec_cmd("dms ipc call toast warnWith \"" .. message .. "\" \"\" \"\" submap")
|
|
else
|
|
hl.exec_cmd("dms ipc call toast dismiss submap")
|
|
end
|
|
end
|
|
|
|
hl.on("hyprland.start", on_start)
|
|
hl.on("keybinds.submap", submap_toast)
|
|
|
|
------------------
|
|
---- MONITORS ----
|
|
------------------
|
|
|
|
-- By default, only the laptop screen is active and no other screen
|
|
-- will be actived. Activation of different monitor layouts is deferred
|
|
-- to other scripts, so to automate profile switching and provide some
|
|
-- stable fallbacks
|
|
--[[
|
|
hl.monitor({
|
|
output = "eDP-1",
|
|
mode = "1920x1200@120",
|
|
position = "0x0",
|
|
scale = "1",
|
|
disabled = false,
|
|
})
|
|
]]
|
|
|
|
---------------------
|
|
---- MY PROGRAMS ----
|
|
---------------------
|
|
programs = {
|
|
terminal = "kitty",
|
|
explorer = "nemo",
|
|
menu = "dms ipc call launcher toggle",
|
|
browser = "librewolf",
|
|
calculator = "qalculate-gtk",
|
|
}
|
|
|
|
-------------------
|
|
---- Variables ----
|
|
-------------------
|
|
local vars = require("hyprland-variables")
|
|
|
|
-------------------
|
|
---- AUTOSTART ----
|
|
-------------------
|
|
require("hyprland-autostart")
|
|
|
|
-------------------------------
|
|
---- ENVIRONMENT VARIABLES ----
|
|
-------------------------------
|
|
require("hyprland-environment-variables")
|
|
|
|
-----------------------
|
|
---- LOOK AND FEEL ----
|
|
-----------------------
|
|
hl.config(vars)
|
|
|
|
hl.animation({ leaf = "windowsIn", enabled = true, speed = 3, bezier = "default" })
|
|
hl.animation({ leaf = "windowsOut", enabled = true, speed = 3, bezier = "default" })
|
|
hl.animation({ leaf = "workspaces", enabled = true, speed = 5, bezier = "default" })
|
|
hl.animation({ leaf = "windowsMove", enabled = true, speed = 4, bezier = "default" })
|
|
hl.animation({ leaf = "fade", enabled = true, speed = 3, bezier = "default" })
|
|
hl.animation({ leaf = "border", enabled = true, speed = 3, bezier = "default" })
|
|
|
|
------------------
|
|
---- KEYBINDS ----
|
|
------------------
|
|
require("hyprland-binds")
|
|
|
|
----------------------
|
|
---- WINDOW RULES ----
|
|
----------------------
|
|
require("hyprland-windowrules")
|
|
hl.layer_rule({ match = { namespace = "^(quickshell)$" }, no_anim = true })
|
|
hl.layer_rule({ match = { namespace = "^dms:.*" }, no_anim = true })
|
|
|
|
------------------
|
|
---- MONITORS ----
|
|
------------------
|
|
require("hyprland-monitors")
|
|
|
|
|
|
-- require("dms.colors")
|
|
-- require("dms.outputs")
|
|
-- require("dms.layout")
|
|
-- require("dms.cursor")
|
|
-- require("dms.binds")
|
|
-- require("dms.binds-user")
|
|
-- require("dms.windowrules")
|