Skip to content

Instantly share code, notes, and snippets.

@orazdow
Last active January 11, 2026 10:55
Show Gist options
  • Select an option

  • Save orazdow/8d6cac9b03115edee041435b8c46c8ec to your computer and use it in GitHub Desktop.

Select an option

Save orazdow/8d6cac9b03115edee041435b8c46c8ec to your computer and use it in GitHub Desktop.
ahk v2 nighlight, wintop, hidebar
;tray icon tooltip
A_IconTip := "alt-l: nightlight`nalt-q: alt-f4`nctl-alt-up: winontop`nctl-alt-b: hidebar"
;*********** Alt-l : open night light *********************;
!l:: Run "ms-settings:nightlight"
;*********** Alt-q : alt-f4 *********************;
!q::Send "!{F4}"
;*********** Ctl-Alt-Up : pin window on top ***************;
^!Up:: WinSetAlwaysOnTop -1, "A"
;*********** Ctl-Alt-b : hide/show taskbar ****************;
^!b:: {
static hide := 0
HideShowTaskbar(hide := !hide)
}
HideShowTaskbar(action) {
static ABM_SETSTATE := 0xA, ABS_AUTOHIDE := 0x1, ABS_ALWAYSONTOP := 0x2
APPBARDATA := Buffer(size := 2*A_PtrSize + 2*4 + 16 + A_PtrSize, 0)
NumPut("UInt", size, APPBARDATA), NumPut("Ptr", WinExist("ahk_class Shell_TrayWnd"), APPBARDATA, A_PtrSize)
NumPut("UInt", action ? ABS_AUTOHIDE : ABS_ALWAYSONTOP, APPBARDATA, size - A_PtrSize)
DllCall("Shell32\SHAppBarMessage", "UInt", ABM_SETSTATE, "Ptr", APPBARDATA)
}
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
<svg class="svg-icon" style="width: 1em; height: 1em;vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M923.306667 554.666667a42.666667 42.666667 0 0 0-44.8-5.973334 343.466667 343.466667 0 0 1-143.786667 31.146667 347.733333 347.733333 0 0 1-347.306667-345.6 366.506667 366.506667 0 0 1 10.666667-85.333333A42.666667 42.666667 0 0 0 341.333333 100.693333a432.64 432.64 0 1 0 597.333334 498.773334 42.666667 42.666667 0 0 0-15.36-44.8z m-405.333334 285.44A347.306667 347.306667 0 0 1 302.08 222.72v11.52a433.066667 433.066667 0 0 0 432.64 432.64 417.706667 417.706667 0 0 0 89.6-9.386667 346.026667 346.026667 0 0 1-306.346667 184.32z" /></svg>
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#Requires AutoHotkey v2.0
;tray icon tooltip
A_IconTip := "alt-l: nightlight`nctl-alt-up: winontop`nctl-alt-b: hidebar"
;*********** Alt-l : open night light *********************;
!l:: Run "ms-settings:nightlight"
;*********** Ctl-Alt-Up : pin window on top ***************;
^!Up:: WinSetAlwaysOnTop -1, "A"
;*********** Ctl-Alt-b : hide/show taskbar ****************;
^!b:: {
static hide := 0
HideShowTaskbar(hide := !hide)
}
HideShowTaskbar(action) {
static ABM_SETSTATE := 0xA, ABS_AUTOHIDE := 0x1, ABS_ALWAYSONTOP := 0x2
APPBARDATA := Buffer(size := 2*A_PtrSize + 2*4 + 16 + A_PtrSize, 0)
NumPut("UInt", size, APPBARDATA)
NumPut("Ptr", WinExist("ahk_class Shell_TrayWnd"), APPBARDATA, A_PtrSize)
NumPut("UInt", action ? ABS_AUTOHIDE : ABS_ALWAYSONTOP, APPBARDATA, size - A_PtrSize)
DllCall("Shell32\SHAppBarMessage", "UInt", ABM_SETSTATE, "Ptr", APPBARDATA)
}
;*********** Remap AppsKey : RCtrl ************************;
AppsKey::RCtrl
;*********** Ctrl+ F5/F6 : Mon brightness -/+ *************;
^F5::Run "ControlMyMonitor.exe /ChangeValue Primary 10 -2", , "Hide"
^F6::Run "ControlMyMonitor.exe /ChangeValue Primary 10 +2", , "Hide"
;tray icon tooltip
A_IconTip := "alt-l: nightlight`nctl-alt-up: winontop`nctl-alt-b: hidebar"
;*********** Alt-l : open night light *********************;
!l:: Run "ms-settings:nightlight"
;*********** Ctl-Alt-Up : pin window on top ***************;
^!Up:: WinSetAlwaysOnTop -1, "A"
;*********** Ctl-Alt-b : hide/show taskbar ****************;
^!b:: {
static hide := 0
HideShowTaskbar(hide := !hide)
}
HideShowTaskbar(action) {
static ABM_SETSTATE := 0xA, ABS_AUTOHIDE := 0x1, ABS_ALWAYSONTOP := 0x2
APPBARDATA := Buffer(size := 2*A_PtrSize + 2*4 + 16 + A_PtrSize, 0)
NumPut("UInt", size, APPBARDATA), NumPut("Ptr", WinExist("ahk_class Shell_TrayWnd"), APPBARDATA, A_PtrSize)
NumPut("UInt", action ? ABS_AUTOHIDE : ABS_ALWAYSONTOP, APPBARDATA, size - A_PtrSize)
DllCall("Shell32\SHAppBarMessage", "UInt", ABM_SETSTATE, "Ptr", APPBARDATA)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment