topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Sunday December 15, 2024, 3:27 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: IDEA: Batch command screensaver  (Read 13137 times)

Hirudin

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 543
    • View Profile
    • Donate to Member
IDEA: Batch command screensaver
« on: April 03, 2006, 12:43 AM »
Has anyone heard of a screensaver that is capible of launching a bunch of commands when it starts? I bet there's something like this out there, if anyone knows of any, please let me know. (Also, I'm going to start searching the net after I post this...)

I think a screensaver (that could be selected in "Display Properties > Screen Saver") that I could use to run a few programs every time the screensaver is activated would be very useful.

The commands/programs I would enable by default would be:
1. Run CCleaner (to clear cache, recycle bin, history, etc.)
2. Lock KeePass (I want my passwords available while I'm at the computer, not while I'm not)
3. Start a "pretty" screen saver (so that it's like a normal screensaver) or maybe start a random screensaver

A couple other ideas:
- Mute the system audio (like IdleMute)
- Kill/pause various programs (like Winamp Killer)
- Maybe turn on some kind of e-mail monitor
- Maybe send IM clients into "away" mode (though I assume most do this by default anyway)

Seems like some of the commands could be as simple as running a shortcut, others might require simulated keystrokes/mouse movements.

Other possible uses:
- Run defrag program
- Start virus scan
- Disable internet activity
« Last Edit: April 03, 2006, 12:55 AM by Hirudin »

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: IDEA: Batch command screensaver
« Reply #1 on: April 03, 2006, 05:18 AM »
I think the best way to do that isn't really with a screensaver. How about a script that lets you execute multiple commands after some time of idle time? It'd have the same effect, but would also allow you to use a different screensaver, or not use one at all.

Hirudin

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 543
    • View Profile
    • Donate to Member
Re: IDEA: Batch command screensaver
« Reply #2 on: April 03, 2006, 05:27 AM »
That would be OK, but it seems a little silly to have a program running just to check if the system has been idle when windows already does that. Also, this way, the screensaver batch program would start the actual "pretty" screensaver. If I saw the pretty screensaver running, I would know the screensaver batch program ran successfully.

I made myself a lil' batch program that I can launch using Maomi. Here it is:
D:\ProgNew\CCleaner\ccleaner.exe /auto
D:\ProgNew\NirCmd\nircmd.exe screensaver -d
start D:\ProgNew\KeePass\KeePass.exe D:\ProgNew\KeePass\Database.kdb
Note: it uses a little command line program called "nircmd" to start the screensaver.

brotherS

  • Master of Good Ideas
  • Honorary Member
  • Joined in 2005
  • **
  • Posts: 2,261
    • View Profile
    • Donate to Member
Re: IDEA: Batch command screensaver
« Reply #3 on: April 03, 2006, 05:56 AM »
That would be OK, but it seems a little silly to have a program running just to check if the system has been idle when windows already does that.
Not at all! :D

AutoHotkey is checking LOTS of things here all the time, it's very helpful.

You could use something like "If A_TimeIdlePhysical > 9000000" to do what you asked for, check http://www.autohotke...om/docs/Tutorial.htm and feel free to ask if you want to try it.

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: IDEA: Batch command screensaver
« Reply #4 on: April 03, 2006, 06:04 AM »
I can fully understand your point of view, Hirudin.
But there's one important thing here. Screensaver files are actually executable files with a different extension.
That means, you can create your script, rename the executable to .scr, and set it as your screensaver.
This way, no more other things waiting.

Hirudin

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 543
    • View Profile
    • Donate to Member
Re: IDEA: Batch command screensaver
« Reply #5 on: April 03, 2006, 07:41 AM »
Yeah, that's a good idea!
brotherS, I'll see if I can get an AHK script put together that does the couple things I want (doesn't seem like it should be too hard). Then do like you say, jgpaiva, and rename the exe to an scr.

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: IDEA: Batch command screensaver
« Reply #6 on: April 03, 2006, 07:59 AM »
Yeah, that's a good idea!
brotherS, I'll see if I can get an AHK script put together that does the couple things I want (doesn't seem like it should be too hard). Then do like you say, jgpaiva, and rename the exe to an scr.
:) Good to know!
If you'd like some help, feel free to send me an email, or come by the Irc channel! (https://www.donation...ndex.php?action=chat)

Hirudin

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 543
    • View Profile
    • Donate to Member
Re: IDEA: Batch command screensaver
« Reply #7 on: April 03, 2006, 09:28 AM »
Welp, I've been messing with this for a while now. I can create the exe easy enough with AHK, and renaming it to ahk.scr is fine, manually running the scr file works fine, but once I select it in the display properties it activates(?). I mean, I select it in the list and it starts... I never hit "OK" or "Apply" or "Preview." It has a mind of it's own.

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: IDEA: Batch command screensaver
« Reply #8 on: April 03, 2006, 10:51 AM »
I tried to do it, and i got the same behaviour.
But, nevertheless, it still acts correctlly, it is ran after the screensaver time.
I don't know why that happens, it might be windows confirming that it does exist.
So, my solution for that is:
See what is the ahk_id of that window, and put a ifwinactive clause in the beginning of the script, so that in case that window is active, it simply returns ;)

(to find out the ahkid of that window, check the autoitwinspy, which should be present in the folder of instalation of ahk)
Does that solve it?