<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Alunduil&#039;s Hosting &#187; dbus</title>
	<atom:link href="http://www.alunduil.com/tag/dbus/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.alunduil.com</link>
	<description>Gentoo Hackery and Other Fun ...</description>
	<lastBuildDate>Sun, 01 May 2011 22:00:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>&#8220;Disabling&#8221; KScreenSaver via DBUS</title>
		<link>http://www.alunduil.com/2009/07/22/disabling-kscreensaver-via-dbus/</link>
		<comments>http://www.alunduil.com/2009/07/22/disabling-kscreensaver-via-dbus/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 05:36:32 +0000</pubDate>
		<dc:creator>Alex Brandt</dc:creator>
				<category><![CDATA[Linux Guides]]></category>
		<category><![CDATA[dbus]]></category>
		<category><![CDATA[kde]]></category>
		<category><![CDATA[kde 4]]></category>
		<category><![CDATA[kscreensaver]]></category>
		<category><![CDATA[powerdevil]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[stop screensaver]]></category>
		<category><![CDATA[stop_kscreensaver]]></category>

		<guid isPermaLink="false">http://www.alunduil.com/?p=59</guid>
		<description><![CDATA[KDE 4 has some major improvements over older versions, but it also seems to have gone backwards in places. The new libraries probably contribute to this and are absolutely the way to go. A nice ability that I&#8217;ve been looking for in powerdevil (the new power manager in KDE 4) is how to have the <a href='http://www.alunduil.com/2009/07/22/disabling-kscreensaver-via-dbus/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>KDE 4 has some major improvements over older versions, but it also seems to have gone backwards in places.  The new libraries probably contribute to this and are absolutely the way to go.  A nice ability that I&#8217;ve been looking for in powerdevil (the new power manager in KDE 4) is how to have the screensaver &#8220;disable&#8221; when entering presentation mode.  This is behavior that I know I expected but found to my dismay partway through a presentation that the screensaver still kicked in.</p>
<p>After looking around for ways to &#8220;fix&#8221; this problem, I finally found some interesting information in the form of the DBUS interface provided by the screensaver in KDE.  Using qdbusviewer I was able to find an API for the screensaver that can be invoked at any point and from anywhere (assuming that you&#8217;re part of the session).  Using this new ammunition for more Google searching, I found that I could write a daemon in python that would keep the screensaver from displaying while it was turned on.</p>
<p>The result of this work can be found in my subversion repository as [stop_kscreensaver.py](http://www.alunduil.com/svn/stop_kscreensaver/trunk/stop_kscreensaver.py).  This script only has 3 parameters and is very easy to use.  When starting the daemon you simply pass a time between activity simulations (by setting this just shorter than the timeout for your screensaver activation it is much more efficient) and if desired a different log level.  To stop the daemon you simply pass the kill parameter which reads the PID from a standard file and makes sure the daemon dies.</p>
<p>The timing parameter for this script is fairly functional in that you can pass the time in with various units and the conversion will be taken into account.  For example, one could pass a time of 2h32.1m94.34s.  Why anyone would is beyond me, but I figured with regular expressions it might be easy to do.  If no units are passed the script assumes that the number passed was in seconds.  As always if any bugs are found please e-mail me, [Alex Brandt](mailto:alunduil@alunduil.com) with a description of the problem (or if you&#8217;re ambitious a patch file would be appreciated).</p>
<p>Now the important part.  How do we get this to work with powerdevil?  That&#8217;s the easiest part of all with powerdevil&#8217;s execute this script when switching to this profile feature.  We simply save the script somewhere, make it executable (chmod 755), and then set the path (or browse to it) in the powerdevil configuration interface.</p>
<p>Once that is in place you can switch to the profile you set the daemon up to start in and the screensaver although active will not start up until you switch profiles again.  This lets you watch that movie you wanted to just like our favorite comic [XKCD](http://xkcd.com/196/) tells us about.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alunduil.com/2009/07/22/disabling-kscreensaver-via-dbus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&quot;Disabling&quot; KScreenSaver via DBUS</title>
		<link>http://www.alunduil.com/2009/07/22/disabling-kscreensaver-via-dbus-2/</link>
		<comments>http://www.alunduil.com/2009/07/22/disabling-kscreensaver-via-dbus-2/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 05:36:32 +0000</pubDate>
		<dc:creator>Alex Brandt</dc:creator>
				<category><![CDATA[Linux Guides]]></category>
		<category><![CDATA[dbus]]></category>
		<category><![CDATA[kde]]></category>
		<category><![CDATA[kde 4]]></category>
		<category><![CDATA[kscreensaver]]></category>
		<category><![CDATA[powerdevil]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[stop screensaver]]></category>
		<category><![CDATA[stop_kscreensaver]]></category>

		<guid isPermaLink="false">http://www.alunduil.com/?p=59</guid>
		<description><![CDATA[KDE 4 has some major improvements over older versions, but it also seems to have gone backwards in places. The new libraries probably contribute to this and are absolutely the way to go. A nice ability that I&#8217;ve been looking for in powerdevil (the new power manager in KDE 4) is how to have the <a href='http://www.alunduil.com/2009/07/22/disabling-kscreensaver-via-dbus-2/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>KDE 4 has some major improvements over older versions, but it also seems to have gone backwards in places.  The new libraries probably contribute to this and are absolutely the way to go.  A nice ability that I&#8217;ve been looking for in powerdevil (the new power manager in KDE 4) is how to have the screensaver &#8220;disable&#8221; when entering presentation mode.  This is behavior that I know I expected but found, to my dismay, partway through a presentation that the screensaver still kicked in.</p>
<p>After looking around for ways to &#8220;fix&#8221; this problem, I finally found some interesting information in the form of the DBUS interface provided by the screensaver in KDE.  Using qdbusviewer I was able to find an API for the screensaver that can be invoked at any point and from anywhere (assuming that you&#8217;re part of the session).  Using this new ammunition for more Google searching, I found that I could write a daemon in python that would keep the screensaver from displaying while it was turned on.</p>
<p>The result of this work can be found in my subversion repository as <a href="http://www.alunduil.com/svn/stop_kscreensaver/trunk/stop_kscreensaver.py">stop_kscreensaver.py</a>.  This script only has 3 parameters and is very easy to use.  When starting the daemon you simply pass a time between activity simulations (by setting this just shorter than the timeout for your screensaver activation it is much more efficient) and if desired a different log level.  To stop the daemon you simply pass the kill parameter which reads the PID from a standard file and makes sure the daemon dies.</p>
<p>The timing parameter for this script is fairly functional in that you can pass the time in with various units and the conversion will be taken into account.  For example, one could pass a time of 2h32.1m94.34s.  Why anyone would is beyond me, but hey I figured with regular expressions it might be easy to do.  If no units are passed the script assumes that the number passed was in seconds.  As always if any bugs are found please e-mail me, [Alex Brandt](mailto:alunduil@alunduil.com) with a description of the problem (or if you&#8217;re ambitious a patch file would be appreciated).</p>
<p>Now the important part.  How do we get this to work with powerdevil?  That&#8217;s the easiest part of all with powerdevil&#8217;s execute this script when switching to this profile feature.  We simply save the script somewhere, make it executable (chmod 755), and then set the path (or browse to it) in the powerdevil configuration interface.</p>
<p>Once that is in place you can switch to the profile you set the daemon up to start in and the screensaver although active will not start up until you switch profiles again.  This lets you watch that movie you wanted to just like our favorite comic <a href="http://xkcd.com/196/">XKCD</a> tells us about.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alunduil.com/2009/07/22/disabling-kscreensaver-via-dbus-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached (User agent is rejected)
Database Caching 4/7 queries in 0.008 seconds using memcached
Object Caching 308/310 objects using memcached

Served from: www.alunduil.com @ 2012-02-06 09:10:56 -->
