Files
hypr-dotfiles/config/hypr/hyprland.lua
T
hermes 30d01e6676 Convert old userprefs.conf windowrules to Lua + section headers
Opacity rules from the pre-Lua backup, rewritten with hl.window_rule and
'override' so they set absolute opacity (HyDE dims to 0.90/0.75 by
default). The old lines contained sed artifacts ($&) that hyprlang
rejected anyway; intent preserved: opaque browsers/zathura/mpv, 0.90
chat window. ASCII section banners for input/keybinds/rules.
2026-11-01 22:47:40 +00:00

109 lines
4.6 KiB
Lua

-- Hyprland loads this file when it is started without a config, and it prefers
-- it over hyprland.conf. HyDE loads it too, last, as the override layer below.
-- The block keeps the two apart: hyde.lua sets `hyde` on its first line, so it
-- runs only when this file is the entry point and HyDE has not been loaded.
-- Removing it leaves a session with a cursor and nothing else.
if not hyde then
local share = os.getenv("XDG_DATA_HOME") or (os.getenv("HOME") .. "/.local/share")
local entry = share .. "/hypr/hyde.lua"
local handle = io.open(entry, "r")
if not handle then
error("HyDE is not installed at " .. entry .. ". Run install.sh -r, or point Hyprland at your own config.")
end
handle:close()
dofile(entry)
end
-- Your Hyprland configuration. HyDE never overwrites this file.
--
-- It loads after HyDE's own binds, so settings here take precedence. Replacing
-- a bind needs more than that: see below. HyDE's defaults live in
-- ~/.local/share/hypr/lua/ and are overwritten on every update, so edits there
-- do not survive.
--
-- Adding a keybind:
--
-- hl.bind("SUPER + SPACE", hl.dsp.exec_cmd(hyde.sh.gamelauncher()), {
-- description = "[Utilities] game launcher",
-- })
--
-- Replacing one of HyDE's: bind the same combination again and yours takes
-- over, but copy its flags across as well. A bind counts as the same one only
-- when its flags match, and `description` is not a flag — miss one and both
-- binds stay live on that combination. Copy the whole options table from
-- ~/.local/share/hypr/lua/key_binds.lua and change only what you need:
--
-- hl.bind("F9", hl.dsp.exec_cmd(hyde.sh.volumecontrol("-o", "m")), {
-- locked = true,
-- description = "[Hardware Controls|Audio] un/mute output",
-- })
--
-- Press SUPER + / to see what is actually loaded, your own binds included.
-- The full reference is KEYBINDINGS.md in the HyDE repository.
--
-- Other Lua files next to this one can be pulled in with require("name").
-- Custom config
-- // █ █▄░█ █▀█ █░█ ▀█▀
-- // █ █░▀█ █▀▀ █▄█ ░█░
-- DK layout
hl.config({
input = {
kb_layout = "dk",
},
})
-- // █░█ █▀▀ █▄█ █▀▄ █ █▄░█ █▀▄ █▀
-- // ▀▄▀ █▄▄ ░█░ █▄▀ █ █░▀█ █▄▀ ▄█
-- Switch workspace left/right
hl.bind("CONTROL + ALT + Right", hl.dsp.focus({ workspace = "r+1" }), {
description = "[Workspaces] next workspace",
})
hl.bind("CONTROL + ALT + Left", hl.dsp.focus({ workspace = "r-1" }), {
description = "[Workspaces] previous workspace",
})
-- Move focused window to workspace left/right
hl.bind("SUPER + CONTROL + ALT + Right", hl.dsp.window.move({ workspace = "r+1" }), {
description = "[Workspaces] move window to next workspace",
})
hl.bind("SUPER + CONTROL + ALT + Left", hl.dsp.window.move({ workspace = "r-1" }), {
description = "[Workspaces] move window to previous workspace",
})
-- Terminal on SUPER + Return
hl.bind("SUPER + Return", hl.dsp.exec_cmd("kitty"), {
description = "[Launcher|Apps] terminal emulator",
})
-- // █▀▀ █░░ █▀█ █░█ █▄░█ █▀▀ █▀ █░█ █▀▀ █▀█ █▀▄
-- // ██▄ █▄▄ █▀▄ █▄█ █░▀█ ██▄ ▄█ ▀▄▀ ██▄ █▀▄ █▄▀
-- Converted from the old userprefs.conf windowrules (hyprlang -> Lua).
-- HyDE dims windows to 0.90 active / 0.75 inactive; `override` sets absolute
-- values instead of multiplying, restoring full opacity for these apps.
-- Values are active / inactive / fullscreen.
-- Opaque: browsers, readers, video
hl.window_rule({ match = { class = "^(firefox)$" },
opacity = "1.0 override 1.0 override 1.0 override" })
hl.window_rule({ match = { class = "^(google-chrome)$" },
opacity = "1.0 override 1.0 override 1.0 override" })
hl.window_rule({ match = { class = "^(chrome-www.twitch.tv__smugslav-Default)$" },
opacity = "1.0 override 1.0 override 1.0 override" })
hl.window_rule({ match = { class = "^(chrome-www.twitch.tv__scrapie-Default)$" },
opacity = "1.0 override 1.0 override 1.0 override" })
hl.window_rule({ match = { class = "^(chrome-mail.balticfinance.com__-Default)$" },
opacity = "1.0 override 1.0 override 1.0 override" })
hl.window_rule({ match = { class = "^(org.pwmt.zathura)$" },
opacity = "1.0 override 1.0 override 1.0 override" })
hl.window_rule({ match = { class = "^(mpv)$" },
opacity = "1.0 override 1.0 override 1.0 override" })
-- Slightly translucent chat window
hl.window_rule({ match = { class = "^(chrome-chat.obahan.xyz__-Default)$" },
opacity = "0.9 override 0.9 override 1.0 override" })