Stay Awake
Stay Awake is a utility tool for Windows designed to keep a computer awake without having to manage its power & sleep settings.
Source
stay-awake (GitHub)
Download (precompiled executable)
Examples
Features
- Off (Passive) - The computer awakeness state is unaffected. The application is waiting for user input.
- Keep awake indefinitely - The computer stays awake indefinitely, until the user explicitly puts the machine to sleep or exits/disables the application.
- Keep awake temporarily - Keep machine awake for a pre-defined limited time. Once the time elapses, computer resumes its previous awakeness state.
- Keep screen on - While Awake can keep the computer awake indefinitely or temporarily, in its default state the displays connected to the machine will turn off, even though the computer won't go to sleep. If you need the displays to be available, use the Keep screen on switch, which will ensure that all monitors remain on.
- System tray - manage the execution of the tool from the system tray, right-click on the tray-icon.
- Settings Gui - manage the awakeness state of the computer.
Test environment
Contributing
- thanks to AutoHotkey Community
Inspired by
- Awake utility from PowerToys
Questions / Bugs / Issues
If you notice any kind of bugs or issues, report them here. Same for any kind of questions.
Copyright and License
Stay Awake
Stay Awake
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
Re: Stay Awake
Todo
- Fix bugs
- Optimize code
- Whatever
Changelog
- Fix bugs
- Optimize code
- Whatever
Changelog
Code: Select all
2021-11-16 Added a kind of dark mode
2021-11-16 Changed run-loop from 30 to 60 seconds
2021-10-22 Changed SetTimer / Changed Gui / Cleanup Code
2021-10-21 Initial
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
Re: Stay Awake
Love your work as always! very neat
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
Re: Stay Awake
Clean code
One tip that is maybe interesting:
There is a simple alternative way to create colored rectangles in the gui: You can use empty text controls with a background color.
This requires less code.
Can be replaced by:
You could also use this trick to replace the GroupBox. The advantage is that the coordinates are a little bit easier to predict and you can set any color.
Of course the DllCall is also quite interesting, as you can do a lot of other things with it.
One tip that is maybe interesting:
There is a simple alternative way to create colored rectangles in the gui: You can use empty text controls with a background color.
This requires less code.
Code: Select all
hFBFBFB := DllCall("gdi32\CreateBitmap", "int", 1, "int", 1, "uint", 0x1, "uint", 32, "int64*", 0xfbfbfb, "ptr")
Main.AddPicture("xs+1 ys+9 w350 h50 BackgroundTrans", "HBITMAP:*" hFBFBFB)
Code: Select all
Main.AddText("xs+1 ys+9 w350 h50 Background0xfbfbfb")
Of course the DllCall is also quite interesting, as you can do a lot of other things with it.
Re: Stay Awake
@joedf
thank you
@AHK_user
thank you
I know. I could also use Progressbars to archiv this or gdip, but I have consciously decided to use a Bitmap.
I also removed GroupBox now and used a 2nd Bitmap layer to get the grey border.
thank you
@AHK_user
thank you
I know. I could also use Progressbars to archiv this or gdip, but I have consciously decided to use a Bitmap.
I also removed GroupBox now and used a 2nd Bitmap layer to get the grey border.
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
Re: Stay Awake
Changes:
- Added a kind of dark mode (feel free to test it and suggestions for better colors)
- Changed run-loop from 30 to 60 seconds (windows 10/11 minimum power saving mode)
- Added a kind of dark mode (feel free to test it and suggestions for better colors)
- Changed run-loop from 30 to 60 seconds (windows 10/11 minimum power saving mode)
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
-
- Posts: 2
- Joined: 13 Jun 2022, 09:33
Re: Stay Awake
I installed this today and noticed that it does not keep Microsoft Teams from showing away. Would it be possible to incorporate this function?
Re: Stay Awake
This tool is designed to keep a computer awake. Not an application.
But you will surely find something about your problem here in the forum.
Alternatively, you can also ask this in the Ask to Help section (viewforum.php?f=76)
But you will surely find something about your problem here in the forum.
Alternatively, you can also ask this in the Ask to Help section (viewforum.php?f=76)
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
Return to “Scripts and Functions (v2)”
Who is online
Users browsing this forum: someguyinKC and 28 guests