nixos-config/modules/home/hyprland/config.nix

380 lines
12 KiB
Nix
Raw Normal View History

{ pkgs, ... }:
2024-04-03 18:02:12 +02:00
{
fonts.fontconfig.enable = true;
home.packages = [
pkgs.nerdfonts
(pkgs.nerdfonts.override { fonts = [ "JetBrainsMono" ]; })
pkgs.twemoji-color-font
pkgs.noto-fonts-emoji
];
gtk = {
enable = true;
font = {
name = "CaskaydiaCove Nerd Font";
size = 12;
};
theme = {
name = "Gruvbox-Green-Dark";
package = pkgs.gruvbox-gtk-theme.override {
colorVariants = [ "dark" ];
themeVariants = [ "green" ];
tweakVariants = [ "macos" ];
};
};
iconTheme = {
name = "Papirus-Dark";
package = pkgs.papirus-icon-theme.override {
color = "black";
};
};
cursorTheme = {
name = "Bibata-Modern-Ice";
package = pkgs.bibata-cursors;
size = 24;
};
};
home.pointerCursor = {
name = "Bibata-Modern-Ice";
package = pkgs.bibata-cursors;
size = 24;
};
# gtk = {
# enable = true;
# theme = {
# name = "Orchis-Dark";
# package = pkgs.orchis-theme;
# };
# iconTheme = {
# name = "Adwaita";
# package = pkgs.gnome.adwaita-icon-theme;
# };
# cursorTheme = {
# name = "Adwaita";
# package = pkgs.gnome.adwaita-icon-theme;
# };
# font = {
# name = "JetBrainsMono Nerd Font";
# size = 11;
# };
# };
# home.pointerCursor = {
# gtk.enable = true;
# # x11.enable = true;
# package = pkgs.bibata-cursors;
# name = "Bibata-Modern-Classic";
# size = 16;
# };
dconf = {
enable = true;
settings = {
"org/gnome/desktop/interface" = {
color-scheme = "prefer-dark";
};
};
};
2023-11-05 11:40:44 +01:00
wayland.windowManager.hyprland = {
settings = {
2024-06-21 09:52:26 +02:00
source = "~/nixos-config/modules/home/hyprland/displays.conf";
2024-06-21 09:52:26 +02:00
"debug:disable_scale_checks" = true;
monitor = "eDP-1, 2256x1504@60, 0x0, 1.5";
2024-04-03 18:02:12 +02:00
# autostart
exec-once = [
"systemctl --user import-environment &"
"hash dbus-update-activation-environment 2>/dev/null &"
"dbus-update-activation-environment --systemd &"
2024-04-13 17:01:32 +02:00
"wl-clip-persist --clipboard both"
2024-04-03 18:02:12 +02:00
"swaybg -m fill -i $(find ~/Pictures/wallpapers/ -maxdepth 1 -type f) &"
2024-05-06 21:22:50 +02:00
"poweralertd &"
2024-04-03 18:02:12 +02:00
"waybar &"
"swaync &"
2024-05-24 23:43:48 +02:00
"wl-paste --watch cliphist store &"
"yubikey-touch-detector --libnotify"
];
2023-11-09 13:42:37 +01:00
2024-04-03 18:02:12 +02:00
input = {
kb_layout = "us";
numlock_by_default = true;
follow_mouse = 1;
sensitivity = 0;
2024-04-13 16:27:11 +02:00
touchpad = {
2024-06-21 09:52:26 +02:00
natural_scroll = false;
2024-04-13 16:27:11 +02:00
};
2024-04-03 18:02:12 +02:00
};
gestures = {
workspace_swipe = true;
workspace_swipe_invert = true;
};
2024-04-03 18:02:12 +02:00
general = {
2024-06-21 09:52:26 +02:00
"$mainMod" = "ALT";
2024-04-03 18:02:12 +02:00
layout = "dwindle";
2024-08-30 12:39:35 +02:00
gaps_in = 5;
gaps_out = 10;
2024-04-03 18:02:12 +02:00
border_size = 2;
2024-09-30 18:38:05 +02:00
"col.active_border" = "rgb(cda5ef) rgb(cda5ef) 45deg";
2024-04-03 18:02:12 +02:00
"col.inactive_border" = "0x00000000";
border_part_of_window = false;
no_border_on_floating = false;
};
misc = {
disable_autoreload = true;
disable_hyprland_logo = true;
always_follow_on_dnd = true;
layers_hog_keyboard_focus = true;
animate_manual_resizes = false;
enable_swallow = true;
focus_on_activate = true;
};
dwindle = {
# no_gaps_when_only = true; # Returns errors for some reason
2024-04-03 18:02:12 +02:00
force_split = 0;
special_scale_factor = 1.0;
split_width_multiplier = 1.0;
use_active_for_splits = true;
pseudotile = "yes";
preserve_split = "yes";
};
master = {
special_scale_factor = 1;
# no_gaps_when_only = true; # Returns errors for some reason
2024-04-03 18:02:12 +02:00
};
decoration = {
rounding = 0;
2024-04-09 19:28:36 +02:00
# active_opacity = 0.90;
# inactive_opacity = 0.90;
# fullscreen_opacity = 1.0;
2024-04-03 18:02:12 +02:00
blur = {
2024-09-30 18:38:05 +02:00
enabled = false;
2024-04-09 21:38:09 +02:00
size = 1;
passes = 1;
# size = 4;
# passes = 2;
2024-04-03 18:02:12 +02:00
brightness = 1;
2024-04-03 21:26:18 +02:00
contrast = 1.400;
2024-04-03 18:02:12 +02:00
ignore_opacity = true;
2024-04-10 22:18:23 +02:00
noise = 0;
2024-04-03 18:02:12 +02:00
new_optimizations = true;
xray = true;
};
drop_shadow = true;
shadow_ignore_window = true;
shadow_offset = "0 2";
shadow_range = 20;
shadow_render_power = 3;
"col.shadow" = "rgba(00000055)";
};
animations = {
enabled = true;
bezier = [
"fluent_decel, 0, 0.2, 0.4, 1"
"easeOutCirc, 0, 0.55, 0.45, 1"
"easeOutCubic, 0.33, 1, 0.68, 1"
"easeinoutsine, 0.37, 0, 0.63, 1"
];
animation = [
# Windows
"windowsIn, 1, 3, easeOutCubic, popin 30%" # window open
"windowsOut, 1, 3, fluent_decel, popin 70%" # window close.
"windowsMove, 1, 2, easeinoutsine, slide" # everything in between, moving, dragging, resizing.
# Fade
"fadeIn, 1, 3, easeOutCubic" # fade in (open) -> layers and windows
"fadeOut, 1, 2, easeOutCubic" # fade out (close) -> layers and windows
"fadeSwitch, 0, 1, easeOutCirc" # fade on changing activewindow and its opacity
"fadeShadow, 1, 10, easeOutCirc" # fade on changing activewindow for shadows
"fadeDim, 1, 4, fluent_decel" # the easing of the dimming of inactive windows
"border, 1, 2.7, easeOutCirc" # for animating the border's color switch speed
"borderangle, 1, 30, fluent_decel, once" # for animating the border's gradient angle - styles: once (default), loop
"workspaces, 1, 4, easeOutCubic, fade" # styles: slide, slidevert, fade, slidefade, slidefadevert
];
};
bind = [
# keybindings
"$mainMod, Return, exec, kitty"
"$mainMod, Q, killactive,"
2024-06-21 09:52:26 +02:00
"$mainMod, F, fullscreen, 1" # set 1 to 0 to set full screen without waybar
"$mainMod, Space, togglefloating,"
"$mainMod, D, exec, bemenu-run -l 5"
2024-07-12 00:17:24 +02:00
"SUPER SHIFT, L, exec, hyprlock"
2024-06-21 09:52:26 +02:00
"$mainMod, E, exec, thunar"
"$mainMod SHIFT, B, exec, pkill -SIGUSR1 .waybar-wrapped"
"$mainMod, C ,exec, hyprpicker -a"
2024-10-14 08:11:21 +02:00
"$mainMod, W ,exec, pkill wofi || wallpaper-picker"
2024-06-21 09:52:26 +02:00
# clipboard manager
"$mainMod SHIFT, V, exec, cliphist list | bemenu -l 5 | cliphist decode | wl-copy"
2024-06-21 09:52:26 +02:00
2024-09-30 18:38:05 +02:00
"$mainMod SHIFT, F, exec, firefox"
"$mainMod SHIFT, W, exec, wdisplays"
2024-09-30 18:38:05 +02:00
"$mainMod SHIFT, T, exec, thunderbird"
"$mainMod SHIFT, P, exec, pavucontrol-qt"
"$mainMod SHIFT, N ,exec, notes" # should be added by scripts/custom packages
2023-11-05 11:40:44 +01:00
# screenshot
2024-06-21 09:52:26 +02:00
"SUPER SHIFT, S, exec, grimblast --notify --cursor save area ~/Pictures/$(date +'%Y-%m-%d-At-%Ih%Mm%Ss').png"
"$mainMod SHIFT, S, exec, grimblast --notify --cursor copy area"
"$mainMod SHIFT, G, exec, grabtext"
2023-11-05 11:40:44 +01:00
# switch focus
2024-06-21 09:52:26 +02:00
"$mainMod, H, movefocus, l"
"$mainMod, L, movefocus, r"
"$mainMod, K, movefocus, u"
"$mainMod, J, movefocus, d"
"$mainMod SHIFT, H, movewindow, l"
"$mainMod SHIFT, L, movewindow, r"
"$mainMod SHIFT, K, movewindow, u"
"$mainMod SHIFT, J, movewindow, d"
# switch to workspace
"$mainMod, 1, workspace, 1"
"$mainMod, 2, workspace, 2"
"$mainMod, 3, workspace, 3"
"$mainMod, 4, workspace, 4"
"$mainMod, 5, workspace, 5"
"$mainMod, 6, workspace, 6"
"$mainMod, 7, workspace, 7"
"$mainMod, 8, workspace, 8"
"$mainMod, 9, workspace, 9"
"$mainMod, 0, workspace, 10"
2024-06-21 09:52:26 +02:00
# move to workspace
"$mainMod SHIFT, 1, movetoworkspacesilent, 1"
"$mainMod SHIFT, 2, movetoworkspacesilent, 2"
"$mainMod SHIFT, 3, movetoworkspacesilent, 3"
"$mainMod SHIFT, 4, movetoworkspacesilent, 4"
"$mainMod SHIFT, 5, movetoworkspacesilent, 5"
"$mainMod SHIFT, 6, movetoworkspacesilent, 6"
"$mainMod SHIFT, 7, movetoworkspacesilent, 7"
"$mainMod SHIFT, 8, movetoworkspacesilent, 8"
"$mainMod SHIFT, 9, movetoworkspacesilent, 9"
"$mainMod SHIFT, 0, movetoworkspacesilent, 10"
# window control
2024-06-21 09:52:26 +02:00
# "$mainMod SHIFT, left, movewindow, l"
# "$mainMod SHIFT, right, movewindow, r"
# "$mainMod SHIFT, up, movewindow, u"
# "$mainMod SHIFT, down, movewindow, d"
# "$mainMod CTRL, left, resizeactive, -80 0"
# "$mainMod CTRL, right, resizeactive, 80 0"
# "$mainMod CTRL, up, resizeactive, 0 -80"
# "$mainMod CTRL, down, resizeactive, 0 80"
# "$mainMod ALT, left, moveactive, -80 0"
# "$mainMod ALT, right, moveactive, 80 0"
# "$mainMod ALT, up, moveactive, 0 -80"
# "$mainMod ALT, down, moveactive, 0 80"
# media and volume controls
",XF86AudioRaiseVolume,exec, pamixer -i 2"
",XF86AudioLowerVolume,exec, pamixer -d 2"
",XF86AudioMute,exec, pamixer -t"
",XF86AudioPlay,exec, playerctl play-pause"
",XF86AudioNext,exec, playerctl next"
",XF86AudioPrev,exec, playerctl previous"
2024-04-13 16:47:30 +02:00
",XF86AudioStop, exec, playerctl stop"
"$mainMod, mouse_down, workspace, e-1"
"$mainMod, mouse_up, workspace, e+1"
2024-04-13 16:47:30 +02:00
# laptop brigthness
",XF86MonBrightnessUp, exec, brightnessctl set 5%+"
",XF86MonBrightnessDown, exec, brightnessctl set 5%-"
"$mainMod, XF86MonBrightnessUp, exec, brightnessctl set 100%+"
"$mainMod, XF86MonBrightnessDown, exec, brightnessctl set 100%-"
];
2023-11-05 11:40:44 +01:00
2024-04-03 18:02:12 +02:00
# mouse binding
bindm = [
"$mainMod, mouse:272, movewindow"
"$mainMod, mouse:273, resizewindow"
];
# windowrule
windowrule = [
"float,imv"
"center,imv"
"size 1200 725,imv"
"float,mpv"
"center,mpv"
"tile,Aseprite"
"size 1200 725,mpv"
"float,title:^(float_kitty)$"
"center,title:^(float_kitty)$"
"size 950 600,title:^(float_kitty)$"
"float,audacious"
"workspace 8 silent, audacious"
"pin,wofi"
"float,wofi"
"noborder,wofi"
"tile, neovide"
"idleinhibit focus,mpv"
"float,udiskie"
"float,title:^(Transmission)$"
"float,title:^(Volume Control)$"
"float,title:^(Firefox Sharing Indicator)$"
"move 0 0,title:^(Firefox Sharing Indicator)$"
"size 700 450,title:^(Volume Control)$"
"move 40 55%,title:^(Volume Control)$"
];
2024-04-03 18:02:12 +02:00
# windowrulev2
windowrulev2 = [
"noanim, class:^(bemenu)$"
2024-04-03 18:02:12 +02:00
"float, title:^(Picture-in-Picture)$"
"opacity 1.0 override 1.0 override, title:^(Picture-in-Picture)$"
"pin, title:^(Picture-in-Picture)$"
"opacity 1.0 override 1.0 override, title:^(.*imv.*)$"
"opacity 1.0 override 1.0 override, title:^(.*mpv.*)$"
"opacity 1.0 override 1.0 override, class:(Aseprite)"
"opacity 1.0 override 1.0 override, class:(Unity)"
"idleinhibit focus, class:^(mpv)$"
"idleinhibit fullscreen, class:^(firefox)$"
"float,class:^(pavucontrol-qt)$"
2024-04-03 18:02:12 +02:00
"float,class:^(pavucontrol)$"
"float,class:^(SoundWireServer)$"
2024-04-09 23:01:21 +02:00
"float,class:^(.sameboy-wrapped)$"
2024-04-03 18:02:12 +02:00
"float,class:^(file_progress)$"
"float,class:^(confirm)$"
"float,class:^(dialog)$"
"float,class:^(download)$"
"float,class:^(notification)$"
"float,class:^(error)$"
"float,class:^(confirmreset)$"
"float,title:^(Open File)$"
"float,title:^(branchdialog)$"
"float,title:^(Confirm to replace files)$"
"float,title:^(File Operation Progress)$"
];
2023-11-05 11:40:44 +01:00
};
2023-11-05 11:40:44 +01:00
extraConfig = "
monitor=,preferred,auto,auto
2023-11-09 13:42:37 +01:00
xwayland {
force_zero_scaling = true
2023-12-22 20:33:21 +01:00
}
2023-11-05 11:40:44 +01:00
";
};
}