diff --git a/config/hypr/hypridle.conf b/config/hypr/hypridle.conf new file mode 100644 index 0000000..8e3b8ed --- /dev/null +++ b/config/hypr/hypridle.conf @@ -0,0 +1,27 @@ +general { + lock_cmd = pidof lock || uv run --directory /home/sankalp/Projects/dev/Modus python3 /home/sankalp/Projects/dev/Modus/src/lock.py + before_sleep_cmd = loginctl lock-session # lock before suspend. + after_sleep_cmd = hyprctl dispatch dpms on # to avoid having to press a key twice to turn on the display. +} + +listener { + timeout = 150 # 2.5min. + on-timeout = brightnessctl -s set 10 # set monitor backlight to minimum, avoid 0 on OLED monitor. + on-resume = brightnessctl -r # monitor backlight restore. +} + +listener { + timeout = 300 # 5min + on-timeout = loginctl lock-session # lock screen when timeout has passed +} + +listener { + timeout = 330 # 5.5min + on-timeout = hyprctl dispatch dpms off # screen off when timeout has passed + on-resume = hyprctl dispatch dpms on # screen on when activity is detected after timeout has fired. +} + +listener { + timeout = 1800 # 30min + on-timeout = systemctl suspend # suspend pc +} diff --git a/config/hypr/modus.lua b/config/hypr/modus.lua index c7d02a7..fe6fcc4 100644 --- a/config/hypr/modus.lua +++ b/config/hypr/modus.lua @@ -1,12 +1,9 @@ --- local modus = "$HOME/.config/Modus" -local modus = "$HOME/Projects/dev/Modus" - --- Global Menu env vars set by environment.py at runtime: --- ~/.config/environment.d/appmenu.conf --- ~/.pam_environment --- systemctl --user set-environment --- (Setting via hl.env here would trigger Gdk-CRITICAL in Modus's own GTK windows.) +-- local modus = os.getenv("HOME") .. "/.config/Modus" +local modus = os.getenv("HOME") .. "/Projects/dev/Modus" +local colors = dofile(modus .. "/config/hypr/colors.lua") +local fabricSend = "fabric-cli exec modus1" +-- startup hl.on("hyprland.start", function() local cmds = { "uwsm app -- awww-daemon", @@ -21,6 +18,21 @@ hl.on("hyprland.start", function() end end) +-- Reload Modus +hl.bind("SUPER + ALT + B", hl.dsp.exec_cmd("killall modus1; cd " .. modus .. " && uwsm app -- uv run start")) + +-- Fabric Launcher Binds +for key, method in pairs({ + -- ["SUPER + SHIFT + Y"] = "app.set_css()", -- Reload CSS + ["ALT + TAB"] = "switcher.show_switcher()", -- Application Switcher + ["SUPER + Z"] = "screencapture.toggle()", -- ScreenCapture + ["SUPER + S"] = "screencapture.toggle(ss='region')", -- Screenshot Region + ["ALT + SPACE"] = "switch_keyboard_layout()", -- KB_Layout Switcher +}) do + hl.bind(key, hl.dsp.exec_cmd(fabricSend .. " '" .. method .. "'")) +end + +-- Layer Rules hl.layer_rule({ match = { namespace = "^(lock|modus-.*)$", @@ -31,48 +43,69 @@ hl.layer_rule({ blur_popups = true, }) --- hl.curve("easeOutQuint", { type = "bezier", points = { { 0.23, 1 }, { 0.32, 1 } } }) --- hl.curve("easeInOutCubic", { type = "bezier", points = { { 0.65, 0.05 }, { 0.36, 1 } } }) --- hl.curve("linear", { type = "bezier", points = { { 0, 0 }, { 1, 1 } } }) --- hl.curve("almostLinear", { type = "bezier", points = { { 0.5, 0.5 }, { 0.75, 1 } } }) --- hl.curve("quick", { type = "bezier", points = { { 0.15, 0 }, { 0.1, 1 } } }) --- hl.curve("move", { type = "bezier", points = { { 0.36, 0.13 }, { 0.1, 1.36 } } }) --- hl.curve("new", { type = "bezier", points = { { 0.36, 0.13 }, { 0.1, 1.26 } } }) --- hl.curve("workspace", { type = "bezier", points = { { 0.42, 0 }, { 0.58, 1 } } }) --- hl.curve("resize", { type = "bezier", points = { { 0.46, 0 }, { 0.58, 1.16 } } }) --- --- hl.curve("easy", { type = "spring", mass = 1, stiffness = 71.2633, dampening = 15.8273644 }) --- --- hl.animation({ leaf = "global", enabled = true, speed = 1, bezier = "default" }) --- hl.animation({ leaf = "border", enabled = true, speed = 5.39, bezier = "easeOutQuint" }) --- hl.animation({ leaf = "windows", enabled = true, speed = 3.5, bezier = "new" }) --- hl.animation({ leaf = "windowsIn", enabled = true, speed = 3.5, bezier = "move", style = "popin 87%" }) --- hl.animation({ leaf = "windowsOut", enabled = true, speed = 3.5, bezier = "move", style = "popin 87%" }) --- hl.animation({ leaf = "fadeIn", enabled = true, speed = 3.5, bezier = "default" }) --- hl.animation({ leaf = "fadeOut", enabled = true, speed = 3.5, bezier = "default" }) --- hl.animation({ leaf = "fade", enabled = true, speed = 3.03, bezier = "quick" }) --- hl.animation({ leaf = "layers", enabled = true, speed = 3.81, bezier = "easeOutQuint" }) --- hl.animation({ leaf = "layersIn", enabled = true, speed = 4, bezier = "easeOutQuint", style = "fade" }) --- hl.animation({ leaf = "layersOut", enabled = true, speed = 1.5, bezier = "linear", style = "fade" }) --- hl.animation({ leaf = "fadeLayersIn", enabled = true, speed = 1.79, bezier = "almostLinear" }) --- hl.animation({ leaf = "fadeLayersOut", enabled = true, speed = 1.39, bezier = "almostLinear" }) --- hl.animation({ leaf = "workspaces", enabled = true, speed = 2, bezier = "workspace", style = "" }) --- hl.animation({ leaf = "workspacesIn", enabled = true, speed = 2, bezier = "workspace", style = "" }) --- hl.animation({ leaf = "workspacesOut", enabled = true, speed = 2, bezier = "workspace", style = "" }) --- hl.animation({ leaf = "zoomFactor", enabled = true, speed = 7, bezier = "quick" }) +hl.config({ + general = { + col = { + active_border = colors.primary, + inactive_border = colors.surface, + }, + gaps_in = 2, + gaps_out = 4, + border_size = 2, + layout = "scrolling", + }, + decoration = { + blur = { + enabled = true, + size = 3, + vibrancy = 0.2, + popups_ignorealpha = true, + popups = true, + }, + rounding = 14, + shadow = { + enabled = false, + range = 10, + render_power = 2, + color = "rgba(0, 0, 0, 0.25)", + }, + }, + animations = { + enabled = true, + }, +}) -local fabricSend = "fabric-cli exec modus1" +-- Curves +hl.curve("expressiveFastSpatial", { type = "bezier", points = { { 0.42, 1.67 }, { 0.21, 0.90 } } }) +hl.curve("expressiveSlowSpatial", { type = "bezier", points = { { 0.39, 1.29 }, { 0.35, 0.98 } } }) +hl.curve("expressiveDefaultSpatial", { type = "bezier", points = { { 0.38, 1.21 }, { 0.22, 1.00 } } }) +hl.curve("emphasizedDecel", { type = "bezier", points = { { 0.05, 0.7 }, { 0.1, 1 } } }) +hl.curve("emphasizedAccel", { type = "bezier", points = { { 0.3, 0 }, { 0.8, 0.15 } } }) +hl.curve("standardDecel", { type = "bezier", points = { { 0, 0 }, { 0, 1 } } }) +hl.curve("menu_decel", { type = "bezier", points = { { 0.1, 1 }, { 0, 1 } } }) +hl.curve("menu_accel", { type = "bezier", points = { { 0.52, 0.03 }, { 0.72, 0.08 } } }) +hl.curve("stall", { type = "bezier", points = { { 1, -0.1 }, { 0.7, 0.85 } } }) --- Reload Modus -hl.bind("SUPER + ALT + B", hl.dsp.exec_cmd("killall modus1; cd " .. modus .. " && uwsm app -- uv run start")) +-- Configs +-- Animations +local animations = { + -- leaf, speed, bezier, style + { "windowsIn", 3, "emphasizedDecel", "popin 80%" }, + { "fadeIn", 3, "emphasizedDecel" }, + { "windowsOut", 2, "emphasizedDecel", "popin 90%" }, + { "fadeOut", 2, "emphasizedDecel" }, + { "windowsMove", 3, "emphasizedDecel", "slide" }, + { "border", 10, "emphasizedDecel" }, + { "layersIn", 2.7, "emphasizedDecel", "popin 93%" }, + { "layersOut", 2.4, "menu_accel", "popin 94%" }, + { "fadeLayersIn", 0.5, "menu_decel" }, + { "fadeLayersOut", 2.7, "stall" }, + { "workspaces", 7, "menu_decel", "slide" }, + { "specialWorkspaceIn", 2.8, "emphasizedDecel", "slidevert" }, + { "specialWorkspaceOut", 1.2, "emphasizedAccel", "slidevert" }, + { "zoomFactor", 3, "standardDecel" }, +} --- Fabric Launcher Binds -for key, method in pairs({ - -- ["SUPER + SHIFT + Y"] = "app.set_css()", -- Reload CSS - ["ALT + TAB"] = "switcher.show_switcher()", -- Application Switcher - ["SUPER + Z"] = "screencapture.toggle()", -- ScreenCapture - ["SUPER + SPACE"] = "screencapture.toggle(ss='region')", -- Screenshot Region - ["ALT + SPACE"] = "switch_keyboard_layout()", -- KB_Layout Switcher -}) do - hl.bind(key, hl.dsp.exec_cmd(fabricSend .. " '" .. method .. "'")) +for _, anim in ipairs(animations) do + hl.animation({ leaf = anim[1], enabled = true, speed = anim[2], bezier = anim[3], style = anim[4] }) end