-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquiet-hours.ahk
More file actions
23 lines (22 loc) · 974 Bytes
/
quiet-hours.ahk
File metadata and controls
23 lines (22 loc) · 974 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
; Ctrl + Windows + Del to toggle Quiet Hours
^#Del::
RegRead, QuietHoursEnabled, HKEY_CURRENT_USER, SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings, NOC_GLOBAL_SETTING_TOASTS_ENABLED
if (QuietHoursEnabled = "") {
TrayTip Quiet Hours, Quiet Hours activated, 0, 1
Sleep, 2000 ; Display for 2 seconds
HideTrayTip()
RegWrite, REG_DWORD, HKEY_CURRENT_USER, SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings, NOC_GLOBAL_SETTING_TOASTS_ENABLED, 0
} else {
RegDelete, HKEY_CURRENT_USER, SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings, NOC_GLOBAL_SETTING_TOASTS_ENABLED
TrayTip Quiet Hours, Quiet Hours deactivated, 0, 1
Sleep, 2000 ; Display for 2 seconds
HideTrayTip()
}
HideTrayTip() {
TrayTip ; Attempt to hide it the normal way.
if SubStr(A_OSVersion,1,3) = "10." {
Menu Tray, NoIcon
Sleep 200 ; It may be necessary to adjust this sleep.
Menu Tray, Icon
}
}