You are not logged in.
@ BlueDarknezz : yes .. little bug. You can modify /usr/share/adeskbar/plugins/digiclock.py ~ line 48
if not time_current == self.time_txt and not date_current == self.date_txt:->
if not time_current == self.time_txt:Btw , I have to investigate for these GtkWarning .. ( locales ? ).
Thanks
Offline
locales ?
It's possible with the locales, but i don't know in which case. I use de_DE.utf8 as global locale.
BTW.: I changed the digiclock.py and check the behaviour.
Offline
Hello ..
Update : adeskbar-0.3.2.tar.bz2
* better look if no composite
* add these directories to scan "menu" applications ( kde app. are showed in menu now ) :~/.local/share/applications /usr/local/share/applications /usr/share/applications/kde4 /usr/local/share/applications/kde4* Tasklist :
-- add menu ( right click ) - maximize / minimize / close
-- minimize/maximize with wheel (SCROLL_UP/SCROLL_DOWN)Working on new feature : Fixed mode ( aka "panel")
Video : http://www.youtube.com/watch?v=hYxBexqYphQ
new feature : reserve space at screen edge ( fixed mode )
Video : http://www.youtube.com/watch?v=RwYGMG3aXfo
Systray : require python-xlib
*** : If you use "systray" plugin , You must close all tray' applications before configure adeskbar !!
Last edited by ADcomp (2010-06-19 16:44:06)
Offline
Tanks ADcomp for adeskbar. I was wondering if it's possible to "port" this
* add these directories to scan "menu" applications ( kde app. are showed in menu now ) :
~/.local/share/applications
/usr/local/share/applications
/usr/share/applications/kde4
/usr/local/share/applications/kde4
to adesk-menu: I use it with tint2 and love it ![]()
Offline
Hi daneel971,
Already done .. ![]()
Someone on ubuntu-fr forum ask me the same question. So I do some change :
* --no-tray : use adeskmenu as daemon ( no icon in systray ). 
* better look if composite or no
Source : adeskmenu-0.3.tar.bz2
!! Take care .. I change the name : 'adesk-menu' > 'adeskmenu'

You can modify the look'n feel : edit "adeskmenu" ( ligne 17~20 )
MENU_WIDTH = 430
BG_COLOR = "#DCDCDC"
BORDER_COLOR = "#4D4D4D"
ROUNDED = 6As usual , sorry for my poor english
Offline
this looks cool and interesting, I might give it a shot  later ![]()
Linux nabcake in training...
ArchLinux64
Offline
Many thanks ADcomp!! ![]()
Offline
this bar is amazing.:D
thank you ADcomp!
Offline
:)ALL THE CREDIT GOES TO ADcomp david.madbox
I don't know python coding
I simply did  few copy & paste.
adeskmenu:  
  as a single file 
  no tray icon
  uses elementary, Humanity and gnome icons 
  in addition it requires /usr/share/pixmaps/debian-logo.png ( watch the script)
it worked flawlesly 
I am using it with  ubuntu 10.10 + standalone compiz + bmpanel2
#!/usr/bin/python
# -*- coding: utf-8 -*-
MENU_WIDTH = 400
import os
import sys
import gtk
import signal
from subprocess import Popen
cat_name = {'Accessories':('Utility','Accessories'),
            'Games':('Game'),
            'Graphics':('Graphics'),
            'Internet':('Internet', 'Network'),
            'Office':('Office'),
            'Other':('Other'),
            'Programming':('Development'),
            'Settings':('Settings'),
            'Sound & Video':('AudioVideo', 'Audio', 'Video', 'Multimedia'),
            'System Tools':('System', 'Administration'),
            }
