LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-11-2010, 05:46 AM   #1
Sound
LQ Newbie
 
Registered: Jan 2010
Posts: 3

Rep: Reputation: 0
Mouse action with a shell script


Hi,

I have security guidelines for my business OS which require me to active screensaver. Nevertheless, I dislike screensavers because I sometime read a while, but I do not want to go offline from my IM in the meantime.

Anyways, I am looking for a solution. So I though about writing a little shell script (connected with a cronjob), which just moves the mouse every 10 minutes or so. Unfortunately, I have no clue how to interact with the mouse in a shell script. So any clue would be appreciated.

And yes, I know it is a dirty hack, but it could work...
 
Old 01-11-2010, 06:23 AM   #2
devnull10
Member
 
Registered: Jan 2010
Location: Lancashire
Distribution: Slackware Stable
Posts: 572

Rep: Reputation: 120Reputation: 120
I assume you are using xscreensaver? How is it started? As far of your startup scripts or by something running as root? If the first you could just kill the pid! Even set it up to do it automatically from your .bash_login
 
Old 01-11-2010, 07:15 AM   #3
Sound
LQ Newbie
 
Registered: Jan 2010
Posts: 3

Original Poster
Rep: Reputation: 0
I want to stress that I do not want to kill the screensaver. There is a script running the whole time which checks if the screensaver is enabled - So killing the process will result in failing the security guidelines. This is not what I intend. So unfortunately your solution is not applicable for me.
 
Old 01-11-2010, 08:27 AM   #4
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Well if you "cheat" it for example by "moving the mouse" programmatically, you are effectively killing the screensaver (the result is the same: no screensaver, which I assume locks your screen). So if the screensaver/lock is enforced by somebody other than you, I don't think you should be messing around with it. Either move the mouse yourself, which means being at your computer, or let it lock the screen -- this is what is wanted, right? That you do not leave your computer unattended for longer periods of time?

I'm fairly sure your IM client can be configured to not go offline at all (unless you do it yourself), so you could start from that end. I just don't see what the problem is with your messaging app, because if you're not there, there is no point in keeping it "online" to watch for messages..you could just as well check them when you get back. I think most messaging apps today can store the messages even if you aren't running the program at all times, sort of like an answering machine.

If you insist on silently not obeying the rules, consider keyboard input as well as mouse input. An all-by-itself moving mouse cursor might be spooky, but what about a terminal that wrote some wicked (maybe random) sentence at intervals?
 
Old 01-11-2010, 10:02 AM   #5
Sound
LQ Newbie
 
Registered: Jan 2010
Posts: 3

Original Poster
Rep: Reputation: 0
Oh well, I completely forgot keyboard events. I was just into doing some mouse action, because normally I move the mouse to avoid the screensaver. I will do this, this should work out. And I know that my use case is not very common, but I am pretty sure what I want to do and why.

And just to clarify things: I am sitting in front of my laptop. But my work requires me to sometimes read a book or something similar, so I am not actually doing something. Nevertheless I want to be informed if someone writes me in my IM - which isn't the case if my screen is locked. I am aware of the fact that I could stay connected but this is useless if I do not see a new incoming message.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Two mouse buttons to trigger an action uni4dfx Linux - Newbie 2 06-25-2009 03:10 AM
mouse pointer moves up upon any mouse action in slackware 10.2 XavierKing Linux - General 2 07-20-2006 03:36 PM
Middle mouse button action TheJkWhoSaysNi Linux - Software 1 03-25-2005 08:38 PM
C executable or shell script run in mouse evnt sudhasmyle Programming 0 02-23-2005 06:37 AM
move mouse pointer from shell script malo_umoran Slackware 1 11-06-2004 08:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration