nix/home-manager/common/desktops/hyprland/components/hyprland.nix

219 lines
7.1 KiB
Nix
Raw Normal View History

2024-08-21 14:48:48 +02:00
{ config, pkgs, ... }: {
2024-01-03 15:33:36 +01:00
wayland.windowManager.hyprland = {
enable = true;
2024-08-21 13:22:49 +02:00
plugins = with pkgs.hyprlandPlugins; [
2024-08-21 14:54:38 +02:00
# hyprbars
2024-08-21 13:22:49 +02:00
hyprexpo
2024-08-21 14:13:45 +02:00
hy3
2024-08-20 09:39:42 +02:00
];
2024-01-07 04:06:19 +01:00
extraConfig = ''
2024-01-07 04:03:33 +01:00
# Resize
2024-01-07 04:08:59 +01:00
bind = SUPER, R, exec, notify-send 'Entered resize mode. Press ESC to quit.'
bind = SUPER, R, submap, resize
2024-01-07 04:03:33 +01:00
submap = resize
binde = , H, resizeactive,-50 0
binde = , L, resizeactive,50 0
binde = , K, resizeactive,0 -50
binde = , J, resizeactive,0 50
binde = , left, resizeactive,-50 0
binde = , right, resizeactive,50 0
binde = , up, resizeactive,0 -50
binde = , down, resizeactive,0 50
bind = , escape, submap, reset
submap = reset
'';
2024-01-03 15:33:36 +01:00
settings = {
2024-08-21 14:56:36 +02:00
plugin = {
2024-08-21 14:54:38 +02:00
hyprexpo = {
gap_size = 8;
2024-08-21 14:58:44 +02:00
workspace_method = "first 1";
2024-08-21 14:54:38 +02:00
enable_gesture = true;
gesture_fingers = 3;
gesture_positive = false;
};
2024-08-21 14:17:22 +02:00
hyprbars = {
2024-08-21 14:46:23 +02:00
bar_height = 25;
2024-08-21 14:48:48 +02:00
bar_part_of_window = true;
bar_color = config.lib.stylix.colors.base04;
2024-08-21 14:17:22 +02:00
# example buttons (R -> L)
# hyprbars-button = color, size, on-click
hyprbars-button = [
2024-08-21 14:46:23 +02:00
"rgb(ff4040), 10, 󰖭 , hyprctl dispatch killactive"
"rgb(eeee11), 10, , hyprctl dispatch fullscreen 1"
2024-08-21 14:17:22 +02:00
];
};
};
2024-01-07 07:50:30 +01:00
layerrule = [
"blur, waybar"
2024-04-19 13:31:00 +02:00
"blur, rofi"
2024-04-16 14:50:50 +02:00
"blur, notifications"
"ignorezero, notifications"
2024-01-07 07:50:30 +01:00
];
2024-04-19 13:31:00 +02:00
xwayland.force_zero_scaling = false;
general = {
2024-08-18 07:06:00 +02:00
gaps_in = "8";
gaps_out = "8";
border_size = "2";
resize_on_border = "true";
extend_border_grab_area = "15";
2024-08-21 15:22:39 +02:00
layout = "hy3";
};
input = {
kb_layout = "us";
follow_mouse = "1";
2024-04-03 15:12:09 +02:00
mouse_refocus = false;
touchpad = {
natural_scroll = true;
disable_while_typing = true;
tap-to-click = true;
clickfinger_behavior = true;
drag_lock = true;
};
sensitivity = 0;
};
gestures = {
workspace_swipe = true;
workspace_swipe_fingers = 3;
};
misc = {
disable_hyprland_logo = true;
mouse_move_enables_dpms = true;
key_press_enables_dpms = true;
};
decoration = {
2024-08-18 07:06:00 +02:00
rounding = 15;
2024-04-19 13:31:00 +02:00
active_opacity = 0.75;
inactive_opacity = 0.6;
fullscreen_opacity = 1.0;
drop_shadow = true;
shadow_range = 4;
shadow_render_power = 3;
blur = {
2024-04-19 13:31:00 +02:00
size = 6;
passes = 3;
ignore_opacity = true;
};
};
animations = {
enabled = true;
bezier = "myBezier, 0.05, 0.9, 0.1, 1.05";
animation = [
"windows,1,7,myBezier"
"windowsOut,1,7,default,popin 80%"
"border,1,10,default"
"borderangle,1,8,default"
"fade,1,7,default"
"workspaces,1,6,default"
];
};
dwindle = {
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
pseudotile = true; # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = true;# you probably want this
2024-04-03 15:35:07 +02:00
no_gaps_when_only = 1; # If it's the only window int he layout, 1=don't show gaps
};
windowrule = [
"noblur,^(firefox)$" # disables blur for firefox
2024-01-07 07:21:41 +01:00
"opacity 1.0 override,^(firefox)$" # Sets opacity to 1
2024-05-07 15:30:24 +02:00
"noblur,^(thunderbird)$" # disables blur for firefox
"opacity 1.0 override,^(thunderbird)$" # Sets opacity to 1
"noblur,^(steam)$" # disables blur for steam
2024-01-07 07:21:41 +01:00
"opacity 1.0 override,^(steam)$" # Sets opacity to 1
2024-01-07 09:47:54 +01:00
"noblur,^(codium)$" # disables blur for codium
2024-08-20 14:19:57 +02:00
"opacity 0.9 override,^(codium)$" # Sets opacity to 0.9
2024-04-19 13:31:00 +02:00
"stayfocused, title:^()$,class:^(steam)$"
"minsize 1 1, title:^()$,class:^(steam)$"
2024-08-18 07:06:00 +02:00
];
2024-03-10 01:31:42 +01:00
2024-08-18 07:06:00 +02:00
windowrulev2 = [
''float, class:(rofi), title:(rofi)''
];
2024-08-18 07:06:00 +02:00
2024-01-03 15:33:36 +01:00
bind = [
2024-08-21 14:58:44 +02:00
''SUPER, , hyprexpo:expo, toggle''
2024-01-03 15:33:36 +01:00
''SUPER, Q, exec, kitty''
''SUPER, C, killactive,''
''SUPER, M, exit,''
''SUPER, V, togglefloating,''
''SUPER, P, pseudo, # dwindle''
''SUPER, J, togglesplit, # dwindle''
2024-04-03 15:35:07 +02:00
''SUPER, F, exec, firefox''
2024-04-03 15:38:52 +02:00
''SUPER, S, exec, steam -vgui''
2024-04-16 15:20:52 +02:00
''SUPER, B, exec, rofi-rbw --action copy --no-folder''
2024-08-20 14:19:57 +02:00
''SUPER_SHIFT, L, exec, logseq''
2023-09-23 09:09:53 +02:00
# Move focus with mainMod + arrow keys
2024-01-03 15:33:36 +01:00
''SUPER_ALT, left, movefocus, l''
''SUPER_ALT, right, movefocus, r''
''SUPER_ALT, up, movefocus, u''
''SUPER_ALT, down, movefocus, d''
2023-11-14 11:31:56 +01:00
2024-01-03 15:33:36 +01:00
''SUPER_ALT, H, movefocus, l''
''SUPER_ALT, L, movefocus, r''
''SUPER_ALT, K, movefocus, u''
''SUPER_ALT, J, movefocus, d''
2023-09-23 09:09:53 +02:00
# Switch workspaces with mainMod + [0-9]
2024-01-03 15:33:36 +01:00
''SUPER, 1, workspace, 1''
''SUPER, 2, workspace, 2''
''SUPER, 3, workspace, 3''
''SUPER, 4, workspace, 4''
''SUPER, 5, workspace, 5''
''SUPER, 6, workspace, 6''
''SUPER, 7, workspace, 7''
''SUPER, 8, workspace, 8''
''SUPER, 9, workspace, 9''
''SUPER, 0, workspace, 10''
2023-09-23 09:09:53 +02:00
# Move active window to a workspace with mainMod + SHIFT + [0-9]
2024-01-03 15:33:36 +01:00
''SUPER SHIFT, 1, movetoworkspace, 1''
''SUPER SHIFT, 2, movetoworkspace, 2''
''SUPER SHIFT, 3, movetoworkspace, 3''
''SUPER SHIFT, 4, movetoworkspace, 4''
''SUPER SHIFT, 5, movetoworkspace, 5''
''SUPER SHIFT, 6, movetoworkspace, 6''
''SUPER SHIFT, 7, movetoworkspace, 7''
''SUPER SHIFT, 8, movetoworkspace, 8''
''SUPER SHIFT, 9, movetoworkspace, 9''
''SUPER SHIFT, 0, movetoworkspace, 10''
2023-09-23 09:09:53 +02:00
# Scroll through existing workspaces with mainMod + scroll
2024-01-03 15:33:36 +01:00
''SUPER, mouse_down, workspace, e+1''
''SUPER, mouse_up, workspace, e-1''
2023-09-23 09:09:53 +02:00
#############################################################################
# Custom keybinds
# Show Rofi on SUPER-SPACE
2024-02-18 03:12:37 +01:00
# ''SUPER, space, exec, fuzzel''
''SUPER, space, exec, rofi -show drun -show-icons''
2024-01-03 15:33:36 +01:00
# Take a screenshot with the Print key''
'', Print, exec, grim -g "$(slurp)" | wl-copy -t image/png''
2023-09-23 09:09:53 +02:00
# Move to the previous / next workspace with SUPER-LEFT and SUPER-RIGHT
2024-01-03 15:33:36 +01:00
''SUPER , right, workspace, e+1''
''SUPER , left , workspace, e-1''
''SUPER SHIFT, right, movetoworkspace, e+1''
''SUPER SHIFT, left , movetoworkspace, e-1''
''SHIFT ALT, L, workspace, e+1''
''SHIFT ALT, H, workspace, e-1''
2023-09-23 09:09:53 +02:00
# Lock the screen, send to swaylock and pause music
2024-01-03 15:33:36 +01:00
''SUPER, L, exec, swaylock''
''SUPER, L, exec, playerctl pause''
2023-11-14 11:31:56 +01:00
# to switch between windows in a floating workspace
2024-01-03 15:33:36 +01:00
''SUPER ,Tab, cyclenext, # change focus to another window''
''SUPER ,Tab, bringactivetotop, # bring it to the top''
2023-09-23 09:09:53 +02:00
2024-01-03 15:33:36 +01:00
];
bindm = [
# Move/resize windows with mainMod + LMB/RMB and dragging
2024-01-07 09:45:50 +01:00
''LCTRL SHIFT, mouse:272, movewindow''
''LCTRL SHIFT, mouse:273, resizewindow''
2024-01-03 15:33:36 +01:00
];
exec-once = ''bash ~/.config/hypr/start.sh'';
2023-09-23 09:09:53 +02:00
};
2024-01-03 15:34:00 +01:00
};
2023-09-23 09:09:53 +02:00
}