# Swap comments on the two following lines to switch betwen
# click does not raise and click to raise.
# $CLIENT_CLICK = "Focus"
$CLIENT_CLICK = "Focus; Raise"

# Base mouse configuration
INCLUDE = "$_PEKWM_ETC_PATH/mouse_system"

# Swap comments on the two folling lines to switch between
# sloppy and click to focus
INCLUDE = "$_PEKWM_ETC_PATH/mouse_sloppy"
# INCLUDE = "$_PEKWM_ETC_PATH/mouse_click"

# Add configuration overrides here, it is possible to add sections,
# sub-section and values overriding/adding specific values.

FrameTitle {
	ButtonRelease = "1" { Actions = "Raise; Focus; ActivateClient" }
	ButtonRelease = "1" { Actions = "HideAllMenus; Raise; Focus; ActivateClient" }
	ButtonRelease = "2" { Actions = "ActivateClient" }
	ButtonRelease = "Mod4 3" { Actions = "Close" }
	ButtonRelease = "3" { Actions = "HideAllMenus; ShowMenu Window" }
	ButtonRelease = "4" { Actions = "ActivateClientRel 1" }
	ButtonRelease = "5" { Actions = "ActivateClientRel -1" }
	DoubleClick = "2" { Actions = "Toggle Shaded" }
	DoubleClick = "1" { Actions = "MaxFill True True" }
	Motion = "1" { Threshold = "4"; Actions = "Move" }
	Motion = "Mod1 1" { Threshold = "4"; Actions = "Move" }
	Motion = "Mod4 1" { Threshold = "4"; Actions = "Move" }
	Motion = "2" { Threshold = "4"; Actions = "GroupingDrag True" }
	Motion = "Mod1 3" { Actions = "Resize" }
	Enter = "Any Any" { Actions = "Focus" }
}

OtherTitle {
	ButtonRelease = "1" { Actions = "Raise; Focus; ActivateClient" }
	ButtonRelease = "1" { Actions = "HideAllMenus; Raise; Focus; ActivateClient" }
	ButtonRelease = "Mod4 3" { Actions = "Close" }
	DoubleClick = "2" { Actions = "Toggle Shaded" }
	DoubleClick = "1" { Actions = "MaxFill True True" }
	Motion = "1" { Threshold = "4"; Actions = "Move" }
	Motion = "Mod1 1" { Threshold = "4"; Actions = "Move" }
	Motion = "Mod4 1" { Threshold = "4"; Actions = "Move" }
	Motion = "Mod1 3" { Actions = "Resize" }
	Enter = "Any Any" { Actions = "Focus" }
}

Border {
	TopLeft     { Enter = "Any Any" { Actions = "Focus" }; ButtonPress = "1" { Actions = "Resize TopLeft" } }
	Top         { Enter = "Any Any" { Actions = "Focus" }; ButtonPress = "1" { Actions = "Move" } }
	TopRight    { Enter = "Any Any" { Actions = "Focus" }; ButtonPress = "1" { Actions = "Resize TopRight" } }
	Left        { Enter = "Any Any" { Actions = "Focus" }; ButtonPress = "1" { Actions = "Resize Left" } }
	Right       { Enter = "Any Any" { Actions = "Focus" }; ButtonPress = "1" { Actions = "Resize Right" } }
	BottomLeft  { Enter = "Any Any" { Actions = "Focus" }; ButtonPress = "1" { Actions = "Resize BottomLeft" } }
	Bottom      { Enter = "Any Any" { Actions = "Focus" }; ButtonPress = "1" { Actions = "Resize Bottom" } }
	BottomRight { Enter = "Any Any" { Actions = "Focus" }; ButtonPress = "1" { Actions = "Resize BottomRight" } }
}

