summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorDaniel Napora <napcok@gmail.com>2013-11-05 22:12:54 +0100
committerDaniel Napora <napcok@gmail.com>2013-11-05 22:12:54 +0100
commitc8021221f25f4dd2d82e69688294c114331549bd (patch)
tree48fcf525cc333c9adab3a4bacc4553e5d3a17638 /usr
parent4eee8a6f5791427441bc4024ee88932a4b90ccc0 (diff)
downloadmageiawelcome-c8021221f25f4dd2d82e69688294c114331549bd.tar
mageiawelcome-c8021221f25f4dd2d82e69688294c114331549bd.tar.gz
mageiawelcome-c8021221f25f4dd2d82e69688294c114331549bd.tar.bz2
mageiawelcome-c8021221f25f4dd2d82e69688294c114331549bd.tar.xz
mageiawelcome-c8021221f25f4dd2d82e69688294c114331549bd.zip
check if irc client is installed
Diffstat (limited to 'usr')
-rw-r--r--usr/share/mageiawelcome/helpers.py9
-rw-r--r--usr/share/mageiawelcome/mageiawelcome.py15
2 files changed, 16 insertions, 8 deletions
diff --git a/usr/share/mageiawelcome/helpers.py b/usr/share/mageiawelcome/helpers.py
index 1ad236b..3695c39 100644
--- a/usr/share/mageiawelcome/helpers.py
+++ b/usr/share/mageiawelcome/helpers.py
@@ -19,6 +19,15 @@ def get_desktop_name(x):
'03WindowMaker':'WindowMaker',
'09Fvwm2':'Fvwm2',
}.get(x,'Other')
+
+def get_irc_client():
+ if os.path.exists("/usr/bin/hexchat"): irc_client = "/usr/bin/hexchat &"
+ elif os.path.exists("/usr/bin/xchat-gnome"): irc_client = "/usr/bin/xchat-gnome &"
+ elif os.path.exists("/usr/bin/xchat"): irc_client = "/usr/bin/xchat &"
+ elif os.path.exists("/usr/bin/konversation"): irc_client = "/usr/bin/konversation &"
+ elif os.path.exists("/usr/bin/quassel"): irc_client = "/usr/bin/quassel &"
+ else: irc_client = "none"
+ return irc_client
def is_installed(name):
return os.WEXITSTATUS(os.system('rpm -q --quiet ' + name))
diff --git a/usr/share/mageiawelcome/mageiawelcome.py b/usr/share/mageiawelcome/mageiawelcome.py
index 3899859..374cd32 100644
--- a/usr/share/mageiawelcome/mageiawelcome.py
+++ b/usr/share/mageiawelcome/mageiawelcome.py
@@ -126,14 +126,13 @@ def main():
elif msg.startswith("http"):
os.system("xdg-open " + msg)
elif msg == "irc":
- if os.path.exists("/usr/bin/xchat-gnome"):
- os.system("/usr/bin/xchat-gnome &")
- elif os.path.exists("/usr/bin/xchat"):
- os.system("/usr/bin/xchat &")
- elif os.path.exists("/usr/bin/konversation"):
- os.system("/usr/bin/konversation &")
- elif os.path.exists("/usr/bin/quassel"):
- os.system("/usr/bin/quassel &")
+ irc_client = get_irc_client()
+ if irc_client == "none":
+ if desktop == "KDE":
+ subprocess.Popen("gurpmi konversation", shell=True)
+ else:
+ subprocess.Popen("gurpmi hexchat", shell=True)
+ else: os.system(irc_client)
elif msg.startswith("run"):
args = shlex.split(msg)
args.pop(0)