fix(hyprland): working again !!!

This commit is contained in:
jacekpoz 2023-11-28 19:52:27 +01:00
parent 5a7d5c2ff5
commit 808bbd10e4
No known key found for this signature in database
GPG key ID: 94E812A8B12AAE3C

View file

@ -8,17 +8,13 @@
}: with lib; let
cfg = config.myOptions.programs.hyprland;
nixpkgs-wayland = inputs.nixpkgs-wayland.packages.${pkgs.system};
inherit (nixpkgs-wayland) foot;
inherit (nixpkgs-wayland) wl-clipboard;
inherit (nixpkgs-wayland) swww;
inherit (nixpkgs-wayland) wlsunset;
inherit (inputs.nixpkgs-wayland.packages.${pkgs.system}) foot wl-clipboard swww wlsunset;
swaylock = config.home-manager.users.${config'.username}.programs.swaylock.package;
inherit (inputs.anyrun.packages.${pkgs.system}) anyrun;
hyprcontrib = inputs.hyprcontrib.packages.${pkgs.system};
inherit (inputs.shadower.packages.${pkgs.system}) shadower;
inherit (inputs.hyprland.packages.${pkgs.system}) hyprland;
in rec {
in {
options.myOptions.programs.hyprland = {
enable = mkEnableOption "enable hiper ląd";
startupSound = mkOption {
@ -51,7 +47,9 @@ in rec {
};
home-manager.users.${config'.username} = {
imports = [ inputs.hyprland.homeManagerModules.default ];
# TODO swap back to this whenever fufexan or anyone else
# adds an equivalent of hm's settings to this module
#imports = [ inputs.hyprland.homeManagerModules.default ];
xdg.dataFile."hypr/startup_sound".source = cfg.startupSound;
@ -62,14 +60,23 @@ in rec {
inputs.hyprland-plugins.packages.${pkgs.system}.csgo-vulkan-fix
inputs.split-monitor-workspaces.packages.${pkgs.system}.split-monitor-workspaces
];
# TODO make these work with the config below (infinite recursion)
# and make this file stop hanging my neovim every 2 seconds
# and figure out why it triggers E79 every single time I edit something
extraConfig = ''
bind=$mainMod, W, exec, ${removeSuffix " %U" config.home-manager.users.${config'.username}.xdg.desktopEntries.firefox-schizo.exec}
bind=$mainMod SHIFT, W, exec, ${removeSuffix " %U" config.home-manager.users.${config'.username}.xdg.desktopEntries.firefox-unschizo.exec}
bind=$mainMod, C, exec, ${swaylock}/bin/swaylock
${if (cfg.startupSound != "") then "exec-once=${pkgs.mpv}/bin/mpv --no-video --volume=100 ~/${config.home-manager.users.${config'.username}.xdg.dataHome}/hypr/startup_sound" else ""}
'';
settings = {
"$mainMod" = "SUPER";
monitor = [
# laptop
"eDP-1, 2560x1440@165, 0x0, 1.5"
"eDP-1, 2560x1440@165, 0x0, 1"
# second monitor
"HDMI-A-1, 2560x1440@144, ${toString (2560 / 1.5)}x0, 1"
"HDMI-A-1, 2560x1440@144, 2560x0, 1"
];
workspace = [
@ -140,9 +147,7 @@ in rec {
#col.group_border = "0xFF45475A";
};
env = [
mkIf cfg.tearing "WLR_DRM_NO_ATOMIC,1"
];
env = optional cfg.tearing "WLR_DRM_NO_ATOMIC,1";
decoration = {
rounding = 10;
@ -200,7 +205,6 @@ in rec {
};
windowrulev2 = [
mkIf cfg.tearing "immediate, title:^(osu!)$"
"float, title:^(.*)(Tor Browser)(.*)$"
"float, class:^(mullvadbrowser)$"
"float, class:^(foot)$"
@ -217,12 +221,11 @@ in rec {
"center, class: ^(code), title: ^(Open*)"
"float, class:^(org.keepassxc.KeePassXC)$"
"size 960 670, title:^(ROG Control Center)$"
];
]
++ optional cfg.tearing "immediate, title:^(osu!)$";
bind = [
"$mainMod, RETURN, exec, ${foot}/bin/${if config.myOptions.programs.foot.server then "footclient" else "foot"}"
"$mainMod, W, exec, ${removeSuffix " %U" config.home-manager.users.${config'.username}.xdg.desktopEntries.firefox-schizo.exec}"
"$mainMod SHIFT, W, exec, ${removeSuffix " %U" config.home-manager.users.${config'.username}.xdg.desktopEntries.firefox-unschizo.exec}"
"$mainMod, Q, killactive"
"$mainMod, F, fullscreen, 0"
"$mainMod, M, fullscreen, 1"
@ -276,12 +279,12 @@ in rec {
"$mainMod, A, togglespecialworkspace, amdgpu_top"
"$mainMod, V, togglespecialworkspace, pipewire"
"$mainMod, N, togglespecialworkspace, nixos"
# rog button on laptop keyboard
", XF86Launch1, togglespecialworkspace, rog"
"$mainMod, R, togglespecialworkspace, rog"
"$mainMod, X, togglespecialworkspace, keepassxc"
# toggle waybar
"$mainMod CONTROL, B, exec, ${pkgs.systemd}/bin/systemctl is-active --user waybar && ${pkgs.systemd}/bin/systemctl stop --user waybar || ${pkgs.systemd}/bin/systemctl start --user waybar"
"$mainMod, C, exec, ${swaylock}/bin/swaylock"
];
# repeat
@ -331,7 +334,6 @@ in rec {
};
exec-once = [
mkIf (cfg.startupSound != "") "exec-once=${pkgs.mpv}/bin/mpv --no-video --volume=100 ~/${config.home-manager.users.${config'.username}.xdg.dataHome}/hypr/startup_sound"
"${pkgs.systemd}/bin/systemctl start --user waybar.service"
# run persistent special workspace windows
@ -339,7 +341,7 @@ in rec {
"[workspace special:rog silent;tile] ${pkgs.asusctl}/bin/rog-control-center"
"[workspace special:keepassxc silent;tile] ${pkgs.keepassxc}/bin/keepassxc"
mkIf config.myOptions.programs.foot.server "sleep 0.5 && ${pkgs.systemd}/bin/systemctl --user restart foot.service"
(if config.myOptions.programs.foot.server then "sleep 0.5 && ${pkgs.systemd}/bin/systemctl --user restart foot.service" else ";")
"${hyprland}/bin/hyprctl setcursor Bibata-Modern-Classic 24"