diff --git a/.config/hypr/hyprland.conf b/.config/hypr/hyprland.conf index 3ca9937..8411419 100644 --- a/.config/hypr/hyprland.conf +++ b/.config/hypr/hyprland.conf @@ -1,48 +1,28 @@ monitor=,preferred,auto,auto -# monitor = eDP-1, 2880x1800@90, 0x1080, 2 -# monitor = DP-1, 2560x1440@180, 0x0, 1, bitdepth, 10, cm, srgb, sdrbrightness, 1.65, sdrsaturation, 1.0 monitor = DP-1, 2560x1440@180, 0x0, 1, bitdepth, 10 monitor = HDMI-A-1, 1920x1080@75, 2560x0, 1, bitdepth, 10 -# monitor = eDP-1, disable -# monitor = HDMI-A-1, disable -# monitor = DP-1, disable -# bindl = , switch:on:Lid Switch, exec, hyprctl keyword monitor "eDP-1, disable" -# bindl = , switch:off:Lid Switch, exec, hyprctl keyword monitor "eDP-1, enable" -# bindl = , switch:on:Lid Switch, exec, hyprctl keyword input:touchdevice:enabled false -# bindl = , switch:off:Lid Switch, exec, hyprctl keyword input:touchdevice:enabled false -# bindl = , switch:off:Lid Switch, exec, hyprctl reload && hyprctl keyword input:touchdevice:enabled false -# bindl = , switch:off:Lid Switch, exec, hyprctl keyword monitor "eDP-1, 2880x1800@90, 0x1080, 2" monitor = HDMI-A-1, disable exec-once = hyprpm reload -n exec-once = sleep 1 && /usr/libexec/polkit-mate-authentication-agent-1 exec-once = bash ~/.config/scripts/shared/song_detail_writer.sh exec-once = sleep 1 && waybar -# exec-once = sleep 1 && eww daemon -# exec-once = sleep 1 && eww open main exec-once = sleep 2 && nm-applet exec-once = sleep 2 && blueman-applet exec-once = sleep 2 && kdeconnect-indicator exec-once = sleep 2 && hyprpaper exec-once = sleep 3 && /opt/Mullvad\ VPN/mullvad-vpn -# exec-once = sleep 3 && hyprctl keyword input:touchdevice:enabled false exec-once = sleep 3 && swaync-client -dn -exec-once = sleep 3 && wl-paste --type text --watch cliphist store # Stores only text data -exec-once = sleep 3 && wl-paste --type image --watch cliphist store # Stores only image data +exec-once = sleep 3 && wl-paste --type text --watch cliphist store +exec-once = sleep 3 && wl-paste --type image --watch cliphist store exec-once = sleep 4 && rfkill unblock bluetooth && bluetoothctl power on exec-once = sudo /usr/local/bin/asus-receiver-rebind -# exec = gsettings set org.gnome.desktop.interface gtk-theme "Adwaita-dark" # for GTK3 apps -# exec = gsettings set org.gnome.desktop.interface color-scheme "prefer-dark" # for GTK4 apps -# exec = gsettings set org.gnome.desktop.interface icon-theme 'papirus-dark' - env = QT_QPA_PLATFORMTHEME,gtk3 env = XCURSOR_SIZE,24 env = HYPRCURSOR_SIZE,24 env = PATH, $HOME/.cargo/bin/:$HOME/.local/bin/:$PATH env = XDG_CURRENT_SESSION, Hyprland -# render:explicit_sync = true # legacy command it's deprecated in 0.50 and now it's always enable - $terminal = wezterm start --always-new-process $fileManager = nautilus --new-window $active_menu = rofi -show @@ -61,11 +41,6 @@ $my_trigger = Alt $monitor_left = DP-1 $monitor_right = HDMI-A-1 -# bind = $my_trigger, 0, exec, bluetoothctl disconnect 00:00:00:00:00:00 && bluetoothctl connect 00:00:00:00:00:00 -# bind = $my_trigger, 1, exec, playerctl previous -# bind = $my_trigger, 2, exec, playerctl play-pause -# bind = $my_trigger, 3, exec, playerctl next - bind = $my_trigger, T, exec, $terminal bind = $my_trigger, Q, exec, $fileManager bind = Alt, F1, exec, $active_menu @@ -118,14 +93,12 @@ bind = $mainMod SHIFT, Y, movetoworkspace, 204 bind = $mainMod SHIFT, P, movetoworkspace, 205 bind = $mainMod SHIFT, N, movetoworkspace, 206 -# bind = $mainMod, D, workspace, 999 bind = $mainMod, D, exec, ~/.config/scripts/hyprland/show_desktop.sh bind = Alt, F4, killactive, bind = Alt, 4, killactive, bind = $mainMod $my_trigger, F4, exit, bind = $mainMod, H, exec, pkill -SIGUSR1 waybar -# bind = $mainMod, H, exec, ~/.config/scripts/system/toggle_eww.sh binds { allow_workspace_cycles = true } @@ -133,8 +106,8 @@ bindr = $mainMod, Tab, bringactivetotop bind = $mainMod, Tab, cyclenext bind = Alt, Tab, workspace, previous_per_monitor bind = $mainMod SHIFT, Tab, split:swapactiveworkspaces, $monitor_left $monitor_right -bind = $mainMod, P, pseudo, # dwindle -bind = $mainMod, J, layoutmsg, togglesplit # dwindle +bind = $mainMod, P, pseudo, +bind = $mainMod, J, layoutmsg, togglesplit bind = $mainMod, F, togglefloating, bind = $mainMod, Q, focusmonitor, $monitor_left bind = $mainMod, E, focusmonitor, $monitor_right @@ -202,11 +175,9 @@ bindl = , XF86AudioPrev, exec, playerctl previous windowrule = match:class .*, suppress_event maximize windowrule = match:class ^$, match:title ^$, match:xwayland 1, match:float 1, match:fullscreen 0, match:pin 0, no_focus on windowrule = match:class kitty, opacity 0.8 -# windowrule = match:class dev.zed.Zed, opacity 0.6 windowrule = match:class .*wezterm.*, opacity 0.8 windowrule = match:class .*dev.heppen.webapps.*, tile on -# Gaming: enable tearing for fullscreen games windowrule = match:fullscreen 1, immediate on windowrule = match:class dev.zed.Zed, immediate off @@ -259,7 +230,7 @@ animations { } dwindle { - preserve_split = true # You probably want this + preserve_split = true } master { @@ -267,29 +238,17 @@ master { } misc { - force_default_wallpaper = 0 # Set to 0 or 1 to disable the anime mascot wallpapers - disable_hyprland_logo = true # If true disables the random hyprland logo / anime girl background. :( + force_default_wallpaper = 0 + disable_hyprland_logo = true vrr = 0 mouse_move_focuses_monitor = false } debug { - # Logging was enabled 2026-04-24 for the hard-freeze hunt. That turned out to be a - # Hyprland bug, fixed upstream — closed 2026-07-29, so back to the default (logs off). - # hyprland.log was growing ~1.2MB/hr into /run/user/1000 (tmpfs = RAM). - # Flip to false again if you ever need to capture compositor state. disable_logs = true enable_stdout_logs = false } -# =================================== -# Power Management -# =================================== -# Super + Escape: Open power menu -# Super + Shift + Q: Quick suspend -# Super + Shift + R: Quick reboot -# Super + Shift + S: Quick shutdown - input { kb_layout = tr kb_variant = @@ -301,15 +260,13 @@ input { mouse_refocus = false accel_profile = flat - sensitivity = 0 # -1.0 - 1.0, 0 means no modification. + sensitivity = 0 touchpad { natural_scroll = true } } -# Example per-device config -# See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more device { name = epic-mouse-v1 sensitivity = 0 diff --git a/.config/hypr/hyprlock.conf b/.config/hypr/hyprlock.conf index 98bd713..e14f249 100644 --- a/.config/hypr/hyprlock.conf +++ b/.config/hypr/hyprlock.conf @@ -1,12 +1,8 @@ -# Hyprlock Configuration -# Lock screen with date/time display, password authentication, and music info -# Background image background { path = ~/Pictures/Wallpapers/ryunosuke-kikuno-VXp-9HwN1eg-unsplash.jpg } -# Date label - displays current date in center label { monitor = text = cmd[update:1000] echo -e "$(LC_TIME=en_GB.UTF-8 date +"%A, %B %d")" @@ -18,7 +14,6 @@ label { valign = center } -# Time label - displays current time in large format at center label { monitor = text = cmd[update:1000] echo "$(date +"%H:%M:%S")" @@ -30,7 +25,6 @@ label { valign = center } -# Password input field with authentication status feedback input-field { monitor = size = 280, 55 @@ -53,7 +47,6 @@ input-field { fail_text = Authentication Failed } -# Music info label - reads single-source file maintained by song_detail_writer.sh label { monitor = text = cmd[update:1000] cat /tmp/song_detail_last 2>/dev/null diff --git a/.config/niri/config.kdl b/.config/niri/config.kdl index 8b080da..511cab1 100644 --- a/.config/niri/config.kdl +++ b/.config/niri/config.kdl @@ -1,15 +1,5 @@ -// niri config — ported from ~/.config/hypr/hyprland.conf, both kept working. -// Docs: https://niri-wm.github.io/niri/ • check edits with `niri validate` -// -// MONITORS: DP-1 = left/primary (2560x1440@180), HDMI-A-1 = right (1920x1080@75). -// KDL has no variables, so those names are literal. They appear ONLY in the -// `output` blocks and the four monitor binds below. Scripts read them from -// ~/.config/scripts/niri/monitors.sh instead. -// -// Mod = Super. Alt is the app-launcher trigger, matching Hyprland's $my_trigger. hotkey-overlay { - // Do not pop the keybind cheat sheet on login. Mod+Shift+Slash still shows it. skip-at-startup } @@ -26,7 +16,6 @@ input { natural-scroll } - // Hyprland: accel_profile = flat (raw input, no acceleration curve). mouse { accel-profile "flat" } @@ -34,24 +23,16 @@ input { trackpoint { } - // focus-follows-mouse stays off, matching Hyprland's follow_mouse = 0. - // No niri equivalent for mouse_move_focuses_monitor = false: moving the - // cursor to the other output does make it the focused one. } -// Ask every client to skip its own decorations, so niri's border is the only -// frame. Kills the CSD titlebar that showed the page/document title (Hyprland -// never had one because it sends server-side decorations by default). prefer-no-csd gestures { - // No overview/workspace switch when the pointer hits a screen corner. hot-corners { off } } -// Hyprland had `bitdepth 10`; niri 26.04 has no bit-depth or hdr output key. output "DP-1" { mode "2560x1440@180" scale 1 @@ -60,7 +41,6 @@ output "DP-1" { focus-at-startup } -// Mode string must be exact: 75.003, not 75. output "HDMI-A-1" { mode "1920x1080@75.003" scale 1 @@ -69,7 +49,6 @@ output "HDMI-A-1" { } layout { - // Hyprland gaps_in = 3; the remaining 7 to reach gaps_out = 10 is in struts. gaps 3 struts { left 7 @@ -80,21 +59,8 @@ layout { center-focused-column "never" - // Puts a plain workspace at index 1 on every output, above the declared - // named block — so the workspace waybar labels on HDMI-A-1 is 1, not 9. - // - // This is NOT a replacement for workspace_startup.sh, which was tested: - // alone it still logs in with the first NAMED workspace active, because it - // only creates the workspace, it never focuses it. The two go together — - // this one supplies index 1, the script focuses it. - // - // Cost, accepted knowingly: every Mod+ shifts by one, since - // workspace_nav.sh indexes plain workspaces and this adds one at the top. empty-workspace-above-first - // New windows take the whole working area — the closest thing to dwindle - // handing a new window all the free space. 1.0 is in the preset cycle too, - // otherwise one Mod+R drops a window to 1/3 with no way back to full. default-column-width { proportion 1.0; } preset-column-widths { proportion 0.33333 @@ -103,19 +69,13 @@ layout { proportion 1.0 } - // Hyprland had one border concept, mapped to `border` below. focus-ring { off } border { - // Hyprland general:border_size = 2 width 2 - // The line after the marker is REWRITTEN IN PLACE by - // ~/.config/scripts/niri/wallust_niri_colors.sh on every wallpaper - // change. niri has no `include`, so generated colors cannot live in a - // separate file. Keep the marker directly above it, all on one line. // WALLUST-GRADIENT active-gradient from="#4D0830" to="#7E420A" angle=90 in="oklch" @@ -123,9 +83,6 @@ layout { urgent-color "#9b0000" } - // Shadows and rounding are left off (Hyprland had rounding = 0, blur off). - // Rounded corners come from the window rule below instead, only so the - // border traces the curve GTK4 apps draw themselves. } environment { @@ -133,15 +90,8 @@ environment { XCURSOR_SIZE "24" } -// Startup. The polkit agent, nm-applet and blueman-applet are deliberately -// absent: niri runs xdg-desktop-autostart.target and /etc/xdg/autostart already -// starts them. Hyprland ignored that target, which is why it needed exec-once. -// The sleeps preserve Hyprland's ordering (tray applets after waybar). spawn-at-startup "sh" "-c" "bash ~/.config/scripts/niri/wallpaper_restore.sh" spawn-at-startup "sh" "-c" "bash ~/.config/scripts/shared/song_detail_writer.sh" -// waybar needs its own config here: the shared one uses hyprland/workspaces -// and hyprland/window, which do nothing under niri. config-niri swaps those -// for niri/workspaces and niri/window. spawn-at-startup "sh" "-c" "sleep 1 && waybar -c ~/.config/waybar/config-niri" spawn-at-startup "sh" "-c" "sleep 2 && kdeconnect-indicator" spawn-at-startup "sh" "-c" "sleep 3 && /opt/Mullvad\\ VPN/mullvad-vpn" @@ -150,29 +100,19 @@ spawn-at-startup "sh" "-c" "sleep 3 && wl-paste --type text --watch cliphist sto spawn-at-startup "sh" "-c" "sleep 3 && wl-paste --type image --watch cliphist store" spawn-at-startup "sh" "-c" "sleep 4 && rfkill unblock bluetooth && bluetoothctl power on" -// The declared app workspaces below all get created on the first output niri -// connects (HDMI-A-1), so that monitor logs in showing "code". This puts every -// output back on a plain workspace. Early on purpose: it must finish before the -// sleep-3/sleep-4 apps map their windows, or one lands on the wrong monitor. spawn-at-startup "sh" "-c" "sleep 1 && bash ~/.config/scripts/niri/workspace_startup.sh" screenshot-path "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png" -// Animations stay at niri's defaults (on), unlike Hyprland where they were off. animations { } -// Every window: draw the border AROUND the window, not behind it. niri uses the -// border as the window background by default, which is invisible behind an -// opaque window — the border simply never showed up. The corner radius makes it -// follow the rounding GTK4/libadwaita apps apply to themselves. window-rule { draw-border-with-background false geometry-corner-radius 12 clip-to-geometry true } -// Hyprland: windowrule = match:class .*wezterm.*, opacity 0.8 window-rule { match app-id=r#"^org\.wezfurlong\.wezterm$"# opacity 0.8 @@ -184,20 +124,6 @@ window-rule { open-floating true } -// The app workspaces. A declared `workspace "name"` node is immortal — which is -// exactly the point: nothing has to create, name or clean them up, so there is -// no reaper daemon and no marker files. They were briefly named at runtime -// instead, and the reaper that un-named them died mid-session (niri dropped its -// IPC event stream for "reading events too slowly") leaving empty named -// workspaces behind — the failure this replaces. -// -// The empties are only visible in the overview: workspace_nav.sh filters on -// `.name == null`, so number and directional navigation skip them, and waybar -// runs niri/workspaces with current-only. -// -// No open-on-output on purpose — KDL has no variables and monitor names are kept -// to the `output` blocks and the monitor binds. They start on the first output -// and workspace_app.sh pulls an empty one to the monitor in use on launch. workspace "code" workspace "github" workspace "whatsapp" @@ -208,8 +134,6 @@ workspace "mail" workspace "signal" binds { - // ─── launchers (Alt trigger, Hyprland $my_trigger) ─────────────────────── - // F-key and number-row variants both bound, as in Hyprland. Alt+T hotkey-overlay-title="Terminal: wezterm" { spawn-sh "wezterm start --always-new-process"; } Alt+Q hotkey-overlay-title="Files: nautilus" { spawn-sh "nautilus --new-window"; } @@ -225,13 +149,6 @@ binds { Alt+F hotkey-overlay-title="Browser" { spawn-sh "flatpak run io.github.ungoogled_software.ungoogled_chromium --enable-features=MiddleClickAutoscroll"; } Shift+Alt+F hotkey-overlay-title="Browser (incognito, outside VPN)" { spawn-sh "mullvad-exclude flatpak run org.chromium.Chromium --incognito --enable-features=MiddleClickAutoscroll,AllowLegacyMV2Extensions --disable-features=ExtensionManifestV2Unsupported,ExtensionManifestV2Disabled,ExtensionsManifestV3Only"; } - // ─── app workspaces ───────────────────────────────────────────────────── - // workspace_app.sh emulates Hyprland's on-created-empty, which niri lacks. - // The workspaces are declared above, so "is the app running" is just "does - // its workspace hold a window". Empty -> the workspace moves to the monitor - // you are on and the app launches there; holding windows -> the key only - // moves focus to it, leaving it on its own monitor. webapp.sh builds the - // Chromium web-app command from a URL + profile id. Alt+C hotkey-overlay-title="Workspace: code" { spawn-sh "~/.config/scripts/niri/workspace_app.sh code zed"; } Alt+G hotkey-overlay-title="Workspace: github" { spawn-sh "~/.config/scripts/niri/workspace_app.sh github ~/.config/scripts/shared/webapp.sh https://github.com/ FCF18Wmt"; } Alt+W hotkey-overlay-title="Workspace: whatsapp" { spawn-sh "~/.config/scripts/niri/workspace_app.sh whatsapp ~/.config/scripts/shared/webapp.sh --mullvad https://web.whatsapp.com/ aW2IMaZ8"; } @@ -250,28 +167,21 @@ binds { Mod+Shift+P { spawn-sh "~/.config/scripts/niri/workspace_app.sh --move mail"; } Mod+Shift+N { spawn-sh "~/.config/scripts/niri/workspace_app.sh --move signal"; } - // ─── session / system ─────────────────────────────────────────────────── - // hyprlock works here: ext-session-lock-v1, no Hyprland IPC dependency. Super+L hotkey-overlay-title="Lock: hyprlock" { spawn "hyprlock"; } Mod+Escape hotkey-overlay-title="Power menu" { spawn-sh "bash ~/.config/scripts/system/power_menu.sh"; } Mod+D hotkey-overlay-title="Show desktop" { spawn-sh "~/.config/scripts/niri/show_desktop.sh"; } Mod+H hotkey-overlay-title="Toggle waybar" { spawn-sh "pkill -SIGUSR1 waybar"; } Mod+W hotkey-overlay-title="Wallpaper picker" { spawn-sh "~/.config/scripts/niri/wallpaper_picker.sh"; } - // Exit is Super+Alt+F4 only, as in Hyprland. The stock Mod+Shift+E and - // Ctrl+Alt+Delete quit binds are removed on purpose. Alt+4 repeat=false { close-window; } Alt+F4 repeat=false { close-window; } Mod+Alt+F4 { quit; } - // Mod+Escape is the power menu, so the shortcut-inhibitor escape hatch - // lives on Mod+Shift+Escape. Mod+Shift+Escape allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; } Mod+Shift+Slash { show-hotkey-overlay; } Mod+O repeat=false { toggle-overview; } Super+Alt+S allow-when-locked=true hotkey-overlay-title=null { spawn-sh "pkill orca || exec orca"; } - // ─── media / brightness ───────────────────────────────────────────────── XF86AudioRaiseVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1+ -l 1.0"; } XF86AudioLowerVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1-"; } XF86AudioMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; } @@ -283,35 +193,19 @@ binds { XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "+10%"; } XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "10%-"; } - // ─── screenshots ──────────────────────────────────────────────────────── - // grim, not niri's built-ins: the Hyprland bind captured ALL outputs into - // one image, while screenshot-screen only grabs the focused output. Print { spawn-sh "grim -t png - | tee \"$HOME/Pictures/Screenshots/$(date '+%y%m%d_%H-%M-%S').png\" | wl-copy -t image/png"; } Shift+Print { spawn-sh "grim -t png -g \"$(slurp)\" - | wl-copy -t image/png"; } Ctrl+Print { screenshot-screen; } Alt+Print { screenshot-window; } - // ─── monitors (the only place output names appear outside `output`) ────── - // Addressed by name, like Hyprland's $monitor_left / $monitor_right. The - // stock directional focus-monitor-* binds are dropped as redundant. Mod+Q { focus-monitor "DP-1"; } Mod+E { focus-monitor "HDMI-A-1"; } Mod+Shift+Q { move-column-to-monitor "DP-1"; } Mod+Shift+E { move-column-to-monitor "HDMI-A-1"; } - // toggle_monitors.sh keeps Hyprland's Super+M menu / Super+Shift+M all-on, - // so maximize sits on Mod+Ctrl+M. Mod+M hotkey-overlay-title="Monitor menu" { spawn-sh "~/.config/scripts/niri/toggle_monitors.sh"; } Mod+Shift+M hotkey-overlay-title="All monitors on" { spawn-sh "~/.config/scripts/niri/toggle_monitors.sh on"; } - // ─── focus ────────────────────────────────────────────────────────────── - // Mod+H is the waybar toggle and Mod+L is the locker, so the stock vim-nav - // binds for those two are gone; arrows still navigate. - // - // Left/Right move between columns. Up/Down are vertical in niri's sense: - // the next window in the column when the column has one, otherwise the - // workspace above/below (workspaces stack vertically). Mod+J/K stay - // strictly in-column. Mod+Left { focus-column-left; } Mod+Right { focus-column-right; } Mod+Up { spawn-sh "~/.config/scripts/niri/workspace_nav.sh up"; } @@ -323,7 +217,6 @@ binds { Mod+Tab { focus-window-previous; } Alt+Tab { focus-workspace-previous; } - // ─── move windows ─────────────────────────────────────────────────────── Mod+Ctrl+Left { move-column-left; } Mod+Ctrl+Right { move-column-right; } Mod+Ctrl+Up { spawn-sh "~/.config/scripts/niri/workspace_nav.sh move-up"; } @@ -335,16 +228,6 @@ binds { Mod+Ctrl+Home { move-column-to-first; } Mod+Ctrl+End { move-column-to-last; } - // ─── workspaces ───────────────────────────────────────────────────────── - // niri workspaces are per-monitor already, which is what hyprsplit gave - // Hyprland. Mod+Shift+N is Hyprland's send-to-workspace; the stock - // Mod+Ctrl+N binds do the same and are kept as well. - // - // All of these go through workspace_nav.sh rather than niri's own - // focus-workspace: niri numbers are indices into each output's live - // workspace list, and the named app workspaces live in that same list, so - // Mod+3 could land on "discord". The script indexes the PLAIN workspaces - // only. N past the end clamps to the last one. Mod+1 { spawn-sh "~/.config/scripts/niri/workspace_nav.sh focus 1"; } Mod+2 { spawn-sh "~/.config/scripts/niri/workspace_nav.sh focus 2"; } Mod+3 { spawn-sh "~/.config/scripts/niri/workspace_nav.sh focus 3"; } @@ -390,7 +273,6 @@ binds { Mod+Shift+U { move-workspace-down; } Mod+Shift+I { move-workspace-up; } - // ─── scroll wheel ─────────────────────────────────────────────────────── Mod+WheelScrollDown cooldown-ms=150 { spawn-sh "~/.config/scripts/niri/workspace_nav.sh next"; } Mod+WheelScrollUp cooldown-ms=150 { spawn-sh "~/.config/scripts/niri/workspace_nav.sh prev"; } Mod+Ctrl+WheelScrollDown cooldown-ms=150 { spawn-sh "~/.config/scripts/niri/workspace_nav.sh move-next"; } @@ -404,9 +286,6 @@ binds { Mod+Ctrl+Shift+WheelScrollDown { move-column-right; } Mod+Ctrl+Shift+WheelScrollUp { move-column-left; } - // ─── size / layout ────────────────────────────────────────────────────── - // Mod+F is floating (Hyprland togglefloating), so maximize is Mod+Ctrl+M. - // Mod+Shift+arrows are Hyprland's resizeactive 30 / -30, in logical pixels. Mod+F { toggle-window-floating; } Mod+Shift+F { fullscreen-window; } Mod+Ctrl+M { maximize-column; } diff --git a/.config/scripts/hyprland/show_desktop.sh b/.config/scripts/hyprland/show_desktop.sh index 8fea66a..ceb0e39 100755 --- a/.config/scripts/hyprland/show_desktop.sh +++ b/.config/scripts/hyprland/show_desktop.sh @@ -24,8 +24,6 @@ WS_FOCUSED=$WS_FOCUSED WS_OTHER=$WS_OTHER EOF - # one empty dummy workspace per monitor; no swapactiveworkspaces — - # swaps rebind workspaces to the wrong monitor and confuse waybar if [ -n "$MON2" ]; then hyprctl --batch "dispatch focusmonitor $MON2; dispatch workspace 998; dispatch focusmonitor $MON1; dispatch workspace 999" else diff --git a/.config/scripts/hyprland/toggle_monitors.sh b/.config/scripts/hyprland/toggle_monitors.sh index 17cf4ac..8124cb0 100755 --- a/.config/scripts/hyprland/toggle_monitors.sh +++ b/.config/scripts/hyprland/toggle_monitors.sh @@ -1,7 +1,5 @@ #!/bin/bash -# Toggle monitors off via rofi, re-enable with keybinding - DP1_CONFIG="DP-1, 2560x1440@180, 0x0, 1, bitdepth, 10" HDMI_CONFIG="HDMI-A-1, 1920x1080@75, 2560x0, 1, bitdepth, 10" diff --git a/.config/scripts/hyprland/wallpaper_picker.sh b/.config/scripts/hyprland/wallpaper_picker.sh index ade14ce..69bbab7 100755 --- a/.config/scripts/hyprland/wallpaper_picker.sh +++ b/.config/scripts/hyprland/wallpaper_picker.sh @@ -1,14 +1,11 @@ #!/bin/bash -# Rofi wallpaper picker — updates hyprpaper, wallust, and waybar WALLPAPER_DIR="$HOME/Pictures/Wallpapers" HYPRPAPER_CONF="$HOME/.config/hypr/hyprpaper.conf" THUMB_DIR="$HOME/.cache/wallpaper_thumbs" -# Generate thumbnail cache (only for new/changed images) mkdir -p "$THUMB_DIR" -# Remove orphan thumbnails for deleted wallpapers for thumb in "$THUMB_DIR"/*.png; do [ -f "$thumb" ] || continue name=$(basename "$thumb" .png) @@ -17,7 +14,6 @@ for thumb in "$THUMB_DIR"/*.png; do fi done -# Generate thumbnails for new/changed wallpapers find "$WALLPAPER_DIR" -maxdepth 1 -type f \( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.webp' \) | while read -r img; do name=$(basename "$img") thumb="$THUMB_DIR/$name.png" @@ -27,7 +23,6 @@ find "$WALLPAPER_DIR" -maxdepth 1 -type f \( -iname '*.jpg' -o -iname '*.jpeg' - done wait -# List image files with cached thumbnails in a grid rofi SELECTED=$(find "$WALLPAPER_DIR" -maxdepth 1 -type f \( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.webp' \) | sort | while read -r img; do name=$(basename "$img") echo -en "${name}\0icon\x1f${THUMB_DIR}/${name}.png\n" @@ -48,7 +43,6 @@ if [ ! -f "$WALLPAPER" ]; then exit 1 fi -# Update hyprpaper config and kill both processes cat > "$HYPRPAPER_CONF" << EOF splash = false @@ -61,7 +55,6 @@ EOF pkill hyprpaper -# Run hyprpaper and wallust in parallel hyprpaper &disown wallust run -qs "$WALLPAPER" & wait diff --git a/.config/scripts/niri/monitors.sh b/.config/scripts/niri/monitors.sh index 68bf4b7..c96f425 100644 --- a/.config/scripts/niri/monitors.sh +++ b/.config/scripts/niri/monitors.sh @@ -1,9 +1,3 @@ -# Monitor names, sourced by the niri scripts. Not executable on purpose. -# -# Swapping a monitor means editing this file plus the `output` blocks and the -# four focus-monitor / move-column-to-monitor binds in config.kdl. KDL has no -# variables, so those cannot be parameterised — config.kdl names the outputs -# in exactly one place each, and this file covers everything scripted. -LEFT_MONITOR="DP-1" # Xiaomi Mi Monitor, 2560x1440@180, primary, at x=0 -RIGHT_MONITOR="HDMI-A-1" # 1920x1080@75, to the right at x=2560 +LEFT_MONITOR="DP-1" +RIGHT_MONITOR="HDMI-A-1" diff --git a/.config/scripts/niri/show_desktop.sh b/.config/scripts/niri/show_desktop.sh index 86abccc..656fbd2 100755 --- a/.config/scripts/niri/show_desktop.sh +++ b/.config/scripts/niri/show_desktop.sh @@ -1,27 +1,15 @@ #!/bin/bash -# Show-desktop toggle for niri. Port of ~/.config/scripts/hyprland/show_desktop.sh -# -# Same idea as the Hyprland version: remember what each output is showing, send -# every output to an empty workspace, and restore on the second press. niri -# always keeps one empty workspace at the end of each output's list, so there is -# no need for the dedicated 998/999 dummy workspaces Hyprland needed. -# -# Workspaces are referenced by name when they have one and by index otherwise, -# because niri workspace indices shift as workspaces come and go. set -euo pipefail STATE_FILE="/tmp/niri_show_desktop" ws_json=$(niri msg -j workspaces) -# Reference used to focus a workspace again later: prefer the name, else index. -ref_of() { # $1 = jq object +ref_of() { jq -r 'if .name != null then .name else (.idx | tostring) end' <<<"$1" } if [ -f "$STATE_FILE" ]; then - # Restore. Focus each output, put back what it was showing, then return - # focus to the output that had it before. while IFS=$'\t' read -r out ref; do [ -n "$out" ] || continue niri msg action focus-monitor "$out" >/dev/null @@ -39,16 +27,12 @@ else : > "$STATE_FILE" printf 'FOCUSED\t%s\n' "$focused_out" >> "$STATE_FILE" - # Record the active workspace of every output. while read -r out; do active=$(jq -c --arg o "$out" '.[] | select(.output == $o and .is_active == true)' <<<"$ws_json") printf '%s\t%s\n' "$out" "$(ref_of "$active")" >> "$STATE_FILE" done < <(jq -r '[.[].output] | unique | .[]' <<<"$ws_json") - # Send every output to an empty workspace of its own. while read -r out; do - # Unnamed only: the named workspaces are the app ones (code, discord, - # ...), and landing on an empty "github" is not "show desktop". empty_idx=$(jq -r --arg o "$out" --argjson w "$win_json" ' [ .[] | select(.output == $o and .name == null) @@ -56,7 +40,6 @@ else | select(([$w[] | select(.workspace_id == $ws.id)] | length) == 0) ] | last | .idx // empty' <<<"$ws_json") - # Fall back to the highest index on that output, which niri keeps empty. if [ -z "$empty_idx" ]; then empty_idx=$(jq -r --arg o "$out" '[.[] | select(.output == $o) | .idx] | max' <<<"$ws_json") fi diff --git a/.config/scripts/niri/toggle_monitors.sh b/.config/scripts/niri/toggle_monitors.sh index a4645cf..dbb3b00 100755 --- a/.config/scripts/niri/toggle_monitors.sh +++ b/.config/scripts/niri/toggle_monitors.sh @@ -1,13 +1,4 @@ #!/usr/bin/env bash -# Rofi monitor chooser for niri. Port of ~/.config/scripts/hyprland/toggle_monitors.sh -# -# usage: toggle_monitors.sh [menu|on] -# -# niri difference worth knowing: there is no per-output DPMS. `power-off-monitors` -# blanks EVERY output and any input wakes them back up, while `niri msg output X off` -# genuinely disables one output — windows on it move away, and only `... on` (or the -# `on` argument here, bound to Super+Shift+M) brings it back. So the single-monitor -# entries below disable rather than blank. set -euo pipefail . "$(dirname "$(realpath "$0")")/monitors.sh" @@ -21,9 +12,9 @@ all_on() { case "${1:-menu}" in menu) choice=$(printf '%s\n' \ - "🖥️ All Monitors Off (blank, any key wakes)" \ - "🖥️ $LEFT_MONITOR Off (disable)" \ - "🖥️ $RIGHT_MONITOR Off (disable)" \ + "🖥️ All Monitors Off" \ + "🖥️ $LEFT_MONITOR Off" \ + "🖥️ $RIGHT_MONITOR Off" \ "💡 All Monitors On" \ "💡 $LEFT_MONITOR On" \ "💡 $RIGHT_MONITOR On" \ diff --git a/.config/scripts/niri/wallpaper_picker.sh b/.config/scripts/niri/wallpaper_picker.sh index 0f14b6a..0de2d43 100755 --- a/.config/scripts/niri/wallpaper_picker.sh +++ b/.config/scripts/niri/wallpaper_picker.sh @@ -1,22 +1,11 @@ #!/bin/bash -# Rofi wallpaper picker for niri — updates awww, wallust, and waybar. -# -# This is the niri twin of ~/.config/scripts/hyprland/wallpaper_picker.sh. -# Everything above the "Apply" section is identical; only the backend differs: -# hyprpaper talks over Hyprland's IPC socket (path built from -# $HYPRLAND_INSTANCE_SIGNATURE) and cannot run here, so awww replaces it. -# -# Unlike hyprpaper there is no config file to rewrite and no process to kill: -# awww-daemon stays up and `awww img` swaps the image at runtime. WALLPAPER_DIR="$HOME/Pictures/Wallpapers" THUMB_DIR="$HOME/.cache/wallpaper_thumbs" STATE_FILE="$HOME/.cache/current_wallpaper" -# Generate thumbnail cache (only for new/changed images) mkdir -p "$THUMB_DIR" -# Remove orphan thumbnails for deleted wallpapers for thumb in "$THUMB_DIR"/*.png; do [ -f "$thumb" ] || continue name=$(basename "$thumb" .png) @@ -25,7 +14,6 @@ for thumb in "$THUMB_DIR"/*.png; do fi done -# Generate thumbnails for new/changed wallpapers find "$WALLPAPER_DIR" -maxdepth 1 -type f \( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.webp' \) | while read -r img; do name=$(basename "$img") thumb="$THUMB_DIR/$name.png" @@ -35,7 +23,6 @@ find "$WALLPAPER_DIR" -maxdepth 1 -type f \( -iname '*.jpg' -o -iname '*.jpeg' - done wait -# List image files with cached thumbnails in a grid rofi SELECTED=$(find "$WALLPAPER_DIR" -maxdepth 1 -type f \( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.webp' \) | sort | while read -r img; do name=$(basename "$img") echo -en "${name}\0icon\x1f${THUMB_DIR}/${name}.png\n" @@ -56,8 +43,6 @@ if [ ! -f "$WALLPAPER" ]; then exit 1 fi -# Apply: awww holds the wallpaper, wallust regenerates the palette. -# Start the daemon if it is not already up (also covers a crashed daemon). if ! awww query >/dev/null 2>&1; then awww-daemon >/dev/null 2>&1 & disown @@ -71,11 +56,8 @@ awww img --transition-type simple "$WALLPAPER" & wallust run -qs "$WALLPAPER" & wait -# Remember the choice so the daemon can be restored on the next login. echo "$WALLPAPER" > "$STATE_FILE" -# -c: the shared waybar config uses the hyprland/* modules, which are inert -# under niri. Must match the config niri starts waybar with. killall waybar 2>/dev/null waybar -c "$HOME/.config/waybar/config-niri" &disown notify-send "Wallpaper Picker" "Applied: $SELECTED" diff --git a/.config/scripts/niri/wallpaper_restore.sh b/.config/scripts/niri/wallpaper_restore.sh index 0ddf477..436051b 100755 --- a/.config/scripts/niri/wallpaper_restore.sh +++ b/.config/scripts/niri/wallpaper_restore.sh @@ -1,7 +1,4 @@ #!/bin/bash -# Start awww-daemon and restore the last wallpaper picked by wallpaper_picker.sh. -# Run once at niri startup. hyprpaper read its wallpaper from hyprpaper.conf; -# awww keeps no config file, so the choice is remembered in a state file. STATE_FILE="$HOME/.cache/current_wallpaper" FALLBACK_DIR="$HOME/Pictures/Wallpapers" @@ -21,8 +18,6 @@ if [ -s "$STATE_FILE" ]; then WALLPAPER=$(cat "$STATE_FILE") fi -# First run on niri: fall back to whatever hyprpaper was last set to, so the -# desktop does not come up blank before the first pick. if [ ! -f "$WALLPAPER" ]; then WALLPAPER=$(grep -oP '^\s*path\s*=\s*\K.*' "$HOME/.config/hypr/hyprpaper.conf" 2>/dev/null | head -1) fi diff --git a/.config/scripts/niri/wallust_niri_colors.sh b/.config/scripts/niri/wallust_niri_colors.sh index ffba35c..9815a87 100755 --- a/.config/scripts/niri/wallust_niri_colors.sh +++ b/.config/scripts/niri/wallust_niri_colors.sh @@ -1,36 +1,15 @@ #!/bin/bash -# Rewrite niri's border gradient from the current wallust palette. -# -# Runs as a wallust hook (see [hooks] in ~/.config/wallust/wallust.toml), so it -# fires on every `wallust run`, i.e. on every wallpaper change. -# -# niri has no `include` directive, so the colors cannot be generated into a -# separate file and pulled in — the line has to be edited inside config.kdl -# itself. The line immediately following the "// WALLUST-GRADIENT" marker is -# replaced wholesale. niri watches its config and reloads on write, so the -# border updates live. -# -# Safe to run under Hyprland too: it only edits a file. niri picks up the new -# colors whenever it next runs. set -euo pipefail CONFIG="$HOME/.config/niri/config.kdl" -# Written by the 'niri' entry in wallust.toml [templates] from -# ~/.config/wallust/templates/niri-colors.sh. Do NOT read -# ~/.cache/wallust/sequences instead: the picker runs `wallust run -qs`, and -s -# skips writing that file, so it silently goes stale and the border never -# changes. COLORS="$HOME/.cache/wallust/niri-colors.sh" MARKER="// WALLUST-GRADIENT" [ -f "$CONFIG" ] || exit 0 [ -f "$COLORS" ] || exit 0 -# shellcheck source=/dev/null . "$COLORS" -# wallust's {{colorN}} placeholders already carry the leading '#'; strip it so -# exactly one is added back below regardless of format. FROM="${NIRI_BORDER_FROM#\#}" TO="${NIRI_BORDER_TO#\#}" @@ -40,7 +19,6 @@ fi grep -qF "$MARKER" "$CONFIG" || exit 0 -# Replace the line after the marker, preserving its indentation. awk -v marker="$MARKER" -v from="#$FROM" -v to="#$TO" ' hit { match($0, /^[ \t]*/) diff --git a/.config/scripts/niri/workspace_app.sh b/.config/scripts/niri/workspace_app.sh index d215294..dc72c8e 100755 --- a/.config/scripts/niri/workspace_app.sh +++ b/.config/scripts/niri/workspace_app.sh @@ -1,21 +1,4 @@ #!/usr/bin/env bash -# Focus an app workspace, launching the app the first time. -# -# usage: workspace_app.sh [args...] -# workspace_app.sh --move -# -# Behaviour: -# * workspace holds windows (app is running) -> just focus it. It stays on the -# monitor it was launched on; the key moves FOCUS there rather than dragging -# the workspace to the monitor you happen to be on. -# * workspace is empty (app not running) -> pull it to the focused monitor, -# focus it, and launch the app there. -# -# The workspaces are DECLARED in config.kdl, so they always exist and niri never -# reaps them. That is what removed the naming step, the grace marker files and -# workspace_reaper.sh: with a permanent workspace, "is the app running" is just -# "does its workspace hold a window", which is one stateless query per keypress -# instead of a daemon following the IPC event stream. set -euo pipefail mode="focus" @@ -29,10 +12,6 @@ shift || true ws_json=$(niri msg -j workspaces) -# Resolved before the --move branch so both modes fail loudly rather than letting -# niri exit non-zero into a keybind, where nothing would be shown at all. -# Two ids means two workspaces carry the name — a leftover runtime name next to -# the declared one — which every jq below would then choke on. mapfile -t ids < <(jq -r --arg w "$ws" '.[] | select(.name == $w) | .id' <<<"$ws_json") if [ "${#ids[@]}" -eq 0 ]; then notify-send "workspace_app" "No workspace named '$ws' — is it declared in config.kdl?" @@ -52,13 +31,8 @@ fi count=$(niri msg -j windows | jq --argjson id "$id" '[.[] | select(.workspace_id == $id)] | length') if [ "$count" -eq 0 ]; then - # Empty, so the app is not running: bring the workspace to the monitor in use - # before focusing, so the app opens where you are. move-workspace-to-monitor - # takes --reference; the positional argument is the OUTPUT. focused=$(jq -r '.[] | select(.is_focused == true) | .output' <<<"$ws_json") home=$(jq -r --arg w "$ws" '.[] | select(.name == $w) | .output' <<<"$ws_json") - # || true: a failed move must not take the focus and the launch down with it - # under `set -e`. Worst case the app opens on the workspace's own monitor. if [ -n "$focused" ] && [ "$focused" != "$home" ]; then niri msg action move-workspace-to-monitor --reference "$ws" "$focused" >/dev/null || true fi @@ -66,8 +40,6 @@ fi niri msg action focus-workspace "$ws" >/dev/null -# Launch only when the workspace holds nothing, so a second press is "go there" -# rather than a duplicate app. if [ "$count" -eq 0 ] && [ "$#" -gt 0 ]; then setsid "$@" >/dev/null 2>&1 & fi diff --git a/.config/scripts/niri/workspace_nav.sh b/.config/scripts/niri/workspace_nav.sh index bab1c0d..457e0f4 100755 --- a/.config/scripts/niri/workspace_nav.sh +++ b/.config/scripts/niri/workspace_nav.sh @@ -1,33 +1,8 @@ #!/usr/bin/env bash -# Navigate only the PLAIN (unnamed) workspaces, skipping the named app ones. -# -# usage: workspace_nav.sh focus focus the Nth plain workspace -# workspace_nav.sh move move focused column to it -# workspace_nav.sh next|prev focus the next/previous plain one -# workspace_nav.sh move-next|move-prev -# workspace_nav.sh up|down focus within the column, else the -# workspace above/below -# workspace_nav.sh move-up|move-down same, moving the window -# -# Why this exists: niri workspace numbers are indices into each output's live -# workspace list, and the named app workspaces (code, github, ...) live in that -# same list — so Mod+3 could land on "discord". The app workspaces are reachable -# by their own Alt+ binds, and should be invisible to number and -# directional navigation. -# -# Everything is scoped to the focused output, matching niri's own per-output -# indices. N beyond the number of plain workspaces clamps to the last one; niri -# always keeps one empty unnamed workspace at the end of each output, so there -# is always at least one target. set -euo pipefail action="${1:?usage: workspace_nav.sh focus|move|next|prev|move-next|move-prev|up|down|move-up|move-down [N]}" -# Vertical motion: niri stacks workspaces vertically, so "down" means the next -# window in the column when there is one, and otherwise the workspace below. -# Whether the in-column action did anything is decided by comparing the focused -# window's row before and after — cheaper and more robust than reimplementing -# niri's column arithmetic. if [ "$action" = "up" ] || [ "$action" = "down" ] || [ "$action" = "move-up" ] || [ "$action" = "move-down" ]; then row_of_focused() { niri msg -j windows | jq -r '.[] | select(.is_focused == true) | .layout.pos_in_scrolling_layout | "\(.[0]),\(.[1])"' @@ -45,11 +20,9 @@ if [ "$action" = "up" ] || [ "$action" = "down" ] || [ "$action" = "move-up" ] | after=$(row_of_focused) if [ -n "$before" ] && [ "$before" != "$after" ]; then - exit 0 # the in-column move worked + exit 0 fi - # Nowhere to go inside the column: fall through to the workspace above/below, - # which is the plain-workspace navigation below. case "$action" in up) action="prev" ;; down) action="next" ;; @@ -61,14 +34,12 @@ fi ws_json=$(niri msg -j workspaces) output=$(jq -r '.[] | select(.is_focused == true) | .output' <<<"$ws_json") -# Indices of the plain workspaces on this output, in list order. mapfile -t plain < <(jq -r --arg o "$output" ' [ .[] | select(.output == $o and .name == null) ] | sort_by(.idx) | .[] | .idx ' <<<"$ws_json") [ "${#plain[@]}" -gt 0 ] || exit 0 -# Where the currently focused workspace sits among them (-1 if it is a named one). current_idx=$(jq -r --arg o "$output" '.[] | select(.output == $o and .is_active == true) | .idx' <<<"$ws_json") pos=-1 for i in "${!plain[@]}"; do @@ -89,7 +60,6 @@ focus | move) target="${plain[$i]}" ;; next | move-next) - # From a named workspace, "next" means the first plain one. if [ "$pos" -lt 0 ]; then target="${plain[0]}" else diff --git a/.config/scripts/niri/workspace_startup.sh b/.config/scripts/niri/workspace_startup.sh index d707b88..b8736f4 100755 --- a/.config/scripts/niri/workspace_startup.sh +++ b/.config/scripts/niri/workspace_startup.sh @@ -1,15 +1,4 @@ #!/usr/bin/env bash -# Put every output on a plain (unnamed) workspace at login. -# -# The app workspaces are declared in config.kdl, so niri creates them all on one -# output at startup and that output comes up showing "code" — the first declared -# one — instead of an empty workspace. Nothing else moves them until their -# Alt+ bind runs, so the fix is a one-shot nudge: focus the first plain -# workspace on each output, then hand focus back to the output that had it -# (the one with `focus-at-startup`). -# -# focus-workspace takes an index into the FOCUSED output's list, hence the -# focus-monitor before each one — same reason workspace_nav.sh scopes by output. set -euo pipefail ws=$(niri msg -j workspaces) diff --git a/.config/scripts/system/power_menu.sh b/.config/scripts/system/power_menu.sh index ea66acd..ca37214 100755 --- a/.config/scripts/system/power_menu.sh +++ b/.config/scripts/system/power_menu.sh @@ -1,9 +1,5 @@ #!/bin/bash -# Power Management Menu -# Provides quick access to suspend, shutdown, reboot, and logout options - -# Create menu options menu=$(echo -e "🔴 Shutdown\n🔄 Reboot\n😴 Suspend\n🚪 Logout\n❌ Cancel" | rofi -dmenu -p "Power" -i) case "$menu" in @@ -17,18 +13,6 @@ case "$menu" in systemctl suspend ;; "🚪 Logout") - # Shared by both compositors, so the exit command is picked at runtime. - # hyprctl is a no-op under niri, which is what silently broke logout. - # - # Hyprland is checked FIRST on purpose: niri pushes NIRI_SOCKET into the - # systemd --user manager environment and never unsets it on exit, so a - # niri -> Hyprland switch that kept the same user manager alive would - # leave a stale NIRI_SOCKET behind, and `niri msg` does not fall back to - # socket discovery — it just errors out. That would mirror this very bug - # onto Hyprland. The leak only goes that direction, so ordering fixes it. - # - # -s skips niri's "Press Enter to confirm" prompt, which has nowhere to - # be answered when the quit comes from a rofi menu. if [ -n "${HYPRLAND_INSTANCE_SIGNATURE:-}" ]; then hyprctl dispatch exit elif [ -n "${NIRI_SOCKET:-}" ]; then