update hyprland conf

nixos
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"; hyprland.url = "github:hyprwm/Hyprland";
hyprpaper.url = "github:hyprwm/hyprpaper";
}; };
outputs = outputs =
@ -105,6 +107,7 @@
self.nixosModules.gaming self.nixosModules.gaming
]; ];
hosts.nixos-desktop.modules = [ hosts.nixos-desktop.modules = [
./hosts/nixos-desktop ./hosts/nixos-desktop
self.nixosModules.desktop self.nixosModules.desktop

View File

@ -3,6 +3,12 @@
, pkgs , 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. # Please note not all available settings / options are set here.
@ -26,7 +32,7 @@
kb_layout = de,us kb_layout = de,us
kb_variant = kb_variant =
kb_model = kb_model =
kb_options = grp:alt_shift_toggle kb_options = grp:win_space_toggle,caps:escape
kb_rules = kb_rules =
follow_mouse = 1 follow_mouse = 1
@ -47,29 +53,31 @@
col.active_border = rgba(1affffee) col.active_border = rgba(1affffee)
col.inactive_border = rgba(595959aa) col.inactive_border = rgba(595959aa)
cursor_inactive_timeout = 1
layout = dwindle layout = dwindle
} }
decoration { decoration {
# See https://wiki.hyprland.org/Configuring/Variables/ for more # See https://wiki.hyprland.org/Configuring/Variables/ for more
rounding = 5 rounding = 3
inactive_opacity = 0.98
blur = yes blur = yes
blur_size = 8 blur_size = 3
blur_passes = 1 blur_passes = 3
blur_new_optimizations = on blur_new_optimizations = on
drop_shadow = yes drop_shadow = yes
shadow_range = 4 shadow_range = 10
shadow_render_power = 3 shadow_render_power = 2
col.shadow = rgba(1a1a1aee)
# col.shadow = rgba(1a1a1aee)
} }
animations { animations {
enabled = yes 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 bezier = myBezier, 0.45, 0, 0.55, 1
@ -90,6 +98,7 @@
master { master {
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
no_gaps_when_only = true no_gaps_when_only = true
new_is_master = false
} }
gestures { gestures {
@ -103,13 +112,21 @@
sensitivity = -0.5 sensitivity = -0.5
} }
# Example windowrule v1
# windowrule = float, ^(kitty)$
# Example windowrule v2 # Example windowrule v2
# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ # windowrulev2 = float,class:^(kitty)$,title:^(kitty)$
windowrulev2 = float,class:^([rR]ofi)$
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more # 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 # See https://wiki.hyprland.org/Configuring/Keywords/ for more
$mainMod = SUPER $mainMod = SUPER
@ -119,10 +136,11 @@
bind = $mainMod, D, exec, hyprctl keyword general:layout dwindle bind = $mainMod, D, exec, hyprctl keyword general:layout dwindle
bind = $mainMod, E, exec, emacsclient -c -a emacs bind = $mainMod, E, exec, emacsclient -c -a emacs
bind = $mainMod, F, togglefloating, bind = $mainMod, F, togglefloating,
bind = $mainMod SHIFT, F, fullscreen,
bind = $mainMod, M, exec, hyprctl keyword general:layout master bind = $mainMod, M, exec, hyprctl keyword general:layout master
bind = $mainMod, P, pseudo, # dwindle bind = $mainMod, P, pseudo, # dwindle
bind = $mainMod, Q, killactive, 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, C, exec, rofi -show calc -modi calc -no-show-match -no-sort | xclip -selection clipboard
bind = $mainMod, B, exec, rofi-bluetooth bind = $mainMod, B, exec, rofi-bluetooth
bind = $mainMod, RETURN, exec, kitty bind = $mainMod, RETURN, exec, kitty

View File

@ -79,9 +79,28 @@ in
} }
]; ];
}; };
# start swayidle as part of hyprland, not sway # start swayidle as part of hyprland, not sway
systemd.user.services.swayidle.Install.WantedBy = lib.mkForce [ "hyprland-session.target" ]; 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; [ users.users.moritz.packages = with pkgs; [
@ -90,6 +109,8 @@ in
pamixer pamixer
playerctl playerctl
brightnessctl brightnessctl
slurp
grim
]; ];
security.pam.services.swaylock = { }; security.pam.services.swaylock = { };
@ -120,18 +141,28 @@ in
__GL_VRR_ALLOWED = "0"; __GL_VRR_ALLOWED = "0";
} else { }); } else { });
services.xserver = { services = {
enable = true; dbus.enable = true;
displayManager = { pipewire = {
gdm.enable = true; enable = true;
autoLogin = { alsa.enable = true;
enable = true; alsa.support32Bit = true;
user = "moritz"; pulse.enable = true;
};
xserver = {
enable = true;
displayManager = {
gdm.enable = true;
autoLogin = {
enable = true;
user = "moritz";
};
defaultSession = "hyprland";
sessionPackages = [ hyprland ];
}; };
defaultSession = "hyprland";
sessionPackages = [ hyprland ];
}; };
}; };
security.rtkit.enable = true;
xdg.portal = { xdg.portal = {
enable = true; enable = true;