input {
	keyboard {
		xkb {
			options "caps:escape_shifted_capslock"
		}
		numlock
	}

	touchpad {
		tap
		dwt
		drag true
		drag-lock
		natural-scroll
		scroll-method "two-finger"
	}

	mouse {
		accel-speed 0.5
	}

	disable-power-key-handling
	warp-mouse-to-focus
	focus-follows-mouse max-scroll-amount="0%"
	workspace-auto-back-and-forth
}

gestures {
	hot-corners {
		off
	}
}

prefer-no-csd

cursor {
	hide-when-typing
	hide-after-inactive-ms 1000
}

clipboard {
	disable-primary
}
hotkey-overlay {
	skip-at-startup
}

layout {
	gaps 16
	struts {
		left -16
		right -16
		top -16
		bottom -16
	}
	focus-ring {
		width 2
	}
}

binds {
	XF86AudioPlay         allow-when-locked=true { spawn "playerctl" "play-pause"; }
	XF86AudioPause        allow-when-locked=true { spawn "playerctl" "play-pause"; }
	XF86AudioMedia        allow-when-locked=true { spawn "playerctl" "play-pause"; }
	XF86AudioPrev         allow-when-locked=true { spawn "playerctl" "previous"; }
	XF86AudioNext         allow-when-locked=true { spawn "playerctl" "next"; }
	XF86AudioRaiseVolume  allow-when-locked=true { spawn "pamixer" "-i" "5"; }
	XF86AudioLowerVolume  allow-when-locked=true { spawn "pamixer" "-d" "5"; }
	XF86AudioMute         allow-when-locked=true { spawn "pamixer" "--toggle-mute"; }
	XF86MonBrightnessUp   allow-when-locked=true { spawn "brightnessctl" "s" "+5%"; }
	XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "s" "5%-"; }

	Mod+R { spawn "zen"; }
	Mod+E { spawn "kitty"; }
	Mod+P { spawn "rofi" "-show" "drun" "-show-icons" "-run-command" "{cmd}"; }
	Mod+S { spawn "screenshot"; }
	Mod+Control+S { spawn "screenshot-freeze"; }
	Mod+Shift+S { spawn "record"; }
	Super+Shift+L { spawn "loginctl" "lock-session"; }
	Mod+B repeat=false { spawn "sh" "-c" "hyprpicker | wl-copy"; }
	Mod+X repeat=false { spawn "wtype" "-k" "XF86Cut"; }
	Mod+C repeat=false { spawn "wtype" "-k" "XF86Copy" "-s" "200ms"; }
	Mod+V repeat=false { spawn "wtype" "-k" "XF86Paste"; }
	Mod+Shift+V repeat=false { spawn "sh" "-c" "cliphist list | rofi -dmenu -display-columns 2 | cliphist decode | wl-copy"; }

	Mod+Space repeat=false { toggle-overview; }
	Mod+Q repeat=false { close-window; }

	Mod+J     { focus-window-up-or-column-left; }
	Mod+K     { focus-window-down-or-column-right; }
	// TODO: add move window down or column right (need to implement those)
	Mod+Shift+J     { move-column-left; }
	Mod+Shift+K     { move-column-right; }

	Mod+Home { focus-column-first; }
	Mod+End  { focus-column-last; }
	Mod+Shift+Home { move-column-to-first; }
	Mod+Shift+End  { move-column-to-last; }

	Mod+Comma      { focus-monitor-previous; }
	Mod+Period     { focus-monitor-next; }
	Mod+Shift+Comma      { move-window-to-monitor-previous;  }
	Mod+Shift+Period     { move-window-to-monitor-next;  }
	Mod+Ctrl+Shift+Comma      { move-column-to-monitor-previous;  }
	Mod+Ctrl+Shift+Period     { move-column-to-monitor-next;  }

	Mod+Alt+J { focus-workspace-down; }
	Mod+Alt+K { focus-workspace-up; }
	Mod+Alt+Shift+J { move-window-to-workspace-down; }
	Mod+Alt+Shift+K { move-window-to-workspace-up; }
	Mod+Alt+Ctrl+Shift+J { move-workspace-down; }
	Mod+Alt+Ctrl+Shift+K { move-workspace-up; }

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

	Mod+WheelScrollRight      { focus-column-right; }
	Mod+WheelScrollLeft       { focus-column-left; }
	Mod+Shift+WheelScrollRight { move-column-right; }
	Mod+Shift+WheelScrollLeft  { move-column-left; }

	Mod+1 { focus-workspace 1; }
	Mod+2 { focus-workspace 2; }
	Mod+3 { focus-workspace 3; }
	Mod+4 { focus-workspace 4; }
	Mod+5 { focus-workspace 5; }
	Mod+6 { focus-workspace 6; }
	Mod+7 { focus-workspace 7; }
	Mod+8 { focus-workspace 8; }
	Mod+9 { focus-workspace 9; }
	Mod+Shift+1 { move-window-to-workspace 1; }
	Mod+Shift+2 { move-window-to-workspace 2; }
	Mod+Shift+3 { move-window-to-workspace 3; }
	Mod+Shift+4 { move-window-to-workspace 4; }
	Mod+Shift+5 { move-window-to-workspace 5; }
	Mod+Shift+6 { move-window-to-workspace 6; }
	Mod+Shift+7 { move-window-to-workspace 7; }
	Mod+Shift+8 { move-window-to-workspace 8; }
	Mod+Shift+9 { move-window-to-workspace 9; }
	Mod+Ctrl+Shift+1 { move-column-to-workspace 1; }
	Mod+Ctrl+Shift+2 { move-column-to-workspace 2; }
	Mod+Ctrl+Shift+3 { move-column-to-workspace 3; }
	Mod+Ctrl+Shift+4 { move-column-to-workspace 4; }
	Mod+Ctrl+Shift+5 { move-column-to-workspace 5; }
	Mod+Ctrl+Shift+6 { move-column-to-workspace 6; }
	Mod+Ctrl+Shift+7 { move-column-to-workspace 7; }
	Mod+Ctrl+Shift+8 { move-column-to-workspace 8; }
	Mod+Ctrl+Shift+9 { move-column-to-workspace 9; }

	Mod+U { consume-window-into-column; }
	Mod+I { expel-window-from-column; }

	// Mod+R { switch-preset-column-width; }
	// Mod+Shift+R { switch-preset-window-height; }
	// Mod+Ctrl+R { reset-window-height; }
	Mod+D { toggle-column-tabbed-display; }
	Mod+M { maximize-column; }
	Mod+F { fullscreen-window; }
	Mod+Shift+F { toggle-window-floating; }
	Mod+Alt+F   { switch-focus-between-floating-and-tiling; }

	Mod+Z { center-column; }
	Mod+Ctrl+Z { center-visible-columns; }

	Mod+H { set-column-width "-5%"; }
	Mod+L { set-column-width "+5%"; }

	// Applications such as remote-desktop clients and software KVM switches may
	// request that niri stops processing the keyboard shortcuts defined here
	// so they may, for example, forward the key presses as-is to a remote machine.
	// It's a good idea to bind an escape hatch to toggle the inhibitor,
	// so a buggy application can't hold your session hostage.
	//
	// The allow-inhibiting=false property can be applied to other binds as well,
	// which ensures niri always processes them, even when an inhibitor is active.
	Mod+Escape allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; }
}

workspace "emtpy" {
	open-on-output "Dell Inc. DELL S2722QC 2HHZH24"
}
workspace "chat" {
	open-on-output "Dell Inc. DELL S2722QC 2HHZH24"
}
workspace "work" {
	open-on-output "Dell Inc. DELL S2722QC 2HHZH24"
}


window-rule {
	match at-startup=true
	open-on-output "Dell Inc. DELL S2722QC 2HHZH24"
	open-on-workspace "work"
	open-maximized true
	open-focused false
}

window-rule {
	match app-id="discord"
	match app-id="vesktop"
	match app-id="com.github.th_ch.youtube_music"
	open-on-workspace "chat"
}

// from wiki, move steam notifications to a corner
window-rule {
	match app-id="steam" title=r#"^notificationtoasts_\d+_desktop$"#
	default-floating-position x=10 y=10 relative-to="bottom-right"
}

spawn-at-startup "wallpaper"
spawn-at-startup "ags"
spawn-at-startup "kitty"
spawn-at-startup "zen"
spawn-at-startup "hyprlock" "--immediate"
