Fix issue if display is not end with .x
authorHuang Peng <shawn.p.huang@gmail.com>
Fri, 4 Jul 2008 03:08:27 +0000 (11:08 +0800)
committerHuang Peng <shawn.p.huang@gmail.com>
Fri, 4 Jul 2008 03:08:27 +0000 (11:08 +0800)
ibus/common.py

index 58d3ef6..c3fd3d6 100644 (file)
@@ -37,7 +37,11 @@ import os
 import sys
 import getpass
 
-IBUS_ADDR = "unix:path=/tmp/ibus-%s/ibus-%s" % (getpass.getuser (), os.environ["DISPLAY"].replace (":", "-"))
+display = os.environ["DISPLAY"]
+if "." not in display:
+       display += ".0" 
+
+IBUS_ADDR = "unix:path=/tmp/ibus-%s/ibus-%s" % (getpass.getuser (), display.replace (":", "-"))
 # IBUS_ADDR  = "tcp:host=localhost,port=7799"
 
 IBUS_IFACE = "org.freedesktop.IBus"