mirror of
https://github.com/youwen5/nixos.git
synced 2025-01-17 20:52:09 -08:00
feat: next generation hyprscroller layout
This commit is contained in:
parent
787a4e8c41
commit
92cb6ca5d6
4 changed files with 89 additions and 17 deletions
|
@ -10,12 +10,27 @@ in
|
||||||
{
|
{
|
||||||
wayland.windowManager.hyprland.settings = lib.mkIf cfg.enable {
|
wayland.windowManager.hyprland.settings = lib.mkIf cfg.enable {
|
||||||
bind =
|
bind =
|
||||||
|
(
|
||||||
|
if cfg.hyprscroller.enable then
|
||||||
[
|
[
|
||||||
# Window actions
|
"$mod+Shift, $Left, scroller:movewindow, l"
|
||||||
"$mod, Q, killactive"
|
"$mod+Shift, $Right, scroller:movewindow, r"
|
||||||
"$mod, W, togglefloating"
|
"$mod+Shift, $Up, scroller:movewindow, u"
|
||||||
"$mod, V, togglesplit"
|
"$mod+Shift, $Down, scroller:movewindow, d"
|
||||||
"$mod, Return, fullscreen"
|
|
||||||
|
# Move around
|
||||||
|
"$mod, $Left, scroller:movefocus, l"
|
||||||
|
"$mod, $Right, scroller:movefocus, r"
|
||||||
|
"$mod, $Up, scroller:movefocus, u"
|
||||||
|
"$mod, $Down, scroller:movefocus, d"
|
||||||
|
]
|
||||||
|
else
|
||||||
|
# Move windows around
|
||||||
|
[
|
||||||
|
"$mod+Shift, $Left, movewindow, l"
|
||||||
|
"$mod+Shift, $Right, movewindow, r"
|
||||||
|
"$mod+Shift, $Up, movewindow, u"
|
||||||
|
"$mod+Shift, $Down, movewindow, d"
|
||||||
|
|
||||||
# Move around
|
# Move around
|
||||||
"$mod, $Left, movefocus, l"
|
"$mod, $Left, movefocus, l"
|
||||||
|
@ -23,6 +38,36 @@ in
|
||||||
"$mod, $Up, movefocus, u"
|
"$mod, $Up, movefocus, u"
|
||||||
"$mod, $Down, movefocus, d"
|
"$mod, $Down, movefocus, d"
|
||||||
|
|
||||||
|
"$mod, V, togglesplit"
|
||||||
|
]
|
||||||
|
)
|
||||||
|
++ (lib.optionals cfg.hyprscroller.enable [
|
||||||
|
"$mod, comma, scroller:admitwindow"
|
||||||
|
"$mod, period, scroller:expelwindow"
|
||||||
|
"$mod, F, scroller:fitsize, active"
|
||||||
|
"$mod, Y, scroller:fitsize, all"
|
||||||
|
"$mod, semicolon, scroller:cyclesize, next"
|
||||||
|
"$mod, apostrophe, scroller:cyclesize, previous"
|
||||||
|
|
||||||
|
"$mod+Shift, U, movetoworkspace, r+1"
|
||||||
|
"$mod+Shift, I, movetoworkspace, r-1"
|
||||||
|
|
||||||
|
"$mod, U, workspace, r+1"
|
||||||
|
"$mod, I, workspace, r-1"
|
||||||
|
|
||||||
|
# harder to reach number keys
|
||||||
|
"$mod, A, workspace, 1"
|
||||||
|
"$mod, D, workspace, 2"
|
||||||
|
|
||||||
|
"$mod, C, scroller:setmode, c"
|
||||||
|
"$mod, V, scroller:setmode, r"
|
||||||
|
])
|
||||||
|
++ [
|
||||||
|
# Window actions
|
||||||
|
"$mod, Q, killactive"
|
||||||
|
"$mod, W, togglefloating"
|
||||||
|
"$mod, Return, fullscreen"
|
||||||
|
|
||||||
"$mod, 1, workspace, 1"
|
"$mod, 1, workspace, 1"
|
||||||
"$mod, 2, workspace, 2"
|
"$mod, 2, workspace, 2"
|
||||||
"$mod, 3, workspace, 3"
|
"$mod, 3, workspace, 3"
|
||||||
|
@ -34,12 +79,6 @@ in
|
||||||
"$mod, 9, workspace, 9"
|
"$mod, 9, workspace, 9"
|
||||||
"$mod, 0, workspace, 10"
|
"$mod, 0, workspace, 10"
|
||||||
|
|
||||||
# Move windows around
|
|
||||||
"$mod+Shift, $Left, movewindow, l"
|
|
||||||
"$mod+Shift, $Right, movewindow, r"
|
|
||||||
"$mod+Shift, $Up, movewindow, u"
|
|
||||||
"$mod+Shift, $Down, movewindow, d"
|
|
||||||
|
|
||||||
"$mod+Ctrl, bracketright, movetoworkspace, r+1"
|
"$mod+Ctrl, bracketright, movetoworkspace, r+1"
|
||||||
"$mod+Ctrl, bracketleft, movetoworkspace, r-1"
|
"$mod+Ctrl, bracketleft, movetoworkspace, r-1"
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,13 @@ in
|
||||||
Whether to enable and rice Hyprland as well as some basic desktop utilities.
|
Whether to enable and rice Hyprland as well as some basic desktop utilities.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
hyprscroller.enable = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = cfg.enable;
|
||||||
|
description = ''
|
||||||
|
Whether to enable the hyprscroller scrolling layout.
|
||||||
|
'';
|
||||||
|
};
|
||||||
useAdvancedBindings = lib.mkEnableOption "advanced keybinds";
|
useAdvancedBindings = lib.mkEnableOption "advanced keybinds";
|
||||||
applyGtkFix = lib.mkOption {
|
applyGtkFix = lib.mkOption {
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
|
@ -78,6 +85,7 @@ in
|
||||||
|
|
||||||
wayland.windowManager.hyprland = {
|
wayland.windowManager.hyprland = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
plugins = lib.mkIf cfg.hyprscroller.enable [ pkgs.hyprlandPlugins.hyprscroller ];
|
||||||
settings = {
|
settings = {
|
||||||
"$mod" = "SUPER";
|
"$mod" = "SUPER";
|
||||||
"$Left" = "H";
|
"$Left" = "H";
|
||||||
|
@ -126,6 +134,7 @@ in
|
||||||
"winIn, 0.1, 1.1, 0.1, 1.1"
|
"winIn, 0.1, 1.1, 0.1, 1.1"
|
||||||
"winOut, 0.3, -0.3, 0, 1"
|
"winOut, 0.3, -0.3, 0, 1"
|
||||||
"liner, 1, 1, 1, 1"
|
"liner, 1, 1, 1, 1"
|
||||||
|
"windup, 0.05, 0.9, 0.1, 1.05"
|
||||||
];
|
];
|
||||||
animation =
|
animation =
|
||||||
[
|
[
|
||||||
|
@ -134,9 +143,18 @@ in
|
||||||
"windowsOut, 1, 5, winOut, slide"
|
"windowsOut, 1, 5, winOut, slide"
|
||||||
"windowsMove, 1, 5, wind, slide"
|
"windowsMove, 1, 5, wind, slide"
|
||||||
"fade, 1, 10, default"
|
"fade, 1, 10, default"
|
||||||
"workspaces, 1, 5, wind"
|
|
||||||
# "layers, 1, 8, default, slide"
|
# "layers, 1, 8, default, slide"
|
||||||
]
|
]
|
||||||
|
++ (
|
||||||
|
if cfg.hyprscroller.enable then
|
||||||
|
[
|
||||||
|
"workspaces, 1, 5, wind, slidevert"
|
||||||
|
]
|
||||||
|
else
|
||||||
|
[
|
||||||
|
"workspaces, 1, 5, wind"
|
||||||
|
]
|
||||||
|
)
|
||||||
++ (lib.optionals (!osConfig.liminalOS.powersave) [
|
++ (lib.optionals (!osConfig.liminalOS.powersave) [
|
||||||
"border, 1, 1, liner"
|
"border, 1, 1, liner"
|
||||||
"borderangle, 1, 30, liner, loop"
|
"borderangle, 1, 30, liner, loop"
|
||||||
|
@ -155,7 +173,7 @@ in
|
||||||
# "col.inactive_border" = pkgs.lib.mkForce "rgba(b4befecc) rgba(6c7086cc) 45deg";
|
# "col.inactive_border" = pkgs.lib.mkForce "rgba(b4befecc) rgba(6c7086cc) 45deg";
|
||||||
"col.active_border" = "rgba(${colors.base0A}ff) rgba(${colors.base09}ff) 45deg";
|
"col.active_border" = "rgba(${colors.base0A}ff) rgba(${colors.base09}ff) 45deg";
|
||||||
"col.inactive_border" = "rgba(${colors.base01}cc) rgba(${colors.base02}cc) 45deg";
|
"col.inactive_border" = "rgba(${colors.base01}cc) rgba(${colors.base02}cc) 45deg";
|
||||||
layout = "dwindle";
|
layout = if cfg.hyprscroller.enable then "scroller" else "dwindle";
|
||||||
resize_on_border = "true";
|
resize_on_border = "true";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -187,6 +205,10 @@ in
|
||||||
input = {
|
input = {
|
||||||
sensitivity = if config.liminalOS.formFactor == "laptop" then "0.0" else "-0.65";
|
sensitivity = if config.liminalOS.formFactor == "laptop" then "0.0" else "-0.65";
|
||||||
};
|
};
|
||||||
|
plugin.scroller = lib.mkIf cfg.hyprscroller.enable {
|
||||||
|
column_widths = "onethird onehalf twothirds one";
|
||||||
|
column_heights = "onethird onehalf twothirds one";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -11,5 +11,16 @@ in
|
||||||
{
|
{
|
||||||
nixpkgs.overlays = [
|
nixpkgs.overlays = [
|
||||||
(import ../pkgs { inherit pkgs; })
|
(import ../pkgs { inherit pkgs; })
|
||||||
|
(final: prev: {
|
||||||
|
hyprlandPlugins.hyprscroller = prev.hyprlandPlugins.hyprscroller.overrideAttrs {
|
||||||
|
version = "0-unstable-2025-01-16";
|
||||||
|
src = prev.fetchFromGitHub {
|
||||||
|
owner = "dawsers";
|
||||||
|
repo = "hyprscroller";
|
||||||
|
rev = "e250f38bde9659ee8459c05a173bcc5c2655418f";
|
||||||
|
hash = "sha256-rqDfY/wPG2F5NfHx6yEWMRybapNwmjjawQ7tWe6gDaw=";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
})
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
liminalOS = {
|
liminalOS = {
|
||||||
utils.easyeffects.enable = true;
|
utils.easyeffects.enable = true;
|
||||||
desktop.hyprland.screenlocker.useNvidiaCrashFix = true;
|
desktop.hyprland.screenlocker.useNvidiaCrashFix = true;
|
||||||
desktop.hyprland.useAdvancedBindings = true;
|
desktop.hyprland.useAdvancedBindings = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.git = {
|
programs.git = {
|
||||||
|
|
Loading…
Reference in a new issue