Showing posts with label kde. Show all posts
Showing posts with label kde. Show all posts

2009-05-29

Custom PATH in KDE run dialog

It has bothered me for a while that the KDE run dialog (Alt+F2) won't find my custom scripts in ~/bin. After a failed attempt, with ~/.kde/env/bin_path, I found a way that should (in theory) work with any desktop manager.

The solution is to put the export command in a file called ~/.xprofile

export PATH="/home/thomas/bin:${PATH}:/home/thomas/installs/bin"

(I keep all my user installed apps in ~/installs/bin ;))

2008-08-07

Dbus, knotify and pidgin

Threw together an ugly python script sendind pidgin notifications to knotify:

#!/usr/bin/env python

import re

html_tags = re.compile('<.*?>')

def my_func(account, sender, message, conversation, flags):
kn.event("receivedImMsg", "pidgin", [], '<b>' + sender + '</b>: ' + html_tags.sub('', message), [0,0,0,0], [], 0, dbus_interface="org.kde.KNotify")

import dbus, gobject
from dbus.mainloop.glib import DBusGMainLoop
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
bus = dbus.SessionBus()

kn = bus.get_object("org.kde.knotify", "/Notify")

bus.add_signal_receiver(my_func,
dbus_interface="im.pidgin.purple.PurpleInterface",
signal_name="ReceivedImMsg")

loop = gobject.MainLoop()
loop.run()

Combine with this file: $HOME/.kde/share/config/pidgin.notifyrc


[Event/receivedImMsg]
Action=Sound|Popup|Taskbar
Execute=
KTTS=
Logfile=
Sound=KDE-Im-Message-In.ogg

... and your're good to go ;)

Pidgin reference