2024-05-23 20:26:30 +00:00
|
|
|
{
|
|
|
|
|
options,
|
|
|
|
|
config,
|
|
|
|
|
lib,
|
|
|
|
|
inputs,
|
|
|
|
|
system,
|
|
|
|
|
pkgs,
|
|
|
|
|
...
|
|
|
|
|
}:
|
|
|
|
|
with lib;
|
|
|
|
|
with lib.custom; let
|
|
|
|
|
cfg = config.wms.hyprland;
|
|
|
|
|
|
|
|
|
|
mkService = recursiveUpdate {
|
2024-10-17 02:05:02 -04:00
|
|
|
Unit.PartOf = ["hyprland-session.target"];
|
|
|
|
|
Unit.After = ["hyprland-session.target"];
|
|
|
|
|
Install.WantedBy = ["hyprland-session.target"];
|
2024-05-23 20:26:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
mod = "SUPER";
|
|
|
|
|
modshift = "${mod}SHIFT";
|
|
|
|
|
|
|
|
|
|
# binds $mod + [shift +] {1..10} to [move to] workspace {1..10} (stolen from fufie)
|
|
|
|
|
workspaces = builtins.concatLists (builtins.genList (
|
|
|
|
|
x: let
|
|
|
|
|
ws = let
|
|
|
|
|
c = (x + 1) / 10;
|
|
|
|
|
in
|
|
|
|
|
builtins.toString (x + 1 - (c * 10));
|
|
|
|
|
in [
|
|
|
|
|
"${mod}, ${ws}, workspace, ${toString (x + 1)}"
|
|
|
|
|
"${mod} SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}"
|
|
|
|
|
]
|
|
|
|
|
)
|
|
|
|
|
10);
|
|
|
|
|
in {
|
|
|
|
|
options.wms.hyprland = with types; {
|
|
|
|
|
enable = mkBoolOpt false "Enable Hyprland";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2024-09-21 18:49:15 -04:00
|
|
|
home.packages = [
|
2024-10-16 15:40:35 -04:00
|
|
|
pkgs.xwayland
|
2024-09-21 18:49:15 -04:00
|
|
|
];
|
|
|
|
|
|
2024-05-23 20:26:30 +00:00
|
|
|
wayland.windowManager.hyprland = {
|
|
|
|
|
enable = true;
|
2024-09-12 14:09:39 -04:00
|
|
|
xwayland.enable = true;
|
2024-05-23 20:26:30 +00:00
|
|
|
|
2024-10-17 02:05:02 -04:00
|
|
|
# systemd = {
|
|
|
|
|
# enable = true;
|
|
|
|
|
# enableXdgAutostart = true;
|
|
|
|
|
# variables = ["-all"];
|
|
|
|
|
# };
|
2024-05-23 20:26:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
wayland.windowManager.hyprland.settings = with colors; {
|
|
|
|
|
exec-once = [
|
2024-11-13 20:35:13 -05:00
|
|
|
"pw-loopback -C \"alsa_input.pci-0000_0d_00.4.analog-stereo\" -P \"Scarlett Solo (3rd Gen.) Headphones / Line 1-2\""
|
2024-10-17 02:05:02 -04:00
|
|
|
# "systemctl --user import-environment DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP"
|
|
|
|
|
"dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP"
|
|
|
|
|
"systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP"
|
|
|
|
|
"zen"
|
2024-09-23 19:22:17 -04:00
|
|
|
"sleep 6;telegram-desktop"
|
2024-10-12 19:45:59 -04:00
|
|
|
"sleep 10;thunderbird"
|
2024-05-23 20:26:30 +00:00
|
|
|
"vesktop"
|
|
|
|
|
"spotify"
|
|
|
|
|
"slack"
|
|
|
|
|
];
|
|
|
|
|
|
2024-10-17 02:05:02 -04:00
|
|
|
env = [
|
|
|
|
|
"XDG_SESSION_TYPE,wayland"
|
|
|
|
|
"XDG_SESSION_DESKTOP,Hyprland"
|
|
|
|
|
"XDG_CURRENT_DESKTOP,Hyprland"
|
|
|
|
|
];
|
|
|
|
|
|
2024-05-23 20:26:30 +00:00
|
|
|
bind =
|
|
|
|
|
[
|
2024-10-12 19:45:59 -04:00
|
|
|
''${mod},RETURN,exec,${pkgs.kitty}/bin/kitty''
|
2024-05-23 20:26:30 +00:00
|
|
|
|
|
|
|
|
"${mod},D,exec,killall anyrun || anyrun"
|
|
|
|
|
"${mod},Q,killactive"
|
|
|
|
|
"${mod},M,exit"
|
|
|
|
|
"${mod},P,pseudo"
|
|
|
|
|
|
|
|
|
|
"${mod},J,togglesplit,"
|
|
|
|
|
|
|
|
|
|
"${mod},T,togglegroup," # group focused window
|
|
|
|
|
"${modshift},G,changegroupactive," # switch within the active group
|
|
|
|
|
"${mod},V,togglefloating," # toggle floating for the focused window
|
|
|
|
|
"${mod},F,fullscreen," # fullscreen focused window
|
|
|
|
|
|
|
|
|
|
# workspace controls
|
|
|
|
|
"${modshift},right,movetoworkspace,+1" # move focused window to the next ws
|
|
|
|
|
"${modshift},left,movetoworkspace,-1" # move focused window to the previous ws
|
|
|
|
|
"${mod},mouse_down,workspace,e+1" # move to the next ws
|
|
|
|
|
"${mod},mouse_up,workspace,e-1" # move to the previous ws
|
|
|
|
|
|
|
|
|
|
"${mod},X,exec, ags --toggle-window \"dashboard\""
|
2024-10-31 21:01:42 -04:00
|
|
|
"${mod},Print,exec,${lib.getExe pkgs.custom.sc}"
|
|
|
|
|
"${mod},Shift&Print,exec,${lib.getExe pkgs.wf-recorder} -g \"$(${lib.getExe pkgs.slurp})\" -f out.mp4"
|
2024-05-23 20:26:30 +00:00
|
|
|
"${modshift},O,exec,wl-ocr"
|
|
|
|
|
|
|
|
|
|
"${mod},Period,exec, tofi-emoji"
|
|
|
|
|
|
|
|
|
|
"${modshift},L,exec,swaylock --grace 0" # lock screen
|
|
|
|
|
]
|
|
|
|
|
++ workspaces;
|
|
|
|
|
|
|
|
|
|
bindm = [
|
|
|
|
|
"${mod},mouse:272,movewindow"
|
|
|
|
|
"${mod},mouse:273,resizewindow"
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
general = {
|
|
|
|
|
# gaps
|
2024-06-27 12:43:39 -04:00
|
|
|
gaps_in = 4;
|
|
|
|
|
gaps_out = 8;
|
2024-05-23 20:26:30 +00:00
|
|
|
|
|
|
|
|
# border thiccness
|
2024-06-27 12:43:39 -04:00
|
|
|
border_size = 2;
|
2024-05-23 20:26:30 +00:00
|
|
|
|
|
|
|
|
# active border color
|
|
|
|
|
"col.active_border" = "rgb(${rose})";
|
|
|
|
|
"col.inactive_border" = "rgb(${muted})";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
input = {
|
|
|
|
|
kb_layout = "us";
|
|
|
|
|
sensitivity = 0; # -1.0 - 1.0, 0 means no modification.
|
|
|
|
|
accel_profile = "flat";
|
2024-09-11 12:55:19 -04:00
|
|
|
force_no_accel = false;
|
2024-05-23 20:26:30 +00:00
|
|
|
};
|
|
|
|
|
|
2024-06-11 14:01:33 -04:00
|
|
|
dwindle = {
|
|
|
|
|
force_split = 2;
|
|
|
|
|
};
|
|
|
|
|
|
2024-05-23 20:26:30 +00:00
|
|
|
decoration = {
|
|
|
|
|
# fancy corners
|
2024-06-27 12:45:14 -04:00
|
|
|
rounding = 10;
|
2024-05-23 20:26:30 +00:00
|
|
|
# blur
|
|
|
|
|
blur = {
|
|
|
|
|
enabled = true;
|
|
|
|
|
size = 2;
|
|
|
|
|
passes = 5;
|
|
|
|
|
ignore_opacity = false;
|
|
|
|
|
new_optimizations = 1;
|
2024-06-27 12:43:39 -04:00
|
|
|
contrast = 1;
|
|
|
|
|
brightness = 1;
|
2024-05-23 20:26:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# shadow config
|
|
|
|
|
drop_shadow = "yes";
|
|
|
|
|
shadow_range = 60;
|
|
|
|
|
shadow_render_power = 5;
|
|
|
|
|
"col.shadow" = "rgba(07061f29)";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
misc = {
|
|
|
|
|
# disable redundant renders
|
|
|
|
|
disable_splash_rendering = true;
|
|
|
|
|
force_default_wallpaper = 0;
|
|
|
|
|
disable_hyprland_logo = true;
|
|
|
|
|
|
2024-06-27 12:43:39 -04:00
|
|
|
vfr = false;
|
2024-05-23 20:26:30 +00:00
|
|
|
|
|
|
|
|
# dpms
|
|
|
|
|
mouse_move_enables_dpms = true; # enable dpms on mouse/touchpad action
|
|
|
|
|
key_press_enables_dpms = true; # enable dpms on keyboard action
|
|
|
|
|
disable_autoreload = true; # autoreload is unnecessary on nixos, because the config is readonly anyway
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
xwayland = {
|
|
|
|
|
force_zero_scaling = true;
|
|
|
|
|
};
|
|
|
|
|
|
2024-10-16 15:40:35 -04:00
|
|
|
cursor = {
|
|
|
|
|
no_hardware_cursors = true;
|
|
|
|
|
};
|
|
|
|
|
|
2024-10-17 02:05:02 -04:00
|
|
|
monitor = ["DP-1,2560x1440@240,0x0,1" "HDMI-A-1,disable" "DP-2,disable"];
|
2024-05-23 20:26:30 +00:00
|
|
|
|
|
|
|
|
layerrule = [
|
|
|
|
|
"blur, ^(gtk-layer-shell)$"
|
|
|
|
|
"blur, ^(launcher)$"
|
|
|
|
|
"ignorezero, ^(gtk-layer-shell)$"
|
|
|
|
|
"ignorezero, ^(launcher)$"
|
|
|
|
|
"blur, notifications"
|
|
|
|
|
"ignorezero, notifications"
|
|
|
|
|
"blur, bar"
|
|
|
|
|
"ignorezero, bar"
|
|
|
|
|
"ignorezero, ^(gtk-layer-shell|anyrun)$"
|
|
|
|
|
"blur, ^(gtk-layer-shell|anyrun)$"
|
|
|
|
|
"noanim, launcher"
|
|
|
|
|
"noanim, bar"
|
|
|
|
|
];
|
|
|
|
|
windowrulev2 = [
|
|
|
|
|
# only allow shadows for floating windows
|
|
|
|
|
"noshadow, floating:0"
|
|
|
|
|
"tile, title:Spotify"
|
|
|
|
|
|
|
|
|
|
"idleinhibit focus, class:^(mpv)$"
|
|
|
|
|
|
|
|
|
|
"float, title:^(Picture-in-Picture)$"
|
|
|
|
|
"pin, title:^(Picture-in-Picture)$"
|
|
|
|
|
|
|
|
|
|
"float,class:udiskie"
|
|
|
|
|
|
|
|
|
|
# "workspace special silent,class:^(pavucontrol)$"
|
|
|
|
|
|
|
|
|
|
"float, class:^(imv)$"
|
|
|
|
|
|
|
|
|
|
# throw sharing indicators away
|
|
|
|
|
"workspace special silent, title:^(Firefox — Sharing Indicator)$"
|
|
|
|
|
"workspace special silent, title:^(.*is sharing (your screen|a window)\.)$"
|
|
|
|
|
|
|
|
|
|
"workspace 5, class:^(thunderbird)$"
|
|
|
|
|
"workspace 4, title:^(.*(Disc|WebC)ord.*)$"
|
|
|
|
|
"workspace 4, class:^(.*Slack.*)$"
|
|
|
|
|
"workspace 3, title:^(Spotify Premium)$"
|
2024-09-23 22:21:44 -04:00
|
|
|
"workspace 2, class:^(zen)$"
|
2024-05-23 20:26:30 +00:00
|
|
|
"opacity 0.0 override,class:^(xwaylandvideobridge)$"
|
|
|
|
|
"noanim,class:^(xwaylandvideobridge)$"
|
|
|
|
|
"noinitialfocus,class:^(xwaylandvideobridge)$"
|
|
|
|
|
"maxsize 1 1,class:^(xwaylandvideobridge)$"
|
|
|
|
|
"noblur,class:^(xwaylandvideobridge)$"
|
|
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
|
2024-09-21 18:49:15 -04:00
|
|
|
# # fake a tray to let apps start
|
|
|
|
|
# # https://github.com/nix-community/home-manager/issues/2064
|
|
|
|
|
# systemd.user.targets.tray = {
|
|
|
|
|
# Unit = {
|
|
|
|
|
# Description = "Home Manager System Tray";
|
|
|
|
|
# Requires = ["graphical-session-pre.target"];
|
|
|
|
|
# };
|
|
|
|
|
# };
|
2024-05-23 20:26:30 +00:00
|
|
|
|
|
|
|
|
systemd.user.services = {
|
|
|
|
|
swaybg = mkService {
|
|
|
|
|
Unit.Description = "Wallpaper chooser";
|
|
|
|
|
Service = {
|
|
|
|
|
ExecStart = "${getExe pkgs.swaybg} -i ${wallpaper}";
|
|
|
|
|
Restart = "always";
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
}
|