input {
    disable-power-key-handling
    focus-follows-mouse max-scroll-amount="0%"
    warp-mouse-to-focus

    mouse {
        accel-profile "flat"
        scroll-factor 0.5
    }
    touchpad {
        accel-profile "flat"
        dwt
        natural-scroll
        scroll-factor 0.5
        tap
    }
}


binds {
    // App Launcher
    Super+Space { spawn "fuzzel"; }

    // Shortcuts
    Super+Shift+Slash { show-hotkey-overlay; }
    Super+E { spawn "nemo"; }
    Super+B { spawn "floorp";}
    Super+L { spawn "hyprlock";}
    Super+M { spawn-sh "$HOME/.config/niri/switch_monitors.sh"; }
    Ctrl+Super+Q { spawn "wlogout"; }
    Super+Return { spawn "alacritty"; }
    Super+S { screenshot; }
    Super+Ctrl+S { screenshot-window; }
    Super+Ctrl+Alt+Print { screenshot-screen; }

    // Window actions
    Super+F { fullscreen-window; }
    Super+Q { close-window; }

    // Workspace jumping
    Super+1 { focus-workspace 1; }
    Super+2 { focus-workspace 2; }
    Super+3 { focus-workspace 3; }
    Super+4 { focus-workspace 4; }
    Super+5 { focus-workspace 5; }
    Super+6 { focus-workspace 6; }
    Super+7 { focus-workspace 7; }
    Super+8 { focus-workspace 8; }
    Super+9 { focus-workspace 9; }
    Super+0 { focus-workspace 10; }

    // Window movement between Workspace
    Super+Shift+1 { move-window-to-workspace 1; }
    Super+Shift+2 { move-window-to-workspace 2; }
    Super+Shift+3 { move-window-to-workspace 3; }
    Super+Shift+4 { move-window-to-workspace 4; }
    Super+Shift+5 { move-window-to-workspace 5; }
    Super+Shift+6 { move-window-to-workspace 6; }
    Super+Shift+7 { move-window-to-workspace 7; }
    Super+Shift+8 { move-window-to-workspace 8; }
    Super+Shift+9 { move-window-to-workspace 9; }
    Super+Shift+0 { move-window-to-workspace 10; }

    // Window focus movement
    /// Using familier keys
    Alt+Tab { focus-column-right; }
    Alt+Shift+Tab  { focus-column-left; }

    /// Using Arrow keys
    Super+Left  { focus-column-left; }
    Super+Down  { focus-window-down; }
    Super+Up    { focus-window-up; }
    Super+Right { focus-column-right; }

    /// Using Vim-like keys
    Super+Shift+H { focus-column-left; }
    Super+Shift+J { focus-window-down; }
    Super+Shift+K { focus-window-up; }
    Super+Shift+L { focus-column-right; }

    // Window direction movement
    /// Using Arrow keys
    Super+Shift+Left  { move-column-left; }
    Super+Shift+Down  { move-window-down; }
    Super+Shift+Up    { move-window-up; }
    Super+Shift+Right { move-column-right; }

    Super+Home { focus-column-first; }
    Super+End  { focus-column-last; }
    Super+Ctrl+Home { move-column-to-first; }
    Super+Ctrl+End  { move-column-to-last; }

    Super+Shift+Alt+Left  { focus-monitor-left; }
    Super+Shift+Alt+Down  { focus-monitor-down; }
    Super+Shift+Alt+Up    { focus-monitor-up; }
    Super+Shift+Alt+Right { focus-monitor-right; }

    Super+Shift+Ctrl+Left  { move-column-to-monitor-left; }
    Super+Shift+Ctrl+Down  { move-column-to-monitor-down; }
    Super+Shift+Ctrl+Up    { move-column-to-monitor-up; }
    Super+Shift+Ctrl+Right { move-column-to-monitor-right; }

    Super+Page_Down      { focus-workspace-down; }
    Super+Page_Up        { focus-workspace-up; }
    Super+U              { focus-workspace-down; }
    Super+I              { focus-workspace-up; }
    Super+Ctrl+Page_Down { move-column-to-workspace-down; }
    Super+Ctrl+Page_Up   { move-column-to-workspace-up; }
    Super+Ctrl+U         { move-column-to-workspace-down; }
    Super+Ctrl+I         { move-column-to-workspace-up; }

    Super+Shift+Page_Down { move-workspace-down; }
    Super+Shift+Page_Up   { move-workspace-up; }
    Super+Shift+U         { move-workspace-down; }
    Super+Shift+I         { move-workspace-up; }

    Super+WheelScrollDown      cooldown-ms=150 { focus-workspace-down; }
    Super+WheelScrollUp        cooldown-ms=150 { focus-workspace-up; }
    Super+Ctrl+WheelScrollDown cooldown-ms=150 { move-column-to-workspace-down; }
    Super+Ctrl+WheelScrollUp   cooldown-ms=150 { move-column-to-workspace-up; }

    Super+WheelScrollRight      { focus-column-right; }
    Super+WheelScrollLeft       { focus-column-left; }
    Super+Ctrl+WheelScrollRight { move-column-right; }
    Super+Ctrl+WheelScrollLeft  { move-column-left; }

    Super+Shift+WheelScrollDown      { focus-column-right; }
    Super+Shift+WheelScrollUp        { focus-column-left; }
    Super+Ctrl+Shift+WheelScrollDown { move-column-right; }
    Super+Ctrl+Shift+WheelScrollUp   { move-column-left; }

    // Alternatively, there are commands to move just a single window:
    // Super+Ctrl+1 { move-window-to-workspace 1; }

    // Switches focus between the current and the previous workspace.
    // Super+Tab { focus-workspace-previous; }

    Super+Comma  { consume-window-into-column; }
    Super+Period { expel-window-from-column; }

    Super+R { switch-preset-column-width; }
    Super+Shift+R { reset-window-height; }
    Super+Shift+F { maximize-column; }

    Super+C { center-column; }

    Super+Minus { set-column-width "-10%"; }
    Super+Equal { set-column-width "+10%"; }

    // Finer height adjustments when in column with other windows.
    Super+Shift+Minus { set-window-height "-10%"; }
    Super+Shift+Equal { set-window-height "+10%"; }

    // Actions to switch layouts.
    // Note: if you uncomment these, make sure you do NOT have
    // a matching layout switch hotkey configured in xkb options above.
    // Having both at once on the same hotkey will break the switching,
    // since it will switch twice upon pressing the hotkey (once by xkb, once by niri).
    // Super+Space       { switch-layout "next"; }
    // Super+Shift+Space { switch-layout "prev"; }

    // The quit action will show a confirmation dialog to avoid accidental exits.
    Super+Shift+E { quit; }

    // Powers off the monitors. To turn them back on, do any input like
    // moving the mouse or pressing any other key.
    Super+Shift+P { power-off-monitors; }

    // Volume control
    XF86AudioLowerVolume allow-when-locked=true { spawn "swayosd-client" "--output-volume" "-2"; }
    XF86AudioMute allow-when-locked=true { spawn "swayosd-client" "--output-volume" "mute-toggle"; }
    XF86AudioRaiseVolume allow-when-locked=true { spawn "swayosd-client" "--output-volume" "+2"; }
    XF86MonBrightnessDown allow-when-locked=true { spawn "swayosd-client" "--brightness" "-5"; }
    XF86MonBrightnessUp allow-when-locked=true { spawn "swayosd-client" "--brightness" "+5"; }

    // Volume control (bonus)
    Ctrl+Alt+Down allow-when-locked=true { spawn "swayosd-client" "--output-volume" "-2"; }
    Ctrl+Alt+Up allow-when-locked=true { spawn "swayosd-client" "--output-volume" "+2"; }
}


