not b@tk1z 头像

消息来源频道

not b@tk1z

@batkizc

频道165 位成员公开可见0 人在线

说一些没用的话,写一些没用的代码。

成员规模165 位成员
在线情况0 人在线
消息总数4,104 条消息
浏览量总数11,491 次浏览

在这个频道里搜索消息……

t.me/batkizc

altsnap 是个很好用的软件,但是在我的场景下,它只能设置居中,而不能设置大小,用起来还是不太爽。
今天想起来了 komorebi 这个 Windows 上的 tiling window manager 有用到 autohotkey,于是查了下 ahk 的 API,花了几分钟写了段脚本搞定了。。。
#Requires AutoHotkey v2.0-
#Warn
#SingleInstance
#=::resizeWindow(WinGetID("A"), 0.8) ; [Win]+[=]
#-::resizeWindow(WinGetID("A"), 0.6) ; [Win]+[-]
resizeWindow(window, percentage) {
WinGetPos , , , , window
width := A_ScreenWidth * percentage
height := A_ScreenHeight * percentage
WinMove (A_ScreenWidth - width)/2, (A_ScreenHeight - height)/2, width, height, window
return
}