Work on moving hyprland

This commit is contained in:
Thomas Avé 2024-05-31 23:44:20 +02:00
parent ee733b781e
commit a2e454015c
5 changed files with 460 additions and 196 deletions

View File

@ -1,172 +0,0 @@
env = WLR_NO_HARDWARE_CURSORS,1
env = TERMINAL,alacritty
$scripts = /home/user/.config/scripts
$mainMod = SUPER
monitor=DP-3,preferred,0x550,1
monitor=DP-2,preferred,1920x0,1
monitor=HDMI-A-1,preferred,5760x550,1
exec-once=hyprpaper
exec-once=wl-paste --type text --watch cliphist store
exec-once=wl-paste --type image --watch cliphist store
exec-once=/usr/lib/mate-polkit/polkit-mate-authentication-agent-1
exec-once=/usr/lib/kdeconnectd
exec-once=waybar
exec-once=hyprpm reload -n
# windowrulev2 = tile, class:.*
windowrulev2 = float, title:^(rofi)(.*)$
windowrulev2 = center, title:^(rofi)(.*)$
windowrulev2 = noborder, title:^(rofi)(.*)$
windowrulev2 = stayfocused, title:^()$,class:^(steam)$
windowrulev2 = minsize 1 1, title:^()$,class:^(steam)$
windowrulev2 = stayfocused, title:^()$,class:^(steam)$
windowrule = noanim,waybar
binds {
scroll_event_delay=1
}
input {
kb_layout = us
follow_mouse = 1
kb_options = compose:rctrl, caps:super, altwin:swap_alt_win
numlock_by_default = true
}
general {
gaps_in = 1
gaps_out = 5
border_size = 2
col.active_border = rgba(002f5fee)
col.inactive_border = rgba(ffffff00)
layout = dwindle
}
xwayland {
force_zero_scaling = true
}
misc {
disable_hyprland_logo = 1
}
decoration {
rounding = 1
blur {
enabled = false
}
}
animations {
enabled = yes
# Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more
bezier = myBezier, 0.05, 0.9, 0.1, 1.05
animation = windows, 1, 2, myBezier
animation = windowsOut, 1, 2, default, popin 80%
animation = border, 1, 2, default
animation = borderangle, 1, 2, default
animation = fade, 1, 2, default
animation = workspaces, 1, 1, default
}
dwindle {
preserve_split = yes
no_gaps_when_only = 1
force_split = 2
}
gestures {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
workspace_swipe = on
workspace_swipe_invert = false
}
bindr = $mainMod, SUPER_L, exec, pkill rofi || rofi -show drun
bindr = $mainMod, SUPER_R, exec, pkill rofi || rofi -show drun
bind = $mainMod, return, exec, $scripts/launch_alacritty.sh $(hyprctl activewindow -j | jq .pid)
bind = $mainMod SHIFT, return, exec, alacritty
bind = $mainMod, Q, killactive,
bind = $mainMod, A, exec, nautilus
bind = $mainMod, S, exec, gnome-calendar
bind = $mainMod, B, exec, MOZ_ENABLE_WAYLAND=1 firefox
bind = $mainMod, M, fullscreen, 1
bind = $mainMod, F11, fullscreen
bind = $mainMod, F, togglefloating,
bind = $mainMod, SPACE, togglesplit, # dwindle
bind = CONTROL_L ALT_L, L, exec, swaylock
bind = $mainMod, C, exec, cliphist list | awk '{print $0, "\0icon\x1fcom.github.davidmhewitt.clipped"}' | rofi -dmenu -display-columns 2 | cliphist decode | wl-copy
bind = $mainMod, Y, exec, /home/user/.config/rofi/rofi-ykman.sh
bind = $mainMod, N, exec, /home/user/.config/rofi/rofi-ssh.sh
bind = $mainMod, Escape, exec, rofi -show power-menu -modi power-menu:$scripts/rofi-power-menu
bind = ,XF86MonBrightnessUp, exec, xbacklight -inc 10
bind = ,XF86MonBrightnessDown, exec, xbacklight -dec 10
bind = ,XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 10%+ --limit 1.0
bind = ,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 10%-
bind = ,XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle
bind = ,mouse_right, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+ --limit 1.0
bind = ,mouse_left, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%-
bind = ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
bind = ,XF86AudioNext, exec, playerctl next
bind = ,XF86AudioPrev, exec, playerctl previous
bind = $mainMod,XF86AudioMute, exec, playerctl play-pause
bind = $mainMod,XF86AudioRaiseVolume, exec, playerctl next
bind = $mainMod,XF86AudioLowerVolume, exec, playerctl previous
bind = , Print, exec, grim -g "$(slurp -d)" - | wl-copy
# Move focus with mainMod + arrow keys
bind = $mainMod, H, exec, $scripts/vim-hypr-nav.sh l
bind = $mainMod, L, exec, $scripts/vim-hypr-nav.sh r
bind = $mainMod, K, exec, $scripts/vim-hypr-nav.sh u
bind = $mainMod, J, exec, $scripts/vim-hypr-nav.sh d
bind = $mainMod CONTROL_L, H, swapwindow, l
bind = $mainMod CONTROL_L, L, swapwindow, r
bind = $mainMod CONTROL_L, K, swapwindow, u
bind = $mainMod CONTROL_L, J, swapwindow, d
bind = $mainMod SHIFT, H, movewindow, l
bind = $mainMod SHIFT, L, movewindow, r
bind = $mainMod SHIFT, K, movewindow, u
bind = $mainMod SHIFT, J, movewindow, d
binde = $mainMod ALT, L, resizeactive, 20 0
binde = $mainMod ALT, H, resizeactive, -20 0
binde = $mainMod ALT, K, resizeactive, 0 -20
binde = $mainMod ALT, J, resizeactive, 0 20
bind = $mainMod, 1, split-workspace, 1
bind = $mainMod, 2, split-workspace, 2
bind = $mainMod, 3, split-workspace, 3
bind = $mainMod, 4, split-workspace, 4
bind = $mainMod, 5, split-workspace, 5
bind = $mainMod, 6, split-workspace, 6
bind = $mainMod, 7, split-workspace, 7
bind = $mainMod, 8, split-workspace, 8
bind = $mainMod, 9, split-workspace, 9
bind = $mainMod SHIFT, 1, split-movetoworkspace, 1
bind = $mainMod SHIFT, 2, split-movetoworkspace, 2
bind = $mainMod SHIFT, 3, split-movetoworkspace, 3
bind = $mainMod SHIFT, 4, split-movetoworkspace, 4
bind = $mainMod SHIFT, 5, split-movetoworkspace, 5
bind = $mainMod SHIFT, 6, split-movetoworkspace, 6
bind = $mainMod SHIFT, 7, split-movetoworkspace, 7
bind = $mainMod SHIFT, 8, split-movetoworkspace, 8
bind = $mainMod SHIFT, 9, split-movetoworkspace, 9
bind = $mainMod SHIFT, T, split-movetoworkspace, empty
bind = $mainMod, T, split-workspace, empty
# Scroll through existing workspaces with mainMod + scroll
bind = $mainMod, TAB, split-workspace, m+1
bind = $mainMod SHIFT, TAB, split-workspace, m-1
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow

