Exemplo n.º 1
0
 def addfavtoconf(self, actor):
     """ get desktop entry info """
     entry = 'Desktop Entry'
     filelist = []
     self.fileitem = self.addfavs.get_filename()
     filelist.append(checkconfig.checksetting(self.fileitem, entry, 'Name'))
     filelist.append(checkconfig.checksetting(self.fileitem, entry, 'Exec'))
     filelist.append(checkconfig.checksetting(self.fileitem, entry, 'Icon'))
     filelist.append(checkconfig.checksetting(self.fileitem, entry,
                                              'Comment'))
     tmpcount = 0
     for items in self.favlist:
         if not items[1]:
             logops.write(LOGFILE, ('PIRUM: adding file to config ' +
                                    filelist[1] + '\n'))
             checkconfig.changesetting(CONFIG, 'dock',
                                       str(tmpcount) +'fav', filelist[1])
             checkconfig.changesetting(CONFIG, 'dock',
                                       str(tmpcount) +'icon', filelist[2])
             self.addfavs.hide()
             self.show()
             return actor
         tmpcount = tmpcount + 1
     self.addfavs.hide()
     return actor
Exemplo n.º 2
0
from gi.repository import Gdk
from gi.repository import GdkPixbuf
#from gi.repository import GLib
from gi.repository import Wnck
from xdg.BaseDirectory import xdg_config_dirs


HOMEFOLDER = os.getenv('HOME')
CONFIG = xdg_config_dirs[0] + '/pirum-shell.conf'
LOGFILE = HOMEFOLDER + '/.pirum-shell.log'
HIDELIST = ['pirum_shell.py', 'pirum_shell.py', 'Desktop', 'pirum-shell: Activities',
            'pirum-shell: Overlay', 'xfce4-panel', 'xfce4-notifyd',
            'Top Expanded Edge Panel', 'plank']
THEMENAME = 'gnome'
MYTHEMEBASE = '/usr/share/icons/' + THEMENAME + '/'
MYTHEMEPATHS = checkconfig.checksetting(MYTHEMEBASE + '/index.theme',
                                        'Icon Theme', 'Directories')
ICONSEARCHPATHS = []
for path in MYTHEMEPATHS.split(','):
    if len(path) > 0:
        ICONSEARCHPATHS.append(MYTHEMEBASE + path)


class PIRUMSHELL(object):
    """ PIRUM-shell overlay """
    def __init__(self):
        """ Initialise the main window and start the program """
        self.builder = Gtk.Builder()
        self.builder.add_from_file("/usr/share/pirum-shell/pirum-shell.ui")
        self.builder.connect_signals(self)
        self.conf = ConfigParser.RawConfigParser()
        # Load primary windows, labels and button objects