ScreenEdge {
	Down {
		ButtonRelease = "3" { Actions = "HideAllMenus; ShowMenu Root" }
		ButtonRelease = "2" { Actions = "ShowMenu Goto" }
		ButtonRelease = "Mod1 1" { Actions = "Exec ~/Startup/barreROX-en_bas.sh &" }
		ButtonRelease = "Mod1 1" { Actions = "Exec ~/Startup/barreROX-en_bas.sh &" }
		EnterMoving = "Any Any" { Actions = "Exec wmctrl -r :ACTIVE: -e 0,0,536,1280,536 &" } # Down
# D'après http://urukrama.wordpress.com/category/pekwm/#Config
# le 10 juin 2013, 2 h 20.
# Formule : 0,0,mi-$haut,$larg,mi-$haut
	}
	Up {
		ButtonRelease = "3" { Actions = "HideAllMenus; ShowMenu Root" }
		ButtonRelease = "2" { Actions = "ShowMenu Goto" }
		ButtonRelease = "Mod1 1" { Actions = "Exec rox -l= -b= && killall stalonetray &" }
		ButtonRelease = "Mod1 4" { Actions = "GoToWorkspace Right" }
		ButtonRelease = "Mod1 5" { Actions = "GoToWorkspace Left" }
		EnterMoving = "Any Any" { Actions = "Exec wmctrl -r :ACTIVE: -e 0,0,0,1280,536 &" } # Up
# Formule : 0,0,0,$larg,mi-$haut
	}
	Left {
		Enter = "Mod1 Any" { Actions = "GoToWorkspace Left" }
		ButtonRelease = "3" { Actions = "HideAllMenus; ShowMenu Root" }
		ButtonRelease = "1" { Actions = "GoToWorkspace Left" }
		ButtonRelease = "Mod1 1" { Actions = "Exec ~/my-applications/bin/a-gauche-wary.sh &" }
		ButtonRelease = "Mod1 2" { Actions = "Exec rox -l= &" }
		ButtonRelease = "Mod1 3" { Actions = "Exec ~/my-applications/bin/barre-disques.sh &" }
		DoubleClick = "1" { Actions = "GoToWorkspace Left" }
		ButtonRelease = "2" { Actions = "ShowMenu Goto" }
		ButtonRelease = "4" { Actions = "GoToWorkspace Right" }
		ButtonRelease = "5" { Actions = "GoToWorkspace Left" }
		EnterMoving = "Any Any" { Actions = "Exec wmctrl -r :ACTIVE: -e 0,0,0,640,1024 &" } # Left
# Formule : 0,0,0,mi-$larg,$haut
	}
	Right {
		Enter = "Mod1 Any" { Actions = "GoToWorkspace Right" }
		ButtonRelease = "3" { Actions = "HideAllMenus; ShowMenu Root" }
		ButtonRelease = "1" { Actions = "GoToWorkspace Right" }
		DoubleClick = "1" { Actions = "GoToWorkspace Right" }
		ButtonRelease = "Mod1 1" { Actions = "Exec ~/my-applications/bin/barre-dsqs-d.sh &" }
		ButtonRelease = "2" { Actions = "ShowMenu Goto" }
		ButtonRelease = "4" { Actions = "GoToWorkspace Right" }
		ButtonRelease = "5" { Actions = "GoToWorkspace Left" }
		EnterMoving = "Any Any" { Actions = "Exec wmctrl -r :ACTIVE: -e 0,640,0,640,1024 &" } # Right
# Formule : 0,mi-$larg,0,mi-$larg,$haut
	}
}

Client {
	ButtonPress = "1" { Actions = "Focus; Raise; ActivateClient" }
	ButtonPress = "1" { Actions = "HideAllMenus; Focus; Raise" }
	ButtonRelease = "Mod1 1" { Actions = "Focus" }
	ButtonRelease = "Mod4 1" { Actions = "Lower" }
	Motion = "Mod1 1" { Actions = "Focus; Raise; Move" }
	Motion = "Mod4 1" { Actions = "Focus; Raise; Move" }
	Motion = "Mod1 2" { Threshold = "4"; Actions = "GroupingDrag True" }
	Motion = "Mod1 3" { Actions = "Resize" }
	Enter = "Any Any" { Actions = "Focus" }
}

Root {
	ButtonRelease = "3" { Actions = "ShowMenu Root" }
# HideAllMenus;
	ButtonRelease = "1" { Actions = "ShowMenu Goto" }
	ButtonRelease = "4" { Actions = "GoToWorkspace Right" }
	ButtonRelease = "5" { Actions = "GoToWorkspace Left" }
	ButtonRelease = "2" { Actions = "Exec ~/.pekwm/spm2-w12n -m &" }
# "HideAllMenus" }
# Utiliser "Escape" / "Échappement" pour fermer les menus
# au lieu du bouton 2.
}

Menu {
	Enter = "Any Any" { Actions = "Focus" }
	ButtonRelease = "2" { Actions = "Toggle Sticky" }
	Motion = "1" { Threshold = "10"; Actions = "Move" }
	ButtonRelease = "3" { Actions = "Close" }
}

Other {
	Enter = "Any Any" { Actions = "Focus" }
	ButtonRelease = "Mod4 3" { Actions = "Close" }
	Motion = "1" { Actions = "Focus; Raise; Move" }
	Motion = "Mod1 1" { Actions = "Focus; Raise; Move" }
}