View File

@ -20,7 +20,169 @@
"type": "github"
}
},
"hyprcursor": {
"inputs": {
"hyprlang": [
"hyprland",
"hyprlang"
],
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1716576411,
"narHash": "sha256-FIN1wMoyePBTtibCbaeJaoKNLuAYIGwLCWAYC1DJanw=",
"owner": "hyprwm",
"repo": "hyprcursor",
"rev": "57298fc4f13c807e50ada2c986a3114b7fc2e621",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprcursor",
"type": "github"
}
},
"hyprland": {
"inputs": {
"hyprcursor": "hyprcursor",
"hyprlang": "hyprlang",
"hyprwayland-scanner": "hyprwayland-scanner",
"nixpkgs": "nixpkgs",
"systems": "systems",
"xdph": "xdph"
},
"locked": {
"lastModified": 1717186020,
"narHash": "sha256-PQF/ng2hSQsKKsn4N+4RmVu+4ljzsrSsrAm5Yp7wADM=",
"ref": "refs/heads/main",
"rev": "a54ab301602e205f273969c093cf494d38ba4a98",
"revCount": 4752,
"submodules": true,
"type": "git",
"url": "https://github.com/hyprwm/Hyprland"
},
"original": {
"submodules": true,
"type": "git",
"url": "https://github.com/hyprwm/Hyprland"
}
},
"hyprland-protocols": {
"inputs": {
"nixpkgs": [
"hyprland",
"xdph",
"nixpkgs"
],
"systems": [
"hyprland",
"xdph",
"systems"
]
},
"locked": {
"lastModified": 1691753796,
"narHash": "sha256-zOEwiWoXk3j3+EoF3ySUJmberFewWlagvewDRuWYAso=",
"owner": "hyprwm",
"repo": "hyprland-protocols",
"rev": "0c2ce70625cb30aef199cb388f99e19a61a6ce03",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprland-protocols",
"type": "github"
}
},
"hyprlang": {
"inputs": {
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1716473782,
"narHash": "sha256-+qLn4lsHU6iL3+HTo1gTQ1tWzet8K9h+IfVemzEQZj8=",
"owner": "hyprwm",
"repo": "hyprlang",
"rev": "87d5d984109c839482b88b4795db073eb9ed446f",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprlang",
"type": "github"
}
},
"hyprwayland-scanner": {
"inputs": {
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1716058375,
"narHash": "sha256-CwjWoVnBZE5SBpRx9dgSQGCr4Goxyfcyv3zZbOhVqzk=",
"owner": "hyprwm",
"repo": "hyprwayland-scanner",
"rev": "3afed4364790aebe0426077631af1e164a9650cc",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprwayland-scanner",
"type": "github"
}
},
"nix-filter": {
"locked": {
"lastModified": 1693833173,
"narHash": "sha256-hlMABKrGbEiJD5dwUSfnw1CQ3bG7KKwDV+Nx3bEZd7U=",
"owner": "numtide",
"repo": "nix-filter",
"rev": "ac030bd9ba98e318e1f4c4328d60766ade8ebe8b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "nix-filter",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1716330097,
"narHash": "sha256-8BO3B7e3BiyIDsaKA0tY8O88rClYRTjvAp66y+VBUeU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5710852ba686cc1fd0d3b8e22b3117d43ba374c2",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1716948383,
"narHash": "sha256-SzDKxseEcHR5KzPXLwsemyTR/kaM9whxeiJohbL04rs=",
@ -39,7 +201,75 @@
"root": {
"inputs": {
"home-manager": "home-manager",
"nixpkgs": "nixpkgs"
"hyprland": "hyprland",
"nixpkgs": "nixpkgs_2",
"split-monitor-workspaces": "split-monitor-workspaces"
}
},
"split-monitor-workspaces": {
"inputs": {
"hyprland": [
"hyprland"
],
"nix-filter": "nix-filter"
},
"locked": {
"lastModified": 1716923053,
"narHash": "sha256-1KV6CErlIu73948+EVfH2OZeyIdUJlRIZLZMlo0Yqis=",
"owner": "Duckonaut",
"repo": "split-monitor-workspaces",
"rev": "df17c6f2d17d0156220a514d0ee622d734411905",
"type": "github"
},
"original": {
"owner": "Duckonaut",
"repo": "split-monitor-workspaces",
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"owner": "nix-systems",
"repo": "default-linux",
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default-linux",
"type": "github"
}
},
"xdph": {
"inputs": {
"hyprland-protocols": "hyprland-protocols",
"hyprlang": [
"hyprland",
"hyprlang"
],
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1716290197,
"narHash": "sha256-1u9Exrc7yx9qtES2brDh7/DDZ8w8ap1nboIOAtCgeuM=",
"owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland",
"rev": "91e48d6acd8a5a611d26f925e51559ab743bc438",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland",
"type": "github"
}
}
},

View File

@ -1,30 +1,49 @@
{
description = "NixOS flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager = {
url = github:nix-community/home-manager;
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
hyprland = {
type = "git";
url = "https://github.com/hyprwm/Hyprland";
submodules = true;
};
split-monitor-workspaces = {
url = "github:Duckonaut/split-monitor-workspaces";
inputs.hyprland.follows = "hyprland";
};
};
outputs = { self, nixpkgs, home-manager, ... }@inputs: {
nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
outputs = {
self,
nixpkgs,
home-manager,
split-monitor-workspaces,
...
}@inputs: let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in {
nixosConfigurations = {
nixos = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; }; # allows access to flake inputs in nixos modules
modules = [
./configuration.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = { inherit inputs; }; # allows access to flake inputs in hm modules
home-manager.users.user = {
home-manager = {
extraSpecialArgs = { inherit inputs; }; # allows access to flake inputs in hm modules
useGlobalPkgs = true;
useUserPackages = true;
users.user = {
imports = [ ./home.nix ];
};
};
}
];
};
};
};
}

