diff --git a/nixos/hosts/Tibo-NixTop/swap.nix b/nixos/hosts/Tibo-NixTop/swap.nix new file mode 100644 index 0000000..859ba33 --- /dev/null +++ b/nixos/hosts/Tibo-NixTop/swap.nix @@ -0,0 +1,23 @@ +{ + boot = { + kernelParams = [ + "mem_sleep_default=deep" + "resume_offset=66637824" + ]; + + resumeDevice = "/dev/disk/by-uuid/e759b10f-7949-4094-9272-d91340dcc5b6"; + }; + + powerManagement.enable = true; + + swapDevices = [{ + device = "/var/lib/swap"; + size = 37 * 1024; + options = [ "discard" ]; + }]; + + #systemd.sleep.extraConfig = '' + # HibernateDelaySec=30m + # SuspendState=mem + #''; +} diff --git a/nixos/modules/desktop/hyprland/default.nix b/nixos/modules/desktop/hyprland/default.nix index 6d7d25b..9d4caa5 100644 --- a/nixos/modules/desktop/hyprland/default.nix +++ b/nixos/modules/desktop/hyprland/default.nix @@ -8,8 +8,7 @@ in { config = lib.mkIf cfg.enable { environment = { sessionVariables = { - # Hint Electron apps to use wayland - NIXOS_OZONE_WL = "1"; + NIXOS_OZONE_WL = "1"; # Hint Electron apps to use wayland ASSETS_DIR = ../../../../assets; SCRIPT_DIR = ../../../../scripts; @@ -25,10 +24,12 @@ in { wlsunset wl-clipboard # Copying to system clipboard in vim wl-mirror # Mirror an output - wdisplays # Tool to configure displays + wdisplays nwg-displays hyprlandPlugins.hy3 # i3/sway layout plugin + grim slurp # Screenshots + swaylock glib diff --git a/nixos/users/tdpeuter/dotfiles.nix b/nixos/users/tdpeuter/dotfiles.nix index 57d5e16..0973f52 100644 --- a/nixos/users/tdpeuter/dotfiles.nix +++ b/nixos/users/tdpeuter/dotfiles.nix @@ -37,10 +37,14 @@ in { recursive = true; source = ../../../stow/hyprland/.config/hypr; }; - ".config/hypr/hy3-plugin.conf" = { + ".config/hypr/hy3-plugin.lua" = { inherit (config.sisyphus.desktop.hyprland) enable; text = '' - plugin = ${pkgs.hyprlandPlugins.hy3}/lib/libhy3.so + hl.on("hyprland.start", function() + if not (hl.plugin and hl.plugin.hy3) then + hl.exec_cmd('hyprctl plugin load ${pkgs.hyprlandPlugins.hy3}/lib/libhy3.so') + end + end) ''; }; ".config/kitty" = { diff --git a/stow/hyprland/.config/hypr/decoration_animations.lua b/stow/hyprland/.config/hypr/decoration_animations.lua new file mode 100644 index 0000000..d2d09a2 --- /dev/null +++ b/stow/hyprland/.config/hypr/decoration_animations.lua @@ -0,0 +1,72 @@ +-- Decorations and animations + +hl.config({ + decoration = { + rounding = 0, + --rounding_power = 4.0, + + active_opacity = 1.0, + inactive_opacity = 1.0, + fullscreen_opacity = 1.0, + dim_modal = false, + dim_inactive = false, + --dim_strength = 0.5, + --dim_special = 0.2, + --dim_around = 0.4, + + --screen_shader = [[Empty]], + --border_part_of_window = true, + + blur = { + enabled = true, + + size = 8, + passes = 1, + ignore_opacity = true, + new_optimizations = true, + xray = true, + noise = 0.01, + contrast = 0.8, + brightness = 0.8, + vibrancy = 0.0, + vibrancy_darkness = 0.0, + + special = false, + popups = false, + --popups_ignorealpha = 0.2, + input_methods = false, + --input_methods_ignorealpha = 0.2, + }, + + shadow = { + enabled = false, + + --range = 4, + --render_power = 3, + --sharp = false, + --color = "#ee1a1a1a", + --color_inactive = unset, + --offset = {0, 0}, + --scale = 1.0, + }, + + glow = { + enabled = false, + --range = 10, + --render_power = 3, + --color = "#ee1a1a1a", + --color_inactive = unset, + }, + + motion_blur = { + --enabled = false, + --samples = 7, + }, + }, + + animations = { + enabled = false, + --workspace_wraparound = false, + }, +}) + diff --git a/stow/hyprland/.config/hypr/docked.conf b/stow/hyprland/.config/hypr/docked.lua similarity index 100% rename from stow/hyprland/.config/hypr/docked.conf rename to stow/hyprland/.config/hypr/docked.lua diff --git a/stow/hyprland/.config/hypr/hy3-plugin.lua b/stow/hyprland/.config/hypr/hy3-plugin.lua new file mode 100644 index 0000000..4798839 --- /dev/null +++ b/stow/hyprland/.config/hypr/hy3-plugin.lua @@ -0,0 +1,5 @@ +hl.on("hyprland.start", function() + if not (hl.plugin and hl.plugin.hy3) then + hl.exec_cmd('hyprctl plugin load /nix/store/78mllvcwa0nbqiczjpd8zqsywhy5dllm-hy3-0.55.0/lib/libhy3.so') + end +end) diff --git a/stow/hyprland/.config/hypr/hy3.conf b/stow/hyprland/.config/hypr/hy3.conf deleted file mode 100644 index 6cd7c06..0000000 --- a/stow/hyprland/.config/hypr/hy3.conf +++ /dev/null @@ -1,167 +0,0 @@ -# -# ~/.config/hypr/hy3.conf -# - -# Load the plugin. File should contain `plugin = /path/to/lib/libhy3.so` -source = /home/tdpeuter/.config/hypr/hy3-plugin.conf - -general:layout = hy3 - -plugin { - hy3 { - # disable gaps when only one window is onscreen - # 0 - always show gaps - # 1 - hide gaps with a single window onscreen - # 2 - 1 but also show the window border - no_gaps_when_only = 1 # default: 0 - - # policy controlling what happens when a node is removed from a group, - # leaving only a group - # 0 = remove the nested group - # 1 = keep the nested group - # 2 = keep the nested group only if its parent is a tab group - node_collapse_policy = 2 # default: 2 - - # offset from group split direction when only one window is in a group - group_inset = 10 # default: 10 - - # if a tab group will automatically be created for the first window spawned in a workspace - tab_first_window = false - - # tab group settings - tabs { - # height of the tab bar - height = 10 # default: 22 - - # padding between the tab bar and its focused node - padding = 0 # default: 6 - - # the tab bar should animate in/out from the top instead of below the window - from_top = false # default: false - - # radius of tab bar corners - radius = 0 # default: 6 - - # tab bar border width - border_width = 2 # default: 2 - - # render the window title on the bar - render_text = false # default: true - - # center the window title - text_center = true # default: true - - # font to render the window title with - text_font = Sans # default: Sans - - # height of the window title - text_height = 8 # default: 8 - - # left padding of the window title - text_padding = 3 # default: 3 - - # active tab bar segment colors - #col.active = # default: rgba(33ccff40) - #col.active.border = # default: rgba(33ccffee) - #col.active.text = # default: rgba(ffffffff) - - # active tab bar segment colors for bars on an unfocused monitor - #col.active_alt_monitor = # default: rgba(60606040) - #col.active_alt_monitor.border = # default: rgba(808080ee) - #col.active_alt_monitor.text = # default: rgba(ffffffff) - - # focused tab bar segment colors (focused node in unfocused container) - #col.focused = # default: rgba(60606040) - #col.focused.border = # default: rgba(808080ee) - #col.focused.text = # default: rgba(ffffffff) - - # inactive tab bar segment colors - col.inactive = rgba(a6a6a620) # default: rgba(30303020) - col.inactive.border = rgba(a6a6a6aa) # default: rgba(606060aa) - #col.inactive.text = # default: rgba(ffffffff) - - # urgent tab bar segment colors - #col.urgent = # default: rgba(ff223340) - #col.urgent.border = # default: rgba(ff2233ee) - #col.urgent.text = # default: rgba(ffffffff) - - # urgent tab bar segment colors - #col.locked = # default: rgba(90903340) - #col.locked.border = # default: rgba(909033ee) - #col.locked.text = # default: rgba(ffffffff) - - # if tab backgrounds should be blurred - # Blur is only visible when the above colors are not opaque. - blur = true # default: true - - # opacity multiplier for tabs - # Applies to blur as well as the given colors. - opacity = 1.0 # default: 1.0 - } - - # autotiling settings - autotile { - # enable autotile - enable = true # default: false - - # make autotile-created groups ephemeral - ephemeral_groups = true # default: true - - # if a window would be squished smaller than this width, a vertical split will be created - # -1 = never automatically split vertically - # 0 = always automatically split vertically - # = pixel width to split at - trigger_width = -1 # default: 0 - - # if a window would be squished smaller than this height, a horizontal split will be created - # -1 = never automatically split horizontally - # 0 = always automatically split horizontally - # = pixel height to split at - trigger_height = 0 # default: 0 - - # a space or comma separated list of workspace ids where autotile should be enabled - # it's possible to create an exception rule by prefixing the definition with "not:" - # workspaces = 1,2 # autotiling will only be enabled on workspaces 1 and 2 - # workspaces = not:1,2 # autotiling will be enabled on all workspaces except 1 and 2 - workspaces = all # default: all - } - } -} - -# Keybinds - -# Navigation - -# Focus - -# First, unbind default -unbind = $flag, $up -unbind = $flag, $right -unbind = $flag, $down -unbind = $flag, $left - -unbind = $flag, up -unbind = $flag, right -unbind = $flag, down -unbind = $flag, left - -bind = $flag, $up, hy3:movefocus, u -bind = $flag, $right, hy3:movefocus, r -bind = $flag, $down, hy3:movefocus, d -bind = $flag, $left, hy3:movefocus, l - -bind = $flag, up, hy3:movefocus, u -bind = $flag, right, hy3:movefocus, r -bind = $flag, down, hy3:movefocus, d -bind = $flag, left, hy3:movefocus, l - -# Layout -bind = $flag, z, hy3:changegroup, opposite -bind = $flag, x, hy3:changegroup, toggletab -bind = $flag, c, hy3:changegroup, h -bind = $flag, v, hy3:changegroup, v - -bind = $flag, p, hy3:changefocus, raise -bind = $flag+Shift, p, hy3:changefocus, lower -bind = $flag, space, hy3:togglefocuslayer - diff --git a/stow/hyprland/.config/hypr/hy3.lua b/stow/hyprland/.config/hypr/hy3.lua new file mode 100644 index 0000000..fe7f886 --- /dev/null +++ b/stow/hyprland/.config/hypr/hy3.lua @@ -0,0 +1,226 @@ +-- i3/sway tiling layout plugin +-- https://github.com/outfoxxed/hy3 + +local v = require("variables") + +local function configure_hy3() + hl.config({ + general = { + layout = "hy3", + }, + + plugin = { + hy3 = { + -- policy controlling what happens when a node is removed from a group, + -- leaving only a group + -- 0 = remove the nested group + -- 1 = keep the nested group + -- 2 = keep the nested group only if its parent is a tab group + --node_collapse_policy = 2, + + -- offset from group split direction when only one window is in a group + --group_inset = 10, + + -- if a tab group will automatically be created for the first window spawned in a workspace + tab_first_window = false, + + -- tab group settings + tabs = { + -- height of the tab bar + height = 10, + + -- padding between the tab bar and its focused node + padding = 0, + + -- the tab bar should animate in/out from the top instead of below the window + --from_top = false, + + -- radius of tab bar corners + radius = 0, + + -- tab bar border width + --border_width = 2, + + -- render the window title on the bar + render_text = false, + + -- center the window title + --text_center : true, + + -- font to render the window title with + --text_font = Sans, + + -- height of the window title + --text_height = 8, + + -- left padding of the window title + --text_padding = 3, + + colors = { + -- active tab bar segment colors + --active = "rgba(33ccff40)", + --active_border = "rgba(33ccffee)", + --active_text = "rgba(ffffffff)", + + -- active tab bar segment colors for bars on an unfocused monitor + --active_alt_monitor = "rgba(60606040)", + --active_alt_monitor_border = "rgba(808080ee)", + --active_alt_monitor_text = "rgba(ffffffff)", + + -- focused tab bar segment colors (focused node in unfocused container) + --focused = "rgba(60606040)", + --focused_border = "rgba(808080ee)", + --focused_text = "rgba(ffffffff)", + + -- inactive tab bar segment colors + inactive = "rgba(a6a6a620)", -- default: "rgba(30303020)" + inactive_border = "rgba(a6a6a620)", -- default: "rgba(606060aa)" + --inactive_text = "rgba(ffffffff)", + + -- urgent tab bar segment colors + --urgent = "rgba(ff223340)", + --urgent_border = "rgba(ff2233ee)", + --urgent_text = "rgba(ffffffff)", + + -- locked tab bar segment colors + --locked = "rgba(90903340)", + --locked_border = "rgba(909033ee)", + --locked_text = "rgba(ffffffff)", + }, + + -- if tab backgrounds should be blurred + -- Blur is only visible when the above colors are not opaque. + --blur = true, + + -- opacity multiplier for tabs + -- Applies to blur as well as the given colors. + --opacity = 1.0, + }, + + -- autotiling settings + autotile = { + -- enable autotile + enable = false, + + -- make autotile-created groups ephemeral + --ephemeral_groups = true, + + -- if a window would be squished smaller than this width, a vertical split will be created + -- -1 = never automatically split vertically + -- 0 = always automatically split vertically + -- = pixel width to split at + --trigger_width = 0, + + -- if a window would be squished smaller than this height, a horizontal split will be created + -- -1 = never automatically split horizontally + -- 0 = always automatically split horizontally + -- = pixel height to split at + --trigger_height = 0, + + -- a space or comma separated list of workspace ids where autotile should be enabled + -- it's possible to create an exception rule by prefixing the definition with "not:" + --workspaces = "1,2", -- autotiling will only be enabled on workspaces 1 and 2 + --workspaces = "not:1,2", -- autotiling will be enabled on all workspaces except 1 and 2 + --workspaces = "all", -- default + }, + }, + }, + }) +end + +local function unbind_defaults() + -- Navigation + + -- Focus + for _, direction in ipairs({ "Up", "Right", "Down", "Left", v.up, v.right, v.down, v.left }) do + -- Focus + pcall(hl.unbind, "SUPER + " .. direction) + -- Move windows + pcall(hl.unbind, "SUPER + SHIFT + " .. direction) + end + + -- Layouts + + -- Workspaces + + for i = 1, #v.ws.ids do + -- Move window to a specific workspace + pcall(hl.unbind, "SUPER + SHIFT + " .. v.ws.keys[i]) + end +end + +local function bind_hy3(hy3) + -- Navigation + + -- Focus + hl.bind("SUPER + Up", hy3.move_focus("up")) + hl.bind("SUPER + Right", hy3.move_focus("right")) + hl.bind("SUPER + Down", hy3.move_focus("down")) + hl.bind("SUPER + Left", hy3.move_focus("left")) + + hl.bind("SUPER + " .. v.up, hy3.move_focus("up")) + hl.bind("SUPER + " .. v.right, hy3.move_focus("right")) + hl.bind("SUPER + " .. v.down, hy3.move_focus("down")) + hl.bind("SUPER + " .. v.left, hy3.move_focus("left")) + + -- Move windows + hl.bind("SUPER + SHIFT + Up", hy3.move_window("up")) + hl.bind("SUPER + SHIFT + Right", hy3.move_window("right")) + hl.bind("SUPER + SHIFT + Down", hy3.move_window("down")) + hl.bind("SUPER + SHIFT + Left", hy3.move_window("left")) + + hl.bind("SUPER + SHIFT + " .. v.up, hy3.move_window("up")) + hl.bind("SUPER + SHIFT + " .. v.right, hy3.move_window("right")) + hl.bind("SUPER + SHIFT + " .. v.down, hy3.move_window("down")) + hl.bind("SUPER + SHIFT + " .. v.left, hy3.move_window("left")) + + -- Layout + + hl.bind("SUPER + Z", hy3.equalize(), { long_press = true }) + hl.bind("SUPER + Z", hy3.change_group("opposite")) + hl.bind("SUPER + X", hy3.change_group("tab")) + hl.bind("SUPER + C", hy3.change_group("h")) + hl.bind("SUPER + V", hy3.change_group("v")) + + hl.bind("SUPER + P", hy3.change_focus("raise")) + hl.bind("SUPER + SHIFT + P", hy3.change_focus("lower")) + hl.bind("SUPER + Space", hy3.toggle_focus_layer()) + + -- Workspaces + + for i = 1, #v.ws.ids do + hl.bind("SUPER + SHIFT + " .. v.ws.keys[i], hy3.move_to_workspace(v.ws.ids[i], { follow = true })) + end + + -- Shortcuts + + hl.bind("SUPER + CONTROL + Q", hy3.kill_active()) +end + +local attempt = 0 +local max_attempts = 5000 + +local check_hy3_status +check_hy3_status = hl.timer(function () + attempt = attempt + 1 + + if hl.plugin and hl.plugin.hy3 then + local success, err = pcall(function() + unbind_defaults() + configure_hy3() + bind_hy3(hl.plugin.hy3) + end) + + if success then + check_hy3_status:set_enabled(false) + end + end + + if attempt >= max_attempts then + hl.notification.create({ text = "[hy3] Plugin failed to load after " .. max_attempts .. " attempts", duration = 5000 }) + check_hy3_status:set_enabled(false) + end +end, { timeout = 5000, type = "repeat" }) + +check_hy3_status:set_enabled(true) + diff --git a/stow/hyprland/.config/hypr/hyprland.conf b/stow/hyprland/.config/hypr/hyprland.conf deleted file mode 100644 index 1ccbc2e..0000000 --- a/stow/hyprland/.config/hypr/hyprland.conf +++ /dev/null @@ -1,286 +0,0 @@ -# ~/.config/hypr/hyperland.conf - -general { - border_size = 1 - no_border_on_floating = false - - gaps_in = 3 - gaps_out = 5 - gaps_workspaces = 0 - - col.inactive_border = 0xff444444 - col.active_border = 0xffffffff - col.nogroup_border = 0xffff00ff - - layout = dwindle - - no_focus_fallback = true - - resize_on_border = true - extend_border_grab_area = 5 - hover_icon_on_border = true - - allow_tearing = false - - resize_corner = 0 - - snap { - enabled = false - window_gap = 10 - monitor_gap = 10 - border_overlap = false - } -} - -decoration { - rounding = 0 - # rounding_power = 4.0 - - active_opacity = 1.0 - inactive_opacity = 1.0 - fullscreen_opacity = 1.0 - dim_inactive = false - dim_strength = 0.5 - dim_special = 0.2 - dim_around = 0.4 - - blur { - enabled = true - - size = 8 - passes = 1 - noise = 0.01 - contrast = 0.8 - brightness = 0.8 - vibrancy = 0.0 - vibrancy_darkness = 0.0 - - ignore_opacity = true - new_optimizations = true - xray = true - special = false - popups = false - # input_methods = false - } - - shadow { - enabled = false - - range = 4 - render_power = 3 - sharp = false - - ignore_window = true - - color = 0xee1a1a1a - color_inactive = 0xee1a1a1a - # offset = [0,0] - scale = 1.0 - } -} - -animations { - enabled = false - first_launch_animation = true -} - -gestures { - workspace_swipe_distance = 300 - workspace_swipe_invert = true - workspace_swipe_min_speed_to_force = 30 - workspace_swipe_cancel_ratio = 0.2 - workspace_swipe_direction_lock = true - workspace_swipe_direction_lock_threshold = 10 - - workspace_swipe_touch = false - workspace_swipe_touch_invert = false - - workspace_swipe_create_new = false - - workspace_swipe_forever = true - - workspace_swipe_use_r = false - - # hyprlang if !HYPRLAND_V_0_53 - workspace_swipe = true - workspace_swipe_fingers = 3 - workspace_swipe_min_fingers = false - # hyprlang endif -} - -group { - auto_group = true - insert_after_current = true - focus_removed_window = true - drag_into_group = 1 - merge_groups_on_drag = true - merge_groups_on_groupbar = true - merge_floated_into_tiled_on_groupbar = false - group_on_movetoworkspace = false - - col.border_active = 0x66ffff00 - col.border_inactive = 0x66777700 - col.border_locked_active = 0x66ff5500 - col.border_locked_inactive = 0x66775500 - - groupbar { - enabled = true - font_family = misc:font_family - font_size = 8 - gradients = true - height = 14 - stacked = false - priority = 3 - render_titles = false - scrolling = true - - text_color = 0xffffffff - - col.active = 0x66ffff00 - col.inactive = 0x66777700 - col.locked_active = 0x66ff5500 - col.locked_inactive = 0x66775500 - } -} - -misc { - disable_hyprland_logo = true - disable_splash_rendering = true - - col.splash = 0xffffffff - - font_family = Letter - # splash_font_family = - force_default_wallpaper = -1 - vfr = true - vrr = 1 - mouse_move_enables_dpms = false - key_press_enables_dpms = true - always_follow_on_dnd = true - layers_hog_keyboard_focus = true - animate_manual_resizes = false - animate_mouse_windowdragging = false - disable_autoreload = true - enable_swallow = false - # swallow_regex = - # swallow_exception_regex = - focus_on_activate = true - mouse_move_focuses_monitor = true - render_ahead_of_time = false - render_ahead_safezone = 1 - allow_session_lock_restore = false - background_color = 0x018281 - close_special_on_empty = true - new_window_takes_over_fullscreen = 2 - exit_window_retains_fullscreen = false - initial_workspace_tracking = 1 - middle_click_paste = false - render_unfocused_fps = 12 - disable_xdg_env_checks = false - # disable_hyprland_qtutils_check = false - # lockdead_screen_delay = 1000 -} - -binds { - pass_mouse_when_bound = false - scroll_event_delay = 300 - workspace_back_and_forth = false - allow_workspace_cycles = false - workspace_center_on = 1 - focus_preferred_method = 0 - ignore_group_lock = false - # movefocus_cycles_fullscreen = true - # movefocus_cycles_groupfirst = false - disable_keybind_grabbing = false - window_direction_monitor_fallback = true - # allow_pin_fullscreen = true -} - -xwayland { - enabled = true - use_nearest_neighbor = true - force_zero_scaling = false -} - -opengl { - nvidia_anti_flicker = false -} - -render { - explicit_sync = 2 - explicit_sync_kms = 2 - direct_scanout = false - expand_undersized_textures = true - # xp_mode = false - # ctm_animation = 2 - # allow_early_buffer_release = true -} - -cursor { - sync_gsettings_theme = true - no_hardware_cursors = false - no_break_fs_vrr = false - min_refresh_rate = 24 - hotspot_padding = 1 - inactive_timeout = 10 - no_warps = false - persistent_warps = false - warp_on_change_workspace = 0 - # default_monitor = - zoom_factor = 1.0 - zoom_rigid = false - # enable_hypercursor = false - hide_on_key_press = true - hide_on_touch = true - # use_cpu_buffer = 2 - # warp_back_after_non_mouse_input = false -} - -ecosystem { - # no_update_news = false - # no_donation_nag = true -} - -exec-once = gnome-keyring-daemon --start --components=secrets -exec-once = dunst --verbosity crit -exec-once = waycorner -exec-once = waybar - -# TODO Replace with something else? -exec-once = wlsunset -t 2500 -l 50.51 -L 4.21 - -exec-once = nextcloud --background - -# Turn volume off at boot -exec-once = bash -c 'for i in $(seq 1 10); do pactl set-sink-mute @DEFAULT_SINK@ 1 && break; sleep 1; done' - -# STYLING -exec-once = swaybg -i "${HOME}/.local/state/sisyphus/bg" --mode=fill -env = XCURSOR_SIZE,24 - -# SHIFT CAPS CTRL/CONTROL ALT MOD2 MOD3 SUPER/WIN/LOGO/MOD4 MOD5 -$flag = MOD4 - -$LMB = mouse:272 -$RMB = mouse:273 -$MMB = mouse:274 - -$left = h -$down = j -$up = k -$right = l - -$term = foot -$menu = j4-dmenu-desktop --dmenu="rofi -dmenu -i" --no-generic --usage-log="/home/tdpeuter/.local/state/dmenu.log" --term=$term -$lock = swaylock --daemonize - -# https://wiki.hyprland.org/Nvidia/#environment-variables -env = __GLX_VENDOR_LIBRARY_NAME,nvidia -env = LIBVA_DRIVER_NAME,nvidia -env = NVD_BACKEND,direct - -source = /home/tdpeuter/.config/hypr/input-output.conf -source = /home/tdpeuter/.config/hypr/keybinds.conf -source = /home/tdpeuter/.config/hypr/modes.conf -source = /home/tdpeuter/.config/hypr/hy3.conf # Sway tiling plugin - diff --git a/stow/hyprland/.config/hypr/hyprland.lua b/stow/hyprland/.config/hypr/hyprland.lua new file mode 100644 index 0000000..7b19b31 --- /dev/null +++ b/stow/hyprland/.config/hypr/hyprland.lua @@ -0,0 +1,270 @@ +-- ~/.config/hypr/hyprland.lua +-- Syntax/options last reviewed on 0.55.2 + +hl.config({ + general = { + border_size = 1, + gaps_in = 3, + gaps_out = 5, + --float_gaps = -1, + gaps_workspaces = 0, + + col = { + inactive_border = "#ff444444", + active_border = "#ffffffff", + nogroup_border = "#ffff00ff", + --nogroup_border_active = "", + }, + + layout = "dwindle", + + no_focus_fallback = true, + + resize_on_border = true, + extend_border_grab_area = 5, + hover_icon_on_border = true, + + allow_tearing = false, + + resize_corner = 0, + + --modal_parent_blocking = true, + --locale = [[Empty]], + + snap = { + enabled = false, + --window_gap = 10, + --monitor_gap = 10, + --border_overlap = false, + --respect_gaps = false, + }, + }, + + group = { + auto_group = true, + insert_after_current = true, + focus_removed_window = true, + drag_into_group = 1, + merge_groups_on_drag = true, + merge_groups_on_groupbar = true, + merge_floated_into_tiled_on_groupbar = false, + group_on_movetoworkspace = false, + + col = { + border_active = "#66ffff00", + border_inactive = "#66777700", + border_locked_active = "#66ff5500", + border_locked_inactive = "#66775500", + }, + + groupbar = { + enabled = true, + + --font_family = misc.font_family, + --font_size = 8, + --font_weight_active = "normal", + --font_weight_inactive = "normal", + + gradients = true, + --height = 14, + --indicator_gap = 0, + --indicator_height = 3, + --stacked = false, + --priority = 3, + render_titles = false, + --text_offset = 0, + --text_padding = 0, + + scrolling = true, + --rounding = 1, + --rounding_power = 4.0, -- squircle + --gradient_rounding = 2, + --gradient_rounding_power = 4.0, -- squircle + --round_only_edges = true, + --gradient_round_only_edges = true, + + text_color = "#ffffffff", + --text_color_inactive = unset, + --text_color_locked_active = unset, + --text_color_locked_inactive = unset, + + col = { + active = "#66ffff00", + inactive = "#66777700", + locked_active = "#66ff5500", + locked_inactive = "#66775500", + }, + + --gaps_in = 2, + --gaps_out = 2, + --keep_upper_gap = true, + --middle_click_close = true, + --blur = false, + }, + }, + + misc = { + disable_hyprland_logo = true, + disable_splash_rendering = true, + --disable_scale_notification = false, + + col = { + splash = "#ffffffff", + }, + font_family = "Letter", + --spash_font_family = [[Empty]], + --force_default_wallpaper = -1, + + vrr = 1, -- on + mouse_move_enables_dpms = false, + key_press_enables_dpms = true, + --name_vk_after_proc = true, + --always_follow_on_dnd = true, + --layers_hog_keyboard_focus = true, + --animate_manual_resizes = false, + --animate_mouse_windowdragging = false, + disable_autoreload = true, + --enable_swallow = false, + --swallow_regex = [[Empty]], + --swallow_exception_regex = [[Empty]], + focus_on_activate = true, + mouse_move_focuses_monitor = true, + + --allow_session_lock_restore = false, + --session_lock_xray = false, + + background_color = "#018281", + --close_special_on_empty = true, + --on_focus_under_fullscreen = 2, -- unfullscreen/unmaximize + --exit_window_retains_fullscreen = false, + --initial_workspace_tracking = 1, -- single-shot + middle_click_paste = false, + render_unfocused_fps = 12, + --disable_xdg_env_checks = false, + --disable_hyprland_qutils_check = false, + --lockdead_screen_delay = 1000, + --enable_anr_dialog = true, + --anr_missed_pings = 5, + --size_limits_tiled = false, + --disable_watchdog_warning = false, + }, + + layout = { + --single_window_aspect_ratio = {0, 0}, + --single_window_aspect_ratio_tolerance = 0.1, + }, + + binds = { + --pass_mouse_when_bound = false, + --scroll_event_delay = 300, + workspace_back_and_forth = false, + --hide_special_on_workspace_change = false, + --allow_workspace_cycles = false, + workspace_center_on = 1, -- last active window for that workspace + focus_preferred_method = 0, + --ignore_group_lock = false, + --movefocus_cycles_fullscreen = false, + --movefocus_cycles_groupfirst = false, + window_direction_monitor_fallback = true, + disable_keybind_grabbing = false, + --allow_pin_fullscreen = false, + drag_threshold = 10, + }, + + xwayland = { + enabled = true, + --use_nearest_neighbor = true, + --force_zero_scaling = false, + --create_abstract_socket = false, + }, + + opengl = { + nvidia_anti_flicker = false, + }, + + render = { + --direct_scanout = 0, -- off + --expand_undersized_textures, = true + --xp_mode = false, + --ctm_animation = 2, -- auto + --cm_enabled = true, + --send_content_type = true, + --cm_auto_hdr = 1, -- cm, hdr + --new_render_scheduling = false, + --non_shader_cm = 2, -- DS and passthrough only + --non_shader_cm_interop = 2, -- external ctm is disabled for fullscreen photo/video/game content types + --cm_sdr_eotf = "default", + --commit_timing_enabled = true, + --use_fp16 = 2, -- enabled in hdr mode + --keep_unmodified_copy = 2, -- auto + --use_shader_blur_blend = false, + }, + + cursor = { + --invisible = false, + sync_gsettings_theme = true, + --no_hardware_cursors = 2, -- auto + --no_break_fs_vvr = 2, -- auto + --min_refresh_rate = 24, + --hotspot_padding = 1, + inactive_timeout = 10, + no_warps = false, + persistent_warps = false, + warp_on_change_workspace = 1, -- enabled + warp_on_toggle_special = 1, -- enabled + --default_monitor = [[Empty]], + --zoom_factor = 1.0, + --zoom_rigid = false, + --zoom_detached_camera = true, + --enable_hyprcursor = true, + hide_on_key_press = true, + hide_on_touch = true, + hide_on_tablet = true, + --use_cpu_buffer = 2, + --warp_back_after_non_mouse_input = false, + --zoom_disable_aa = false, + }, + + ecosystem = { + --no_update_news = false, + --no_donation_nag = false, + --enforce_permission = false, + }, + + --quirks.prefer_hdr = 0, -- off +}) + +hl.on("hyprland.start", function() + hl.exec_cmd("gnome-keyring-daemon --start --components=secrets") + hl.exec_cmd("dunst --verbosity crit") + hl.exec_cmd("waycorner") + hl.exec_cmd("waybar") + + -- TODO Replace with something else? + hl.exec_cmd("wlsunset -t 2500 -l 50.51 -L 4.21") + + hl.exec_cmd("nextcloud --background") + + -- Turn volume off at boot + hl.exec_cmd("for i in $(seq 1 10); do pactl set-sink-mute @DEFAULT_SINK@ 1 && break; sleep 1; done") +end) + +-- STYLING +hl.on("hyprland.start", function() + hl.exec_cmd("swaybg -i \"${HOME}/.local/state/sisyphus/bg\" --mode=fill") +end) +hl.env("XCURSOR_SIZE", "24") + +-- https://wiki.hypr.land/Configuring/Advanced-and-Cool/Environment-variables/#nvidia-specific +hl.env("GBM_BACKEND", "nivida-drm") +hl.env("__GLX_VENDOR_LIBRARY_NAME", "nvidia") +hl.env("LIBVA_DRIVER_NAME", "nvidia") -- Hardware acceleration on NVIDIA GPUs + +require("decoration_animations") +require("input-output") +require("keybinds") +require("modes") + +pcall(require, "hy3-plugin") -- Sway tiling plugin +require("hy3") -- hy3 config. Since hy3.lua uses timers, it should NOT be required in "hyprland.start"! + diff --git a/stow/hyprland/.config/hypr/input-output.conf b/stow/hyprland/.config/hypr/input-output.conf deleted file mode 100644 index 3c04c15..0000000 --- a/stow/hyprland/.config/hypr/input-output.conf +++ /dev/null @@ -1,62 +0,0 @@ -# ~/.config/hypr/input-output.conf - -input { - kb_layout = us,be,us - kb_variant = altgr-intl,iso-alternate,dvorak - - numlock_by_default = true - resolve_binds_by_sym = false - - repeat_rate = 25 - repeat_delay = 600 - - sensitivity = 0.0 - accel_profile = flat - force_no_accel = false - - left_handed = false - scroll_method = 2fg - scroll_button_lock = true - scroll_factor = 1.0 - natural_scroll = false - - follow_mouse = 2 - focus_on_close = 0 - mouse_refocus = true - float_switch_override_focus = 1 - special_fallthrough = false - off_window_axis_events = 1 - emulate_discrete_scroll = 1 - - touchpad { - disable_while_typing = true - natural_scroll = true - scroll_factor = 0.8 - middle_button_emulation = false - tap_button_map = lrm - clickfinger_behavior = false - tap-to-click = true - drag_lock = false - tap-and-drag = true - } -} - -device { - name = at-translated-set-2-keyboard - numlock_by_default = false -} - -monitor = , preferred, auto, 1 - -monitor = desc:BOE 0x08CF, preferred, 640x1440, 1 -monitor = desc:Hewlett Packard HP ZR2740w CNT319Y008, preferred, auto-up, 1 -# Vertical monitors -monitor = desc:Dell Inc. DELL P2214H 29C2937M4YTL, preferred, auto-right, 1, transform, 1 -monitor = desc:Samsung Electric Company S22C650, preferred, auto-right, 1, transform, 1 - -# TV -monitor = desc:Samsung Electric Company SAMSUNG, disable - -bindl = , switch:on:Lid Switch, exec, hyprctl keyword monitor "eDP-1, disable" -bindl = , switch:off:Lid Switch, exec, hyprctl keyword monitor "eDP-1, enable" - diff --git a/stow/hyprland/.config/hypr/input-output.lua b/stow/hyprland/.config/hypr/input-output.lua new file mode 100644 index 0000000..4fe9be3 --- /dev/null +++ b/stow/hyprland/.config/hypr/input-output.lua @@ -0,0 +1,122 @@ +hl.config({ + input = { + --kb_model = [[Empty]], + kb_layout = "us,be,us", + kb_variant = "altgr-intl,iso-alternate,dvorak", + --kb_options = [[Empty]], + --kb_rules = [[Empty]], + --kb_file = [[Empty]], + + numlock_by_default = true, + resolve_binds_by_sym = false, + + repeat_rate = 25, + repeat_delay = 600, + + sensitivity = 0.0, + accel_profile = "flat", + force_no_accel = false, + + --rotation = 0, + left_handed = false, + --scroll_points = [[Empty]], + scroll_method = "2fg", + scroll_button = 0, -- 0 means default + scroll_button_lock = true, + scroll_factor = 1.0, + natural_scroll = false, + + follow_mouse = 2, + --follow_mouse_shrink = 0, + --follow_mouse_threshold = 0.0, + focus_on_close = 0, + mouse_refocus = true, + float_switch_override_focus = 1, + special_fallthrough = false, + off_window_axis_events = 1, + emulate_discrete_scroll = 1, + + touchpad = { + disable_while_typing = true, + natural_scroll = true, + scroll_factor = 0.8, + middle_button_emulation = false, + tap_button_map = "lrm", + clickfinger_behavior = false, + tap_to_click = true, + drag_lock = 0, -- false + tap_and_drag = true, + + --flip_x = false, + --flip_y = false, + --drag_3fg = 0, + }, + + touchdevice = { + --transform = -1, + --output = [[Auto]], + --enabled = true, + }, + + virtualkeyboard = { + --share_states = 2, + --release_pressed_on_close = false, + }, + + tablet = { + --transform = -1, + --output = [[Empty]], + --region_position = {0, 0}, + --absolute_region_position = false, + --region_size = {0, 0}, + --relative_input = false, + --left_handed = false, + --active_area_size = {0, 0}, + --active_area_position = {0, 0}, + }, + + tablettool = { + --eraser_button_mode = 0, + --eraser_button_override = 0, + --pressure_range_min = -1.0, + --pressure_range_max = 1.0, + }, + }, + + gestures = { + workspace_swipe_distance = 300, + workspace_swipe_touch = false, + workspace_swipe_invert = true, + workspace_swipe_touch_invert = false, + workspace_swipe_min_speed_to_force = 30, + workspace_swipe_cancel_ratio = 0.2, + workspace_swipe_create_new = false, + workspace_swipe_direction_lock = true, + workspace_swipe_direction_lock_threshold = 10, + workspace_swipe_forever = true, + workspace_swipe_use_r = false, + + --close_max_timeout = 1000, + }, +}) + +-- Disable numlock by default on laptop keyboard +hl.device({ name = "at-translated-set-2-keyboard", numlock_by_default = false }) + +hl.monitor({ output = "", mode = "preferred", position = "auto", scale = 1 }) +hl.monitor({ output = "desc:BOE 0x08CF", mode = "preferred", position = "640x1440", scale = 1 }) +hl.monitor({ output = "desc:Hewlett Packard HP ZR2740w CNT319Y008", mode = "preferred", position = "auto-up", scale = 1 }) +hl.monitor({ output = "desc:Dell Inc. DELL P2214H 29C2937M4YTL", mode = "preferred", position = "auto-right", scale = 1, transform = 1 }) +hl.monitor({ output = "desc:Samsung Electric Company S22C650", mode = "preferred", position = "auto-right", scale = 1, transform = 1 }) +hl.monitor({ output = "desc:Samsung Electric Company SAMSUNG", disabled = true }) + +hl.bind("switch:on:Lid Switch", function() + hl.notification.create({ text = "Lid closed — disabling eDP-1", timeout = 2500 }) + hl.monitor({ output = "eDP-1", disabled = true }) +end, { locked = true }) + +hl.bind("switch:off:Lid Switch", function() + hl.notification.create({ text = "Lid opened — enabling eDP-1", timeout = 2500 }) + hl.monitor({ output = "eDP-1", disabled = false }) +end, { locked = true }) + diff --git a/stow/hyprland/.config/hypr/keybinds.conf b/stow/hyprland/.config/hypr/keybinds.conf deleted file mode 100644 index f628da6..0000000 --- a/stow/hyprland/.config/hypr/keybinds.conf +++ /dev/null @@ -1,184 +0,0 @@ -$notify = "${SCRIPT_DIR}/notify.sh" - -# Navigation - -# Focus -bind = $flag, $up, movefocus, u -bind = $flag, $right, movefocus, r -bind = $flag, $down, movefocus, d -bind = $flag, $left, movefocus, l - -bind = $flag, up, movefocus, u -bind = $flag, right, movefocus, r -bind = $flag, down, movefocus, d -bind = $flag, left, movefocus, l - -# Move windows -bind = $flag+Shift, $up, movewindow, u -bind = $flag+Shift, $right, movewindow, r -bind = $flag+Shift, $down, movewindow, d -bind = $flag+Shift, $left, movewindow, l - -bind = $flag+Shift, up, movewindow, u -bind = $flag+Shift, right, movewindow, r -bind = $flag+Shift, down, movewindow, d -bind = $flag+Shift, left, movewindow, l - -# $flag+Next move scratchpad -# $flag+KP_Next move scratchpad -# $flag+Prior scratchpad show -# $flag+KP_Prior scratchpad show -bind = $flag, Next, movetoworkspace, special:scratchpad -bind = $flag, KP_Next, movetoworkspace, special:scratchpad - -bind = $flag, Prior, togglespecialworkspace, special:scratchpad -bind = $flag, Prior, movetoworkspace, special:scratchpad -bind = $flag, Prior, togglespecialworkspace, special:scratchpad - -# bind = $flag, Next, movetoworkspace, special:magic -# bind = $flag, Next, togglespecialworkspace, magic - -# bind = $flag, KP_Next, togglespecialworkspace, magic -# bind = $flag, KP_Next, movetoworkspace, +0 -# bind = $flag, KP_Next, togglespecialworkspace, magic -# bind = $flag, KP_Next, movetoworkspace, special:magic -# bind = $flag, KP_Next, togglespecialworkspace, magic - -# Layouts -bind = $flag, f, togglefloating -bind = $flag+Shift, f, settiled - -bind = $flag, s, pin -bind = $flag, s, setfloating -bind = $flag+Shift, s, pin -bind = $flag+Shift, s, settiled - -bind = $flag, F11, fullscreen, 1 -bind = $flag+Shift, F11, fullscreen, 0 - -bindm = $flag, $LMB, movewindow -bindm = $flag, $RMB, resizewindow -bindc = $flag, $LMB, togglefloating - -# Workspaces - -$ws1 = 1 -$ws2 = 2 -$ws3 = 3 -$ws4 = 4 -$ws5 = 5 -$ws6 = 6 -$ws7 = 7 -$ws8 = 8 -$ws9 = 9 -$ws10 = 10 -$ws11 = 11 -$ws12 = 12 - -# Focus a specific workspace -bind = $flag, 1, workspace, $ws1 -bind = $flag, 2, workspace, $ws2 -bind = $flag, 3, workspace, $ws3 -bind = $flag, 4, workspace, $ws4 -bind = $flag, 5, workspace, $ws5 -bind = $flag, 6, workspace, $ws6 -bind = $flag, 7, workspace, $ws7 -bind = $flag, 8, workspace, $ws8 -bind = $flag, 9, workspace, $ws9 -bind = $flag, 0, workspace, $ws10 -bind = $flag, minus, workspace, $ws11 -bind = $flag, equal, workspace, $ws12 - -# Move window to a specific workspace -bind = $flag+Shift, 1, movetoworkspace, $ws1 -bind = $flag+Shift, 2, movetoworkspace, $ws2 -bind = $flag+Shift, 3, movetoworkspace, $ws3 -bind = $flag+Shift, 4, movetoworkspace, $ws4 -bind = $flag+Shift, 5, movetoworkspace, $ws5 -bind = $flag+Shift, 6, movetoworkspace, $ws6 -bind = $flag+Shift, 7, movetoworkspace, $ws7 -bind = $flag+Shift, 8, movetoworkspace, $ws8 -bind = $flag+Shift, 9, movetoworkspace, $ws9 -bind = $flag+Shift, 0, movetoworkspace, $ws10 -bind = $flag+Shift, Minus, movetoworkspace, $ws11 -bind = $flag+Shift, Equal, movetoworkspace, $ws12 - -# Go through workspaces in order -bind = $flag+Ctrl, $left, workspace, e-1 -bind = $flag+Ctrl, $right, workspace, e+1 - -bind = $flag+Ctrl, left, workspace, e-1 -bind = $flag+Ctrl, right, workspace, e+1 - -bind = $flag+Ctrl+Shift, $left, movetoworkspace, e-1 -bind = $flag+Ctrl+Shift, $right, movetoworkspace, e+1 - -bind = $flag+Ctrl+Shift, left, movetoworkspace, e-1 -bind = $flag+Ctrl+Shift, right, movetoworkspace, e+1 - -# GNOME-like keybinds -bind = $flag+Alt, $left, workspace, e-1 -bind = $flag+Alt, $right, workspace, e+1 - -bind = $flag+Alt, left, workspace, e-1 -bind = $flag+Alt, right, workspace, e+1 - -bind = $flag+Alt+Shift, $left, movetoworkspace, e-1 -bind = $flag+Alt+Shift, $right, movetoworkspace, e+1 - -bind = $flag+Alt+Shift, left, movetoworkspace, e-1 -bind = $flag+Alt+Shift, right, movetoworkspace, e+1 - -# System - -# Brightness -bind = , XF86MonBrightnessDown, exec, brightnessctl -e s 5%- && $notify -b -bind = , XF86MonBrightnessUp, exec, brightnessctl -e s +5% && $notify -b - -# Audio -bind = , XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 2%+ && $notify -v -bind = , XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%- && $notify -v -bind = , XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle && $notify -v -bind = , XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle - -# Media -bind = , XF86AudioPlay, exec, playerctl play-pause -bind = , XF86AudioPrev, exec, playerctl previous -bind = , XF86AudioNext, exec, playerctl next - -bind = Shift, XF86AudioMute, exec, playerctl play-pause -bind = Shift, XF86AudioLowerVolume, exec, playerctl previous -bind = Shift, XF86AudioRaiseVolume, exec, playerctl next - -# Other special keys -bind = , XF86Calculator, exec, qalculate-gtk - -# Shortcuts - -# Reload -bind = Alt+Shift, r, exec, "hyperctl reload" -bind = Ctrl+Alt+Shift, r, forcerendererreload -bind = Alt+Shift, e, exit - -# Kill a window -bind = $flag, q, closewindow, activewindow - -# Start a terminal -bind = $flag, Return, exec, $term -bind = CTRL&ALT, T, exec, $term -# Application menu -bind = Alt, Space, exec, $menu -bind = Alt, Tab, focuscurrentorlast - -bind = $flag, e, exec, $term -e vifm -bind = Ctrl+Shift, Escape, exec, $term -e zenith - -bind = Ctrl+Shift, a, exec, notify-send "hole!" && hyprctl setcursor _ 87 && sleep 5 && hyprctl setcursor _ 24 - -# bind = $flag, mouse_up, movefocus, l -bind = SUPER, mouse_down, workspace, e-1 -bind = SUPER, mouse_up, workspace, e+1 -# bind = $flag, mouse_down, movefocus, r - -bind = $flag, Delete, exec, $lock - diff --git a/stow/hyprland/.config/hypr/keybinds.lua b/stow/hyprland/.config/hypr/keybinds.lua new file mode 100644 index 0000000..b326de0 --- /dev/null +++ b/stow/hyprland/.config/hypr/keybinds.lua @@ -0,0 +1,229 @@ +local v = require("variables") + +local notify = "${SCRIPT_DIR}/notify.sh" + +-- Navigation + +-- Focus +hl.bind("SUPER + " .. v.up, hl.dsp.focus({ direction = "u" })) +hl.bind("SUPER + " .. v.right, hl.dsp.focus({ direction = "r" })) +hl.bind("SUPER + " .. v.down, hl.dsp.focus({ direction = "d" })) +hl.bind("SUPER + " .. v.left, hl.dsp.focus({ direction = "l" })) + +hl.bind("SUPER + Up", hl.dsp.focus({ direction = "u" })) +hl.bind("SUPER + Right", hl.dsp.focus({ direction = "r" })) +hl.bind("SUPER + Down", hl.dsp.focus({ direction = "d" })) +hl.bind("SUPER + Left", hl.dsp.focus({ direction = "l" })) + +-- Move windows +hl.bind("SUPER + SHIFT + " .. v.up, hl.dsp.window.move({ direction = "u" })) +hl.bind("SUPER + SHIFT + " .. v.right, hl.dsp.window.move({ direction = "r" })) +hl.bind("SUPER + SHIFT + " .. v.down, hl.dsp.window.move({ direction = "d" })) +hl.bind("SUPER + SHIFT + " .. v.left, hl.dsp.window.move({ direction = "l" })) + +hl.bind("SUPER + SHIFT + Up", hl.dsp.window.move({ direction = "u" })) +hl.bind("SUPER + SHIFT + Right", hl.dsp.window.move({ direction = "r" })) +hl.bind("SUPER + SHIFT + Down", hl.dsp.window.move({ direction = "d" })) +hl.bind("SUPER + SHIFT + Left", hl.dsp.window.move({ direction = "l" })) + +-- Minimizing +-- https://wiki.hypr.land/Configuring/Advanced-and-Cool/Uncommon-tips-and-tricks/#minimize-windows-using-special-workspaces + +local scratchpad = "scratchpad" + +hl.bind("SUPER + End", hl.dsp.window.move({ workspace = "special:" .. scratchpad, follow = false })) +hl.bind("SUPER + KP_End", hl.dsp.window.move({ workspace = "special:" .. scratchpad, follow = false })) + +hl.bind("SUPER + SHIFT + End", hl.dsp.window.move({ workspace = "+0", follow = true })) +hl.bind("SUPER + SHIFT + KP_End", hl.dsp.window.move({ workspace = "+0", follow = true })) + +hl.bind("SUPER + Home", hl.dsp.workspace.toggle_special(scratchpad)) +hl.bind("SUPER + KP_Home", hl.dsp.workspace.toggle_special(scratchpad)) + +-- Layouts + +hl.bind("SUPER + F", hl.dsp.window.float({ "toggle" })) +hl.bind("SUPER + SHIFT + F", hl.dsp.window.float({ "enable" })) + +hl.bind("SUPER + S", function() + hl.dsp.window.pin({ "enable" }) + hl.dsp.window.float({ "enable" }) +end) +hl.bind("SUPER + SHIFT + S", function() + hl.dsp.window.pin({ "disable" }) + hl.dsp.window.float({ "disable" }) +end) + +hl.bind("SUPER + F11", hl.dsp.window.fullscreen({ "maximized", "toggle" })) +hl.bind("SUPER + SHIFT + F11", hl.dsp.window.fullscreen({ "fullscreen", "toggle" })) + +hl.bind("SUPER + " .. v.LMB, hl.dsp.window.float(), { mouse = true, click = true }) +hl.bind("SUPER + " .. v.LMB, hl.dsp.window.drag(), { mouse = true, drag = true }) +hl.bind("SUPER + " .. v.RMB, hl.dsp.window.resize(), { mouse = true, drag = true }) + +hl.gesture({ fingers = 4, direction = "swipe", action = "resize", mod = "SUPER" }) + +-- Switch between layouts +hl.bind("SUPER + b", function () + local layouts = { "scrolling", "dwindle", "master", "monocle" } + local workspace = hl.get_active_workspace() + local next_layout = "dwindle" + + if not workspace then + return + end + + for i = 1, #layouts do + if layouts[i] == workspace.tiled_layout then + local next_layout_idx = (i % #layouts) + 1 + next_layout = layouts[next_layout_idx] + break + end + end + + hl.workspace_rule({ + workspace = workspace.name, + layout = next_layout + }) +end) + +-- Workspaces + +for i = 1, #v.ws.ids do + -- Focus a specific workspace + hl.bind("SUPER + " .. v.ws.keys[i], hl.dsp.focus({ workspace = v.ws.ids[i] })) + -- Move window to a specific workspace + hl.bind("SUPER + SHIFT + " .. v.ws.keys[i], hl.dsp.window.move({ workspace = v.ws.ids[i], switch = true })) +end + +-- Go through workspaces in order +hl.bind("SUPER + CONTROL + " .. v.left, hl.dsp.focus({ workspace = "e-1" })) +hl.bind("SUPER + CONTROL + " .. v.right, hl.dsp.focus({ workspace = "e+1" })) + +hl.bind("SUPER + CONTROL + Left", hl.dsp.focus({ workspace = "e-1" })) +hl.bind("SUPER + CONTROL + Right", hl.dsp.focus({ workspace = "e+1" })) + +hl.bind("SUPER + CONTROL + SHIFT + " .. v.left, hl.dsp.window.move({ workspace = "e-1", switch = true })) +hl.bind("SUPER + CONTROL + SHIFT + " .. v.right, hl.dsp.window.move({ workspace = "e+1", switch = true })) + +hl.bind("SUPER + CONTROL + SHIFT + Left", hl.dsp.window.move({ workspace = "e-1", switch = true })) +hl.bind("SUPER + CONTROL + SHIFT + Right", hl.dsp.window.move({ workspace = "e+1", switch = true })) + +-- Move workspace to the next monitor +hl.bind("SUPER + CONTROL + SHIFT + " .. v.up, hl.dsp.workspace.move({ workspace="+0", monitor = "-1" })) +hl.bind("SUPER + CONTROL + SHIFT + " .. v.down, hl.dsp.workspace.move({ workspace="+0", monitor = "+1" })) + +hl.bind("SUPER + CONTROL + SHIFT + Up", hl.dsp.workspace.move({ monitor = "-1" })) +hl.bind("SUPER + CONTROL + SHIFT + Down", hl.dsp.workspace.move({ monitor = "+1" })) + +-- GNOME-like keybinds +hl.bind("SUPER + ALT + " .. v.left, hl.dsp.focus({ workspace = "e-1" })) +hl.bind("SUPER + ALT + " .. v.right, hl.dsp.focus({ workspace = "e+1" })) + +hl.bind("SUPER + ALT + Left", hl.dsp.focus({ workspace = "e-1" })) +hl.bind("SUPER + ALT + Right", hl.dsp.focus({ workspace = "e+1" })) + +hl.bind("SUPER + ALT + SHIFT + " .. v.left, hl.dsp.window.move({ workspace = "e-1", switch = true })) +hl.bind("SUPER + ALT + SHIFT + " .. v.right, hl.dsp.window.move({ workspace = "e+1", switch = true })) + +hl.bind("SUPER + ALT + SHIFT + Left", hl.dsp.window.move({ workspace = "e-1", switch = true })) +hl.bind("SUPER + ALT + SHIFT + Right", hl.dsp.window.move({ workspace = "e+1", switch = true })) + +hl.gesture({ fingers = 3, direction = "horizontal", action = "workspace" }) + +-- System + +-- Brightness +hl.bind("XF86MonBrightnessDown", hl.dsp.exec_cmd("brightnessctl -e s 5%- && " .. notify .. " -b"), + { locked = true, repeating = true, submap_universal = true }) +hl.bind("XF86MonBrightnessUp", hl.dsp.exec_cmd("brightnessctl -e s +5% && " .. notify .. " -b"), + { locked = true, repeating = true, submap_universal = true }) + +-- Audio +hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_cmd("wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 2%+ && " .. notify .. " -v"), + { locked = true, repeating = true, submap_universal = true }) +hl.bind("XF86AudioLowerVolume", hl.dsp.exec_cmd("wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 2%- && " .. notify .. " -v"), + { locked = true, repeating = true, submap_universal = true }) +hl.bind("XF86AudioMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle && " .. notify .. " -v"), + { locked = true, submap_universal = true }) +hl.bind("XF86AudioMicMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle && " .. notify .. " -v"), + { submap_universal = true }) + +-- Media +hl.bind("XF86AudioPlay", hl.dsp.exec_cmd("playerctl play-pause"), { locked = true, submap_universal = true }) +hl.bind("XF86AudioPrev", hl.dsp.exec_cmd("playerctl previous"), { locked = true, submap_universal = true }) +hl.bind("XF86AudioNext", hl.dsp.exec_cmd("playerctl next"), { locked = true, submap_universal = true }) + +hl.bind("SHIFT + XF86AudioMute", hl.dsp.exec_cmd("playerctl play-pause"), { locked = true, submap_universal = true }) +hl.bind("SHIFT + XF86AudioLowerVolume", hl.dsp.exec_cmd("playerctl previous"), { locked = true, submap_universal = true }) +hl.bind("SHIFT + XF86AudioRaiseVolume", hl.dsp.exec_cmd("playerctl next"), { locked = true, submap_universal = true }) + +-- Other special keys +hl.bind("XF86Calculator", hl.dsp.exec_cmd("qalculate-gtk")) + +-- Shortcuts + +-- Reload +hl.bind("ALT + SHIFT + R", hl.dsp.exec_cmd("hyprctl reload")) +-- TODO hl.bind("Ctrl + Alt + Shift + R", forcerendererreload) +hl.bind("ALT + SHIFT + E", hl.dsp.exit()) + +-- Kill a window +hl.bind("SUPER + Q", hl.dsp.window.close()) +hl.bind("SUPER + SHIFT + Q", hl.dsp.window.kill()) + +-- Start a terminal +hl.bind("SUPER + Return", hl.dsp.exec_cmd(v.term)) +hl.bind("CONTROL + ALT + T", hl.dsp.exec_cmd(v.term)) + +hl.bind("SUPER + SHIFT + Return", hl.dsp.exec_cmd(v.term .. " -e -- zellij a main")) +hl.bind("CONTROL + ALT + SHIFT + T", hl.dsp.exec_cmd(v.term .. " -e -- zellij a main")) +-- Application menu +hl.bind("ALT + Space", hl.dsp.exec_cmd(v.menu)) +-- TODO hl.bind("Alt + Tab", focuscurrentorlast) +-- TODO hl.bind("SUPER + Tab", hl.dsp.exec_cmd(v.windowmenu)) + +hl.gesture({ fingers = 3, direction = "up", action = function () hl.exec_cmd("pkill " .. v.menu .. " || " .. v.menu) end }) +hl.gesture({ fingers = 3, direction = "down", action = function () hl.exec_cmd("pkill " .. v.menu) end }) + +hl.bind("SUPER + E", hl.dsp.exec_cmd(v.term .. " -e vifm")) +hl.bind("CONTROL + SHIFT + Escape", hl.dsp.exec_cmd(v.term .. " -e zenith")) + +hl.bind("SUPER + mouse_down", hl.dsp.focus({ workspace = "e-1" })) +hl.bind("SUPER + mouse_up", hl.dsp.focus({ workspace = "e+1" })) + +hl.bind("SUPER + Delete", hl.dsp.exec_cmd(v.lock)) + +-- Glass magnifier zoom + +local MAX_ZOOM = 3 +local MIN_ZOOM = 1 +local ZOOM_TOGGLE_FACTOR + +--@param offset number +--@return nil +local function zoom(offset) + local current = hl.get_config("cursor.zoom_factor") + if offset ~= nil then + current = current + offset + elseif current ~= MIN_ZOOM then + current = MIN_ZOOM + else + current = ZOOM_TOGGLE_FACTOR + end + current = math.max(MIN_ZOOM, math.min(MAX_ZOOM, current)) + hl.config({ + cursor = { + zoom_factor = current + } + }) +end + +hl.bind("SUPER + SHIFT + Z", zoom) +hl.bind("SUPER + SHIFT + Z + KP_Add", function() + zoom(0.5) +end) +hl.bind("SUPER + SHIFT + Z + minus", function() + zoom(-0.5) +end) + diff --git a/stow/hyprland/.config/hypr/modes.conf b/stow/hyprland/.config/hypr/modes.conf deleted file mode 100644 index 4e11c56..0000000 --- a/stow/hyprland/.config/hypr/modes.conf +++ /dev/null @@ -1,105 +0,0 @@ -# Resizing -$mode_resize = Resize -bind = $flag, R, submap, $mode_resize -submap = $mode_resize - -bind = , F, togglefloating - -binde = , $right, resizeactive, 10 0 -binde = , $up, resizeactive, 0 -10 -binde = , $left, resizeactive, -10 0 -binde = , $down, resizeactive, 0 10 - -binde = , Right , resizeactive, 10 0 -binde = , Up, resizeactive, 0 -10 -binde = , Left, resizeactive, -10 0 -binde = , Down, resizeactive, 0 10 - -binde = Shift, $right, resizeactive, 50 0 -binde = Shift, $up, resizeactive, 0 -50 -binde = Shift, $left, resizeactive, -50 0 -binde = Shift, $down, resizeactive, 0 50 - -binde = Shift, Right, resizeactive, 50 0 -binde = Shift, Up, resizeactive, 0 -50 -binde = Shift, Left, resizeactive, -50 0 -binde = Shift, Down, resizeactive, 0 50 - -binde = $flag, $right, moveactive, 10 0 -binde = $flag, $up, moveactive, 0 -10 -binde = $flag, $left, moveactive, -10 0 -binde = $flag, $down, moveactive, 0 10 - -binde = $flag, Right, moveactive, 10 0 -binde = $flag, Up, moveactive, 0 -10 -binde = $flag, Left, moveactive, -10 0 -binde = $flag, Down, moveactive, 0 10 - -binde = $flag+Shift, $right, moveactive, 50 0 -binde = $flag+Shift, $up, moveactive, 0 -50 -binde = $flag+Shift, $left, moveactive, -50 0 -binde = $flag+Shift, $down, moveactive, 0 50 - -binde = $flag+Shift, Right , moveactive, 50 0 -binde = $flag+Shift, Up, moveactive, 0 -50 -binde = $flag+Shift, Left, moveactive, -50 0 -binde = $flag+Shift, Down, moveactive, 0 50 - - -# hyprlang if HYPRLAND_V_0_53 -#gesture = 3, swipe, move -#gesture = 4, swipe, resize -# hyprlang endif - -bind = $flag, R, submap, reset -bind = , Escape, submap, reset -bind = , Return, submap, reset - -submap = reset - -# System actions -$mode_system = System (l)ock, (s)leep, (h)ibernate, (r)eboot, (Shift+s)hutdown -bind = Ctrl+Alt, Delete, submap, $mode_system -submap = $mode_system - -bind = , l, exec, $lock -bind = , l, submap, reset -bind = , s, exec, $lock, exec, systemctl suspend -bind = , s, submap, reset -bind = , h, exec, $lock, exec, systemctl hibernate -bind = , h, submap, reset -bind = , r, exec, systemctl reboot -bind = Shift, s, exec, systemctl poweroff -i - -bind = Ctrl+Alt, Delete, submap, reset -bind = , Escape, submap, reset -bind = , Return, submap, reset - -submap = reset - -# Launcher -$mode_launcher = Launch (f)irefox, (t)hunderbird, (l)ogseq. -bind = $flag, O, submap, $mode_launcher -submap = $mode_launcher - -bind = , F, exec, firefox -bind = , F, submap, reset -bind = , L, exec, logseq -bind = , L, submap, reset -bind = , T, exec, thunderbird -bind = , T, submap, reset - -bind = $flag, O, submap, reset -bind = , Escape, submap, reset -bind = , Return, submap, reset - -submap = reset - -# Ignore (all) keybinds. Useful when working with Virtual Machines. -$mode_ignore=Ignore keybinds - Press Control+Alt+Insert to escape. -bind = Ctrl+Alt, Insert, submap, $mode_ignore -submap = $mode_ignore - -bind = Ctrl+Alt, Insert, submap, reset - -submap = reset diff --git a/stow/hyprland/.config/hypr/modes.lua b/stow/hyprland/.config/hypr/modes.lua new file mode 100644 index 0000000..6f43bae --- /dev/null +++ b/stow/hyprland/.config/hypr/modes.lua @@ -0,0 +1,186 @@ +local v = require("variables") + +local mode_reset = "reset" + +-- Resizing +local mode_resize = "Resize" +local mode_resize_toggle = "SUPER + R" +hl.bind(mode_resize_toggle, hl.dsp.submap(mode_resize)) +hl.define_submap(mode_resize, function () + hl.bind("F", hl.dsp.window.float({ action = "toggle" })) + + local directions = { "Up", "Right", "Down", "Left", v.up, v.right, v.down, v.left } + local dx = { 0, 1, 0, -1, 0, 1, 0, -1 } + local dy = { -1, 0, 1, 0, -1, 0, 1, 0 } + for i, direction in ipairs(directions) do + -- Resize windows with arrow keys or vim keys + hl.bind(direction, hl.dsp.window.resize({ x = dx[i] * 10, y = dy[i] * 10 }), { repeating = true }) + hl.bind("SHIFT + " .. direction, hl.dsp.window.resize({ x = dx[i] * 50, y = dy[i] * 50 }), { repeating = true }) + + hl.bind("CONTROL + " .. direction, hl.dsp.window.resize({ x = dx[i] * 10, y = dy[i] * 10, relative = true }), { repeating = true }) + hl.bind("CONTROL + SHIFT + " .. direction, hl.dsp.window.resize({ x = dx[i] * 50, y = dy[i] * 50, relative = true }), { repeating = true }) + + -- Move windows with arrow keys or vim keys + hl.bind("SUPER + " .. direction, hl.dsp.window.move({ x = dx[i] * 10, y = dy[i] * 10 }), { repeating = true }) + hl.bind("SUPER + SHIFT + " .. direction, hl.dsp.window.move({ x = dx[i] * 50, y = dy[i] * 50 }), { repeating = true }) + end + + hl.gesture({ fingers = 2, direction = "swipe", action = "move" }) + hl.gesture({ fingers = 3, direction = "swipe", action = "resize" }) + + -- hl.bind(mode_resize_toggle, hl.dsp.submap(mode_reset)) + hl.bind("Escape", hl.dsp.submap(mode_reset)) + hl.bind("Return", hl.dsp.submap(mode_reset)) +end) + +-- System actions +local mode_system = "System (l)ock, (s)leep, (h)ibernate, (r)eboot, (Shift+s)hutdown" +local mode_system_toggle = "CONTROL + ALT + Delete" +hl.bind(mode_system_toggle, hl.dsp.submap(mode_system)) +hl.define_submap(mode_system, function () + + hl.bind("L", function () + hl.dispatch(hl.dsp.submap(mode_reset)) + hl.dispatch(hl.dsp.exec_cmd(v.lock)) + end) + hl.bind("S", function () + hl.dispatch(hl.dsp.submap(mode_reset)) + hl.dispatch(hl.dsp.exec_cmd(v.lock)) + hl.dispatch(hl.dsp.exec_cmd("systemctl suspend")) + end) + hl.bind("H", function () + hl.dispatch(hl.dsp.submap(mode_reset)) + hl.dispatch(hl.dsp.exec_cmd(v.lock)) + hl.dispatch(hl.dsp.exec_cmd("systemctl hibernate")) + end) + hl.bind("R", function () + hl.dispatch(hl.dsp.submap(mode_reset)) + hl.dispatch(hl.dsp.exec_cmd("systemctl reboot")) + end) + hl.bind("SHIFT + S", function () + hl.dispatch(hl.dsp.submap(mode_reset)) + hl.dispatch(hl.dsp.exec_cmd("systemctl poweroff -i")) + end) + + -- hl.bind(mode_system_toggle, hl.dsp.submap(mode_reset)) + hl.bind("Escape", hl.dsp.submap(mode_reset)) + hl.bind("Return", hl.dsp.submap(mode_reset)) +end) + +-- Launcher +local mode_launcher = "Launch (f)irefox, (n)otes or (t)hunderbird" +local mode_launcher_toggle = "SUPER + O" +hl.bind(mode_launcher_toggle, hl.dsp.submap(mode_launcher)) +hl.define_submap(mode_launcher, mode_reset, function () + hl.bind("F", hl.dsp.exec_cmd("firefox")) + hl.bind("N", hl.dsp.exec_cmd("logseq")) + hl.bind("T", hl.dsp.exec_cmd("thunderbird")) + + --hl.bind(mode_launcher_toggle, hl.dsp.submap(mode_reset)) + hl.bind("Escape", hl.dsp.submap(mode_reset)) + hl.bind("Return", hl.dsp.submap(mode_reset)) +end) + +-- Preferences +local mode_preferences = "Toggle (d)ark mode, (n)otifications, (s)unset/nightlight" +local mode_preferences_toggle = "ALT + End" +hl.bind(mode_preferences_toggle, hl.dsp.submap(mode_preferences)) +hl.bind("ALT + KP_End", hl.dsp.submap(mode_preferences)) +hl.define_submap(mode_preferences, mode_reset, function () + hl.bind("D", hl.dsp.exec_cmd("${SCRIPT_DIR}/toggle-light-dark.sh")) + hl.bind("N", hl.dsp.exec_cmd("${SCRIPT_DIR}/toggle-notifications.sh")) + hl.bind("S", hl.dsp.exec_cmd("${SCRIPT_DIR}/toggle-nightlight.sh")) + + hl.bind("Escape", hl.dsp.submap(mode_reset)) + hl.bind("Return", hl.dsp.submap(mode_reset)) +end) + +-- Ignore (all) keybinds. Useful when working with Virtual Machines. +local mode_ignore = "Ignoring keybinds - Press Ctrl+Alt+Shift+Insert to escape." +local mode_ignore_toggle = "CONTROL + ALT + Insert" +hl.bind(mode_ignore_toggle, hl.dsp.submap(mode_ignore)) +hl.define_submap(mode_ignore, function () + hl.bind("CONTROL + ALT + SHIFT + Insert", hl.dsp.submap(mode_reset)) +end) + +-- Screenshots +local mode_screenshot = "Screenshot of (a)rea, current (w)indow, (s)creen - Shift to save" +local mode_screenshot_toggle = "Print" +local screenshot_format = "~/Nextcloud/Afbeeldingen/Screenshots/$(date +%F-%H-%M-%S).png" +hl.bind(mode_screenshot_toggle, hl.dsp.submap(mode_screenshot)) +hl.define_submap(mode_screenshot, mode_reset, function () + local function take_screenshot(target, action, interactive) + local date_str = os.date("%F-%H-%M-%S") + local save_dir = os.getenv("HOME") .. "/Nextcloud/Afbeeldingen/Screenshots/" + local save_path + if action == "save" then + save_path = save_dir .. "/" .. date_str .. ".png" + else + save_path = "/tmp/screenshot_" .. date_str .. ".png" + end + + local cmd = "" + if target == "area" then + cmd = cmd .. string.format('grim -g "$( slurp )" "%s"', save_path) + + elseif target == "window" then + local window_geometry + if interactive then + --window_geometry = [[$(workspace_id="$(hyprctl activeworkspace -j | jq '.id')"; hyprctl clients -j | jq -r --argjson ws "${workspace_id}" '.[] | select(.workspace.id == $ws) | "\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1])"' | slurp -d)]] + window_geometry = [[$(ws="$(hyprctl activeworkspace -j | jq '.id')"; hyprctl clients -j | jq -r --argjson ws "$ws" '.[] | select(.workspace.id == $ws) | (.at[0]|tostring) + "," + (.at[1]|tostring) + " " + (.size[0]|tostring) + "x" + (.size[1]|tostring)' | slurp -d)]] + else + -- window_geometry = [[$(hyprctl activewindow -j | jq -r '"\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1])"')]] + window_geometry = [[$(hyprctl activewindow -j | jq -r '(.at[0]|tostring) + "," + (.at[1]|tostring) + " " + (.size[0]|tostring) + "x" + (.size[1]|tostring)')]] + end + cmd = cmd .. string.format('grim -g "%s" "%s"', window_geometry, save_path) + + elseif target == "screen" then + local monitor_geometry + if interactive then + -- monitor_geometry = [[$(hyprctl monitors -j | jq -r '.[] | "\(.x),\(.y) \(.width)x\(.height)"' | slurp -d)]] + monitor_geometry = [[$(hyprctl monitors -j | jq -r '.[] | (.x|tostring) + "," + (.y|tostring) + " " + (.width|tostring) + "x" + (.height|tostring)' | slurp -d)]] + cmd = cmd .. string.format('grim -g "%s" "%s"', monitor_geometry, save_path) + else + -- monitor_geometry = [[$(workspace_id="$(hyprctl activeworkspace -j | jq '.id')"; hyprctl monitors -j | jq -r --argjson ws "${workspace_id}" '.[] | select(.activeWorkspace.id == $ws) | .name')]] + monitor_geometry = [[$(ws="$(hyprctl activeworkspace -j | jq '.id')"; hyprctl monitors -j | jq -r --argjson ws "$ws" '.[] | select(.activeWorkspace.id == $ws) | .name')]] + cmd = cmd .. string.format('grim -o "%s" "%s"', monitor_geometry, save_path) + end + + elseif target == "all" then + cmd = cmd .. string.format('grim "%s"', save_path) + + else + --hl.error("Invalid screenshot target: " .. target) + return + end + + if action == "copy" then + cmd = cmd .. string.format(' && wl-copy < "%s"', save_path) + end + + local destination = (action == "copy") and "Copied to clipboard" or ("Saved to " .. save_path) + cmd = cmd .. string.format(' && notify-send -a "Grim" -i "%s" "Screenshot Captured" "%s"', save_path, destination) + + hl.exec_cmd("sh -c '" .. cmd .. "'") + end + + hl.bind("A", function() take_screenshot("area", "copy", false) end) + hl.bind("W", function() take_screenshot("window", "copy", false) end) + hl.bind("S", function() take_screenshot("screen", "copy", false) end) + hl.bind("A", function() take_screenshot("area", "copy", true) end, { longpress = true }) + + hl.bind("SHIFT + A", function() take_screenshot("area", "save", false) end) + hl.bind("SHIFT + W", function() take_screenshot("window", "save", false) end) + hl.bind("SHIFT + S", function() take_screenshot("screen", "save", false) end) + hl.bind("SHIFT + A", function() take_screenshot("area", "save", true) end, { longpress = true }) + + hl.bind("CONTROL + W", function() take_screenshot("window", "copy", true) end) + hl.bind("CONTROL + S", function() take_screenshot("screen", "copy", true) end) + + hl.bind("CONTROL + SHIFT + W", function() take_screenshot("window", "save", true) end) + hl.bind("CONTROL + SHIFT + S", function() take_screenshot("screen", "save", true) end) + + hl.bind("Escape", hl.dsp.submap(mode_reset)) + hl.bind("Return", hl.dsp.submap(mode_reset)) +end) + diff --git a/stow/hyprland/.config/hypr/monitors.conf b/stow/hyprland/.config/hypr/monitors.lua similarity index 100% rename from stow/hyprland/.config/hypr/monitors.conf rename to stow/hyprland/.config/hypr/monitors.lua diff --git a/stow/hyprland/.config/hypr/undocked.conf b/stow/hyprland/.config/hypr/undocked.lua similarity index 100% rename from stow/hyprland/.config/hypr/undocked.conf rename to stow/hyprland/.config/hypr/undocked.lua diff --git a/stow/hyprland/.config/hypr/variables.lua b/stow/hyprland/.config/hypr/variables.lua new file mode 100644 index 0000000..4b31191 --- /dev/null +++ b/stow/hyprland/.config/hypr/variables.lua @@ -0,0 +1,26 @@ +local M = {} + +-- SHIFT CAPS CTRL/CONTROL ALT MOD2 MOD3 SUPER/WIN/LOGO/MOD4 MOD5 +M.flag = "Super" + +M.LMB = "mouse:272" +M.RMB = "mouse:273" +M.MMB = "mouse:274" + +M.left = "h" +M.down = "j" +M.up = "k" +M.right = "l" + +M.ws = { + ids = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12" }, + keys = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "Minus", "Equal" }, +} + +M.term = "foot" +M.menu = "j4-dmenu-desktop --dmenu=\"rofi -dmenu -i\" --no-generic --usage-log=\"/home/tdpeuter/.local/state/dmenu.log\" --term=$term" +M.lock = "swaylock --daemonize" + +M.enable_hy3 = true + +return M diff --git a/stow/hyprland/.config/hypr/workspaces.conf b/stow/hyprland/.config/hypr/workspaces.conf deleted file mode 100644 index e69de29..0000000