cat_icon = {
 'Accessories':'/usr/share/icons/gnome/24x24/categories/applications-utilities.png',
 'Games':'/usr/share/icons/gnome/24x24/categories/applications-games.png',
 'Graphics':'/usr/share/icons/gnome/24x24/categories/applications-graphics.png',
 'Internet':'/usr/share/icons/gnome/24x24/categories/applications-internet.png',
 'Office':'/usr/share/icons/gnome/24x24/categories/applications-office.png',
 'Other':'/usr/share/icons/gnome/24x24/categories/applications-other.png',
 'Programming':'/usr/share/icons/gnome/24x24/categories/applications-development.png',
 'Settings':'/usr/share/icons/gnome/24x24/categories/preferences-desktop.png',
 'Sound & Video':'/usr/share/icons/gnome/24x24/categories/applications-multimedia.png',
 'System Tools':'/usr/share/icons/gnome/24x24/categories/applications-system.png',
}
# Find the Name / Command / Icon from .desktop file
def info_desktop(file, term_cmd=None):
    cmd, icon, name, category = None, None, None, 'Other'
    terminal = False
    try:
        cfile = open(file,"r")
        for line in cfile:
            if 'NoDisplay=true' in line or 'OnlyShowIn=KDE' in line:
                icon, category = None, None
                break
            elif 'Terminal=true' in line:
                terminal = True
            elif '=' in line:
                words = line.split('=')
                if words[0] == 'Name':
                    name = words[1].replace('\n','')
                    # print 'Name =', name
                elif words[0] == 'Icon':
                    icon = words[1].replace('\n','')
                    # print 'Icon =', icon
                elif words[0] == 'Exec':
                    cmd = words[1].replace('\n','')
                    cmd = cmd.split('%')[0]
                    # print 'Exec :', cmd
                elif words[0] == 'Categories':
                    tab = words[1].replace('\n','')
                    tab = tab.split(';')
                    #~ category = '***************************'
                    #~ if not 'X-XFCE' in tab:
                    for cat in tab:
                        found = False
                        for c_name in cat_name:
                            if cat in cat_name[c_name]:
                                category = c_name
                                found = True
                                break
                        if found:
                            break
        # if command is 'console only', launch it with terminal ..
        if terminal:
            if term_cmd:
                cmd = "%s -e %s" % (term_cmd, cmd)
            else:
                cmd = "x-terminal-emulator -e %s" % cmd
        cfile.close()
    except:
        #~ print("# Error : parsing %s" % file)
        pass
    return (cmd, icon, name, category)
# Find the best icon with highest resolution for the launcher
def find_icon(icon):
    foundiconfile=None
    if icon == '' or icon == None:
        return foundiconfile
    if icon[0] == '/':
        return icon
  
    iconbase=('elementary', 'Humanity', 'gnome')
    iconpath='/usr/share/icons'
    categorylist =('128', '64', '48', '32', '24', 'apps')
    sizelist=('apps', 'actions',"devices", 'categories','filesystems', 'places', 'status', '24x24', '')
    extensionlist = ('svg', 'png')
    iconimagelist=[]
    for extension in extensionlist:
        if (icon.find('.'+extension) != -1):
            icon = icon.replace('.'+extension,'')
    for size in sizelist:
        for extension in extensionlist:
            for category in categorylist:
                for iconbasecat in iconbase:
                    iconfile = iconpath+"/"+iconbasecat+'/'+size+'/'+category+'/'+icon+'.'+extension
                    iconimagelist.append(iconfile)
    for extension in extensionlist:
        iconfile = '/usr/share/pixmaps/'+icon+'.'+extension
        iconimagelist.append(iconfile)
    for extension in extensionlist:
        iconfile = '/usr/share/app-install/icons/'+icon+'.'+extension
        iconimagelist.append(iconfile)
    # Seek if the files in pre-generated list exists.. first match is the best
    # return it
    for iconimage in iconimagelist:
        if os.path.exists(iconimage):
            return iconimage
    return foundiconfile
def parse_desktop_dir(desktop_dir='/usr/share/applications/', term_cmd=None):
    config = {}
    listdir = os.listdir(desktop_dir)
    for i in listdir:
        if '.desktop' in i:
            #~ print i
            (cmd, icon, name, category) = info_desktop(desktop_dir + i, term_cmd)
            #~ print cmd, icon, name, category
            if category:
                if not config.has_key(category):
                    #~ print "@ add :", category
                    config[category] = []
                if icon:
                    icon_path = find_icon(icon)
                    config[category].append((cmd, icon_path, name))
                else:
                    config[category].append((cmd, 'images/def_icon.png', name))
            else:
                ## No category ?
                pass
    #~ print config
    return config
def launch_command(cmd):
    if cmd != ' ' and cmd != None and len(cmd)!=0:
        os.chdir(os.environ['HOME'])
        #~ logINFO("Exec. | %s |" % cmd)
        ## FIXME! replace os.system with subprocess.Popen
        #~ os.system('sh -c "%s" &' % cmd)
        p = Popen(cmd, shell=True).pid
        #~ sts = os.waitpid(p.pid, 0)[1]
        realpath = os.path.dirname(os.path.realpath( __file__ ))
        os.chdir(realpath + '/..')