View File

@ -1,11 +1,11 @@
{ config, pkgs, ... }:
{ inputs, config, pkgs, ... }:
{
imports = [
(import ./modules/zsh/config.nix {inherit config pkgs;})
(import ./modules/nvim/config.nix {inherit config pkgs;})
(import ./modules/email/config.nix {inherit config pkgs;})
(import ./modules/hyprland/config.nix {inherit config pkgs;})
(import ./modules/hyprland/config.nix {inherit inputs config pkgs;})
];
home.stateVersion = "24.11";

View File

@ -1,5 +1,192 @@
{ config, pkgs, ... }:
{
wayland.windowManager.hyprland.enable = true;
inputs,
config,
pkgs,
...
}: let
hyprland = inputs.hyprland.packages.${pkgs.system}.hyprland;
playerctl = "${pkgs.playerctl}/bin/playerctl";
wl-paste = "${pkgs.wl-clipboard}/bin/wl-paste";
hyprpaper = "${pkgs.hyprpaper}/bin/hyprpaper";
waybar = "${pkgs.waybar}/bin/waybar";
scripts = "${config.xdg.configHome}/scripts";
wpctl = "${pkgs.wireplumber}/bin/wpctl";
alacritty = "${pkgs.alacritty}/bin/alacritty";
swaylock = "${pkgs.swaylock}/bin/swaylock";
rofi = "${pkgs.rofi}/bin/rofi";
in {
services.kdeconnect = {
enable = true;
package = pkgs.kdePackages.kdeconnect-kde;
indicator = true;
};
wayland.windowManager.hyprland = {
enable = true;
systemd.variables = ["--all"];
systemd.enable = true;
systemd.enableXdgAutostart = true;
xwayland.enable = true;
plugins = [
inputs.split-monitor-workspaces.packages.${pkgs.system}.split-monitor-workspaces
];
settings = {
"$mainMod" = "SUPER";
exec-once = [
"hyprpaper"
"${wl-paste} --type text --watch cliphist store"
"${wl-paste} --type image --watch cliphist store"
"${waybar}"
];
env = [
"WLR_NO_HARDWARE_CURSORS,1"
"TERMINAL,${alacritty}"
];
windowrulev2 = [
"float, title:^(rofi)(.*)$"
"center, title:^(rofi)(.*)$"
"noborder, title:^(rofi)(.*)$"
"stayfocused, title:^()$,class:^(steam)$"
"minsize 1 1, title:^()$,class:^(steam)$"
"stayfocused, title:^()$,class:^(steam)$"
];
windowrule = [
"noanim,waybar"
];
monitor = [
"DP-3,preferred,0x550,1"
"DP-2,preferred,1920x0,1"
"HDMI-A-1,preferred,5760x550,1"
];
general = {
gaps_in = 1;
gaps_out = 5;
border_size = 2;
col.active_border = "rgba(002f5fee)";
col.inactive_border = "rgba(ffffff00)";
layout = "dwindle";
};
input = {
kb_layout = "us";
follow_mouse = 1;
kb_options = "compose:rctrl, caps:super, altwin:swap_alt_win";
numlock_by_default = true;
};
binds = {
scroll_event_delay = 1;
};
xwayland = {
force_zero_scaling = true;
};
misc = {
disable_hyprland_logo = 1;
};
decoration = {
rounding = 1;
blur = {
enabled = false;
};
};
animations = {
enabled = "yes";
bezier = "myBezier, 0.05, 0.9, 0.1, 1.05";
animation = [
"windows, 1, 2, myBezier"
"windowsOut, 1, 2, default, popin 80%"
"border, 1, 2, default"
"borderangle, 1, 2, default"
"fade, 1, 2, default"
"workspaces, 1, 1, default"
];
};
dwindle = {
preserve_split = "yes";
no_gaps_when_only = 1;
force_split = 2;
};
gestures = {
workspace_swipe = "on";
workspace_swipe_invert = false;
};
bindr = [
"$mainMod, SUPER_L, exec, pkill rofi || ${rofi} -show drun"
"$mainMod, SUPER_R, exec, pkill rofi || ${rofi} -show drun"
];
bindm = [
"$mainMod, mouse:272, movewindow"
"$mainMod, mouse:273, resizewindow"
];
bind = [
"$mainMod, return, exec, ${scripts}/launch_alacritty.sh $(hyprctl activewindow -j | jq .pid)"
"$mainMod SHIFT, return, exec, ${alacritty}"
"$mainMod, Q, killactive,"
"$mainMod, A, exec, nautilus"
"$mainMod, S, exec, gnome-calendar"
"$mainMod, B, exec, MOZ_ENABLE_WAYLAND=1 firefox"
"$mainMod, M, fullscreen, 1"
"$mainMod, F11, fullscreen"
"$mainMod, F, togglefloating,"
"$mainMod, SPACE, togglesplit, # dwindle"
"CONTROL_L ALT_L, L, exec, ${swaylock}"
"$mainMod, C, exec, cliphist list | awk '{print $0, \"\0icon\x1fcom.github.davidmhewitt.clipped\"}' | ${rofi} -dmenu -display-columns 2 | cliphist decode | wl-copy"
"$mainMod, Y, exec, ${config.xdg.configHome}/rofi/rofi-ykman.sh"
"$mainMod, N, exec, ${config.xdg.configHome}/rofi/rofi-ssh.sh"
"$mainMod, Escape, exec, ${rofi} -show power-menu -modi power-menu:${scripts}/rofi-power-menu"
",XF86MonBrightnessUp, exec, xbacklight -inc 10"
",XF86MonBrightnessDown, exec, xbacklight -dec 10"
",XF86AudioRaiseVolume, exec, ${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 10%+ --limit 1.0"
",XF86AudioLowerVolume, exec, ${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 10%-"
",XF86AudioMicMute, exec, ${wpctl} set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
",mouse_right, exec, ${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 1%+ --limit 1.0"
",mouse_left, exec, ${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 1%-"
",XF86AudioMute, exec, ${wpctl} set-mute @DEFAULT_AUDIO_SINK@ toggle"
",XF86AudioNext, exec, ${playerctl} next"
",XF86AudioPrev, exec, ${playerctl} previous"
"$mainMod,XF86AudioMute, exec, ${playerctl} play-pause"
"$mainMod,XF86AudioRaiseVolume, exec, ${playerctl} next"
"$mainMod,XF86AudioLowerVolume, exec, ${playerctl} previous"
", Print, exec, grim -g \"$(slurp -d)\" - | wl-copy"
"focus with mainMod + arrow keys"
"$mainMod, H, exec, ${scripts}/vim-hypr-nav.sh l"
"$mainMod, L, exec, ${scripts}/vim-hypr-nav.sh r"
"$mainMod, K, exec, ${scripts}/vim-hypr-nav.sh u"
"$mainMod, J, exec, ${scripts}/vim-hypr-nav.sh d"
"$mainMod CONTROL_L, H, swapwindow, l"
"$mainMod CONTROL_L, L, swapwindow, r"
"$mainMod CONTROL_L, K, swapwindow, u"
"$mainMod CONTROL_L, J, swapwindow, d"
"$mainMod SHIFT, H, movewindow, l"
"$mainMod SHIFT, L, movewindow, r"
"$mainMod SHIFT, K, movewindow, u"
"$mainMod SHIFT, J, movewindow, d"
"$mainMod ALT, L, resizeactive, 20 0"
"$mainMod ALT, H, resizeactive, -20 0"
"$mainMod ALT, K, resizeactive, 0 -20"
"$mainMod ALT, J, resizeactive, 0 20"
"$mainMod SHIFT, T, split-movetoworkspace, empty"
"$mainMod, T, split-workspace, empty"
"$mainMod, TAB, split-workspace, m+1"
"$mainMod SHIFT, TAB, split-workspace, m-1"
]
++ (
# workspaces
# binds $mod + [shift +] {1..10} to [move to] workspace {1..10}
builtins.concatLists (builtins.genList (
x: let
ws = let
c = (x + 1) / 10;
in
builtins.toString (x + 1 - (c * 10));
in [
"$mainMod, ${ws}, split-workspace, ${toString (x + 1)}"
"$mod SHIFT, ${ws}, split-movetoworkspace, ${toString (x + 1)}"
]
)
10)
);
};
};
}