Created
February 13, 2012 10:48
-
-
Save ssokolow/1815976 to your computer and use it in GitHub Desktop.
Fix-it script for Pidgin tray icon status under Lubuntu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| """Quick-fix script for Pidgin status tray icon in Lubuntu""" | |
| __appname__ = "Lubuntu Pidgin Tray Icon QuickFix" | |
| __author__ = "Stephan Sokolow (deitarion/SSokolow)" | |
| __version__ = "0.1" | |
| __license__ = "MIT" | |
| import os, re, sys | |
| ICON_RE = re.compile('user-(.+?)-panel.(svg|png)') | |
| def fix_pidgin_icons(src, tgt=None): | |
| src_base = os.path.join(src, 'panel') | |
| tgt_base = os.path.join(tgt or src, 'status') | |
| for size in os.listdir(src_base): | |
| src_size_base = os.path.join(src_base, size) | |
| tgt_size_base = os.path.join(tgt_base, size) | |
| for icon in os.listdir(src_size_base): | |
| if ICON_RE.match(icon): | |
| src_path = os.path.join(src_size_base, icon) | |
| tgt_path = os.path.join(tgt_size_base, ICON_RE.sub(r'pidgin-tray-\1.\2', icon)) | |
| src_path_rel = os.path.relpath(src_path, os.path.dirname(tgt_path)) | |
| dest_dir = os.path.dirname(tgt_path) | |
| if not os.path.exists(dest_dir): | |
| os.makedirs(dest_dir) | |
| if os.path.isfile(tgt_path) or os.path.islink(tgt_path): | |
| os.remove(tgt_path) | |
| print "Symlinking: %s -> %s" % (src_path_rel, tgt_path) | |
| os.symlink(src_path_rel, tgt_path) | |
| if __name__ == '__main__': | |
| if os.geteuid() != 0: | |
| print "Re-calling self via sudo..." | |
| os.execvp('sudo', ['sudo'] + sys.argv) | |
| fix_pidgin_icons('/usr/share/icons/elementary-mono-dark') | |
| fix_pidgin_icons('/usr/share/icons/elementary') | |
| print "\nIf you still experience problems, try re-running this script after running this command:" | |
| print "\n\tsudo rm /usr/share/icons/elementary/status/*/pidgin-tray-*.*" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It is out of date. For Trusty(14.04) i think