def image_button(label, image, size):
    bt = gtk.Button()
    bt.set_relief(gtk.RELIEF_NONE)
    bt.set_border_width(0)
    bt.set_focus_on_click(False)
    bt.set_property('can-focus', False)
    bt_image = gtk.Image()
    bt_image.show()
    bt_image.set_size_request(size, size)
    if not type(image) == gtk.gdk.Pixbuf:
        try:
            pixbuf = gtk.gdk.pixbuf_new_from_file_at_size(image, size, size)
        except:
            pixbuf = gtk.gdk.pixbuf_new_from_file_at_size('/usr/share/pixmaps/debian-logo.png', size, size)
    else:
        pixbuf = image
    bt_image.set_from_pixbuf(pixbuf)
    bt_image.show()
    bt_label = gtk.Label()
    bt_label.set_use_markup(True)
    bt_label.set_markup(label)
    bt_label.set_alignment(0.2, 1)
    align = gtk.Alignment(1, 0, 0.5, 0.5)
    align.show()
    align.add(bt_label)
    box = gtk.HBox(False, 6)
    box.set_border_width(2)
    box.show()
    box.pack_start(bt_image, False, False)
    box.pack_start(align, False, False)
    bt.add(box)
    bt.show_all()
    return bt
class Menu():
    def __init__(self):
        self.hide_me = False
        self.focus_check = False
        self.mode = None
        self.create_window()
        self.toggle_hide()
       
    def run(self):
    gtk.main()
    
    def create_window(self):
        self.window = gtk.Window() ## gtk.WINDOW_TOPLEVEL)
        #~self.window.connect("destroy", self.doquit)
        self.window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_UTILITY)
        #~ self.window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_NORMAL)
        self.window.add_events(gtk.gdk.FOCUS_CHANGE_MASK)
        self.window.connect("focus-out-event", self.lost_focus)
        self.window.connect("key-press-event", self.onkeypress)
        self.window.stick()
        self.window.set_decorated(False)
        #~ self.window.set_keep_below(False)
        #~ self.window.set_keep_above(True)
        self.window.set_skip_taskbar_hint(True)
        self.window.set_skip_pager_hint(True)
        #~ self.window.set_resizable(True)
        #~ self.window.set_border_width(0)
        self.window.set_app_paintable(True)
        #~ self.window.set_title("ADeskMenu")
        #~ self.window.set_name("ADeskMenuWindow")
        self.frame = gtk.Frame()
        self.frame.show()
        self.frame.set_size_request(MENU_WIDTH,-1)
        self.nbook = gtk.Notebook()
        self.nbook.show()
        self.nbook.set_tab_pos(gtk.POS_LEFT)
        self.nbook.set_border_width(0)
        self.frame.add(self.nbook)
        self.window.add(self.frame)
        menu = parse_desktop_dir()
        cat_tmp = []
        for categoty in menu:
            cat_tmp.append(categoty)
        cat_tmp.sort()
        self.cat_visible = True
        for category in cat_tmp:
            #~ print category
            bBox = gtk.VBox()
            bBox.show()
            bBox.set_spacing(1)
            bBox.set_border_width(1)
            scrolled = gtk.ScrolledWindow()
            scrolled.show()
            scrolled.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
            scrolled.add_with_viewport(bBox)
            tab_box = gtk.HBox(False, 4)
            tab_label = gtk.Label(category)
            tab_icon = gtk.Image()
            tab_icon.set_from_file(cat_icon[category])
            tab_box.pack_start(tab_icon, False)
            tab_box.pack_start(tab_label, False)
            # needed, otherwise even calling show_all on the notebook won't
            # make the hbox contents appear.
            tab_box.show_all()
            gtk.gdk.threads_enter()
            self.nbook.append_page(scrolled, tab_box)
            gtk.gdk.threads_leave()
            for application in menu[category]:
                button = image_button(application[2], application[1], 24)
                button.connect("button-release-event", self.ExecuteAction, application)
                bBox.pack_start(button, False, False)
            
    def ExecuteAction(self, widget, event, item):
        self.focus_check = False
        launch_command(item[0])
        self.toggle_hide(widget)
    def toggle_hide(self, widget=None, event=None):
        if self.hide_me:
            self.hide_me = False
            self.show_menu(self.mode)
            self.window.show()
            self.focus_check = True
        else:
            self.hide_me = True
            self.focus_check = False
            self.window.hide()
    def show_menu(self, mode=None):
        screen_width, screen_height = gtk.gdk.screen_width(), gtk.gdk.screen_height()
        if not mode:
            #(screen, rect, orientation) = self.statusIcon.get_geometry()
            if rect[0] + MENU_WIDTH > screen_width:
                x = screen_width - MENU_WIDTH
            else:
                x = rect[0] + MENU_WIDTH
            y = rect[1]+rect[3]
        else:
            rootwin = self.window.get_screen().get_root_window()
            w_width , w_height = self.window.get_size()
            x, y, mods = rootwin.get_pointer()
            if x + MENU_WIDTH > screen_width:
                x = screen_width - MENU_WIDTH
            if y + w_height > screen_height:
                y = screen_height - w_height - 25
        self.window.move(x, y)
        self.window.present()
    def lost_focus(self, widget, event):
        if self.focus_check:
            self.toggle_hide()
    def onkeypress(self, widget, event):
        if event.keyval == gtk.keysyms.Escape:
            self.toggle_hide()
    def callback_signal(self):
        #~ print "callback_signal .."
        self.mode = "mouse"
        self.toggle_hide()
        self.mode = None
