<< DiscussionsReply

Button or Keystroke to turn off monitors and lock computer

Avatar from Gravatar.com
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
Avatar from Gravatar.com
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
Avatar from Gravatar.com
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
Avatar from Gravatar.com
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

Jan 5, 2016  • #6
Avatar from Gravatar.com
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
Avatar from Gravatar.com
164 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()


Edit: Found the function.
Aug 18, 2017 (modified Aug 18, 2017)  • #9
Avatar from Gravatar.com
1 discussion post
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?
14 days ago  • #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?
10 days ago  • #11
Was this helpful?  (2)  
<< DiscussionsReply