2024-09-09 00:22:14 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
2024-09-13 01:50:53 +00:00
|
|
|
with lib; let
|
2024-09-09 00:22:14 +00:00
|
|
|
clipse = "${pkgs.clipse}/bin/clipse";
|
|
|
|
firefox-esr = "${
|
|
|
|
config.home-manager.users.${config.custom.username}.programs.firefox.finalPackage
|
|
|
|
}/bin/firefox-esr";
|
2024-09-15 23:22:23 +00:00
|
|
|
left = config.home-manager.users.${config.custom.username}.home.file.".local/bin/left".source;
|
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";
|
|
|
|
waybar = "${
|
|
|
|
config.home-manager.users.${config.custom.username}.programs.waybar.package
|
|
|
|
}/bin/waybar";
|
|
|
|
|
|
|
|
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
|
|
|
|
monitor = [
|
|
|
|
", 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
|
|
|
|
#// exec = [ ];
|
|
|
|
|
|
|
|
# https://wiki.hyprland.org/Configuring/Keywords/#executing
|
2024-09-13 01:50:53 +00:00
|
|
|
exec-once =
|
|
|
|
[
|
2024-09-15 22:41:21 +00:00
|
|
|
"${rm} ~/.cache/walker/clipboard.gob" # Clear clipboard
|
2024-09-13 01:50:53 +00:00
|
|
|
sway-audio-idle-inhibit # Inhibit idle while audio is playing
|
2024-09-15 22:41:21 +00:00
|
|
|
left # Left-handed at boot
|
2024-09-09 00:22:14 +00:00
|
|
|
|
2024-09-13 01:50:53 +00:00
|
|
|
# TODO: Remove when systemd service fixed
|
|
|
|
# https://github.com/Alexays/Waybar/issues/2882
|
|
|
|
"${sleep} 2 && ${systemctl} --user restart waybar"
|
2024-09-09 00:22:14 +00:00
|
|
|
|
2024-09-11 23:21:13 +00:00
|
|
|
"[group new lock; tile] ${firefox-esr}"
|
|
|
|
]
|
|
|
|
++ optionals config.custom.wallpaper ["wallpaper"];
|
2024-09-09 00:22:14 +00:00
|
|
|
|
|
|
|
# https://wiki.hyprland.org/Configuring/Variables/#xwayland
|
|
|
|
xwayland = {
|
|
|
|
force_zero_scaling = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
# https://wiki.hyprland.org/Configuring/Master-Layout
|
|
|
|
# Optimized for ultrawide use by default
|
|
|
|
master = {
|
|
|
|
allow_small_split = true;
|
|
|
|
always_center_master = true;
|
|
|
|
mfact = 0.5;
|
|
|
|
orientation = "center";
|
|
|
|
};
|
|
|
|
|
|
|
|
# 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;
|
|
|
|
gaps_in = config.custom.gap / 2;
|
|
|
|
gaps_out = config.custom.gap;
|
|
|
|
layout = "master";
|
|
|
|
#// no_border_on_floating = true;
|
|
|
|
resize_on_border = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
# https://wiki.hyprland.org/Configuring/Animations
|
|
|
|
#?? animation = NAME, ONOFF, SPEED, CURVE, [STYLE]
|
|
|
|
animation = [
|
|
|
|
"global, 1, 5, default"
|
|
|
|
"specialWorkspace, 1, 5, default, fade"
|
2024-09-11 23:19:04 +00:00
|
|
|
"windows, 1, 5, default, slide"
|
|
|
|
"layers, 0"
|
2024-09-09 00:22:14 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# https://wiki.hyprland.org/Configuring/Variables/#decoration
|
|
|
|
decoration = {
|
|
|
|
"col.shadow_inactive" = "rgba(0000001a)";
|
|
|
|
"col.shadow" = "rgba(00000040)";
|
|
|
|
blur.enabled = false;
|
2024-09-09 03:19:28 +00:00
|
|
|
dim_special = 0;
|
2024-09-09 00:22:14 +00:00
|
|
|
rounding = 12;
|
|
|
|
shadow_range = 50;
|
|
|
|
shadow_render_power = 4; # Distance falloff
|
|
|
|
};
|
|
|
|
|
|
|
|
# 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)";
|
|
|
|
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;
|
|
|
|
font_family = "monospace";
|
|
|
|
force_default_wallpaper = 0;
|
|
|
|
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 = {
|
|
|
|
accel_profile = "flat";
|
|
|
|
float_switch_override_focus = 0; # Disable float to tile hover focus
|
2024-09-11 23:19: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-12 21:58:43 +00:00
|
|
|
#// mouse_refocus = false;
|
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-09-09 03:19:28 +00:00
|
|
|
special_fallthrough = true; # Alternative to toggle script
|
2024-09-09 00:22:14 +00:00
|
|
|
|
|
|
|
touchpad = {
|
|
|
|
clickfinger_behavior = true; # Multi-finger clicks
|
|
|
|
natural_scroll = true;
|
|
|
|
scroll_factor = 0.4;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# https://wiki.hyprland.org/Configuring/Variables/#cursor
|
|
|
|
cursor = {
|
2024-09-15 00:58:17 +00:00
|
|
|
hide_on_key_press = true;
|
2024-09-09 00:22:14 +00:00
|
|
|
hotspot_padding = 10;
|
|
|
|
min_refresh_rate = 60; # !! Hardware dependent
|
|
|
|
no_break_fs_vrr = true;
|
|
|
|
#// 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;
|
|
|
|
workspace_swipe_forever = true;
|
|
|
|
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-09-09 00:22:14 +00:00
|
|
|
# TODO: Combine same devices
|
|
|
|
# FIXME: Hotplugging may result in different id
|
|
|
|
device = [
|
|
|
|
{
|
|
|
|
name = "kensington-orbit-wireless-tb-mouse";
|
|
|
|
accel_profile = "adaptive";
|
|
|
|
sensitivity = -0.6;
|
|
|
|
left_handed = true;
|
|
|
|
middle_button_emulation = true;
|
|
|
|
natural_scroll = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
name = "orbit-bt5.0-mouse";
|
|
|
|
accel_profile = "adaptive";
|
|
|
|
sensitivity = -0.6;
|
|
|
|
left_handed = true;
|
|
|
|
middle_button_emulation = true;
|
|
|
|
natural_scroll = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
name = "logitech-m570";
|
2024-09-11 23:20:31 +00:00
|
|
|
accel_profile = "custom 1 0 1 3";
|
|
|
|
sensitivity = -0.1;
|
2024-09-09 00:22:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
name = "nordic-2.4g-wireless-receiver-mouse";
|
|
|
|
sensitivity = -0.6;
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
name = "protoarc-em11-nl-mouse";
|
|
|
|
sensitivity = -0.6;
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
name = "razer-razer-viper-ultimate-dongle";
|
|
|
|
sensitivity = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
name = "wireless-controller-touchpad";
|
|
|
|
enabled = false;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|