dotfiles/config/hypr/hyprland.conf
Mads Fagerlund 64a399597a
plain: one x86_64 target, no host branching
Drops the mbp (Asahi) target and everything that existed only to serve
two machines at once:

  - apple-silicon input, firmware/ (87M of Mac Wi-Fi/BT blobs), hosts/mbp/
  - the mkHost helper and the common-vs-host-module split, merged into one
    `pc` module
  - the osConfig.networking.hostName conditional that generated
    hypr/monitors.conf per host -- the monitor layout, workspace placement
    and panel float rule are now stated once, inline in hyprland.conf
  - the aarch64 nixbuild.net builder and the aarch64 devShell
  - Mac-only hyprland bits: the apple-spi-keyboard device block and the
    touchpad input block

hosts/pc/hardware-configuration.nix moves to the repo root: with one
machine there is no host to namespace it under. The flake output stays
named `pc` so it matches networking.hostName, which means plain
`nixos-rebuild switch --flake ~/nixos` resolves it with no #target.

eww goes too. It only ever drew a battery popup (SUPER+R), and a battery
readout on a desktop with no battery is nothing.

Also fixes the services.logind.suspendKey/hibernateKey/lidSwitch rename
that eval has been warning about; the rendered logind.conf keeps the same
three Handle*=ignore directives.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-10-10 19:34:53 +02:00

169 lines
5.7 KiB
Text

