<?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:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>briancarper.net (λ) (Tag: Xorg)</title><link>http://briancarper.net/tag/246/xorg</link><description>Some guy's blog about programming and Linux and cows.</description><item><title>X automation with xte</title><link>http://briancarper.net/blog/563/x-automation-with-xte</link><guid>http://briancarper.net/blog/563/x-automation-with-xte</guid><pubDate>Fri, 06 Aug 2010 13:03:01 -0700</pubDate><description>&lt;p&gt;I learned today (via a &lt;a href=&quot;http://hanschen.org/2009/10/13/mouse-shortcuts-with-xbindkeys/&quot;&gt;great blog post&lt;/a&gt;) about &lt;code&gt;xte&lt;/code&gt;.  This program lets you simulate X Windows mouse and keyboard events from the commandline.  How much more awesome can you get?  &lt;/p&gt;

&lt;p&gt;Hans illustrates how to integrate &lt;code&gt;xbindkeys&lt;/code&gt; and &lt;code&gt;xte&lt;/code&gt; to make KDE4 effects activate.  I wanted the KDE4 &quot;Desktop Grid&quot; to appear when I press a mouse button (because my &lt;a href=&quot;http://briancarper.net/blog/558/review-logitech-performance-mx&quot;&gt;new mouse&lt;/a&gt; has a lot of buttons to spare), so this is exactly what I was looking for.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;xte&lt;/code&gt; is the kind of glue that makes Linux awesome.  KDE lets you set global keyboard shortcuts for lots of things.  &lt;code&gt;xbindkeys&lt;/code&gt; lets you assign shell commands to mouse buttons.  And &lt;code&gt;xte&lt;/code&gt; ties the two together.  Possibly none of the programmers on these three tools knew about the others, but they interact perfectly to let you do anything you want.&lt;/p&gt;

&lt;p&gt;You may be thinking, &quot;&lt;em&gt;If you want to work with KDE from the commandline, why not use DBUS?&lt;/em&gt;&quot;  That's what I tried to do first.  But I can't for the life of me figure it out.  There's &lt;a href=&quot;http://osdir.com/ml/kde-devel/2010-04/msg00195.html&quot;&gt;some indication&lt;/a&gt; that we might be able to do this somday, like so:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;qdbus org.kde.kglobalaccel /component/kwin org.kde.kglobalaccel.Component.invokeShortcut ShowDesktopGrid
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Or maybe it's already in the latest version of KDE and I haven't upgraded yet.  Either way.&lt;/p&gt;

&lt;p&gt;By the way: could DBUS possibly have a more verbose or cryptic interface?  I was hunting through the available DBUS commands looking for something that would show the Desktop Grid, and I ended up having to scan through lists of crap like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;~ % qdbus org.kde.kwin /KWin                         
method Q_NOREPLY void org.kde.KWin.cascadeDesktop()
method void org.kde.KWin.circulateDesktopApplications()
method bool org.kde.KWin.compositingActive()
signal void org.kde.KWin.compositingToggled(bool active)
method int org.kde.KWin.currentDesktop()
method QList&amp;lt;int&amp;gt; org.kde.KWin.decorationSupportedColors()
method void org.kde.KWin.doNotManage(QString name)
method Q_NOREPLY void org.kde.KWin.killWindow()
method QStringList org.kde.KWin.listOfEffects()
method void org.kde.KWin.loadEffect(QString name)
method QStringList org.kde.KWin.loadedEffects()
method void org.kde.KWin.nextDesktop()
method void org.kde.KWin.previousDesktop()
method Q_NOREPLY void org.kde.KWin.reconfigure()
method void org.kde.KWin.reconfigureEffect(QString name)
method void org.kde.KWin.refresh()
signal void org.kde.KWin.reinitCompositing()
signal void org.kde.KWin.reloadConfig()
method bool org.kde.KWin.setCurrentDesktop(int desktop)
method void org.kde.KWin.showWindowMenuAt(qlonglong winId, int x, int y)
method Q_NOREPLY void org.kde.KWin.toggleCompositing()
method void org.kde.KWin.toggleEffect(QString name)
method Q_NOREPLY void org.kde.KWin.unclutterDesktop()
method void org.kde.KWin.unloadEffect(QString name)
method bool org.kde.KWin.waitForCompositingSetup()
method QDBusVariant org.freedesktop.DBus.Properties.Get(QString interface_name, QString property_name)
method QVariantMap org.freedesktop.DBus.Properties.GetAll(QString interface_name)
method void org.freedesktop.DBus.Properties.Set(QString interface_name, QString property_name, QDBusVariant value)
method QString org.freedesktop.DBus.Introspectable.Introspect()
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This is line noise to me.&lt;/p&gt;</description></item></channel></rss>

