dsh-cursor-whale 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -2
- package/app/DSH-Hotkey.exe +0 -0
- package/app/hotkey.ini +21 -0
- package/app/whale-alpha.png +0 -0
- package/cordis.patch.yml +7 -0
- package/docs/DETAIL.md +1 -0
- package/docs/DETAIL.zh.md +1 -0
- package/docs/preview.svg +18 -0
- package/docs/preview.zh.svg +18 -0
- package/icon.svg +7 -0
- package/lib/index.js +106 -0
- package/locale/en.json +7 -0
- package/locale/zh.json +7 -0
- package/package.json +35 -3
package/README.md
CHANGED
|
@@ -1,3 +1,30 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dsh-cursor-whale
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
把 dsh-mini 的小窗收成一只跟着鼠标走的透明鲸鱼:小窗不用的时候是一张贴纸,鼠标前进键一按就切回真窗口。
|
|
4
|
+
|
|
5
|
+
## 用法
|
|
6
|
+
|
|
7
|
+
- **鼠标后退键**:主窗 ⇄ 小窗
|
|
8
|
+
- **鼠标前进键**:鲸鱼 ⇄ 小窗(一个键双向)
|
|
9
|
+
- 鼠标**移出小窗**:自动收成鲸鱼,贴在光标右下
|
|
10
|
+
- 退出热键:`Ctrl+Alt+Shift+Q`
|
|
11
|
+
|
|
12
|
+
## 配置
|
|
13
|
+
|
|
14
|
+
首次运行会把程序复制到 `%LOCALAPPDATA%\DSH-Hotkey`,配置在同目录 `hotkey.ini`,保存后约 2 秒生效:
|
|
15
|
+
|
|
16
|
+
```ini
|
|
17
|
+
toggle = XButton1
|
|
18
|
+
openMini = XButton2
|
|
19
|
+
whaleScale = 3 # 鲸鱼宽度 = 系统指针宽度 × 该倍数
|
|
20
|
+
whaleOffsetX = 16
|
|
21
|
+
whaleOffsetY = 16
|
|
22
|
+
whaleImage = whale-alpha.png
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## 限制
|
|
26
|
+
|
|
27
|
+
- 仅 **Windows**(Win10/11 x64);
|
|
28
|
+
- 需要先安装 **dsh-mini** 插件,并使用 **DSH 桌面端**(网页版没有可折叠的小窗);
|
|
29
|
+
- 自带的是未签名 exe,首次运行可能被 SmartScreen/杀软拦一次;
|
|
30
|
+
- 插件被禁用或卸载时,助手进程会一起退出。
|
|
Binary file
|
package/app/hotkey.ini
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# DSH 折叠热键配置。改完保存,约 2 秒内自动生效,不用重启。
|
|
2
|
+
# 写法:修饰键(Ctrl/Alt/Shift/Win,可组合)+ 一个按键。
|
|
3
|
+
# 按键可用:A-Z 0-9 F1-F24 ` - = [ ] \ ; ' , . / Space Enter Esc Tab Delete Home End PageUp PageDown Up Down Left Right PrintScreen
|
|
4
|
+
# 想关掉某个热键,就把它留空:toggle =
|
|
5
|
+
|
|
6
|
+
toggle = XButton1
|
|
7
|
+
follow = Ctrl+Alt+`
|
|
8
|
+
quit = Ctrl+Alt+Shift+Q
|
|
9
|
+
openMini = XButton2
|
|
10
|
+
|
|
11
|
+
# 跟随鼠标时窗口中心相对光标的纵向偏移(负数往上)
|
|
12
|
+
followOffsetY = 24
|
|
13
|
+
|
|
14
|
+
# 鼠标侧键被绑定时,是否吞掉它原本的「后退/前进」动作(true = 只给 DSH 用)
|
|
15
|
+
blockMouseButton = true
|
|
16
|
+
|
|
17
|
+
# 跟随鼠标的鲸鱼:宽度 = 系统指针宽度 × whaleScale;位置相对光标右下
|
|
18
|
+
whaleScale = 3
|
|
19
|
+
whaleOffsetX = 16
|
|
20
|
+
whaleOffsetY = 16
|
|
21
|
+
whaleImage = whale-alpha.png
|
|
Binary file
|
package/cordis.patch.yml
ADDED
package/docs/DETAIL.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+

|
|
@@ -0,0 +1 @@
|
|
|
1
|
+

|
package/docs/preview.svg
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="640" height="300" viewBox="0 0 640 300">
|
|
2
|
+
<rect x="24" y="24" width="592" height="252" rx="24" fill="#0F172A"/>
|
|
3
|
+
<rect x="60" y="60" width="220" height="180" rx="12" fill="#111E33" stroke="#2AA7E0" stroke-opacity="0.55" stroke-width="2"/>
|
|
4
|
+
<rect x="76" y="76" width="188" height="14" rx="7" fill="#2AA7E0" fill-opacity="0.55"/>
|
|
5
|
+
<rect x="76" y="100" width="150" height="8" rx="4" fill="#CBD5E1" fill-opacity="0.45"/>
|
|
6
|
+
<rect x="76" y="116" width="168" height="8" rx="4" fill="#CBD5E1" fill-opacity="0.32"/>
|
|
7
|
+
<rect x="76" y="132" width="120" height="8" rx="4" fill="#CBD5E1" fill-opacity="0.22"/>
|
|
8
|
+
<path d="M300 214c34-58 96-96 150-92" fill="none" stroke="#2AA7E0" stroke-width="3" stroke-dasharray="9 11" stroke-linecap="round" stroke-opacity="0.6"/>
|
|
9
|
+
<g transform="translate(352 108) scale(2.3)">
|
|
10
|
+
<path d="M18 52c0-11 9-19 21-19 10 0 18 5 21 13l9-7-2 11 2 11-9-7c-3 8-11 13-21 13-12 0-21-8-21-15z" fill="#2AA7E0"/>
|
|
11
|
+
<path d="M18 52c0 7 9 15 21 15 6 0 11-2 15-5-6 1-13-1-17-5-5-5-7-11-8-15-6 3-11 6-11 10z" fill="#DCEFFA"/>
|
|
12
|
+
<circle cx="55" cy="45" r="4.5" fill="#0B2A3A"/>
|
|
13
|
+
<circle cx="56.5" cy="43.5" r="1.6" fill="#FFFFFF"/>
|
|
14
|
+
</g>
|
|
15
|
+
<g transform="translate(556 196)">
|
|
16
|
+
<path d="M0 0 L0 30 L8 22 L14 34 L21 30 L15 18 L26 19 Z" fill="#E2E8F0" stroke="#0F172A" stroke-width="1.6" stroke-linejoin="round"/>
|
|
17
|
+
</g>
|
|
18
|
+
</svg>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="640" height="300" viewBox="0 0 640 300">
|
|
2
|
+
<rect x="24" y="24" width="592" height="252" rx="24" fill="#0F172A"/>
|
|
3
|
+
<rect x="60" y="60" width="220" height="180" rx="12" fill="#111E33" stroke="#2AA7E0" stroke-opacity="0.55" stroke-width="2"/>
|
|
4
|
+
<rect x="76" y="76" width="188" height="14" rx="7" fill="#2AA7E0" fill-opacity="0.55"/>
|
|
5
|
+
<rect x="76" y="100" width="150" height="8" rx="4" fill="#CBD5E1" fill-opacity="0.45"/>
|
|
6
|
+
<rect x="76" y="116" width="168" height="8" rx="4" fill="#CBD5E1" fill-opacity="0.32"/>
|
|
7
|
+
<rect x="76" y="132" width="120" height="8" rx="4" fill="#CBD5E1" fill-opacity="0.22"/>
|
|
8
|
+
<path d="M300 214c34-58 96-96 150-92" fill="none" stroke="#2AA7E0" stroke-width="3" stroke-dasharray="9 11" stroke-linecap="round" stroke-opacity="0.6"/>
|
|
9
|
+
<g transform="translate(352 108) scale(2.3)">
|
|
10
|
+
<path d="M18 52c0-11 9-19 21-19 10 0 18 5 21 13l9-7-2 11 2 11-9-7c-3 8-11 13-21 13-12 0-21-8-21-15z" fill="#2AA7E0"/>
|
|
11
|
+
<path d="M18 52c0 7 9 15 21 15 6 0 11-2 15-5-6 1-13-1-17-5-5-5-7-11-8-15-6 3-11 6-11 10z" fill="#DCEFFA"/>
|
|
12
|
+
<circle cx="55" cy="45" r="4.5" fill="#0B2A3A"/>
|
|
13
|
+
<circle cx="56.5" cy="43.5" r="1.6" fill="#FFFFFF"/>
|
|
14
|
+
</g>
|
|
15
|
+
<g transform="translate(556 196)">
|
|
16
|
+
<path d="M0 0 L0 30 L8 22 L14 34 L21 30 L15 18 L26 19 Z" fill="#E2E8F0" stroke="#0F172A" stroke-width="1.6" stroke-linejoin="round"/>
|
|
17
|
+
</g>
|
|
18
|
+
</svg>
|
package/icon.svg
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="96" height="96" viewBox="0 0 96 96">
|
|
2
|
+
<rect width="96" height="96" rx="20" fill="#0B2A3A"/>
|
|
3
|
+
<path d="M18 52c0-11 9-19 21-19 10 0 18 5 21 13l9-7-2 11 2 11-9-7c-3 8-11 13-21 13-12 0-21-8-21-15z" fill="#2AA7E0"/>
|
|
4
|
+
<path d="M18 52c0 7 9 15 21 15 6 0 11-2 15-5-6 1-13-1-17-5-5-5-7-11-8-15-6 3-11 6-11 10z" fill="#DCEFFA"/>
|
|
5
|
+
<circle cx="55" cy="45" r="4.5" fill="#0B2A3A"/>
|
|
6
|
+
<circle cx="56.5" cy="43.5" r="1.6" fill="#FFFFFF"/>
|
|
7
|
+
</svg>
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dsh-cursor-whale — Host 半边。
|
|
3
|
+
*
|
|
4
|
+
* 做的事只有三件:
|
|
5
|
+
* 1. 把随包携带的 DSH-Hotkey.exe / whale-alpha.png 复制到 %LOCALAPPDATA%\DSH-Hotkey
|
|
6
|
+
* (不覆盖用户已有的 hotkey.ini)
|
|
7
|
+
* 2. 启动这个托盘程序
|
|
8
|
+
* 3. 插件卸载/进程退出时把它收掉
|
|
9
|
+
*
|
|
10
|
+
* 真正的热键与窗口逻辑都在那个 exe 里,它通过 dsh-mini 的 /dsh-mini/open 接口操作小窗。
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { spawn } from 'node:child_process'
|
|
14
|
+
import { copyFileSync, existsSync, mkdirSync, writeFileSync } from 'node:fs'
|
|
15
|
+
import { homedir } from 'node:os'
|
|
16
|
+
import { dirname, join } from 'node:path'
|
|
17
|
+
import { fileURLToPath } from 'node:url'
|
|
18
|
+
|
|
19
|
+
const PLUGIN_ROOT = join(dirname(fileURLToPath(import.meta.url)), '..')
|
|
20
|
+
|
|
21
|
+
let child = null
|
|
22
|
+
|
|
23
|
+
function localAppData() {
|
|
24
|
+
return process.env.LOCALAPPDATA || join(homedir(), 'AppData', 'Local')
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function defaultIni() {
|
|
28
|
+
return [
|
|
29
|
+
'# DSH 折叠热键配置。改完保存,约 2 秒内自动生效。',
|
|
30
|
+
'# 写法:修饰键(Ctrl/Alt/Shift/Win)+ 一个按键;鼠标侧键写 XButton1 / XButton2。',
|
|
31
|
+
'',
|
|
32
|
+
'toggle = XButton1',
|
|
33
|
+
'follow = Ctrl+Alt+`',
|
|
34
|
+
'openMini = XButton2',
|
|
35
|
+
'quit = Ctrl+Alt+Shift+Q',
|
|
36
|
+
'',
|
|
37
|
+
'blockMouseButton = true',
|
|
38
|
+
'',
|
|
39
|
+
'# 跟随鼠标的鲸鱼:宽度 = 系统指针宽度 × whaleScale',
|
|
40
|
+
'whaleScale = 3',
|
|
41
|
+
'whaleOffsetX = 16',
|
|
42
|
+
'whaleOffsetY = 16',
|
|
43
|
+
'whaleImage = whale-alpha.png',
|
|
44
|
+
''
|
|
45
|
+
].join('\n')
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function ensureAssets(targetDir) {
|
|
49
|
+
mkdirSync(targetDir, { recursive: true })
|
|
50
|
+
for (const file of ['DSH-Hotkey.exe', 'whale-alpha.png']) {
|
|
51
|
+
const source = join(PLUGIN_ROOT, 'app', file)
|
|
52
|
+
const target = join(targetDir, file)
|
|
53
|
+
if (!existsSync(source)) continue
|
|
54
|
+
try {
|
|
55
|
+
copyFileSync(source, target)
|
|
56
|
+
} catch {
|
|
57
|
+
// 目标可能正在运行(EBUSY):保持现有文件即可
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
const ini = join(targetDir, 'hotkey.ini')
|
|
61
|
+
if (!existsSync(ini)) {
|
|
62
|
+
try {
|
|
63
|
+
writeFileSync(ini, defaultIni(), 'utf8')
|
|
64
|
+
} catch {}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function apply(ctx) {
|
|
69
|
+
if (process.platform !== 'win32') {
|
|
70
|
+
ctx.logger?.warn?.('dsh-cursor-whale: Windows only, skipped')
|
|
71
|
+
return
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const dir = join(localAppData(), 'DSH-Hotkey')
|
|
75
|
+
const exe = join(dir, 'DSH-Hotkey.exe')
|
|
76
|
+
|
|
77
|
+
try {
|
|
78
|
+
ensureAssets(dir)
|
|
79
|
+
} catch {}
|
|
80
|
+
|
|
81
|
+
if (!existsSync(exe)) {
|
|
82
|
+
ctx.logger?.warn?.('dsh-cursor-whale: DSH-Hotkey.exe missing, run skipped')
|
|
83
|
+
return
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
try {
|
|
87
|
+
child = spawn(exe, [], { cwd: dir, windowsHide: true, stdio: 'ignore' })
|
|
88
|
+
child.on('exit', () => {
|
|
89
|
+
child = null
|
|
90
|
+
})
|
|
91
|
+
child.on('error', () => {
|
|
92
|
+
child = null
|
|
93
|
+
})
|
|
94
|
+
} catch {
|
|
95
|
+
child = null
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
ctx.effect(() => () => {
|
|
99
|
+
if (child && !child.killed) {
|
|
100
|
+
try {
|
|
101
|
+
child.kill()
|
|
102
|
+
} catch {}
|
|
103
|
+
child = null
|
|
104
|
+
}
|
|
105
|
+
})
|
|
106
|
+
}
|
package/locale/en.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"title": "Cursor whale",
|
|
4
|
+
"description": "Collapses the dsh-mini popout into a small transparent whale that follows the cursor, and brings it back with the mouse forward button. Windows only; requires the dsh-mini plugin and a desktop DSH install.",
|
|
5
|
+
"detail": "docs/DETAIL.md"
|
|
6
|
+
}
|
|
7
|
+
}
|
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,38 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-cursor-whale",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "lib/index.js",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": "./lib/index.js",
|
|
8
|
+
"./locale/*.json": "./locale/*.json"
|
|
9
|
+
},
|
|
10
|
+
"icon": "./icon.svg",
|
|
11
|
+
"files": [
|
|
12
|
+
"lib",
|
|
13
|
+
"app",
|
|
14
|
+
"locale",
|
|
15
|
+
"docs",
|
|
16
|
+
"cordis.patch.yml",
|
|
17
|
+
"icon.svg",
|
|
18
|
+
"README.md"
|
|
19
|
+
],
|
|
20
|
+
"description": "把 dsh-mini 的小窗收成跟着鼠标走的透明鲸鱼,鼠标前进键一键切回。Windows only.",
|
|
21
|
+
"keywords": [
|
|
22
|
+
"dsh",
|
|
23
|
+
"dsh-plugin",
|
|
24
|
+
"deepseek-harness",
|
|
25
|
+
"always-on-top",
|
|
26
|
+
"window",
|
|
27
|
+
"whale"
|
|
28
|
+
],
|
|
29
|
+
"os": [
|
|
30
|
+
"win32"
|
|
31
|
+
],
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"dsh": {
|
|
34
|
+
"bundle": {
|
|
35
|
+
"patch": "./cordis.patch.yml"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
6
38
|
}
|