<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: KDE4 Save Current Session - DBUS to the Rescue</title>
	<atom:link href="http://raetsel.wordpress.com/2008/04/25/kde4-save-current-session-dbus-to-the-rescue/feed/" rel="self" type="application/rss+xml" />
	<link>http://raetsel.wordpress.com/2008/04/25/kde4-save-current-session-dbus-to-the-rescue/</link>
	<description>Open source chicanery and the battle with my inner geek</description>
	<pubDate>Wed, 23 Jul 2008 21:43:43 +0000</pubDate>
	<generator>http://wordpress.org/?v=MU</generator>
		<item>
		<title>By: raetsel</title>
		<link>http://raetsel.wordpress.com/2008/04/25/kde4-save-current-session-dbus-to-the-rescue/#comment-2347</link>
		<dc:creator>raetsel</dc:creator>
		<pubDate>Tue, 13 May 2008 15:24:28 +0000</pubDate>
		<guid isPermaLink="false">http://raetsel.wordpress.com/?p=61#comment-2347</guid>
		<description>Hi Edney,

I haven't really done anything with passing parameters to dbus-send etc. but a couple of things spring to mind.

Firstly would using the system bus work rather than the session bus :-

&lt;code&gt;dbus-send --system --type etc etc.&lt;/code&gt;

Or failing that can you find out the name of the user logged in and use the su -c command as root to send the info as that user? (Not ideal but might work):-

&lt;code&gt;LOGUSER=[ some code to work out the user ]
su - $LOGUSER -c dbus-send --system --type etc etc
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Hi Edney,</p>
<p>I haven&#8217;t really done anything with passing parameters to dbus-send etc. but a couple of things spring to mind.</p>
<p>Firstly would using the system bus work rather than the session bus :-</p>
<p><code>dbus-send --system --type etc etc.</code></p>
<p>Or failing that can you find out the name of the user logged in and use the su -c command as root to send the info as that user? (Not ideal but might work):-</p>
<p><code>LOGUSER=[ some code to work out the user ]<br />
su - $LOGUSER -c dbus-send &#8211;system &#8211;type etc etc<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Edney</title>
		<link>http://raetsel.wordpress.com/2008/04/25/kde4-save-current-session-dbus-to-the-rescue/#comment-2346</link>
		<dc:creator>Edney</dc:creator>
		<pubDate>Tue, 13 May 2008 02:58:03 +0000</pubDate>
		<guid isPermaLink="false">http://raetsel.wordpress.com/?p=61#comment-2346</guid>
		<description>Hi!

Nice article! I'm trying to grow from it to custom my acpi power button event to ask user to shutdown when button pressed. But I can't handle the fact that root can't send message to other users.I'm using

#usr/bin/dbus-send --session --type=method_call --dest=org.kde.ksmserver /KSMServer org.kde.KSMServerInterface.logout int32:1 int32:2 int32:0

this works fine when called from the user logged in, but not from root.

Do you know how to handle this situation?

