openSUSE Forums > Programming/Scripting » qdbus screensaver inhibit

Go Back   openSUSE Forums > Programming/Scripting
Forums FAQ Members List Search Today's Posts Mark Forums Read


Programming/Scripting Questions about programming, bash scripts, perl, php, cron jobs, ruby, python, etc.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 27-May-2009, 15:47
Puzzled Penguin
 
Join Date: Jun 2008
Posts: 39
chriscrutch hasn't been rated much yet
Default qdbus screensaver inhibit

Let me preface this by saying I know very little about programming or scripting and have limited experience with the Linux command line.

Now that that's done... I have a program that I run through Wine that doesn't use very much keyboard or mouse input. Consequently, my screensaver likes to kick on in the middle of using the program, which is annoying. I don't want to have to disable the screensaver just to run this one program. I came across something via Google about using dbus to inhibit the screensaver. I can do this:

Code:
qdbus org.freedesktop.ScreenSaver /ScreenSaver org.freedesktop.ScreenSaver.Inhibit "$$" "Wine"
to inhibit the screensaver. This outputs a number, different every time. To cancel the inhibiting of the screensaver, I have to run a different command and pass that number as an argument, e.g.:

Code:
qdbus org.freedesktop.ScreenSaver /ScreenSaver org.freedesktop.ScreenSaver.UnInhibit 5822
I'd like to create an alias to run in a terminal so that I can inhibit the screensaver, run my program through Wine, and uninhibit the screensaver when I close Wine, all with one command. But since the cookie from the inhibit command changes every time its run, I don't know how to pass that number to the uninhibit command. There must be a way to do it with pipes or redirection, right?

I hope you understand what I'm getting at, and any ideas are appreciated. Thanks.

--chriscrutch
Reply With Quote
Reply

Bookmarks

Tags
dbus, screensaver, stdout


Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2