2024-09-09 00:22:14 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
2024-09-13 01:50:53 +00:00
|
|
|
with lib; let
|
2024-09-25 20:05:04 +00:00
|
|
|
_1password = "${config.programs._1password-gui.package}/bin/1password";
|
2024-09-27 19:51:18 +00:00
|
|
|
audio = config.home-manager.users.${config.custom.username}.home.file.".local/bin/audio".source;
|
2024-09-09 00:22:14 +00:00
|
|
|
clipse = "${pkgs.clipse}/bin/clipse";
|
2024-09-27 20:12:15 +00:00
|
|
|
firefox-esr = "${config.home-manager.users.${config.custom.username}.programs.firefox.finalPackage}/bin/firefox-esr";
|
2024-12-07 01:51:19 +00:00
|
|
|
grep = "${pkgs.gnugrep}/bin/grep";
|
2024-09-15 23:22:23 +00:00
|
|
|
left = config.home-manager.users.${config.custom.username}.home.file.".local/bin/left".source;
|
2024-11-08 20:32:37 +00:00
|
|
|
loupe = "${pkgs.loupe}/bin/loupe";
|
2024-12-07 01:51:19 +00:00
|
|
|
modprobe = "${pkgs.kmod}/bin/modprobe";
|
2024-11-06 18:06:38 +00:00
|
|
|
nautilus = "${pkgs.nautilus}/bin/nautilus";
|
2024-09-09 00:22:14 +00:00
|
|
|
pkill = "${pkgs.procps}/bin/pkill";
|
|
|
|
rm = "${pkgs.coreutils}/bin/rm";
|
|
|
|
sleep = "${pkgs.coreutils}/bin/sleep";
|
|
|
|
sway-audio-idle-inhibit = "${pkgs.sway-audio-idle-inhibit}/bin/sway-audio-idle-inhibit";
|
|
|
|
systemctl = "${pkgs.systemd}/bin/systemctl";
|
2024-12-07 01:51:19 +00:00
|
|
|
virsh = "${config.virtualisation.libvirtd.package}/bin/virsh";
|
2024-09-27 20:12:15 +00:00
|
|
|
waybar = "${config.home-manager.users.${config.custom.username}.programs.waybar.package}/bin/waybar";
|
2024-09-09 00:22:14 +00:00
|
|
|
|
|
|
|
cfg = config.custom.desktops.hyprland.settings;
|
2024-09-13 01:50:53 +00:00
|
|
|
in {
|
|
|
|
options.custom.desktops.hyprland.settings.enable = mkOption {default = false;};
|
2024-09-09 00:22:14 +00:00
|
|
|
|
|
|
|
config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
|
|
|
|
wayland.windowManager.hyprland.settings = {
|
|
|
|
# https://wiki.hyprland.org/Configuring/Variables/#debug
|
|
|
|
debug = {
|
|
|
|
#// disable_logs = false;
|
|
|
|
enable_stdout_logs = true; # systemd-cat
|
|
|
|
|
|
|
|
#!! May result in resolution oddities
|
|
|
|
disable_scale_checks = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
# https://wiki.hyprland.org/Configuring/Monitors
|
|
|
|
#?? monitor = NAME, RESOLUTION, POSITION, SCALE
|
2024-12-07 01:54:17 +00:00
|
|
|
monitor = mkBefore [
|
2024-09-09 00:22:14 +00:00
|
|
|
", highrr, auto, ${toString config.custom.scale}"
|
|
|
|
|
|
|
|
# HACK: Ensure the fallback output has a sane resolution
|
|
|
|
# https://github.com/hyprwm/Hyprland/issues/7276#issuecomment-2323346668
|
|
|
|
"FALLBACK, ${toString config.custom.width}x${toString config.custom.height}@60, auto, ${toString config.custom.scale}"
|
|
|
|
];
|
|
|
|
|
|
|
|
# https://wiki.hyprland.org/Configuring/Keywords/#setting-the-environment
|
|
|
|
#?? envd = VARIABLE, VALUE
|
|
|
|
# HACK: Mapped home-manager variables to envd in lieu of upstream fix
|
|
|
|
# https://github.com/nix-community/home-manager/issues/2659
|
2024-09-13 01:50:53 +00:00
|
|
|
envd = with builtins;
|
2024-09-09 00:22:14 +00:00
|
|
|
attrValues (
|
|
|
|
mapAttrs (
|
|
|
|
name: value: "${name}, ${toString value}"
|
2024-09-13 01:50:53 +00:00
|
|
|
)
|
|
|
|
config.home-manager.users.${config.custom.username}.home.sessionVariables
|
2024-09-09 00:22:14 +00:00
|
|
|
)
|
|
|
|
++ [
|
|
|
|
"EDITOR, gnome-text-editor"
|
|
|
|
];
|
|
|
|
|
|
|
|
# https://wiki.hyprland.org/Configuring/Keywords/#executing
|
2024-09-16 00:50:21 +00:00
|
|
|
exec = [
|
2024-09-24 23:24:27 +00:00
|
|
|
"${left} --init --scroll kensington-orbit-wireless-tb-mouse" # Enforce left-pawed state
|
2024-09-16 00:50:21 +00:00
|
|
|
];
|
2024-09-09 00:22:14 +00:00
|
|
|
|
|
|
|
# https://wiki.hyprland.org/Configuring/Keywords/#executing
|
2024-09-13 01:50:53 +00:00
|
|
|
exec-once =
|
2024-12-07 01:51:19 +00:00
|
|
|
[
|
2024-09-13 01:50:53 +00:00
|
|
|
sway-audio-idle-inhibit # Inhibit idle while audio is playing
|
2024-09-27 19:51:18 +00:00
|
|
|
"${audio} --init" # Enforce audio profile state
|
2024-11-24 03:21:56 +00:00
|
|
|
"${rm} ~/.cache/walker/clipboard.gob" # Clear clipboard history
|
2024-09-25 20:05:04 +00:00
|
|
|
"${_1password} --silent" # Launch password manager in background
|
2024-11-06 17:38:00 +00:00
|
|
|
#// "[group new; tile] ${firefox-esr}"
|
2024-11-06 18:06:38 +00:00
|
|
|
|
2024-11-08 20:32:37 +00:00
|
|
|
# HACK: Launch hidden GTK windows to reduce startup time
|
|
|
|
"[workspace special:hidden silent] ${loupe}"
|
|
|
|
"[workspace special:hidden silent] ${nautilus}"
|
2024-12-07 01:54:17 +00:00
|
|
|
]
|
2024-12-07 01:51:19 +00:00
|
|
|
++ optionals config.custom.wallpaper [
|
|
|
|
"wallpaper"
|
|
|
|
]
|
|
|
|
# HACK: Delay driver initialization to work around reset issues
|
|
|
|
++ optionals config.custom.settings.vm.passthrough.init [
|
|
|
|
"${virsh} list | ${grep} ${config.custom.settings.vm.passthrough.guest} || sudo ${modprobe} ${config.custom.settings.vm.passthrough.driver}"
|
2024-09-24 23:24:36 +00:00
|
|
|
];
|
2024-09-09 00:22:14 +00:00
|
|
|
|
|
|
|
# https://wiki.hyprland.org/Configuring/Variables/#xwayland
|
|
|
|
xwayland = {
|
|
|
|
force_zero_scaling = true;
|
|
|
|
};
|
|
|
|
|
2024-10-06 21:51:13 +00:00
|
|
|
# https://wiki.hyprland.org/Configuring/Dwindle-Layout/
|
|
|
|
dwindle = {
|
|
|
|
default_split_ratio = 1.25;
|
|
|
|
force_split = 2; # Right
|
|
|
|
split_bias = 1; # Larger active window
|
|
|
|
split_width_multiplier = 1.5;
|
|
|
|
};
|
|
|
|
|
|
|
|
# https://wiki.hyprland.org/Configuring/Master-Layout/
|
2024-09-09 00:22:14 +00:00
|
|
|
# Optimized for ultrawide use by default
|
|
|
|
master = {
|
|
|
|
allow_small_split = true;
|
|
|
|
always_center_master = true;
|
|
|
|
mfact = 0.5;
|
2024-11-15 18:04:33 +00:00
|
|
|
orientation =
|
|
|
|
if config.custom.ultrawide
|
|
|
|
then "center"
|
|
|
|
else "top";
|
2024-09-09 00:22:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# https://wiki.hyprland.org/Configuring/Variables/#general
|
|
|
|
general = {
|
|
|
|
"col.active_border" = "rgb(93a1a1)";
|
|
|
|
"col.inactive_border" = "rgba(93a1a140)";
|
|
|
|
"col.nogroup_border_active" = "rgb(dc322f)";
|
|
|
|
"col.nogroup_border" = "rgba(dc322f40)";
|
|
|
|
#// allow_tearing = true;
|
|
|
|
border_size = config.custom.border;
|
2024-11-25 18:00:23 +00:00
|
|
|
extend_border_grab_area = 5;
|
2024-09-09 00:22:14 +00:00
|
|
|
gaps_in = config.custom.gap / 2;
|
|
|
|
gaps_out = config.custom.gap;
|
|
|
|
layout = "master";
|
|
|
|
#// no_border_on_floating = true;
|
2024-11-17 19:37:48 +00:00
|
|
|
#// resize_corner = 3; # Bottom-right
|
2024-09-09 00:22:14 +00:00
|
|
|
resize_on_border = true;
|
2024-10-27 21:42:00 +00:00
|
|
|
snap.enabled = true;
|
2024-09-09 00:22:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# https://wiki.hyprland.org/Configuring/Animations
|
|
|
|
#?? animation = NAME, ONOFF, SPEED, CURVE, [STYLE]
|
|
|
|
animation = [
|
2024-10-02 00:10:19 +00:00
|
|
|
"global, 1, 3, default"
|
|
|
|
"specialWorkspace, 1, 3, default, fade"
|
|
|
|
"windows, 1, 3, default, slide"
|
2024-09-11 23:19:04 +00:00
|
|
|
"layers, 0"
|
2024-09-09 00:22:14 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# https://wiki.hyprland.org/Configuring/Variables/#decoration
|
|
|
|
decoration = {
|
|
|
|
blur.enabled = false;
|
2024-10-13 22:15:48 +00:00
|
|
|
dim_special = 0.25;
|
2024-10-06 15:45:37 +00:00
|
|
|
rounding = config.custom.rounding;
|
2024-11-11 00:07:03 +00:00
|
|
|
|
|
|
|
shadow = {
|
|
|
|
color = "rgba(00000040)";
|
|
|
|
color_inactive = "rgba(0000001a)";
|
|
|
|
range = 50;
|
|
|
|
render_power = 4; # Distance falloff
|
|
|
|
};
|
2024-09-09 00:22:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# https://wiki.hyprland.org/Configuring/Variables/#group
|
|
|
|
group = {
|
|
|
|
"col.border_active" = "rgb(6c71c4)";
|
|
|
|
"col.border_inactive" = "rgba(6c71c440)";
|
|
|
|
"col.border_locked_active" = "rgb(d33682)";
|
|
|
|
"col.border_locked_inactive" = "rgba(d3368240)";
|
2024-10-08 23:23:18 +00:00
|
|
|
#// auto_group = false;
|
2024-09-09 00:22:14 +00:00
|
|
|
insert_after_current = false;
|
|
|
|
|
|
|
|
# https://wiki.hyprland.org/Configuring/Variables/#groupbar
|
|
|
|
groupbar = {
|
|
|
|
"col.active" = "rgb(6c71c4)";
|
|
|
|
"col.inactive" = "rgba(6c71c440)";
|
|
|
|
"col.locked_active" = "rgb(d33682)";
|
|
|
|
"col.locked_inactive" = "rgba(d3368240)";
|
2024-09-13 01:50:53 +00:00
|
|
|
font_size =
|
|
|
|
if config.custom.hidpi
|
|
|
|
then 16
|
|
|
|
else 10;
|
2024-09-09 00:22:14 +00:00
|
|
|
height = 5;
|
|
|
|
render_titles = false;
|
|
|
|
text_color = "rgb(93a1a1)";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# https://wiki.hyprland.org/Configuring/Variables/#misc
|
|
|
|
misc = {
|
|
|
|
#// animate_manual_resizes = true;
|
|
|
|
#// animate_mouse_windowdragging = true;
|
|
|
|
background_color = "rgb(073642)";
|
|
|
|
disable_hyprland_logo = true;
|
|
|
|
disable_splash_rendering = true;
|
|
|
|
focus_on_activate = true;
|
2024-09-21 15:47:31 +00:00
|
|
|
font_family = config.custom.font.monospace;
|
2024-09-09 00:22:14 +00:00
|
|
|
force_default_wallpaper = 0;
|
2024-11-24 19:11:31 +00:00
|
|
|
initial_workspace_tracking = 2; # All children
|
2024-09-09 00:22:14 +00:00
|
|
|
key_press_enables_dpms = true;
|
|
|
|
middle_click_paste = false;
|
|
|
|
|
2024-09-09 22:26:04 +00:00
|
|
|
# BUG: Still causes hard freezes
|
|
|
|
#// vrr = 2; # VRR in fullscreen
|
2024-09-09 00:22:14 +00:00
|
|
|
};
|
|
|
|
|
2024-09-11 23:19:33 +00:00
|
|
|
# https://wiki.hyprland.org/Configuring/Variables/#binds
|
|
|
|
binds = {
|
|
|
|
allow_workspace_cycles = true;
|
|
|
|
disable_keybind_grabbing = true;
|
|
|
|
ignore_group_lock = true;
|
|
|
|
scroll_event_delay = 0;
|
|
|
|
};
|
|
|
|
|
2024-09-09 00:22:14 +00:00
|
|
|
# https://wiki.hyprland.org/Configuring/Variables/#input
|
|
|
|
input = {
|
2024-10-27 18:32:38 +00:00
|
|
|
accel_profile = "adaptive";
|
2024-09-09 00:22:14 +00:00
|
|
|
float_switch_override_focus = 0; # Disable float to tile hover focus
|
2024-10-26 17:14:51 +00:00
|
|
|
focus_on_close = 1; # Focus window under mouse
|
2024-09-09 00:22:14 +00:00
|
|
|
follow_mouse = 1; # Hover focus
|
2024-09-28 18:44:36 +00:00
|
|
|
mouse_refocus = false; # Required to focus last window on close
|
2024-09-11 23:20:04 +00:00
|
|
|
repeat_delay = 300;
|
2024-09-09 00:22:14 +00:00
|
|
|
repeat_rate = 40;
|
|
|
|
sensitivity = 0.5;
|
|
|
|
#// scroll_factor = 0.75;
|
2024-10-06 21:51:13 +00:00
|
|
|
special_fallthrough = true; # Focus windows under special workspace
|
2024-09-09 00:22:14 +00:00
|
|
|
|
|
|
|
touchpad = {
|
|
|
|
clickfinger_behavior = true; # Multi-finger clicks
|
|
|
|
natural_scroll = true;
|
2024-11-02 19:43:49 +00:00
|
|
|
scroll_factor = 0.5;
|
2024-09-09 00:22:14 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-10-19 00:21:31 +00:00
|
|
|
# https://wiki.hyprland.org/Configuring/Variables/#render
|
|
|
|
render = {
|
2024-10-22 01:01:15 +00:00
|
|
|
#// explicit_sync = 1;
|
|
|
|
#// explicit_sync_kms = 1;
|
2024-10-19 00:21:31 +00:00
|
|
|
};
|
|
|
|
|
2024-09-09 00:22:14 +00:00
|
|
|
# https://wiki.hyprland.org/Configuring/Variables/#cursor
|
|
|
|
cursor = {
|
2024-09-15 00:58:17 +00:00
|
|
|
hide_on_key_press = true;
|
2024-10-06 21:51:13 +00:00
|
|
|
#// hotspot_padding = config.custom.gap;
|
2024-09-20 00:41:41 +00:00
|
|
|
#// min_refresh_rate = 60; # !! Hardware dependent
|
|
|
|
#// no_break_fs_vrr = true;
|
2024-09-09 00:22:14 +00:00
|
|
|
#// no_hardware_cursors = true;
|
|
|
|
no_warps = true;
|
|
|
|
zoom_rigid = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
# https://wiki.hyprland.org/Configuring/Variables/#gestures
|
|
|
|
gestures = {
|
|
|
|
workspace_swipe = true;
|
|
|
|
workspace_swipe_cancel_ratio = 0.2;
|
|
|
|
workspace_swipe_distance = 1000;
|
2024-11-18 18:07:03 +00:00
|
|
|
#// workspace_swipe_forever = true;
|
2024-09-09 00:22:14 +00:00
|
|
|
workspace_swipe_min_speed_to_force = 10;
|
|
|
|
};
|
|
|
|
|
|
|
|
# https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs
|
|
|
|
#?? device = { name = NAME ... }
|
2024-09-11 23:20:31 +00:00
|
|
|
# https://wiki.hyprland.org/Configuring/Variables/#custom-accel-profiles
|
|
|
|
# https://wayland.freedesktop.org/libinput/doc/latest/pointer-acceleration.html#the-custom-acceleration-profile
|
|
|
|
#?? custom <STEP> <POINTS...>
|
2024-11-27 22:12:59 +00:00
|
|
|
device = let
|
|
|
|
# Combine duplicate devices into one attrset
|
|
|
|
#?? (devices ["NAME"] {ATTRS})
|
|
|
|
devices = names: attrs: map (name: {inherit name;} // attrs) names;
|
|
|
|
in
|
|
|
|
flatten [
|
2024-12-07 01:49:48 +00:00
|
|
|
(devices ["compx-2.4g-receiver-mouse"] {
|
|
|
|
accel_profile = "custom 1 0 1 10 20";
|
|
|
|
})
|
|
|
|
|
2024-11-27 22:12:59 +00:00
|
|
|
(devices ["kensington-orbit-wireless-tb-mouse" "orbit-bt5.0-mouse"] {
|
|
|
|
accel_profile = "adaptive";
|
|
|
|
left_handed = true;
|
|
|
|
middle_button_emulation = true;
|
|
|
|
natural_scroll = true;
|
|
|
|
sensitivity = -0.6;
|
|
|
|
})
|
|
|
|
|
|
|
|
(devices ["logitech-m570"] {
|
|
|
|
accel_profile = "custom 1 0 1 3";
|
|
|
|
sensitivity = -0.2;
|
|
|
|
})
|
|
|
|
|
|
|
|
(devices ["nordic-2.4g-wireless-receiver-mouse" "protoarc-em11-nl-mouse"] {
|
|
|
|
sensitivity = -0.7;
|
|
|
|
})
|
|
|
|
|
2024-12-07 01:49:48 +00:00
|
|
|
(devices ["razer-razer-viper-ultimate" "razer-razer-viper-ultimate-dongle" "razer-razer-viper-ultimate-dongle-1"] {
|
2024-11-27 22:12:59 +00:00
|
|
|
sensitivity = -0.7;
|
|
|
|
})
|
|
|
|
|
|
|
|
(devices ["wireless-controller-touchpad"] {
|
|
|
|
enabled = false;
|
|
|
|
})
|
|
|
|
];
|
2024-09-09 00:22:14 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|