From 2caaa661d95a8de58ef1e5474f42e596f534f04f Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Fri, 29 Mar 2024 14:46:11 -0400 Subject: [PATCH] meta(hyprland): Add hycov plugin This cool plugin makes it possible to press "alt+tab" in order to switch between all windows in Hyprland, particularly useful if a certain window you want to focus is a few workspaces away from your current one. It's also possible to swipe up with 4 fingers to show hycov, from which you can then use 3 finger motions to switch between the shown windows. Finally, it's possible to show hycov by simply hovering over the bottom right part of the screen, similar to the "show desktop" functionality in certain desktop environments and GNOME's hot corner feature. --- home/hyprland.nix | 23 +++++++++++++++++++++++ packages/hycov.nix | 29 +++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 packages/hycov.nix diff --git a/home/hyprland.nix b/home/hyprland.nix index a2df1b05..20ee0b6a 100644 --- a/home/hyprland.nix +++ b/home/hyprland.nix @@ -11,6 +11,14 @@ in hyprlock ]; + wayland.windowManager.hyprland = { + enable = true; + + plugins = [ + (pkgs.callPackage ../packages/hycov.nix { }) + ]; + }; + xdg.configFile."hypr/gaps.sh" = { executable = true; text = /* bash */ '' @@ -334,6 +342,21 @@ in bind = $SUPER_SHIFT, 1, exec, hyprnome --previous --move bind = $SUPER_SHIFT, 2, exec, hyprnome --move + bind = ALT, tab, hycov:toggleoverview + bind = ALT, h, hycov:movefocus,l + bind = ALT, l, hycov:movefocus,r + bind = ALT, k, hycov:movefocus,u + bind = ALT, j, hycov:movefocus,d + + plugin { + hycov { + hotarea_pos = 2 + enable_gesture = 1 + enable_alt_release_exit = 1 + alt_toggle_auto_next = 1 + } + } + bind = CTRL, Alt_L, submap, passthrough submap = passthrough bind = CTRL, Alt_L, submap, reset diff --git a/packages/hycov.nix b/packages/hycov.nix new file mode 100644 index 00000000..a2b7e495 --- /dev/null +++ b/packages/hycov.nix @@ -0,0 +1,29 @@ +{ + lib, + stdenv, + hyprland, + fetchFromGitHub, +}: + +stdenv.mkDerivation { + pname = "hycov"; + version = "0.1"; + + src = fetchFromGitHub { + owner = "Ayuei"; + repo = "hycov"; + rev = "db6ea8a24f0a58fa69f86db49d7c853754b1b8e1"; + hash = "sha256-fSujEAViKqQusHyYe7Qg8QnLlyUNOf0/Jk1P70BmiyE="; + }; + + inherit (hyprland) nativeBuildInputs; + + buildInputs = [ hyprland ] ++ hyprland.buildInputs; + + meta = with lib; { + homepage = "https://github.com/Ayuei/hycov"; + description = "Clients overview for hyprland plugin"; + license = licenses.mit; + platforms = platforms.linux; + }; +}