-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmiscRespond.ahk
55 lines (46 loc) · 1.59 KB
/
miscRespond.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
miscRespond(){
; Restart processes when dead
process_watchdog(PRG_RS_GPG_Agent)
process_watchdog({process: "eartrumpet.exe", name: "EarTrumpet"})
; ==========================================================================
; Move Control Center to left
if winActive("ahk_group WG_TrayMenu") ; NB: WinExist/WinMove does not work for these windows without ID
WinMove % winactive("Control Center")? -10: 54
; ==========================================================================
; Close image viewer when out of focus
/*
win:=winExist("ahk_group WG_ImageViewer")
if win && !winActive("ahk_id " win) {
WinGetPos,, y,, h
if (y==0 && h==A_ScreenHeight)
winclose
}
*/
; ==========================================================================
; Do not mute when 0 volume
if !VA_GetMasterVolume()
VA_SetMasterMute(false)
; ==========================================================================
; Close unwanted popups
IfWinExist, (UNREGISTERED) ahk_group WG_Sublime
{
WinGetTitle, t
WinSetTitle % StrReplace(t, " (UNREGISTERED)")
}
while winExist("ahk_group WG_unwantedEsc") {
winactivate
send, {esc}
}
winHide ahk_group WG_unwantedHide
winClose ahk_group WG_unwantedClose
winClose ahk_group WG_unwantedCloseRegex
DetectHiddenWindows On
winClose ahk_group WG_unwantedClose
SetTitleMatchMode Regex
winClose ahk_group WG_unwantedCloseRegex
return
}
process_watchdog(spec) {
if !processExist(spec.process)
activateProgram(spec)
}