Processing Ajax...

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

Confirm
Close Dialog

User Image
welsh rarebit
17 discussion posts
I have my screensaver and lock time at 20 minutes and my screens power off at 60 minutes. This works fine except when I want to get up to get a glass of water, or when I go to a meeting. I would like to create a button or a keystroke in DisplayFusion to do this when I want to get up for a couple minutes.

Is there any way I can set DisplayFusion to put the monitors to sleep and lock the computer instantly?

Thank you.

Windows 7, or Windows 10
Jan 1, 2016 (modified Jan 1, 2016)  • #1
User Image
Alan Russell
13 discussion posts
I don't know about DisplayFusion, but pressing the Windows key and L will lock the computer.
Jan 1, 2016  • #2
User Image
welsh rarebit
17 discussion posts
Thanks, but I mostly want the displays to go dark, save energy, and hide all my emails and documents from passersby. If I leave the computer for only a couple minutes, I just don't want my screens visible in case I start chatting at the printer, for example. If I plan to be gone for a while, like lunch or a meeting, I do want the computer to lock also, and I use win-L for that, but I am really looking for some way to turn off the screens without shortening the power settings, because then they power off while reading webpages or emails.

I need some button or keystroke to "power off the screens".

One to "lock computer and power off screens" would be nice too, especially if the first one doesn't work after I lock the computer.
Jan 2, 2016 (modified Jan 2, 2016)  • #3
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Nircmd can power off the monitors: http://www.nirsoft.net/utils/nircmd.html

So, you could create a Scripted Function that calls "nircmd.exe monitor off", then locks the desktop. I've attached a sample script. Here's how to set it up:
  • Download Nircmd and extract it to c:\nircmd (or somewhere else, and update the path in the script)
  • On the DisplayFusion Settings > Functions tab, click Add Scripted, and give the script a name and hotkey
  • Paste in the code from the attached text file
  • Click OK, and Apply
  • Test it out by pressing the hotkey you set in step 2

Hope that helps!
• Attachment: Monitor Off and Lock Desktop.txt [219 bytes]
Jan 4, 2016  • #4
User Image
welsh rarebit
17 discussion posts
That was really nice of you Keith, but the IT department said 'no' to nircmd. It took them two weeks to approve DF.

I was hoping you might have figured out the commands needed for 'monitor sleep' and had it in DF already.
Jan 5, 2016  • #5
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Ah ok, not at the moment unfortunately, but it is on our list. We'll be sure to post a follow-up if/when we're able to add it as a Function in DisplayFusion :)

Thanks!
Jan 5, 2016  • #6
User Image
J J
1 discussion post
I have been a user for over 5 years and find this an excellent product.
Thank you Keith! I used your script and it worked perfectly as you detail.
Please let this be another vote for this as an included Displayfusion function. ::)
Jan 20, 2016 (modified Jan 20, 2016)  • #7
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Will do, and thanks for the kind words!
Jan 21, 2016  • #8
User Image
UWK-87
165 discussion posts
Hi Keith,

Amazing software and the script worked like a charm. Just wondering if the function has been implemented as a built-in command?

+1 vote if it's still in the to-do list.


Never mind found the function BFS.General.SleepMonitors()

Thanks

Edit: Found the function.
Aug 18, 2017 (modified Aug 18, 2017)  • #9
User Image
Blackheat45
5 discussion posts
Hello Keith,
I'm trying to use your script and it seems to work once or twice. After that it seems to not want to work anymore until I restart Displayfusion. It'll make my monitors go black then they come right back on. Do you know of any fix for this or than restarting Displayfusion?
Apr 3, 2021  • #10
Keith Lammers (BFS)'s profile on WallpaperFusion.com
I'm not sure of any other way to fix that, no. DF just sends a "please go to sleep" message via the Windows API. After that we don't really have any control over it.

Restarting DisplayFusion immediately fixes it though?
Apr 6, 2021  • #11
User Image
Blackheat45
5 discussion posts
Yes if I restart DisplayFusion I'm able to put my monitors to sleep with your script. It works once and sometimes twice then after that I have to restart it again. Sorry for the very late reply I've been really busy :( Edit - even after reinstalling Windows I have this issue
May 1, 2021 (modified May 1, 2021)  • #12
Keith Lammers (BFS)'s profile on WallpaperFusion.com
When it stops working, does it do nothing at all? Or do the monitors sleep, then immediately wake back up?
May 4, 2021  • #13
User Image
Blackheat45
5 discussion posts
Goes to sleep and immediately wakes back up
May 5, 2021  • #14
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Could you run this at an elevated command prompt and attach a screenshot of the output?

powercfg /requests


When mine does this, it's usually because some application or driver is requesting the machine to stay awake.
May 5, 2021  • #15
User Image
Blackheat45
5 discussion posts
If I run the script manually from Functions it works just fine. I was trying to get the keybind it even do the sleep then wake back up but it didn't work at all. My other keybinds work though - mute, turn up and down volume for application. This is without restarting DF. Edit just restarted DF and it did the quick sleep and come back. Second Edit- I do not understand lol. So I went to try the keybind and it didn't work. I went to just look at the scripts then when I was done tried the keybind again which it put the monitors to sleep. Then I woke them back up browsed on Brave browser tried it again it did the quick sleep. Minimized the browser and it allowed them to fully sleep. Woke them up and click on the browser again and it still worked. So I have no idea why this time it's working over and over when just seconds ago it wasn't. Not sure if this will keep working. I'll report back in a few hours and see if it's still working. So confusing. Third edit - So it doesn't have to do with the browser I believe. The sleep wake up would happen even with it closed. If I manually minimize the browser DF would put my monitors to sleep. I close Brave and it doesn't work. I manually minimize anything not via the task bar but with the top right of the window and it will put them to sleep.
• Attachment [protected]: Untitled.png [19,479 bytes]
May 5, 2021 (modified May 5, 2021)  • #16
Keith Lammers (BFS)'s profile on WallpaperFusion.com
What happens if you put the computer to sleep via the start menu? Does it do the quick sleep/wake?
May 6, 2021  • #17
User Image
Blackheat45
5 discussion posts
Yes full sleep works just fine. I just don't understand it's working when it wants too. At first I thought it would only work if my browser was open but I closed it and it worked. Other times it will not work and I have to open it again, and it seems to work. I honestly can't find a good enough pattern to figure out why it's not just working all the time.
May 6, 2021  • #18
Keith Lammers (BFS)'s profile on WallpaperFusion.com
If you exit DisplayFusion and use NirCmd to power off the monitors, does it work?

The command should be something like
nircmd.exe monitor off
I believe.
May 7, 2021  • #19
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(2)  Login to Vote(-)