##--
global g_menu
def SigUSR1Handler(signum, frame):
    """ grab signal to reload config """
    # kill -10 <adesk-menu pid>
    global g_menu
    g_menu.callback_signal()
    return
def save_pid():
    home = os.environ['HOME']
    pid_file = "%s/.config/adesk-menu/pid" % home
    pid = os.getpid()
    #~ print "PID = %s" % pid
    if not os.path.exists("%s/.config/adesk-menu" % home):
        os.makedirs("%s/.config/adesk-menu" % home)
    f = open(pid_file,'w')
    f.write('%s' % pid)
    f.close()
    #~ print "PID saved to %s" % pid_file
def run():
    global g_menu
    signal.signal(signal.SIGUSR1, SigUSR1Handler)
    save_pid()
    ## need to change directory
    SRC_PATH = os.path.dirname(os.path.realpath( __file__ ))
    os.chdir(SRC_PATH)
    g_menu = Menu()
    # change directory to Home
    os.chdir(os.getenv('HOME'))
    g_menu.run()
if __name__ == "__main__":
    realpath = os.path.dirname(os.path.realpath( __file__ ))
    os.chdir(realpath)
    if len(sys.argv) == 2:
        if sys.argv[1] == '-t':
            cmd = "kill -10 `cat ~/.config/adesk-menu/pid`"
        launch_command(cmd)
        else:
            print "Unknow option .."
            print "Usage : adesk-menu [-t]"
            print " -t : show menu ( cursor position )"
    else:
        run()Last edited by bhante (2010-06-21 04:12:17)
Offline
Thanks ADcomp for this remarkable piece of software
Last edited by bhante (2010-06-21 04:34:51)
Offline
Offline
is the sys-tray working properly? After adding the plug in nothing appears. am i missing something?
Offline
is the sys-tray working properly? After adding the plug in nothing appears. am i missing something?
Yes, you are missing few packages that plugins needs. Install python-wnck python-alsaaudio python-vte python-xlib
packages and all the plugins should work ![]()
Linux nabcake in training...
ArchLinux64
Offline
all packages except python-vte are there. I used BlueDarknezz's PKGBUILD. I hope vte in extra should give the same functionality.
Last edited by kgas (2010-06-22 05:41:03)
Offline
Source : adeskbar-0.3.6.tar.bz2
* menu use current icon theme
* some improvement for systray
* ...
Tips : ( > v0.3.4 only )
Use your default icon theme with plugins - menu , bookmarks , showdesktop , terminal , session
Simply edit them like this :
"menu" : images/plugins/menu.png -> start-here
"bookmarks" : images/plugins/bookmarks.png -> user-home
"showdesktop" : images/plugins/showdesktop.png -> user-desktop
"terminal" : images/plugins/terminal.png -> terminal
"session" : images/plugins/session.png -> system-log-outAnd refresh ..
Default icon :
Icon theme : SimplyGrey
Icon theme : mistEEk
Offline
0.3.6 has a bug - autohide ..
Offline
update : fix "fake transparency" with plugin "tasklist"
Sources : adeskbar-0.3.8.tar.bz2
Offline
And here is the new PKGBUILD and adeskbar.install for 0.3.8.
Last edited by BlueDarknezz (2010-06-29 16:39:22)
Offline
Thanks ADcomp / BlueDarknezz. Systray is working now.
Offline
Something fishy in elinks.desktop because menu.py says "# Error : parsing /usr/share/applications/elinks.desktop" and then stops parsing rest of the applications and menu is incomplete... Maybe it should just say that elinks.desktop is faulty and continue parsing?
Offline
@suolx -  this should not happen   
 
I just install elinks and I don't have this behavior. Can't you post your "/usr/share/applications/elinks.desktop"
Offline
Hmm weird...even when reinstalling elinks this happens for me. https://sulx.dy.fi/elinks.desktop
Offline
@suolx - ok , I found where is buggy. Quick hack ( if you can't wait for next update ) : edit your elinks.desktop ~line 8
Icon=like this :
Icon=elinksBut you can set other icon if you want ( I don't have elinks icon on my system )
Icon=web-browserLast edited by ADcomp (2010-07-01 05:23:42)
Offline
when adeskbar is on the left / right side of the screen, system tray icons are stacked horizontally (which does not look nice) instead of vertical stagging. I hope this issue will be fixed in your next release.
Offline
Offline