# -- Monitors --
monitor = desc:Lenovo Group Limited P27q-20 V909LRFR, 2560x1440@60, 0x0, 1.0
monitor = desc:Lenovo Group Limited P27q-20 V909LPNY, 2560x1440@60, 2560x0, 1.0
monitor = desc:Lenovo Group Limited P27q-20 V909LRDD, 2560x1440@60, 5120x0, 1.0
# Each screen's home workspace; SUPER+ALT+h/l can still move it.
workspace = 1, monitor:desc:Lenovo Group Limited P27q-20 V909LRFR, default:true
workspace = 2, monitor:desc:Lenovo Group Limited P27q-20 V909LPNY, default:true
workspace = 3, monitor:desc:Lenovo Group Limited P27q-20 V909LRDD, default:true
# -- Input --
# TrackPoint (Corne nipple): hold middle button + move to scroll, joystick-style
device {
name = corne-tp
scroll_method = on_button_down
scroll_button = 274 # BTN_MIDDLE
scroll_button_lock = false # set true to toggle scroll on/off with a tap instead of holding
}
input {
kb_layout = us,dk
kb_options = grp:win_space_toggle
follow_mouse = 1
repeat_rate = 50
repeat_delay = 300
accel_profile = custom
scroll_points = 0.5 1.0 1.5 2.0 2.5
}
general {
gaps_in = 0
gaps_out = 0
border_size = 0
layout = dwindle
}
animations {
enabled = false
}
dwindle {
preserve_split = true
force_split = 2
}
# Apps don't get to maximize themselves: kitty (0.49) asks ~250ms after it
# maps, so every new terminal opened maximized. SUPER+F still works.
windowrule = match:class .*, suppress_event maximize
misc {
disable_hyprland_logo = true
disable_splash_rendering = true
focus_on_activate = true
}
ecosystem {
no_update_news = true
no_donation_nag = true
}
# -- Environment --
env = QT_QPA_PLATFORMTHEME,qt6ct
env = QT_STYLE_OVERRIDE,Adwaita-Dark
env = XDG_SCREENSHOTS_DIR,$HOME/Pictures/Screenshots
# hyprshot ignores XDG_SCREENSHOTS_DIR: it reads HYPRSHOT_DIR, else XDG_PICTURES_DIR,
# else $HOME. Without this, screenshots land loose in ~/Pictures.
env = HYPRSHOT_DIR,$HOME/Pictures/Screenshots
# -- Autostart --
exec-once = uwsm finalize
# Boot lands on the lock screen rather than an unlocked desktop. Unlocking it
# also unlocks the keyring (see security.pam.services.hyprlock in flake.nix).
exec-once = hyprlock
exec-once = swaybg -c '#16181a'
exec-once = systemctl --user start hyprpolkitagent
# -- Core --
bind = SUPER, Return, exec, kitty
bind = SUPER, D, exec, fuzzel
bind = SUPER, Q, killactive
bind = SUPER, F, fullscreen, 1
bind = SUPER SHIFT, Space, togglefloating
bind = SUPER, Escape, exec, hyprlock
# Amphetamine-style stay-awake toggle: idle + sleep + lid. See flake.nix.
bind = SUPER, A, exec, caffeine
# -- Floating panels --
# Each gets its own app_id so the rule below floats only these and not every
# terminal. Quit with the TUI's own `q`; no toggle wrapper.
#
# Hyprland 0.56 `size` takes ONLY absolute pixels -- percentages are silently
# ignored (they parse fine and then do nothing), so this is 70% of 2560x1440.
windowrule = match:class ^(panel-wifi|panel-bt)$, float on, size 1792 1440, center on
bind = SUPER, W, exec, kitty --class panel-wifi impala
bind = SUPER, E, exec, kitty --class panel-bt bluetui
# -- Focus --
bind = SUPER, h, movefocus, l
bind = SUPER, j, movefocus, d
bind = SUPER, k, movefocus, u
bind = SUPER, l, movefocus, r
# -- Move windows --
bind = SUPER SHIFT, h, movewindow, l
bind = SUPER SHIFT, j, movewindow, d
bind = SUPER SHIFT, k, movewindow, u
bind = SUPER SHIFT, l, movewindow, r
# -- Workspaces (AeroSpace-style) --
# Each workspace lives on one monitor. SUPER+N shows N on its monitor and
# focuses it, leaving the other screens alone; a new workspace opens on the
# focused monitor. SUPER+ALT+h/l carries a workspace to another monitor.
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
# Send the window without following it, like AeroSpace's move-node-to-workspace.
bind = SUPER SHIFT, 1, movetoworkspacesilent, 1
bind = SUPER SHIFT, 2, movetoworkspacesilent, 2
bind = SUPER SHIFT, 3, movetoworkspacesilent, 3
bind = SUPER SHIFT, 4, movetoworkspacesilent, 4
bind = SUPER SHIFT, 5, movetoworkspacesilent, 5
# AeroSpace's alt-tab / alt-shift-tab: previous workspace, and send the
# current workspace to the next monitor (+1 wraps past the last one).
bind = SUPER, Tab, workspace, previous
bind = SUPER SHIFT, Tab, movecurrentworkspacetomonitor, +1
bind = SUPER ALT, Tab, movecurrentworkspacetomonitor, +1
# -- Move current workspace to another monitor --
bind = SUPER ALT, h, movecurrentworkspacetomonitor, l
bind = SUPER ALT, l, movecurrentworkspacetomonitor, r
# -- Resize (hold for repeat) --
binde = SUPER CTRL, h, resizeactive, -40 0
binde = SUPER CTRL, j, resizeactive, 0 40
binde = SUPER CTRL, k, resizeactive, 0 -40
binde = SUPER CTRL, l, resizeactive, 40 0
# -- Mouse --
bindm = SUPER, mouse:272, movewindow
bindm = SUPER, mouse:273, resizewindow
# -- Audio (bindel: locked + repeat; bindl: locked, no repeat) --
bindel = , XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 5%+
bindel = , XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
bindl = , XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
bindl = , XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle
# -- Brightness --
bindel = , XF86MonBrightnessUp, exec, brightnessctl set 5%+
bindel = , XF86MonBrightnessDown, exec, brightnessctl set 5%-
# -- Media --
bindl = , XF86AudioPlay, exec, playerctl play-pause
bindl = , XF86AudioNext, exec, playerctl next
bindl = , XF86AudioPrev, exec, playerctl previous
# -- Screenshots --
# Super+Ctrl+S: focused monitor -> file + clipboard
bind = SUPER CTRL, S, exec, hyprshot -m output
# Super+Shift+S: region (screen frozen while selecting) -> file + clipboard
bind = SUPER SHIFT, S, exec, hyprshot -m region -z