From ea530ddcf39f3bd28530ce72ca414d5ee66d1413 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Wed, 7 Apr 2021 19:55:57 +0200 Subject: Use sh instead of batch, support custom hotkeys --- drm.ahk | 4 +++- drm.x | 4 ---- hotkeys.x | 0 patch.bat | 9 --------- patch.sh | 5 +++++ rules.x | 4 ++++ 6 files changed, 12 insertions(+), 14 deletions(-) delete mode 100644 drm.x create mode 100644 hotkeys.x delete mode 100644 patch.bat create mode 100644 patch.sh create mode 100644 rules.x diff --git a/drm.ahk b/drm.ahk index c0a8091..2fbd9ac 100644 --- a/drm.ahk +++ b/drm.ahk @@ -62,6 +62,8 @@ ButtonRestart: Reload return +#IncludeAgain %A_ScriptDir%\hotkeys.x + ; Handle tray opening NotifyIcon(wParam, lParam) @@ -193,7 +195,7 @@ Save(ByRef Positions) if (style & 0x40000 = 0) ; WS_SIZEBOX DoIgnoreSize := true - #IncludeAgain %A_ScriptDir%\drm.x + #IncludeAgain %A_ScriptDir%\rules.x ; Example: ; if (exe = "mpc-hc.exe" and cw = 294) diff --git a/drm.x b/drm.x deleted file mode 100644 index e35c42b..0000000 --- a/drm.x +++ /dev/null @@ -1,4 +0,0 @@ -if (exe = "mpc-hc.exe" and (cw = 294 or cw = 304 or cw = 307)) -{ - DoIgnoreSize := true -} \ No newline at end of file diff --git a/hotkeys.x b/hotkeys.x new file mode 100644 index 0000000..e69de29 diff --git a/patch.bat b/patch.bat deleted file mode 100644 index 5ccd33e..0000000 --- a/patch.bat +++ /dev/null @@ -1,9 +0,0 @@ -@echo off -setlocal -cd /d %~dp0 -if "%~1" == "" ( - echo Error: argument missing - pause - exit /b -) -sed "s/^ ; Custom rules$/ #IncludeAgain %%A_ScriptDir%%\\\\drm.x/" "%~1" > drm.ahk \ No newline at end of file diff --git a/patch.sh b/patch.sh new file mode 100644 index 0000000..380966f --- /dev/null +++ b/patch.sh @@ -0,0 +1,5 @@ +#!/bin/sh +test -z "$1" && { echo usage: $0 file 1>&2; exit 1; } +sed 's/^ ; Custom rules$/ #IncludeAgain %A_ScriptDir%\\rules.x/' "$1" | +sed 's/^; Custom hotkeys$/#IncludeAgain %A_ScriptDir%\\hotkeys.x/' > drm.tmp +mv drm.tmp drm.ahk diff --git a/rules.x b/rules.x new file mode 100644 index 0000000..e35c42b --- /dev/null +++ b/rules.x @@ -0,0 +1,4 @@ +if (exe = "mpc-hc.exe" and (cw = 294 or cw = 304 or cw = 307)) +{ + DoIgnoreSize := true +} \ No newline at end of file -- cgit v1.2.3