Thanks.</description>
		<content:encoded><![CDATA[<p>Hi!</p>
<p>Nice article! I&#8217;m trying to grow from it to custom my acpi power button event to ask user to shutdown when button pressed. But I can&#8217;t handle the fact that root can&#8217;t send message to other users.I&#8217;m using</p>
<p>#usr/bin/dbus-send &#8211;session &#8211;type=method_call &#8211;dest=org.kde.ksmserver /KSMServer org.kde.KSMServerInterface.logout int32:1 int32:2 int32:0</p>
<p>this works fine when called from the user logged in, but not from root.</p>
<p>Do you know how to handle this situation?</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: raetsel</title>
		<link>http://raetsel.wordpress.com/2008/04/25/kde4-save-current-session-dbus-to-the-rescue/#comment-2345</link>
		<dc:creator>raetsel</dc:creator>
		<pubDate>Sat, 10 May 2008 11:12:41 +0000</pubDate>
		<guid isPermaLink="false">http://raetsel.wordpress.com/?p=61#comment-2345</guid>
		<description>Oh and please note that the command line options all need double dashes before them i.e. - - , wordpress is mangling these to show a single long dash &lt;code&gt;--&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Oh and please note that the command line options all need double dashes before them i.e. - - , wordpress is mangling these to show a single long dash <code>--</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: raetsel</title>
		<link>http://raetsel.wordpress.com/2008/04/25/kde4-save-current-session-dbus-to-the-rescue/#comment-2344</link>
		<dc:creator>raetsel</dc:creator>
		<pubDate>Sat, 10 May 2008 11:08:09 +0000</pubDate>
		<guid isPermaLink="false">http://raetsel.wordpress.com/?p=61#comment-2344</guid>
		<description>Hi Resu,

I managed to get a desktop shortcut to work. I created it with the following executable command:-

/usr/bin/dbus-send --print-reply --session --dest=org.kde.ksmserver /KSMServer org.kde.KSMServerInterface.saveCurrentSession &#62;/tmp/session.out 2&#62;&#38;1

Not that when this is clicked it creates  a file call /tmp/session.out that you can look at to see the output of the command. Also I have added the --print-reply option which will show the response from the dbus server. Which should be something like:-

method return sender=:1.6 -&#62; dest=:1.49 reply_serial=2</description>
		<content:encoded><![CDATA[<p>Hi Resu,</p>
<p>I managed to get a desktop shortcut to work. I created it with the following executable command:-</p>
<p>/usr/bin/dbus-send &#8211;print-reply &#8211;session &#8211;dest=org.kde.ksmserver /KSMServer org.kde.KSMServerInterface.saveCurrentSession &gt;/tmp/session.out 2&gt;&amp;1</p>
<p>Not that when this is clicked it creates  a file call /tmp/session.out that you can look at to see the output of the command. Also I have added the &#8211;print-reply option which will show the response from the dbus server. Which should be something like:-</p>
<p>method return sender=:1.6 -&gt; dest=:1.49 reply_serial=2</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: resu</title>
		<link>http://raetsel.wordpress.com/2008/04/25/kde4-save-current-session-dbus-to-the-rescue/#comment-2340</link>
		<dc:creator>resu</dc:creator>
		<pubDate>Fri, 09 May 2008 13:21:55 +0000</pubDate>
		<guid isPermaLink="false">http://raetsel.wordpress.com/?p=61#comment-2340</guid>
		<description>Hi, Reatsel!

Thank you for your useful suggestion on using dbus-send. In my case (Kubuntu 8.04, KDE4) however it didn't work. I checked with kdbus and found the command line that worked:

dbus-send &lt;b&gt;--session&lt;b&gt; &lt;b&gt;--&lt;b&gt;dest=org.kde.ksmserver /KSMServer org.kde.KSMServerInterface.saveCurrentSession

This allowed me to save the session I needed, though this session included &lt;b&gt;terminal&lt;b&gt; I used to run the commanу itself. When I tried to use 'run command' on KDE desktop it didn't work.

Is there a workaround?

Thanks and regards</description>
		<content:encoded><![CDATA[<p>Hi, Reatsel!</p>
<p>Thank you for your useful suggestion on using dbus-send. In my case (Kubuntu 8.04, KDE4) however it didn&#8217;t work. I checked with kdbus and found the command line that worked:</p>
<p>dbus-send <b>&#8211;session</b><b> </b><b>&#8211;</b><b>dest=org.kde.ksmserver /KSMServer org.kde.KSMServerInterface.saveCurrentSession</p>
<p>This allowed me to save the session I needed, though this session included </b><b>terminal</b><b> I used to run the commanу itself. When I tried to use &#8216;run command&#8217; on KDE desktop it didn&#8217;t work.</p>
<p>Is there a workaround?</p>
<p>Thanks and regards</b></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: raetsel</title>
		<link>http://raetsel.wordpress.com/2008/04/25/kde4-save-current-session-dbus-to-the-rescue/#comment-2318</link>
		<dc:creator>raetsel</dc:creator>
		<pubDate>Sat, 26 Apr 2008 15:14:23 +0000</pubDate>
		<guid isPermaLink="false">http://raetsel.wordpress.com/?p=61#comment-2318</guid>
		<description>Hi Pete,

I haven't seen that issue with the 3.5 builds, certainly Hardy Heron 3.5.9 has a save session button on the kicker as long as you have "Restore Manually Saved" session switched on in the Session Manager.

However in KDE 3.5 the dcop equivalent is:-

dcop ksmserver default saveCurrentSession</description>
		<content:encoded><![CDATA[<p>Hi Pete,</p>
<p>I haven&#8217;t seen that issue with the 3.5 builds, certainly Hardy Heron 3.5.9 has a save session button on the kicker as long as you have &#8220;Restore Manually Saved&#8221; session switched on in the Session Manager.</p>
<p>However in KDE 3.5 the dcop equivalent is:-</p>
<p>dcop ksmserver default saveCurrentSession</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Lewis</title>
		<link>http://raetsel.wordpress.com/2008/04/25/kde4-save-current-session-dbus-to-the-rescue/#comment-2317</link>
		<dc:creator>Peter Lewis</dc:creator>
		<pubDate>Fri, 25 Apr 2008 23:36:30 +0000</pubDate>
		<guid isPermaLink="false">http://raetsel.wordpress.com/?p=61#comment-2317</guid>
		<description>Thanks Simon. I'd noticed that "save current session" had either dissapeared or moved to somewhere beyond my knowledge in recent KDE 3s in Kubuntu. Thanks for the tip on doing this in 4! (Building today's KDE 4 SVN as we speak...)</description>
		<content:encoded><![CDATA[<p>Thanks Simon. I&#8217;d noticed that &#8220;save current session&#8221; had either dissapeared or moved to somewhere beyond my knowledge in recent KDE 3s in Kubuntu. Thanks for the tip on doing this in 4! (Building today&#8217;s KDE 4 SVN as we speak&#8230 <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
</channel>
</rss>
