From e4a6ceaa4d20425b7696bb0b56541644143505f8 Mon Sep 17 00:00:00 2001 From: Janis Hutz Date: Mon, 15 Jun 2026 09:18:17 +0200 Subject: [PATCH] fix: more keybind cleanup, remove hyprlock --- config/hypr/hypridle.conf | 4 +- config/hypr/hyprland.lua | 10 +-- config/hypr/hyprland/binds/device.lua | 14 ++- config/hypr/hyprland/binds/window.lua | 19 +++- config/hypr/hyprland/colors.lua | 39 ++++---- config/hypr/hyprland/core/input.lua | 88 +++++++++---------- config/hypr/hyprland/execs.lua | 35 +++++--- .../hyprland/windowrules/noscreenshare.lua | 13 +++ config/matugen/templates/hyprland/colors.lua | 46 +++++----- test.lua | 0 10 files changed, 152 insertions(+), 116 deletions(-) create mode 100644 config/hypr/hyprland/windowrules/noscreenshare.lua create mode 100644 test.lua diff --git a/config/hypr/hypridle.conf b/config/hypr/hypridle.conf index 4327dc6..e75029e 100644 --- a/config/hypr/hypridle.conf +++ b/config/hypr/hypridle.conf @@ -9,9 +9,9 @@ #██████████████ █████ ████████████████████████████████████████████████████████████████████████████████████████████████ ██ general { - lock_cmd = hyprlock + lock_cmd = dms ipc call lock lock unlock_cmd = loginctl unlock-session - before_sleep_cmd = hyprlock + before_sleep_cmd = dms ipc call lock lock inhibit_sleep = 3 } diff --git a/config/hypr/hyprland.lua b/config/hypr/hyprland.lua index 74073b5..cdf4416 100644 --- a/config/hypr/hyprland.lua +++ b/config/hypr/hyprland.lua @@ -1,12 +1,8 @@ -- Determine current platform local is_docked = false local laptop_config = false -local read_platform = pcall(function() - io.popen("cat ~/.config/janishutz/platform-laptop") -end) -local read_docked = pcall(function() - io.popen("cat ~/.config/janishutz/docked") -end) +local read_platform = io.popen("cat ~/.config/janishutz/platform-laptop") == "l" +local read_docked = io.popen("cat ~/.config/janishutz/docked") == "y" if read_platform then laptop_config = true @@ -46,7 +42,7 @@ require("hyprland.workspacerules.main") require("hyprland.monitors")(laptop_config, is_docked) -- Execs -require("hyprland.execs") +require("hyprland.execs")(laptop_config) hl.device({ name = "pnp0c50:00-093a:0255-touchpad", diff --git a/config/hypr/hyprland/binds/device.lua b/config/hypr/hyprland/binds/device.lua index e42a757..77130e9 100644 --- a/config/hypr/hyprland/binds/device.lua +++ b/config/hypr/hyprland/binds/device.lua @@ -2,6 +2,14 @@ local function exit_submap() hl.dispatch(hl.dsp.submap("reset")) end +hl.bind("code:232", hl.dsp.exec_cmd("")) +-- bind = ,code:232, exec, light -U 5 && notify-send 'Display brightness decreased by 5%' +-- bind = ,code:233, exec, light -A 5 && notify-send 'Display brightness increased by 5%' + +hl.bind("code:123", hl.dsp.exec_cmd("pamixer -i 5")) +hl.bind("code:122", hl.dsp.exec_cmd("pamixer -d 5")) +hl.bind("code:121", hl.dsp.exec_cmd("pamixer t")) + hl.define_submap("device", function() hl.bind("m", function() hl.dispatch(hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle")) @@ -25,19 +33,19 @@ hl.define_submap("device", function() end) -- ── DMS controls ───────────────────────────────────────────────── - -- clipboard history + -- clipboard history hl.bind("h", function() hl.dispatch(hl.dsp.exec_cmd("dms ipc call clipboard toggle")) exit_submap() end) - -- Dash + -- Dash hl.bind("d", function() hl.dispatch(hl.dsp.exec_cmd("dms ipc call dash toggle")) exit_submap() end) - -- Settings + -- Settings hl.bind("s", function() hl.dispatch(hl.dsp.exec_cmd("dms ipc call settings toggle")) exit_submap() diff --git a/config/hypr/hyprland/binds/window.lua b/config/hypr/hyprland/binds/window.lua index cb99cc6..99dddc0 100644 --- a/config/hypr/hyprland/binds/window.lua +++ b/config/hypr/hyprland/binds/window.lua @@ -2,38 +2,51 @@ local function exit_submap() hl.dispatch(hl.dsp.submap("reset")) end +hl.bind("SUPER + mouse:272", hl.dsp.window.move()) +hl.bind("SUPER + mouse:273", hl.dsp.window.resize()) + hl.define_submap("window", function() + -- Close window hl.bind("x", function() - hl.dispatch(hl.dsp.exit()) + hl.dispatch(hl.dsp.window.close()) exit_submap() end) - hl.bind("q", function() - hl.dispatch(hl.dsp.exit()) + hl.dispatch(hl.dsp.window.close()) exit_submap() end) + -- Fullscreen hl.bind("f", function() hl.dispatch(hl.dsp.window.fullscreen({ mode = "fullscreen" })) exit_submap() end) + -- Floating hl.bind("v", function() hl.dispatch(hl.dsp.window.float()) exit_submap() end) + -- Center hl.bind("c", function() hl.dispatch(hl.dsp.window.center()) exit_submap() end) + -- Kill hl.bind("SHIFT + K", function() hl.dispatch(hl.dsp.exec_cmd("notify-send 'Insta-Kill activated' --app-name='Hyprtclt'")) hl.dispatch(hl.dsp.exec_cmd("hyprctl kill")) exit_submap() end) + -- Resize + hl.bind("l", hl.dsp.window.resize({ x = 10, y = 0 })) + hl.bind("h", hl.dsp.window.resize({ x = -10, y = 0 })) + hl.bind("j", hl.dsp.window.resize({ x = 0, y = 10 })) + hl.bind("k", hl.dsp.window.resize({ x = 0, y = -10 })) + hl.bind("Escape", function() exit_submap() end) diff --git a/config/hypr/hyprland/colors.lua b/config/hypr/hyprland/colors.lua index 352fd13..f1e3282 100644 --- a/config/hypr/hyprland/colors.lua +++ b/config/hypr/hyprland/colors.lua @@ -1,24 +1,19 @@ hl.config({ - general = { - col = { - active_border = "rgba(ffaabbcc) rgba(ffaabbcc) rgba(ffaabbcc) 45deg", - inactive_border = "rgba(ffaabb33)", - }, - }, - group = { - col = { - active_border = "rgba(ffaabb77)", - inactive_border = "rgba(ffaabb33)", - }, - }, - decoration = { - shadow = { - color = "rgba(ffffff20)", - } - } -}) - -hl.window_rule({ - match = { pin = 1 }, - border_color = "rgba(ffffffaa) rgba(ffffff77)", + general = { + col = { + active_border = { colors = { "rgba(ffaabbcc)", "rgba(ffaabbcc)", "rgba(ffaabbcc)" }, angle = "45deg" }, + inactive_border = "rgba(ffaabb33)", + }, + }, + group = { + col = { + border_active = "rgba(ffaabb77)", + border_inactive = "rgba(ffaabb33)", + }, + }, + decoration = { + shadow = { + color = "rgba(ffffff20)", + }, + }, }) diff --git a/config/hypr/hyprland/core/input.lua b/config/hypr/hyprland/core/input.lua index 63a05eb..171c8d1 100644 --- a/config/hypr/hyprland/core/input.lua +++ b/config/hypr/hyprland/core/input.lua @@ -1,51 +1,51 @@ ---- @param swap_escape boolean -return function(swap_escape) - hl.config({ - input = { - -- kb_options = swap_escape and "caps:swapescape" or "", - kb_layout = "us", - kb_variant = "altgr-intl", - natural_scroll = true, +--- @param laptop_config boolean +return function(laptop_config) + hl.config({ + input = { + kb_options = laptop_config and "caps:swapescape" or "", + kb_layout = "us", + kb_variant = "altgr-intl", + natural_scroll = true, - numlock_by_default = true, - repeat_delay = 400, + numlock_by_default = true, + repeat_delay = 400, - follow_mouse = 2, - mouse_refocus = true, - scroll_factor = 2, - accel_profile = "flat", + follow_mouse = 2, + mouse_refocus = true, + scroll_factor = 2, + accel_profile = "flat", - touchpad = { - disable_while_typing = true, - natural_scroll = true, - scroll_factor = 4, - }, + touchpad = { + disable_while_typing = true, + natural_scroll = true, + scroll_factor = 4, + }, - focus_on_close = 1, + focus_on_close = true, - sensitivity = 0, - }, - gestures = { - workspace_swipe_distance = 200, - workspace_swipe_cancel_ratio = 0.3, - workspace_swipe_forever = true, - workspace_swipe_direction_lock = false, - }, - }) + sensitivity = 0, + }, + gestures = { + workspace_swipe_distance = 200, + workspace_swipe_cancel_ratio = 0.3, + workspace_swipe_forever = true, + workspace_swipe_direction_lock = false, + }, + }) - hl.gesture({ - fingers = 3, - direction = "horizontal", - action = "workspace", - }) - hl.gesture({ - fingers = 3, - direction = "down", - action = "close", - }) - hl.gesture({ - fingers = 3, - direction = "up", - action = "fullscreen", - }) + hl.gesture({ + fingers = 3, + direction = "horizontal", + action = "workspace", + }) + hl.gesture({ + fingers = 3, + direction = "down", + action = "close", + }) + hl.gesture({ + fingers = 3, + direction = "up", + action = "fullscreen", + }) end diff --git a/config/hypr/hyprland/execs.lua b/config/hypr/hyprland/execs.lua index 8fe879c..b8f704e 100644 --- a/config/hypr/hyprland/execs.lua +++ b/config/hypr/hyprland/execs.lua @@ -1,13 +1,22 @@ -hl.on("hyprland.start", function() - -- hl.exec_cmd("~/.config/hypr/xdg-portal-hyprland") - -- hl.exec_cmd("dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP XAUTHORITY DISPLAY") - -- hl.exec_cmd("systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP") - hl.exec_cmd("systemctl --user start hyprpolkitagent") - hl.exec_cmd("hypridle") - hl.exec_cmd("hyprpaper") - hl.exec_cmd("hyprlauncher -d") - hl.exec_cmd("nm-applet") - hl.exec_cmd("nextcloud --background") - hl.exec_cmd("dms run") - hl.exec_cmd("wl-paste --type text --watch cliphist store") -end) +return function(is_laptop) + hl.env("QT_QPA_PLATFORM", "wayland") + hl.env("QT_QPA_PLATFORM_THEME", "qt6ct") + hl.on("hyprland.start", function() + -- hl.exec_cmd("~/.config/hypr/xdg-portal-hyprland") + -- hl.exec_cmd("dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP XAUTHORITY DISPLAY") + -- hl.exec_cmd("systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP") + hl.exec_cmd("systemctl --user start hyprpolkitagent") + hl.exec_cmd("hypridle") + hl.exec_cmd("hyprpaper") + hl.exec_cmd("hyprlauncher -d") + hl.exec_cmd("nm-applet") + hl.exec_cmd("nextcloud --background") + hl.exec_cmd("dms run") + hl.exec_cmd("wl-paste --watch cliphist store") + if is_laptop then + hl.exec_cmd("hyprctl setcursor oreo_spark_blue_cursors 36") + else + hl.exec_cmd("hyprctl setcursor oreo_spark_blue_cursors 24") + end + end) +end diff --git a/config/hypr/hyprland/windowrules/noscreenshare.lua b/config/hypr/hyprland/windowrules/noscreenshare.lua new file mode 100644 index 0000000..571708b --- /dev/null +++ b/config/hypr/hyprland/windowrules/noscreenshare.lua @@ -0,0 +1,13 @@ +hl.window_rule({ + match = { + title = "Bitwarden|secret", + }, + no_screen_share = true +}) + +hl.window_rule({ + match = { + class = "nm-connection-editor|[aA]uthentication", + }, + no_screen_share = true +}) diff --git a/config/matugen/templates/hyprland/colors.lua b/config/matugen/templates/hyprland/colors.lua index 734047c..94d3b35 100644 --- a/config/matugen/templates/hyprland/colors.lua +++ b/config/matugen/templates/hyprland/colors.lua @@ -1,24 +1,26 @@ hl.config({ - general = { - col = { - active_border = "rgba({{colors.primary.default.hex_stripped}}cc) rgba({{colors.secondary.default.hex_stripped}}cc) rgba({{colors.tertiary.default.hex_stripped}}cc) 45deg", - inactive_border = "rgba({{colors.surface_container_low.default.hex_stripped}}33)", - }, - }, - group = { - col = { - active_border = "rgba({{colors.outline_variant.default.hex_stripped}}77)", - inactive_border = "rgba({{colors.surface_container_high.default.hex_stripped}}33)", - }, - }, - decoration = { - shadow = { - color = "rgba({{colors.shadow.default.hex_stripped}}20)", - } - } -}) - -hl.window_rule({ - match = { pin = 1 }, - border_color = "rgba({{colors.primary.default.hex_stripped}}AA) rgba({{colors.primary.default.hex_stripped}}77)", + general = { + col = { + active_border = { + colors = { + "rgba({{colors.primary.default.hex_stripped}}cc)", + "rgba({{colors.secondary.default.hex_stripped}}cc)", + "rgba({{colors.tertiary.default.hex_stripped}}cc)", + }, + angle = 45, + }, + inactive_border = "rgba({{colors.surface_container_low.default.hex_stripped}}33)", + }, + }, + group = { + col = { + active_border = "rgba({{colors.outline_variant.default.hex_stripped}}77)", + inactive_border = "rgba({{colors.surface_container_high.default.hex_stripped}}33)", + }, + }, + decoration = { + shadow = { + color = "rgba({{colors.shadow.default.hex_stripped}}20)", + }, + }, }) diff --git a/test.lua b/test.lua new file mode 100644 index 0000000..e69de29