environment {
    CURRENT_COMPOSITOR "niri"
    DISPLAY ":0"
    XDG_CURRENT_DESKTOP "niri"
    XDG_SESSION_DESKTOP "niri"
}


hotkey-overlay {
    skip-at-startup
}

prefer-no-csd

screenshot-path "~/Pictures/Screenshots/SCREENSHOT-%Y-%m-%d-%H:%M:%S.png"

spawn-at-startup "fcitx5" "-d" "-r"
spawn-at-startup "nm-applet"
spawn-at-startup "blueman-applet"
spawn-at-startup "sh" "-c" "dbus-update-activation-environment --systemd --all && systemctl --user stop niri-session.target && systemctl --user start niri-session.target"
spawn-at-startup "swayosd-server"
spawn-at-startup "swww-daemon"
spawn-at-startup "sh" "-c" "sleep 1 && swww img $HOME/Git/DCGOS/dotfiles/.local/share/wallpapers/yohoho.jpg"
spawn-at-startup "swww" "restore"
spawn-at-startup "waybar"
spawn-at-startup "lxqt-policykit-agent"

window-rule {
    block-out-from "screen-capture"

    match app-id=r#"^org\.keepassxc\.KeePassXC$"#
    match app-id=r#"^org\.gnome\.World\.Secrets$"#

    // Use this instead if you want them visible on third-party screenshot tools.
    // block-out-from "screencast"
}
window-rule {
    clip-to-geometry true
    geometry-corner-radius 10
}

animations {
    // Uncomment to turn off all animations.
    // You can also put "off" into each individual animation to disable it.
    // off

    // Slow down all animations by this factor. Values below 1 speed them up instead.
    // slowdown 3.0

    // Individual animations.

    workspace-switch {
        spring damping-ratio=1.0 stiffness=1000 epsilon=0.0001
    }

    window-open {
        duration-ms 150
        curve "ease-out-expo"
    }

    window-close {
        duration-ms 150
        curve "ease-out-quad"
    }

    horizontal-view-movement {
        spring damping-ratio=1.0 stiffness=800 epsilon=0.0001
    }

    window-movement {
        spring damping-ratio=1.0 stiffness=800 epsilon=0.0001
    }

    window-resize {
        spring damping-ratio=1.0 stiffness=800 epsilon=0.0001
    }

    config-notification-open-close {
        spring damping-ratio=0.6 stiffness=1000 epsilon=0.001
    }

    screenshot-ui-open {
        duration-ms 200
        curve "ease-out-quad"
    }
}

layout {
    center-focused-column "on-overflow"
    border {
        width 1
        active-color "#313244FF"
        inactive-color "#1e1e2eFF"
    }
    default-column-width { proportion 1.00; }
    focus-ring {
        off
        active-color "#31324400"
        inactive-color "#31324400"
        width 3
    }
    gaps 2
    preset-column-widths {
        proportion 0.33333
        proportion 0.5
        proportion 0.66667
    }

    struts {
        left 0.1
        right 0.1
        top 0
        bottom 0
    }
}