Showing posts with label kde4. Show all posts
Showing posts with label kde4. Show all posts

Tuesday, 17 March 2009

Bilbo Blogger

Hmmm.. praps this new-fangled, KDE4 blogging app Bilbo Blogger is what I need to get me out of my blogging torpor. Seems to wrestle with links somewhat, but it's early days.

Build instructions here.

Thursday, 17 April 2008

simple qdbus tutorial (part two)

Following on from part one of my qdbus tutorial, we move on to look into what happens when we try to manipulate a D-Bus capable application that is already running in remote session. This is not as easy as one might imagine. It's certainly not difficult, but it did take me a little while and some help off the mailing lists to work out what I wanted to do.

For demonstration purposes, I shall be logged in remotely on my home machine via ssh. If I run qdbus as per the last tutorial it fails immediately.
cm@pablo:~> qdbus
Could not connect to D-Bus server: org.freedesktop.DBus.Error.Spawn.ExecFailed: dbus-launch failed to autolaunch D-Bus session: Autolaunch error: X11 initialization failed.
X11? WTF? This may initially seem that qdbus is dependent on an accessible X session. Indeed, if I were to log out, and login again using ssh -X this problem would go away. The big issue being that I would then be connecting to the bus on the local machine and not the remote one which I am trying to manipulate.

What's really happening here is that qdbus is looking for the all important shell variable DBUS_SESSION_BUS_ADDRESS which contains a unique address for each bus. Not finding this, it's running dbus-launch --autostart to try and determine the address by querying another X window. Of course it then fails if it is unable to connect to any X session.

The obvious way to get around this is to set this variable. But how do we determine the bus address that we need to connect to our running instance of a program? This is not difficult, but it's not the most obvious method. As far as I am aware, there is no other easy way to do this - perhaps in future versions this will become more trivial.

The first thing to do is determine the PID of the app that we are after (ktorrent as in the last example).
cm@pablo:~> ps -ef|grep -i ktorrent
cm 4685 1 1 08:50 ? 00:06:17 ktorrent
So, we can see that ktorrent has a PID of 4685. Now to determine the relevant bus address being used by this program (obviously replacing the example PID with the actual one).
cm@pablo:~> cat /proc/4685/environ
This will spew out a stack of environment variables, amongst them, with any luck, the one we are after: DBUS_SESSION_BUS_ADDRESS. What we want to do is export this shell variable, so it is available to our shell session and we in turn will be able to manipulate our app:
export DBUS_SESSION_BUS_ADDRESS="unix:abstract=/tmp/dbus-tIGLky9nbN,guid=49eaa775154aa8aa83ba330048070013"
The above will all be on one line of course (or properly escaped). Having done this, set your faces to stunned as now when you run qdbus, you are now seeing the apps on the correct bus:
cm@pablo:~> qdbus
:1.0
org.ktorrent.ktorrent
:1.2
org.kde.klauncher
:1.3
org.kde.kded
org.kde.kwalletd
:1.69
:1.70
org.freedesktop.DBus
And that's the end of my introduction to qdbus!

Saturday, 12 April 2008

Zenburn for Konsole Redux

One of my favorite kde apps is konsole. A while ago I discovered Zenburn which is just about the only sane colorscheme for terminal editing of any sort, and especially in vim. Then I discovered that some enterprising chap had knocked together Zenburn for konsole. Seventh heaven ensued. But lately, as I've been dabbling in kde4 I've been really missing Zenburn in the new version of konsole. So I give you Zenburn for Konsole Redux, shamelessly built on the hard work of others so that you don't have to spend half your evening fiddling about with annoying colorscheme settings just to get it right.

UPDATED: Thanks to Sterling Winter who pointed out in the comments that the link no longer works. So here it is inline, hopefully blogger will react sanely as it so often doesn't with any code examples etc. :)

[Background]
Bold=false
Color=63,63,63
Transparency=true

[BackgroundIntense]
Bold=false
Color=63,63,63
Transparency=true

[Color0]
Bold=false
Color=63,63,63
Transparency=false

[Color0Intense]
Bold=false
Color=112,144,128
Transparency=false

[Color1]
Bold=false
Color=112,80,80
Transparency=false

[Color1Intense]
Bold=false
Color=220,163,163
Transparency=false

[Color2]
Bold=false
Color=96,180,138
Transparency=false

[Color2Intense]
Bold=false
Color=195,191,159
Transparency=false

[Color3]
Bold=false
Color=223,175,143
Transparency=false

[Color3Intense]
Bold=false
Color=240,223,175
Transparency=false

[Color4]
Bold=false
Color=80,96,112
Transparency=false

[Color4Intense]
Bold=false
Color=148,192,243
Transparency=false

[Color5]
Bold=false
Color=220,140,195
Transparency=false

[Color5Intense]
Bold=false
Color=236,147,211
Transparency=false

[Color6]
Bold=false
Color=140,209,211
Transparency=false

[Color6Intense]
Bold=false
Color=147,225,227
Transparency=false

[Color7]
Bold=false
Color=220,220,204
Transparency=false

[Color7Intense]
Bold=false
Color=255,255,255
Transparency=false

[Foreground]
Bold=false
Color=220,220,204
Transparency=false

[ForegroundIntense]
Bold=true
Color=220,220,204
Transparency=false

[General]
Description=Zenburn
Opacity=1

Copy it into ~/.kde4/share/apps/konsole/Zenburn.colorscheme and select it in the Settings->Manage Profiles->Edit Profiles Appearance tab.