update hyprland conf

This commit is contained in:
Moritz Böhme 2022-12-23 12:39:24 +01:00
parent 8470cbe182
commit a856565ac9
Signed by: moritz
GPG key ID: 970C6E89EB0547A9
3 changed files with 75 additions and 23 deletions

View file

@ -52,6 +52,8 @@
};
hyprland.url = "github:hyprwm/Hyprland";
hyprpaper.url = "github:hyprwm/hyprpaper";
};
outputs =
@ -105,6 +107,7 @@
self.nixosModules.gaming
];
hosts.nixos-desktop.modules = [
./hosts/nixos-desktop
self.nixosModules.desktop

View file

@ -3,6 +3,12 @@
, pkgs
, ...
}:
with lib;
let
mkRule = rule: windowRegexes: "windowrulev2 = ${rule},${concatStringsSep "," windowRegexes}";
mkRules = rules: windowRegexes: concatStringsSep "\n" (map (flip mkRule windowRegexes) rules);
in
''
#
# Please note not all available settings / options are set here.
@ -26,7 +32,7 @@
kb_layout = de,us
kb_variant =
kb_model =
kb_options = grp:alt_shift_toggle
kb_options = grp:win_space_toggle,caps:escape
kb_rules =
follow_mouse = 1
@ -47,29 +53,31 @@
col.active_border = rgba(1affffee)
col.inactive_border = rgba(595959aa)
cursor_inactive_timeout = 1
layout = dwindle
}
decoration {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
rounding = 5
inactive_opacity = 0.98
rounding = 3
blur = yes
blur_size = 8
blur_passes = 1
blur_size = 3
blur_passes = 3
blur_new_optimizations = on
drop_shadow = yes
shadow_range = 4
shadow_render_power = 3
col.shadow = rgba(1a1a1aee)
shadow_range = 10
shadow_render_power = 2
# col.shadow = rgba(1a1a1aee)
}
animations {
enabled = yes
# Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more
# Some default Lanimations, see https://wiki.hyprland.org/Configuring/Animations/ for more
bezier = myBezier, 0.45, 0, 0.55, 1
@ -90,6 +98,7 @@
master {
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
no_gaps_when_only = true
new_is_master = false
}
gestures {
@ -103,13 +112,21 @@
sensitivity = -0.5
}
# Example windowrule v1
# windowrule = float, ^(kitty)$
# Example windowrule v2
# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$
windowrulev2 = float,class:^([rR]ofi)$
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
# Firefox Sharing Indicator
${mkRules ["float" "move 49% 40" "noborder"] ["title:^(.*Sharing Indicator)$"]}
# Rofi
${mkRules ["float" "opacity 0.95 0.95"] ["class:^([rR]ofi)$"]}
windowrulev2 = opacity 0.95 0.95,floating:1
# Games
# ${mkRules ["opaque" "noblur" "noborder" "noshadow" "forceinput"] ["fullscreen:1"]}
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
$mainMod = SUPER
@ -119,10 +136,11 @@
bind = $mainMod, D, exec, hyprctl keyword general:layout dwindle
bind = $mainMod, E, exec, emacsclient -c -a emacs
bind = $mainMod, F, togglefloating,
bind = $mainMod SHIFT, F, fullscreen,
bind = $mainMod, M, exec, hyprctl keyword general:layout master
bind = $mainMod, P, pseudo, # dwindle
bind = $mainMod, Q, killactive,
bind = $mainMod, R, exec, rofi -show combi
bind = $mainMod, R, exec, rofi -show combi -normal-window
bind = $mainMod, C, exec, rofi -show calc -modi calc -no-show-match -no-sort | xclip -selection clipboard
bind = $mainMod, B, exec, rofi-bluetooth
bind = $mainMod, RETURN, exec, kitty

View file

@ -79,9 +79,28 @@ in
}
];
};
# start swayidle as part of hyprland, not sway
systemd.user.services.swayidle.Install.WantedBy = lib.mkForce [ "hyprland-session.target" ];
xdg.configFile."hypr/hyprpaper.conf" = {
text =
let
setWallpaper = wallpaper: ''
preload = ${wallpaper}
wallpaper = ,${wallpaper}
'';
in
# setWallpaper "/home/moritz/.config/wallpapers/a_short_walk.png";
setWallpaper "/home/moritz/.config/wallpapers/mario.gif";
onChange = "${pkgs.systemd}/bin/systemctl restart --user hyprpaper.service";
};
};
systemd.user.services.hyprpaper = {
enable = true;
path = [ pkgs.hyprpaper ];
wantedBy = [ "display-manager.service" ];
after = [ "display-manager.service" ];
script = "hyprpaper";
};
users.users.moritz.packages = with pkgs; [
@ -90,6 +109,8 @@ in
pamixer
playerctl
brightnessctl
slurp
grim
];
security.pam.services.swaylock = { };
@ -120,7 +141,15 @@ in
__GL_VRR_ALLOWED = "0";
} else { });
services.xserver = {
services = {
dbus.enable = true;
pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
xserver = {
enable = true;
displayManager = {
gdm.enable = true;
@ -132,6 +161,8 @@ in
sessionPackages = [ hyprland ];
};
};
};
security.rtkit.enable = true;
xdg.portal = {
enable = true;