exec {
	himitsud
	hissh-agent
	pipewire
	mako
	foot --server
	~/.local/libexec/title-watch
	wlchewing -e -d no -f "Noto Sans CJK TC 11" -b#303030 -s#80cbc4 -S#101a19 2>/tmp/wlchewing.log
	dbus-update-activation-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP GTK_THEME
}

#xwayland disable 

output {
	eDP-1	scale 3
	DP-2	pos 0 0

	'BNQ BenQ BL2780 96L0214501Q' {
		pos 0 0
		subpixel rgb
	}

	'Dell Inc. DELL U2422HE 5DFMNM3' {
		pos 1920 0
		subpixel rgb
	}

	'Shenzhen Soogeen Electronics Co., LTD. L01N8A 0x01348C5C' {
		transform 270
		pos 9000 9000
	}

	* background ~/.local/share/backgrounds/20618.jpg fill
}

bindswitch lid:toggle output eDP-1 toggle

input {
	1739:30383:DELL07E6:00_06CB:76AF_Touchpad tap enabled
	1267:9454:ELAN24EE:00_04F3:24EE map_to_output eDP-1
}

set $m Mod4

# Use Mouse+$m to drag floating windows to their wanted position
floating_modifier $m

set $show_brightness notify-send Brightness "Brightness set to $(brightnessctl -m | cut -f 4 -d ,)"

bindsym {
	$m+Return	exec footclient
	$m+d	exec j4-dmenu-desktop --dmenu='wmenu -i -n c0c0c0 -N 303030 -s ffffff -S 37474f' --no-generic --term=footclient --usage-log=$XDG_CACHE_HOME/j4desktop

	$m+Shift+q	kill

	$m+Left	focus left
	$m+Down	focus down
	$m+Up	focus up
	$m+Right	focus right

	$m+space	focus mode_toggle

	$m+Shift+Left	move left
	$m+Shift+Down	move down
	$m+Shift+Up	move up
	$m+Shift+Right	move right

	$m+h	split h
	$m+v	split v

	$m+s	layout stacking
	$m+w	layout tabbed
	$m+e	layout toggle split

	$m+f	fullscreen toggle
	$m+p	sticky toggle
	$m+b	border toggle
	$m+Shift+space	floating toggle

	$m+1	workspace 1
	$m+2	workspace 2
	$m+3	workspace 3
	$m+4	workspace 4
	$m+5	workspace 5
	$m+6	workspace 6
	$m+7	workspace 7
	$m+8	workspace 8
	$m+9	workspace 9
	$m+0	workspace 10

	$m+Shift+1	move container to workspace 1
	$m+Shift+2	move container to workspace 2
	$m+Shift+3	move container to workspace 3
	$m+Shift+4	move container to workspace 4
	$m+Shift+5	move container to workspace 5
	$m+Shift+6	move container to workspace 6
	$m+Shift+7	move container to workspace 7
	$m+Shift+8	move container to workspace 8
	$m+Shift+9	move container to workspace 9
	$m+Shift+0	move container to workspace 10

	$m+Shift+c	reload
	$m+Shift+e	exit
	$m+Shift+l	exec swaylockd

	XF86AudioMute	exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
	XF86AudioLowerVolume	exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
	XF86AudioRaiseVolume	exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+

	XF86AudioPlay	exec playerctl play-pause
	XF86AudioPrev	exec playerctl previous
	XF86AudioNext	exec playerctl next
	XF86Search	exec playerctl shuffle Toggle

	XF86MonBrightnessUp	exec brightnessctl set 5%+ && $show_brightness
	XF86MonBrightnessDown	exec brightnessctl set 5%- && $show_brightness

	Print	exec screenshot
	$m+Print	exec screenshot crop
}

bindgesture {
	swipe:right	focus right
	swipe:left	focus left

	pinch:inward+up	move up
	pinch:inward+down	move down
	pinch:inward+left	move left
	pinch:inward+right	move right
}

mode resize {
        bindsym {
		Left	resize shrink width
        	Down	resize grow height
        	Up	resize shrink height
        	Right	resize grow width
		$m+r	mode default
	}
}

bindsym $m+r mode resize

bar {
        status_command i3status
	colors {
		# mtrl grey 850 background_material_dark
		background #303030
		statusline #ffffff
		# mtrl calced divider
		separator #494949
		# mtrl dark accent
		focused_workspace #80cbc4 #80cbc4 #101a19
		inactive_workspace #303030 #303030 #ffffff
		# mtrl red 500
		urgent_workspace #F44336 #F44336 #ffffff
	}
	separator_symbol |
}

font pango:Noto Sans Mono, Noto Sans Mono CJK TC 8

# mtrl dark secondary
client.focused #37474f #37474f #ffffff #37474f #37474f
client.unfocused #303030 #303030 #c0c0c0 #303030 #303030
client.urgent #f44336 #f44336 #ffffff #f44336 #f44336

default_border normal 1
hide_edge_borders both
focus_on_window_activation urgent

set $ff "^(org\.mozilla\.)?firefox$"

for_window {
	[app_id=$ff title="^(Picture-in-Picture|子母畫面)$"] {
		border none
		floating enable
		sticky enable
		move right 390 px
		move down 210 px
		resize set 480 270
	}

	[app_id=$ff title="^Extension: \(Open in Browser\) \- Opening "] floating enable

	[app_id=$ff title="^Opening "] floating enable

	[app_id=$ff title="^Firefox — (Sharing Indicator|分享指示器)$"] {
		border none
		floating enable
		resize set 80 50
	}
}