hyprland and dms configuration
This commit is contained in:
@@ -1,31 +1,109 @@
|
||||
hl.config({ autogenerated = false })
|
||||
|
||||
-- DMS_STARTUP_BEGIN
|
||||
hl.on("hyprland.start", function()
|
||||
hl.exec_cmd("dbus-update-activation-environment --systemd --all")
|
||||
-- hl.exec_cmd("systemctl --user start hyprland-session.target")
|
||||
end)
|
||||
-- DMS_STARTUP_END
|
||||
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 ----
|
||||
------------------
|
||||
require("hyprland-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 ----
|
||||
---------------------
|
||||
|
||||
-- Set programs that you use
|
||||
local terminal = "kitty"
|
||||
local fileManager = "dolphin"
|
||||
local menu = "hyprlauncher"
|
||||
programs = {
|
||||
terminal = "kitty",
|
||||
explorer = "nemo",
|
||||
menu = "dms ipc call launcher toggle",
|
||||
browser = "librewolf",
|
||||
calculator = "qalculate-gtk",
|
||||
}
|
||||
|
||||
-------------------
|
||||
---- Variables ----
|
||||
-------------------
|
||||
require("hyprland-variables")
|
||||
local vars = require("hyprland-variables")
|
||||
|
||||
-------------------
|
||||
---- AUTOSTART ----
|
||||
@@ -37,58 +115,10 @@ require("hyprland-autostart")
|
||||
-------------------------------
|
||||
require("hyprland-environment-variables")
|
||||
|
||||
-----------------------
|
||||
----- PERMISSIONS -----
|
||||
-----------------------
|
||||
require("hyprland-permissions")
|
||||
|
||||
-----------------------
|
||||
---- LOOK AND FEEL ----
|
||||
-----------------------
|
||||
|
||||
|
||||
hl.config({
|
||||
input = {
|
||||
-- empty inherits XKB_DEFAULT_LAYOUT (libxkbcommon), falls back to "us"
|
||||
kb_layout = "de",
|
||||
numlock_by_default = true,
|
||||
follow_mouse = 0,
|
||||
touchpad = {
|
||||
tap_to_click = true,
|
||||
natural_scroll = true,
|
||||
},
|
||||
},
|
||||
general = {
|
||||
gaps_in = 5,
|
||||
gaps_out = 5,
|
||||
border_size = 2,
|
||||
layout = "dwindle",
|
||||
},
|
||||
decoration = {
|
||||
rounding = 12,
|
||||
active_opacity = 1.0,
|
||||
inactive_opacity = 1.0,
|
||||
shadow = {
|
||||
enabled = true,
|
||||
range = 30,
|
||||
render_power = 5,
|
||||
offset = "0 5",
|
||||
color = "rgba(00000070)",
|
||||
},
|
||||
},
|
||||
misc = {
|
||||
disable_hyprland_logo = true,
|
||||
disable_splash_rendering = true,
|
||||
key_press_enables_dpms = true,
|
||||
mouse_move_enables_dpms = true,
|
||||
},
|
||||
dwindle = {
|
||||
preserve_split = true,
|
||||
},
|
||||
master = {
|
||||
mfact = 0.5,
|
||||
},
|
||||
})
|
||||
hl.config(vars)
|
||||
|
||||
hl.animation({ leaf = "windowsIn", enabled = true, speed = 3, bezier = "default" })
|
||||
hl.animation({ leaf = "windowsOut", enabled = true, speed = 3, bezier = "default" })
|
||||
@@ -97,35 +127,28 @@ hl.animation({ leaf = "windowsMove", enabled = true, speed = 4, bezier = "defaul
|
||||
hl.animation({ leaf = "fade", enabled = true, speed = 3, bezier = "default" })
|
||||
hl.animation({ leaf = "border", enabled = true, speed = 3, bezier = "default" })
|
||||
|
||||
hl.window_rule({ match = { class = "^(org\\.wezfurlong\\.wezterm)$" }, tile = true })
|
||||
hl.window_rule({ match = { class = "^(org\\.gnome\\.)" }, rounding = 12 })
|
||||
hl.window_rule({ match = { class = "^(gnome-control-center)$" }, tile = true })
|
||||
hl.window_rule({ match = { class = "^(pavucontrol)$" }, tile = true })
|
||||
hl.window_rule({ match = { class = "^(nm-connection-editor)$" }, tile = true })
|
||||
hl.window_rule({ match = { class = "^(org\\.gnome\\.Calculator)$" }, float = true })
|
||||
hl.window_rule({ match = { class = "^(gnome-calculator)$" }, float = true })
|
||||
hl.window_rule({ match = { class = "^(galculator)$" }, float = true })
|
||||
hl.window_rule({ match = { class = "^(blueman-manager)$" }, float = true })
|
||||
hl.window_rule({ match = { class = "^(org\\.gnome\\.Nautilus)$" }, float = true })
|
||||
hl.window_rule({ match = { class = "^(xdg-desktop-portal)$" }, float = true })
|
||||
hl.window_rule({
|
||||
match = { class = "^(steam)$", title = "^(notificationtoasts)" },
|
||||
no_initial_focus = true,
|
||||
pin = true,
|
||||
})
|
||||
hl.window_rule({
|
||||
match = { class = "^(firefox)$", title = "^(Picture-in-Picture)$" },
|
||||
float = true,
|
||||
})
|
||||
hl.window_rule({ match = { class = "^(zoom)$" }, float = true })
|
||||
------------------
|
||||
---- 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 })
|
||||
|
||||
require("dms.colors")
|
||||
--require("dms.outputs")
|
||||
require("dms.layout")
|
||||
require("dms.cursor")
|
||||
require("dms.binds")
|
||||
require("dms.binds-user")
|
||||
require("dms.windowrules")
|
||||
------------------
|
||||
---- 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")
|
||||
|
||||
Reference in New Issue
Block a user