<?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>ChiaoCheng.com &#187; Linux</title>
	<atom:link href="http://www.chiaocheng.com/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.chiaocheng.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Fri, 04 Jun 2010 23:20:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Linux remote screen lock</title>
		<link>http://www.chiaocheng.com/2009/12/linux-remote-screen-lock/</link>
		<comments>http://www.chiaocheng.com/2009/12/linux-remote-screen-lock/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 02:45:03 +0000</pubDate>
		<dc:creator>chiao</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[lock]]></category>
		<category><![CDATA[remote]]></category>
		<category><![CDATA[screen saver]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[x11]]></category>

		<guid isPermaLink="false">http://www.chiaocheng.com/?p=274</guid>
		<description><![CDATA[You can activate your linux screen saver or screen lock by running this command:
gnome-screensaver-command --lock
or
xlock
But if you ssh into your linux machine to activate the screen lock or screen saver, you might run into this error:
** Message: Failed to connect to the D-BUS daemon: dbus-launch failed to
autolaunch D-Bus session: Autolaunch error: X11 initialization failed.
or
No protocol [...]]]></description>
			<content:encoded><![CDATA[<p>You can activate your linux screen saver or screen lock by running this command:
<pre class="brush:shell; gutter:false">gnome-screensaver-command --lock</pre>
<p>or
<pre class="brush:shell; gutter:false">xlock</pre>
<p>But if you ssh into your linux machine to activate the screen lock or screen saver, you might run into this error:</p>
<pre>** Message: Failed to connect to the D-BUS daemon: dbus-launch failed to
autolaunch D-Bus session: Autolaunch error: X11 initialization failed.</pre>
<p>or</p>
<pre>No protocol specified
xscreensaver: Can't open display: :0.0</pre>
<p>You have to set the DBUS_SESSION_BUS_ADDRESS environment variable in order the command to work.  You can find the current running DBUS address by first getting the process id of the running screen saver.  Then grepping for the address in the environ file.  The following script will lock your linux terminal:
<pre class="brush:shell">#!/bin/sh

PID=`pgrep -u $USER -f &quot;gnome-screensaver&quot;`
DBUS_SESSION_BUS_ADDRESS=`grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ`
DBUS_SESSION_BUS_ADDRESS=`echo $DBUS_SESSION_BUS_ADDRESS | sed -e 's/DBUS_SESSION_BUS_ADDRESS=//'`
export DBUS_SESSION_BUS_ADDRESS

gnome-screensaver-command --lock</pre>
<p>Holy remote locking Batman!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chiaocheng.com/2009/12/linux-remote-screen-lock/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
