aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-04-07 19:55:57 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-04-07 20:00:58 +0200
commitea530ddcf39f3bd28530ce72ca414d5ee66d1413 (patch)
treefc0cda81b549a2909be7779b3bc3793174850ffd
parenteecc489a5576401219e90e7ba4bf690951c6d452 (diff)
downloaddrm-ea530ddcf39f3bd28530ce72ca414d5ee66d1413.tar.gz
Use sh instead of batch, support custom hotkeys
-rw-r--r--drm.ahk4
-rw-r--r--hotkeys.x0
-rw-r--r--patch.bat9
-rw-r--r--patch.sh5
-rw-r--r--rules.x (renamed from drm.x)0
5 files changed, 8 insertions, 10 deletions
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/hotkeys.x b/hotkeys.x
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/hotkeys.x
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/drm.x b/rules.x
index e35c42b..e35c42b 100644
--- a/drm.x
+++ b/rules.x