Skip to content

Instantly share code, notes, and snippets.

@son-link
Created March 4, 2013 20:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save son-link/5085112 to your computer and use it in GitHub Desktop.
Save son-link/5085112 to your computer and use it in GitHub Desktop.
patch for testings
*** cdtray.py 2013-03-04 20:56:23.469254814 +0100
--- cdtray_patch.py 2013-03-04 20:56:13.069311883 +0100
***************
*** 11,17 ****
import gst
import ConfigParser
! from os import environ, getcwd, walk
from os.path import isfile, join
from commands import getoutput
from ctypes import CDLL
--- 11,17 ----
import gst
import ConfigParser
! from os import environ, walk
from os.path import isfile, join
from commands import getoutput
from ctypes import CDLL
***************
*** 20,26 ****
configfile = environ['HOME']+'/.cdtray'
! t = gettext.translation('cdtray', 'lang')
_ = t.ugettext
class CDTRAY():
--- 20,26 ----
configfile = environ['HOME']+'/.cdtray'
! t = gettext.translation('cdtray', '/usr/share/locale')
_ = t.ugettext
class CDTRAY():
***************
*** 42,48 ****
self.statusicon = gtk.StatusIcon()
! self.statusicon.set_from_file('cdtray.svg')
self.statusicon.connect("popup-menu", self.show_menu)
self.statusicon.connect('activate', self.play)
--- 42,48 ----
self.statusicon = gtk.StatusIcon()
! self.statusicon.set_from_icon_name('cdtray')
self.statusicon.connect("popup-menu", self.show_menu)
self.statusicon.connect('activate', self.play)
***************
*** 223,230 ****
# Send notify
if self.shownotify == 1:
pynotify.init('CD Tray')
! img = '%s/cdtray.svg' % getcwd()
! notify = pynotify.Notification('CD Tray', _('Playing track %s') % self.actual_track, img)
notify.show()
def update_jt_menu(self):
--- 223,229 ----
# Send notify
if self.shownotify == 1:
pynotify.init('CD Tray')
! notify = pynotify.Notification('CD Tray', _('Playing track %s') % self.actual_track, '/usr/share/icons/cdtray.svg')
notify.show()
def update_jt_menu(self):
***************
*** 390,399 ****
info = gtk.AboutDialog()
info.set_name('CD Tray')
! logo = gtk.gdk.pixbuf_new_from_file('cdtray.svg')
! info.set_logo(logo)
info.set_version('1.0.0')
! f = open('COPYING', 'r')
info.set_license(f.read())
f.close()
info.set_comments(_('Special Thanks:\nTo the Desdelinux users for supporting me with their ideas\nTo Desdelinux\'s user proper for helping me with the name of the program\nAnd for all of you for downloading and using this program'))
--- 389,397 ----
info = gtk.AboutDialog()
info.set_name('CD Tray')
! info.set_logo_icon_name('cdtray')
info.set_version('1.0.0')
! f = open('/usr/share/cdtray/COPYING', 'r')
info.set_license(f.read())
f.close()
info.set_comments(_('Special Thanks:\nTo the Desdelinux users for supporting me with their ideas\nTo Desdelinux\'s user proper for helping me with the name of the program\nAnd for all of you for downloading and using this program'))
***************
*** 423,434 ****
(options, args) = parser.parse_args()
process = getoutput('ps -A')
! libc6 = 'libc.so.6'
# Check is exist another PacSyu instace
! for root, dirs, files in walk('/lib'):
! if libc6 in files:
! libc6 = join(root, libc6)
! break
if not 'cdtray' in process:
libc = CDLL(libc6)
--- 421,443 ----
(options, args) = parser.parse_args()
process = getoutput('ps -A')
! libc6 = None
# Check is exist another PacSyu instace
! if isfile('/lib/libc.so.6'):
! libc6 = '/lib/libc.so.6'
! elif isfile('/lib/x86_64-linux-gnu/libc.so.6'):
! libc6 = '/lib/x86_64-linux-gnu/libc.so.6'
! elif isfile('/lib/i386-linux-gnu/libc.so.6'):
! libc6 = '/lib/i386-linux-gnu/libc.so.6'
! else:
! print 'Error: Don\'t find the libc.so.6 lib'
! exit(1)
!
! if not 'cdtray' in process:
! libc = CDLL(libc6)
! libc.prctl (15, 'cdtray', 0, 0, 0)
! CDTRAY()
! gtk.main()
if not 'cdtray' in process:
libc = CDLL(libc6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment