configuration.nix/home/wm/hyprland/default.nix

193 lines
7.6 KiB
Nix
Raw Normal View History

2023-04-05 22:39:22 +05:30
{ config, pkgs, ... }:
let
brightnessctl = "${pkgs.brightnessctl}/bin/brightnessctl";
2023-04-07 13:44:31 +05:30
grim = "${pkgs.grim}/bin/grim";
2023-04-05 22:39:22 +05:30
hyprctl = "${config.wayland.windowManager.hyprland.package}/bin/hyprctl";
2023-04-07 21:10:13 +05:30
kitty = "${config.programs.kitty.package}/bin/kitty";
2023-04-05 22:39:22 +05:30
playerctl = "${pkgs.playerctl}/bin/playerctl";
2023-04-07 21:05:41 +05:30
rofi = "${config.programs.rofi.package}/bin/rofi";
2023-04-07 13:44:31 +05:30
slurp = "${pkgs.slurp}/bin/slurp";
2023-04-05 22:39:22 +05:30
swaylock = "${pkgs.swaylock}/bin/swaylock";
2023-04-08 14:57:55 +05:30
tmux = "${config.programs.tmux.package}/bin/tmux";
2023-04-05 22:39:22 +05:30
wpctl = "${pkgs.wireplumber}/bin/wpctl";
2023-04-07 13:44:31 +05:30
xdg-user-dir = "${pkgs.xdg-user-dirs}/bin/xdg-user-dir";
2023-04-06 03:36:03 +05:30
change-wallpaper = "${pkgs.scripts}/bin/chpaper ${pkgs.catppuccin-wallpapers}/share/wallpapers";
2023-04-06 01:27:26 +05:30
in
{
2023-04-05 22:39:22 +05:30
wayland.windowManager.hyprland = {
enable = true;
systemdIntegration = true;
recommendedEnvironment = true;
extraConfig = ''
monitor = eDP-1, 1920x1080, 0x0, 1
monitor = , preferred, auto, 1
2023-04-08 00:02:41 +05:30
general {
col.active_border = rgb(bd93f9)
col.inactive_border = rgba(44475aaa)
col.group_border = rgba(282a36dd)
col.group_border_active = rgb(bd93f9)
2023-04-08 00:03:40 +05:30
border_size = 1
gaps_in = 2
gaps_out = 4
2023-04-08 00:04:39 +05:30
layout = master
2023-04-08 00:02:41 +05:30
}
decoration {
col.shadow = rgba(1E202966)
drop_shadow = yes
shadow_range = 60
shadow_offset = 1 2
shadow_render_power = 3
shadow_scale = 0.97
2023-04-08 00:03:57 +05:30
rounding = 5
dim_around = 0.6
2023-04-08 00:02:41 +05:30
}
2023-04-05 22:39:22 +05:30
input {
touchpad {
2023-04-08 00:02:56 +05:30
clickfinger_behavior = true
2023-04-05 22:39:22 +05:30
disable_while_typing = true
natural_scroll = true
tap-to-click = true
}
}
2023-04-08 00:03:15 +05:30
misc {
disable_hyprland_logo = true
disable_splash_rendering = true
}
2023-04-08 00:04:39 +05:30
master {
new_is_master = true
new_on_top = true
}
2023-04-08 20:15:09 +05:30
animation = windows,1,3,default,slide
animation = fade,1,3,default
animation = border,1,3,default
animation = borderangle,1,3,default
animation = workspaces,1,3,default,slide
2023-04-08 00:04:08 +05:30
2023-04-08 00:02:41 +05:30
windowrulev2 = bordercolor rgb(ff5555),xwayland:1
2023-04-08 00:04:39 +05:30
2023-04-07 16:39:27 +05:30
windowrulev2 = workspace 2,class:^(firefox)$,title:^(Mozilla Firefox)$
2023-04-09 12:34:10 +05:30
windowrulev2 = float,class:^(firefox)$,title:^(Library)$
2023-04-07 13:45:04 +05:30
windowrulev2 = nofullscreenrequest,class:^(firefox)$,title:^(Firefox Sharing Indicator)$
windowrulev2 = float,class:^(firefox)$,title:^(Firefox Sharing Indicator)$
2023-04-07 16:19:49 +05:30
windowrulev2 = move 95% 50%,class:^(firefox)$,title:^(Firefox Sharing Indicator)$
windowrulev2 = float,class:^(pavucontrol)$,title:^(Volume Control)$
windowrulev2 = size 50% 50%,class:^(pavucontrol)$,title:^(Volume Control)$
windowrulev2 = center,class:^(pavucontrol)$,title:^(Volume Control)$
windowrulev2 = float,class:^(.blueman-manager-wrapped)$
windowrulev2 = size 50% 50%,class:^(.blueman-manager-wrapped)$
windowrulev2 = center,class:^(.blueman-manager-wrapped)$
windowrulev2 = float,class:^(mpv)$
windowrulev2 = size 90% 90%,class:^(mpv)$
windowrulev2 = center,class:^(mpv)$
windowrulev2 = dimaround,class:^(mpv)$
2023-04-07 13:45:04 +05:30
2023-04-08 15:29:17 +05:30
windowrulev2 = float,class:^(io.github.celluloid_player.Celluloid)$
windowrulev2 = size 90% 90%,class:^(io.github.celluloid_player.Celluloid)$
windowrulev2 = center,class:^(io.github.celluloid_player.Celluloid)$
windowrulev2 = dimaround,class:^(io.github.celluloid_player.Celluloid)$
2023-04-07 16:39:27 +05:30
windowrulev2 = float,class:^(eog)$
2023-04-08 15:29:17 +05:30
windowrulev2 = float,class:^(eog)$
windowrulev2 = size 90% 90%,class:^(eog)$
2023-04-07 16:39:27 +05:30
windowrulev2 = center,class:^(eog)$
windowrulev2 = dimaround,class:^(eog)$
2023-04-08 18:46:46 +05:30
windowrulev2 = float,class:^(org.gnome.Nautilus)$
windowrulev2 = center,class:^(org.gnome.Nautilus)$
windowrulev2 = size 60% 60%,class:^(org.gnome.Nautilus)$
2023-04-07 16:39:27 +05:30
windowrulev2 = float,class:^(gnome-system-monitor)$
windowrulev2 = center,class:^(gnome-system-monitor)$
windowrulev2 = size 60% 50%,class:^(gnome-system-monitor)$
windowrulev2 = float,class:^(virt-manager)$
windowrulev2 = size 20% 50%,class:^(virt-manager)$,title:^(Virtual Machine Manager)$
windowrulev2 = move 5%% 10%,class:^(virt-manager)$,title:^(Virtual Machine Manager)$
2023-04-08 15:29:17 +05:30
windowrulev2 = float,class:^(.yubioath-flutter-wrapped)$
windowrulev2 = center,class:^(.yubioath-flutter-wrapped)$
windowrulev2 = float,class:^(yubico.org.)$
windowrulev2 = center,class:^(yubico.org.)$
2023-04-09 12:34:53 +05:30
windowrulev2 = dimaround,class:^(gcr-prompter)$
2023-04-07 13:44:53 +05:30
exec-once = ${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1
2023-04-05 22:39:22 +05:30
exec-once = ${hyprctl} setcursor ${config.gtk.cursorTheme.name} 24
2023-04-06 03:36:03 +05:30
exec-once = ${change-wallpaper}
2023-04-05 22:39:22 +05:30
2023-04-05 23:44:06 +05:30
bindm = SUPER,mouse:272, movewindow
bindm = SUPER_SHIFT,mouse:272, resizewindow
bind = SUPER_SHIFT,Q, killactive,
bind = SUPER_SHIFT,space, togglefloating,active
bind = SUPER_SHIFT,F, fullscreen,0
2023-04-09 12:35:52 +05:30
bind = SUPER_ALT,F, fakefullscreen
2023-04-05 23:44:06 +05:30
bind = SUPER_SHIFT,C, exec, ${hyprctl} reload
bind = SUPER_SHIFT,C, exec, systemctl --user restart swayidle.service
2023-04-07 13:45:14 +05:30
bind = SUPER_SHIFT,C, exec, systemctl --user restart kanshi.service
bind = SUPER_SHIFT,C, exec, systemctl --user reload waybar.service
2023-04-05 22:39:22 +05:30
bind = SUPER,Return, exec, ${kitty} ${tmux} new
bind = SUPER_SHIFT,Return, exec, ${kitty}
bind = SUPER,d, exec, ${rofi} -show drun
2023-04-08 00:04:39 +05:30
bind = SUPER,escape, exec, ${swaylock} -f -i /tmp/lockpaper.jpg
2023-04-06 03:36:03 +05:30
bind = SUPER_SHIFT,W, exec, ${change-wallpaper}
2023-04-06 01:27:26 +05:30
bind = SUPER_SHIFT,escape, exec, ${pkgs.scripts}/bin/power-menu
2023-04-06 03:10:22 +05:30
bind = SUPER,f11, exec, ${pkgs.scripts}/bin/tmux-sessions
2023-04-05 22:39:22 +05:30
2023-04-07 13:44:31 +05:30
bindr = ,print, exec, ${grim} "''$(${xdg-user-dir} PICTURES)/Screenshots/screenshot-''$(date +%Y-%m-%d-%H-%M-%S).png"
bindr = SHIFT,print, exec, ${grim} -g "''$(${slurp})" "''$(${xdg-user-dir} PICTURES)/Screenshots/screenshot-''$(date +%Y-%m-%d-%H-%M-%S).png"
2023-04-05 22:39:22 +05:30
bind = SUPER,1, workspace, 1
bind = SUPER,2, workspace, 2
bind = SUPER,3, workspace, 3
bind = SUPER,4, workspace, 4
bind = SUPER,5, workspace, 5
bind = SUPER,6, workspace, 6
bind = SUPER,7, workspace, 7
bind = SUPER,8, workspace, 8
bind = SUPER,9, workspace, 9
bind = SUPER_SHIFT,1, movetoworkspace, 1
bind = SUPER_SHIFT,2, movetoworkspace, 2
bind = SUPER_SHIFT,3, movetoworkspace, 3
bind = SUPER_SHIFT,4, movetoworkspace, 4
bind = SUPER_SHIFT,5, movetoworkspace, 5
bind = SUPER_SHIFT,6, movetoworkspace, 6
bind = SUPER_SHIFT,7, movetoworkspace, 7
bind = SUPER_SHIFT,8, movetoworkspace, 8
bind = SUPER_SHIFT,9, movetoworkspace, 9
2023-04-08 00:04:39 +05:30
bind = SUPER,l, layoutmsg,cyclenext
bind = SUPER,h, layoutmsg,cycleprev
bind = SUPER,m, layoutmsg,focusmaster
bind = SUPER_SHIFT,m, layoutmsg,swapwithmaster
2023-04-09 12:36:12 +05:30
binde = ,XF86MonBrightnessUp, exec, ${brightnessctl} set +5%
binde = ,XF86MonBrightnessDown, exec, ${brightnessctl} set 5%-
2023-04-05 22:39:22 +05:30
bind = ,XF86AudioMute, exec, ${wpctl} set-mute @DEFAULT_AUDIO_SINK@ toggle
2023-04-09 12:36:12 +05:30
binde = ,XF86AudioRaiseVolume, exec, ${wpctl} set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+
binde = ,XF86AudioLowerVolume, exec, ${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 5%-
2023-04-05 22:39:22 +05:30
bind = ,XF86AudioPlay, exec, ${playerctl} play-pause
bind = ,XF86AudioNext, exec, ${playerctl} next
bind = ,XF86AudioPrev, exec, ${playerctl} previous
'';
};
}