use home-manager options for hyprland

This commit is contained in:
Adithya 2023-11-09 20:32:13 +05:30
parent 23cc693157
commit 7378dcd2c3
Signed by: adtya
GPG key ID: 48FC9915FFD326D0

View file

@ -14,7 +14,7 @@ let
swaylock = "${pkgs.swaylock}/bin/swaylock";
tmux = "${config.programs.tmux.package}/bin/tmux";
wpctl = "${pkgs.wireplumber}/bin/wpctl";
xdg-user-dir = "${pkgs.xdg-user-dirs}/bin/xdg-user-dir";
pictures = "${config.xdg.userDirs.pictures}";
change-wallpaper = "${pkgs.scripts}/bin/chpaper ${config.xdg.userDirs.pictures}/Wallpapers";
wallhaven-wallpaper = "${pkgs.scripts}/bin/chpaper \$(${pkgs.scripts}/bin/wallhaven ${config.xdg.userDirs.pictures}/Wallpapers)";
in
@ -23,204 +23,207 @@ in
hyprland
];
systemd.user.targets = {
hyprland-session = {
Unit = {
After = [ "graphical-session-pre.target" ];
BindsTo = [ "graphical-session.target" ];
Description = "Hyprland session";
Documentation = [ "man:systemd.special(7)" ];
Wants = [ "graphical-session-pre.target" ];
wayland.windowManager.hyprland = {
enable = true;
systemd.enable = true;
settings = {
general = {
border_size = 1;
"col.active_border" = "rgb(bd93f9)";
"col.inactive_border" = "rgba(44475aaa)";
"col.nogroup_border" = "rgba(282a36dd)";
"col.nogroup_border_active" = "rgb(bd93f9)";
gaps_in = 2;
gaps_out = 4;
layout = "master";
};
decoration = {
"col.shadow" = "rgba(1E202966)";
dim_around = 0.6;
drop_shadow = "yes";
rounding = 5;
shadow_range = 60;
shadow_offset = "1 2";
shadow_render_power = 3;
shadow_scale = 0.97;
};
monitor = [
"eDP-1, 1920x1080, 0x0, 1"
", preferred, auto, 1"
# ", preferred, auto, 1, mirror, eDP-1"
];
input = {
kb_layout = "us";
kb_options = "rupeesign:4";
kb_variant = "altgr-intl";
touchpad = {
clickfinger_behavior = true;
disable_while_typing = true;
natural_scroll = true;
tap-to-click = true;
};
};
misc = {
disable_hyprland_logo = true;
disable_splash_rendering = true;
};
master = {
new_is_master = true;
new_on_top = true;
mfact = 0.65;
};
animation = [
"windows,1,3,default,slide"
"fade,1,3,default"
"border,1,3,default"
"borderangle,1,3,default"
"workspaces,1,3,default,slide"
];
windowrulev2 = [
"bordercolor rgb(ff5555),xwayland:1"
"workspace 2,class:^(firefox)$,title:^(Mozilla Firefox)$"
"workspace 10,class:^(org.telegram.desktop)$"
"workspace 10,class:^(discord)$"
"workspace 10,class:^(fluffychat)$"
"float,class:^(firefox)$,title:^(Library)$"
"nofullscreenrequest,class:^(firefox)$,title:^(Firefox Sharing Indicator)$"
"float,class:^(firefox)$,title:^(Firefox Sharing Indicator)$"
"move 95% 50%,class:^(firefox)$,title:^(Firefox Sharing Indicator)$"
"float,class:^(pavucontrol)$,title:^(Volume Control)$"
"size 50% 50%,class:^(pavucontrol)$,title:^(Volume Control)$"
"center,class:^(pavucontrol)$,title:^(Volume Control)$"
"float,class:^(.blueman-manager-wrapped)$"
"size 50% 50%,class:^(.blueman-manager-wrapped)$"
"center,class:^(.blueman-manager-wrapped)$"
"float,class:^(ytfzf)$"
"size 90% 90%,class:^(ytfzf)$"
"center,class:^(ytfzf)$"
"float,class:^(mpv)$"
"size 90% 90%,class:^(mpv)$"
"center,class:^(mpv)$"
"dimaround,class:^(mpv)$"
"float,class:^(eog)$"
"size 90% 90%,class:^(eog)$"
"center,class:^(eog)$"
"dimaround,class:^(eog)$"
"float,class:^(org.gnome.Nautilus)$"
"center,class:^(org.gnome.Nautilus)$"
"size 60% 60%,class:^(org.gnome.Nautilus)$"
"float,class:^(gnome-system-monitor)$"
"center,class:^(gnome-system-monitor)$"
"size 60% 50%,class:^(gnome-system-monitor)$"
"float,class:^(virt-manager)$"
"size 25% 50%,class:^(virt-manager)$,title:^(Virtual Machine Manager)$"
"move 5%% 10%,class:^(virt-manager)$,title:^(Virtual Machine Manager)$"
"float,class:^(.yubioath-flutter-wrapped_)$"
"center,class:^(.yubioath-flutter-wrapped_)$"
"float,class:^(yubico.org.)$"
"center,class:^(yubico.org.)$"
"float,class:^(Bitwarden)$"
"center,class:^(Bitwarden)$"
"dimaround,class:^(gcr-prompter)$"
];
exec-once = [
#"${dbus-update-activation-environment} --systemd DISPLAY WAYLAND_DISPLAY HYPRLAND_INSTANCE_SIGNATURE XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL"
#"systemctl --user start hyprland-session.target"
"${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"
"${hyprctl} setcursor ${config.gtk.cursorTheme.name} 24"
"${change-wallpaper}"
];
bindm = [
"SUPER,mouse:272, movewindow"
"SUPER_SHIFT,mouse:272, resizewindow"
];
bind = [
"SUPER_SHIFT,Q, killactive,"
"SUPER_SHIFT,space, togglefloating,active"
"SUPER_SHIFT,space, centerwindow"
"SUPER_SHIFT,F, fullscreen,0"
"SUPER_ALT,F, fakefullscreen"
"SUPER_SHIFT,C, exec, ${hyprctl} reload"
"SUPER_SHIFT,C, exec, systemctl --user restart swayidle.service"
"SUPER_SHIFT,C, exec, systemctl --user restart kanshi.service"
"SUPER_SHIFT,C, exec, systemctl --user reload waybar.service"
"SUPER,Return, exec, ${kitty} ${tmux} new"
"SUPER_SHIFT,Return, exec, ${kitty}"
"SUPER,d, exec, ${rofi} -show drun"
"SUPER,escape, exec, ${swaylock} -f -i /tmp/lockpaper.jpg"
"SUPER_SHIFT,W, exec, ${change-wallpaper}"
"SUPER_ALT,W, exec, ${wallhaven-wallpaper}"
"SUPER_SHIFT,escape, exec, ${pkgs.scripts}/bin/power-menu"
"SUPER,f11, exec, ${pkgs.scripts}/bin/tmux-sessions"
"SUPER_SHIFT,y, exec, ${pkgs.scripts}/bin/youtube"
"SUPER_SHIFT,b, exec, ${pkgs.rofi-bluetooth}/bin/rofi-bluetooth"
"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"
"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"
"SUPER,l, layoutmsg,cyclenext"
"SUPER,h, layoutmsg,cycleprev"
"SUPER,m, layoutmsg,focusmaster"
"SUPER_SHIFT,m, layoutmsg,swapwithmaster"
",XF86AudioMute, exec, ${wpctl} set-mute @DEFAULT_AUDIO_SINK@ toggle"
",XF86AudioPlay, exec, ${playerctl} play-pause"
",XF86AudioNext, exec, ${playerctl} next"
",XF86AudioPrev, exec, ${playerctl} previous"
];
bindr = [
",print, exec, ${grim} ${pictures}/Screenshots/screenshot-''$(date +%Y-%m-%d-%H-%M-%S).png"
"SHIFT,print, exec, ${grim} -g ''$(${slurp}) ${pictures}/Screenshots/screenshot-''$(date +%Y-%m-%d-%H-%M-%S).png"
];
binde = [
",XF86MonBrightnessUp, exec, ${brightnessctl} set +5%"
",XF86MonBrightnessDown, exec, ${brightnessctl} set 5%-"
",XF86AudioRaiseVolume, exec, ${wpctl} set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+"
",XF86AudioLowerVolume, exec, ${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 5%-"
];
};
};
xdg.configFile."hypr/hyprland.conf".text = ''
monitor = eDP-1, 1920x1080, 0x0, 1
monitor = , preferred, auto, 1
#monitor = , preferred, auto, 1, mirror, eDP-1
general {
col.active_border = rgb(bd93f9)
col.inactive_border = rgba(44475aaa)
col.nogroup_border = rgba(282a36dd)
col.nogroup_border_active = rgb(bd93f9)
border_size = 1
gaps_in = 2
gaps_out = 4
layout = master
}
decoration {
col.shadow = rgba(1E202966)
drop_shadow = yes
shadow_range = 60
shadow_offset = 1 2
shadow_render_power = 3
shadow_scale = 0.97
rounding = 5
dim_around = 0.6
}
input {
kb_layout = us
kb_options = rupeesign:4
kb_variant = altgr-intl
touchpad {
clickfinger_behavior = true
disable_while_typing = true
natural_scroll = true
tap-to-click = true
}
}
misc {
disable_hyprland_logo = true
disable_splash_rendering = true
}
master {
new_is_master = true
new_on_top = true
mfact = 0.65
}
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
windowrulev2 = bordercolor rgb(ff5555),xwayland:1
windowrulev2 = workspace 2,class:^(firefox)$,title:^(Mozilla Firefox)$
windowrulev2 = workspace 10,class:^(org.telegram.desktop)$
windowrulev2 = workspace 10,class:^(discord)$
windowrulev2 = workspace 10,class:^(fluffychat)$
windowrulev2 = float,class:^(firefox)$,title:^(Library)$
windowrulev2 = nofullscreenrequest,class:^(firefox)$,title:^(Firefox Sharing Indicator)$
windowrulev2 = float,class:^(firefox)$,title:^(Firefox Sharing Indicator)$
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:^(ytfzf)$
windowrulev2 = size 90% 90%,class:^(ytfzf)$
windowrulev2 = center,class:^(ytfzf)$
windowrulev2 = float,class:^(mpv)$
windowrulev2 = size 90% 90%,class:^(mpv)$
windowrulev2 = center,class:^(mpv)$
windowrulev2 = dimaround,class:^(mpv)$
windowrulev2 = float,class:^(eog)$
windowrulev2 = size 90% 90%,class:^(eog)$
windowrulev2 = center,class:^(eog)$
windowrulev2 = dimaround,class:^(eog)$
windowrulev2 = float,class:^(org.gnome.Nautilus)$
windowrulev2 = center,class:^(org.gnome.Nautilus)$
windowrulev2 = size 60% 60%,class:^(org.gnome.Nautilus)$
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 25% 50%,class:^(virt-manager)$,title:^(Virtual Machine Manager)$
windowrulev2 = move 5%% 10%,class:^(virt-manager)$,title:^(Virtual Machine Manager)$
windowrulev2 = float,class:^(.yubioath-flutter-wrapped_)$
windowrulev2 = center,class:^(.yubioath-flutter-wrapped_)$
windowrulev2 = float,class:^(yubico.org.)$
windowrulev2 = center,class:^(yubico.org.)$
windowrulev2 = float,class:^(Bitwarden)$
windowrulev2 = center,class:^(Bitwarden)$
windowrulev2 = dimaround,class:^(gcr-prompter)$
exec-once = ${dbus-update-activation-environment} --systemd DISPLAY WAYLAND_DISPLAY HYPRLAND_INSTANCE_SIGNATURE XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL
exec-once = systemctl --user start hyprland-session.target
exec-once = ${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1
exec-once = ${hyprctl} setcursor ${config.gtk.cursorTheme.name} 24
exec-once = ${change-wallpaper}
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,space, centerwindow
bind = SUPER_SHIFT,F, fullscreen,0
bind = SUPER_ALT,F, fakefullscreen
bind = SUPER_SHIFT,C, exec, ${hyprctl} reload
bind = SUPER_SHIFT,C, exec, systemctl --user restart swayidle.service
bind = SUPER_SHIFT,C, exec, systemctl --user restart kanshi.service
bind = SUPER_SHIFT,C, exec, systemctl --user reload waybar.service
bind = SUPER,Return, exec, ${kitty} ${tmux} new
bind = SUPER_SHIFT,Return, exec, ${kitty}
bind = SUPER,d, exec, ${rofi} -show drun
bind = SUPER,escape, exec, ${swaylock} -f -i /tmp/lockpaper.jpg
bind = SUPER_SHIFT,W, exec, ${change-wallpaper}
bind = SUPER_ALT,W, exec, ${wallhaven-wallpaper}
bind = SUPER_SHIFT,escape, exec, ${pkgs.scripts}/bin/power-menu
bind = SUPER,f11, exec, ${pkgs.scripts}/bin/tmux-sessions
bind = SUPER_SHIFT,y, exec, ${pkgs.scripts}/bin/youtube
bind = SUPER_SHIFT,b, exec, ${pkgs.rofi-bluetooth}/bin/rofi-bluetooth
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"
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,0, workspace, 10
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
bind = SUPER_SHIFT,0, movetoworkspace, 10
bind = SUPER,l, layoutmsg,cyclenext
bind = SUPER,h, layoutmsg,cycleprev
bind = SUPER,m, layoutmsg,focusmaster
bind = SUPER_SHIFT,m, layoutmsg,swapwithmaster
binde = ,XF86MonBrightnessUp, exec, ${brightnessctl} set +5%
binde = ,XF86MonBrightnessDown, exec, ${brightnessctl} set 5%-
bind = ,XF86AudioMute, exec, ${wpctl} set-mute @DEFAULT_AUDIO_SINK@ toggle
binde = ,XF86AudioRaiseVolume, exec, ${wpctl} set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+
binde = ,XF86AudioLowerVolume, exec, ${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 5%-
bind = ,XF86AudioPlay, exec, ${playerctl} play-pause
bind = ,XF86AudioNext, exec, ${playerctl} next
bind = ,XF86AudioPrev, exec, ${playerctl} previous
'';
}