my current hyprland configuration
| hl.config({ autogenerated = false }) | |
| hl.on("hyprland.start", function() | |
| hl.exec_cmd("gnome-keyring-daemon --start --components=secrets") | |
| hl.exec_cmd("dbus-update-activation-environment --all") | |
| hl.exec_cmd("arrpc") | |
| hl.exec_cmd("goxlr-daemon") | |
| hl.exec_cmd("xwaylandvideobridge") | |
| hl.exec_cmd("vicinae server --replace") | |
| hl.exec_cmd("fcitx5") | |
| hl.exec_cmd("hyprpm reload") | |
| hl.exec_cmd("hyprctl setcursor macOS 24") | |
| hl.exec_cmd("equibop") | |
| hl.exec_cmd("steam") | |
| hl.exec_cmd("dms run") | |
| end) | |
| --[CONFIG HELPER]-------------------------------------------------------------------------------------------------------- | |
| local cfg = {} | |
| local m_workspace = 1 | |
| function cfg.config(path, value) | |
| if not path:find(".", 1, true) then | |
| return hl.config({ [path] = value }) | |
| end | |
| local t = {} | |
| local cur = t | |
| for key in path:gmatch("[^.]+") do | |
| if key == path:match("[^.]+$") then | |
| cur[key] = value | |
| else | |
| cur[key] = {} | |
| cur = cur[key] | |
| end | |
| end | |
| hl.config(t) | |
| end | |
| function cfg.bind(keybind, action, settings) | |
| if type(action) == 'string' then | |
| action = hl.dsp.exec_cmd(action) | |
| end | |
| hl.bind(keybind, action, settings) | |
| end | |
| function cfg.envs(vars) | |
| for name, value in pairs(vars) do | |
| hl.env(name, value) | |
| end | |
| end | |
| function cfg.plugins(plugins) | |
| for id, settings in pairs(plugins) do | |
| if id ~= nil and hl.plugin[id] and settings then | |
| hl.config({ plugin = { [id] = settings } }) | |
| end | |
| end | |
| end | |
| function cfg.monitors(settings) | |
| local last = m_workspace + 10 - 1 | |
| for key, monitor_settings in pairs(settings) do | |
| local monitor_name = key:gsub("_", "-") | |
| if monitor_settings.default then | |
| hl.config({ cursor = { default_monitor = monitor_name } }) | |
| monitor_settings.default = nil | |
| end | |
| monitor_settings.output = monitor_name | |
| hl.monitor(monitor_settings) | |
| hl.workspace_rule({ | |
| workspace = "r[" .. m_workspace .. "-" .. last .. "]", | |
| default_name = "default:" .. monitor_name, | |
| monitor = monitor_name, | |
| default = true, | |
| }) | |
| m_workspace = last + 1 | |
| end | |
| end | |
| cfg.dsp = {} | |
| function cfg.dsp.switchxkblayout(layouts, device) | |
| cfg.config("input", { kb_layout = table.concat(layouts, ",") }) | |
| local layout_idx = 0 | |
| return function() | |
| layout_idx = (layout_idx + 1) % #layouts | |
| local layout = layouts[layout_idx + 1] | |
| hl.exec_cmd("hyprctl switchxkblayout " .. device .. " " .. layout_idx) | |
| local args = "-c" | |
| if layout == "jp" then args = "-o -s mozc" end | |
| hl.exec_cmd("fcitx5-remote " .. args) | |
| end | |
| end | |
| function cfg.dsp.deeplink(link) | |
| return function() | |
| hl.exec_cmd('vicinae deeplink ' .. link) | |
| end | |
| end | |
| function cfg.animations(settings) | |
| for leaf, animation_settings in pairs(settings) do | |
| animation_settings.leaf = leaf | |
| if type(animation_settings.bezier) == "table" then | |
| local custom_bezier = "" | |
| for _ = 1, 8 do | |
| custom_bezier = custom_bezier .. string.char(math.random(97, 122)) | |
| end | |
| hl.curve(custom_bezier, animation_settings.bezier) | |
| animation_settings.bezier = custom_bezier | |
| end | |
| if animation_settings.enabled == nil then | |
| animation_settings.enabled = true | |
| end | |
| if animation_settings.bezier == nil then | |
| animation_settings.bezier = "default" | |
| end | |
| hl.animation(animation_settings) | |
| end | |
| end | |
| --[CONFIG]--------------------------------------------------------------------------------------------------------------- | |
| cfg.config("general.border_size", 0) | |
| cfg.config("general", { | |
| gaps_in = 4, | |
| gaps_out = 6, | |
| }) | |
| cfg.config("general.layout", "master") | |
| cfg.config("master", { | |
| allow_small_split = true, | |
| mfact = 0.5, | |
| slave_count_for_center_master = 0, | |
| orientation = "center", | |
| center_master_fallback = "right" | |
| }) | |
| cfg.config("general.snap", { | |
| enabled = true, | |
| respect_gaps = true | |
| }) | |
| cfg.config("decoration.rounding", 12) | |
| cfg.config("decoration", { | |
| active_opacity = 0.95, | |
| inactive_opacity = 0.95, | |
| }) | |
| cfg.config("decoration", { | |
| dim_strength = 0.05, | |
| dim_special = 0.75, | |
| border_part_of_window = false | |
| }) | |
| cfg.config("decoration.blur", { | |
| size = 10, | |
| passes = 3, | |
| }) | |
| cfg.config("decoration.blur.noise", 0.5) | |
| cfg.config("decoration.blur", { | |
| vibrancy = 1, | |
| vibrancy_darkness = 0.75, | |
| }) | |
| cfg.config("decoration.shadow.enabled", false) | |
| cfg.animations({ | |
| global = { speed = 4 } | |
| }) | |
| cfg.config("input.repeat_delay", 150) | |
| cfg.config("input", { | |
| sensitivity = -0.5, | |
| accel_profile = "flat", | |
| natural_scroll = true, | |
| }) | |
| cfg.config("input.follow_mouse", 2) | |
| cfg.config("input.tablet.output", "DP-1") | |
| cfg.config("input.tablet", { | |
| region_position = { 1285, 4 }, | |
| region_size = { 2546, 1380 }, | |
| }) | |
| cfg.config("input.tablet", { | |
| active_area_position = { 46, 15 }, | |
| active_area_size = { 58, 29 }, | |
| }) | |
| cfg.config("misc", { | |
| disable_hyprland_logo = true, | |
| disable_splash_rendering = true, | |
| middle_click_paste = false, | |
| render_unfocused_fps = 1, | |
| }) | |
| cfg.config("ecosystem", { | |
| no_update_news = true, | |
| no_donation_nag = true, | |
| enforce_permissions = true, | |
| }) | |
| hl.permission({ binary = "/usr/bin/hyprpm", type = "plugin", mode = "allow" }) | |
| cfg.monitors({ | |
| DP_1 = { | |
| mode = "5120x1440@240", | |
| position = "-2x-2", | |
| bitdepth = 10, | |
| default = true, | |
| }, | |
| HDMI_A_1 = { | |
| mode = "1920x1080@60", | |
| position = "-384x1440", | |
| bitdepth = 10, | |
| }, | |
| HDMI_A_2 = { | |
| mode = "1920x1080@165", | |
| position = "-1922x0", | |
| bitdepth = 10, | |
| }, | |
| }) | |
| cfg.bind("SUPER + mouse:272", hl.dsp.window.drag(), { mouse = true }) | |
| cfg.bind("SUPER + mouse:273", hl.dsp.window.resize(), { mouse = true }) | |
| cfg.bind("SUPER + Q", hl.dsp.window.close()) | |
| cfg.bind("SUPER + ALT + Q", hl.dsp.window.kill()) | |
| cfg.bind("SUPER + RETURN", "kitty") | |
| cfg.bind("SUPER + C", "vicinae toggle") | |
| cfg.bind("SUPER + SHIFT + S", function () hl.plugin.hyprcapture.open("region") end) | |
| cfg.bind("SUPER + SHIFT + C", 'dms ipc call color-picker toggle') | |
| cfg.bind("SUPER + V", cfg.dsp.deeplink("vicinae://launch/clipboard/history")) | |
| cfg.bind("SUPER + Period", cfg.dsp.deeplink("vicinae://launch/core/search-emojis")) | |
| cfg.bind("SUPER + ALT + S", hl.dsp.window.move({ workspace = "special", follow = false })) | |
| cfg.bind("SUPER + ALT + TAB", hl.dsp.window.move({ workspace = 1, follow = true })) | |
| cfg.bind("SUPER + TAB", hl.dsp.workspace.toggle_special()) | |
| cfg.bind("SUPER + ALT + SPACE", hl.dsp.window.float({ action = "toggle" })) | |
| cfg.bind("SUPER + SPACE", cfg.dsp.switchxkblayout({ "us", "jp", "de" }, "wooting-wooting-60he-v2")) | |
| cfg.bind("ALT + TAB", hl.plugin.hymission.toggle) | |
| cfg.bind("ALT + CTRL + DELETE", "dms ipc call powermenu toggle") | |
| cfg.envs({ | |
| GTK_IM_MODULE = "fcitx", | |
| QT_IM_MODULE = "fcitx", | |
| XMODIFIERS = "@im=fcitx", | |
| }) | |
| hl.layer_rule({ | |
| match = { | |
| namespace = "^(lock|modus-.*)$", | |
| }, | |
| blur = true, | |
| no_anim = true, | |
| ignore_alpha = 0, | |
| blur_popups = true, | |
| }) | |
| cfg.plugins({ | |
| dynamic_cursors = { | |
| enabled = true, | |
| mode = "tilt", | |
| tilt = { | |
| activation = "quadratic", | |
| full = 45 | |
| }, | |
| shake = { | |
| enabled = true, | |
| threshold = 6.0, | |
| base = 2.0, | |
| speed = 2.0, | |
| influence = 1.5, | |
| limit = 10.0, | |
| effects = true, | |
| }, | |
| hyprcursor = { | |
| enabled = true, | |
| nearest = 1, | |
| resolution = -1, | |
| fallback = "clientside", | |
| }, | |
| }, | |
| hyprselect = { | |
| should_round = false, | |
| col = { | |
| main = "rgba(0085e625)", | |
| border = "rgba(0085e6ff)", | |
| }, | |
| fade_time_ms = 65.0, | |
| should_blur = false, | |
| border_size = 2.0, | |
| }, | |
| hyprcapture = { | |
| allow_quick = true, | |
| save = true, | |
| save_dir = "$XDG_PICTURES_DIR/Screenshots", | |
| filename_template = "%Y-%m-%d_%M-%S.png", | |
| fusion_mode = true, | |
| }, | |
| }) |
评论
?
参与讨论