Léa-Linux & amis :   LinuxFR   GCU-Squad   GNU
Besoin d'un programmeur !
Envoyé par: bluelambda

Voilà, j'ai une barre des taches sous karamba, mais je n'arrive pas à trouver comment réduire le temps de rafraichissement (les taches mettent 5 secondes à apparaitre après que je les ai lançées).

J'ai chercher dans le fichier du thème, et le script, je ne trouve pas comment modifier ça.

Quelqu'un a une iddée?

Dois-je vous poster le fichier thème ou le fichier script, pour que vous voyez vous mêmes ?

Merci



Linux a un noyau, Windows a un pépin ;-)

Poste le Monday 27 October 2003 22:33:04
Répondre     Citer    
Re: Besoin d'un programmeur !
Envoyé par: bluelambda

Bon, ok je vous envoie le code ;-)

Voici le code du thème :

# Formerly SuperKaramba Glas-Bar Theme v0.1 by GeniusR13
# Adapted by Chip2003
# Grafics by Chip2003 / KDE default icons

KARAMBA x=0 y=713 w=1020 h=58 BOTTOMBAR=true locked=true interval=2500

# The Bar Body
IMAGE x=0 y=0 x=851 h=70 PATH="Glas/bg_b1.png"

# Task Background
#IMAGE x=250 y=6 w=650 h=40 PATH="Glas/task_bg.png"

# Clock Background
IMAGE x=903 y=7 PATH="Glas/clk_pat2.png"

# Kmenu Button, to appear on the very left bottom
IMAGE x=21 y=12 w=32 h=32 PATH="Icons/kmenu.png"
CLICKAREA x=21 y=20 w=32 h=32 ONCLICK="dcop kicker kicker popupKMenu 20,265"

# Pager - click updates EVERY running karamba task
<GROUP> x=175 y=10
#IMAGE x=0 y=0 w=62 h=60 SENSOR=PROGRAM PROGRAM="echo Glas/pager-`dcop kwin KWinInterface currentDesktop`.png"
#CLICKAREA x=0 y=0 w=29 h=29 ONCLICK="dcop kwin KWinInterface setCurrentDesktop 1; LIST=`dcop | grep karamba`; for BLA in $LIST; do dcop $BLA 'qt/karamba' updateSensors; done"
#CLICKAREA x=32 y= w=29 h=29 ONCLICK="dcop kwin KWinInterface setCurrentDesktop 2; LIST=`dcop | grep karamba`; for BLA in $LIST; do dcop $BLA 'qt/karamba' updateSensors; done"
#CLICKAREA x=0 y=32 w=29 h=29 ONCLICK="dcop kwin KWinInterface setCurrentDesktop 3; LIST=`dcop | grep karamba`; for BLA in $LIST; do dcop $BLA 'qt/karamba' updateSensors; done"
#CLICKAREA x=32 y=32 w=29 h=29 ONCLICK="dcop kwin KWinInterface setCurrentDesktop 4; LIST=`dcop | grep karamba`; for BLA in $LIST; do dcop $BLA 'qt/karamba' updateSensors; done"
</GROUP>

# The Button Group
<GROUP> x=47 y=12

# Gaim Button
#IMAGE x=0 y=0 w=32 h=32 PATH="Icons/gaim.png"
#CLICKAREA x=0 y=0 w=32 h=32 ONCLICK="gaim"

# Opera Button
#IMAGE x=40 y=0 w=32 h=32 PATH="Icons/opera.png"
#CLICKAREA x=40 y=0 w=32 h=32 ONCLICK="opera"

# Konqueror Button
IMAGE x=90 y=0 w=32 h=32 PATH="Icons/konqueror.png"
CLICKAREA x=90 y=0 w=32 h=32 ONCLICK="kfmclient openProfile webbrowsing"

# Kmail Button
IMAGE x=125 y=0 w=32 h=32 PATH="Icons/kmail.png"
CLICKAREA x=120 y=0 w=32 h=32 ONCLICK="kmail"

# FTP Button
#IMAGE x=160 y=0 w=32 h=32 PATH="Icons/ftp.png"
#CLICKAREA x=160 y=0 w=32 h=32 ONCLICK="gftp-gtk"

# Konsole Button
IMAGE x=55 y=0 w=32 h=32 PATH="Icons/konsole.png"
CLICKAREA x=55 y=0 w=32 h=32 ONCLICK="konsole --workdir $HOME"

# HomeDir Button
IMAGE x=20 y=0 w=32 h=32 PATH="Icons/kfm_home.png"
CLICKAREA x=20 y=0 w=32 h=32 ONCLICK="kfmclient openProfile filemanagement"

# XMMS Button
# IMAGE x=280 y=0 w=32 h=32 PATH="Icons/xmms.png"
#CLICKAREA x=280 y=0 w=32 h=32 ONCLICK="xmms"

</GROUP>
# End Button Group


# Time and Date, updated every second
# TEXT x=730 y=14 COLOR=64,64,64 FONT="arial" FONTSIZE=16 SENSOR=TIME #INTERVAL=1000 FORMAT="hh:mm"
# TEXT x=730 y=46 COLOR=64,64,64 FONT="arial" FONTSIZE=7 SENSOR=TIME #INTERVAL=1000 FORMAT="dd.MM.yyyy"

# CPU/Mem Usage Display
# BAR x=793 y=3 w=5 h=68 VERTICAL=true PATH="Glas/cpu-bar.png" #SENSOR=CPU #INTERVAL=300
# BAR x=803 y=3 w=5 h=68 VERTICAL=true PATH="Glas/mem-bar.png" #SENSOR=MEMORY FORMAT="%um" INTERVAL=3000
# BAR x=813 y=3 w=5 h=68 VERTICAL=true PATH="Glas/swap-bar.png" #SENSOR=MEMORY FORMAT="%us" INTERVAL=3000


# Kmix MiniButton only if kmix is running, NOT updated dynamicly
IMAGE x=985 y=11 w=16 h=16 SENSOR=PROGRAM PROGRAM="echo Icons/mini-`dcop | grep kmix`.png"
CLICKAREA x=985 y=11 w=16 h=16 ONCLICK="kinternet --quiet --karamba"
#dcop kinternet --swallow"
#CLICKAREA x=985 y=11 w=16 h=16 ONCLICK="dcop kmix kmix-mainwindow#1 restore"

# Klipper MiniButton only if klipper is running, NOT updated dynamicly
IMAGE x=985 y=30 w=17 h=16 SENSOR=PROGRAM PROGRAM="echo Icons/mini-`dcop | grep klipper`.png"
#CLICKAREA x=985 y=30 w=17 h=16 ONCLICK="dcop klipper 'qt/main_menu' showNormal"

#Clock & Date
text x=975 y=8 sensor=time format="h:mm" align=right color=0,0,0 fontsize=19 font="Verdana" shadow=2 bgcolor=120,120,120
text x=975 y=34 sensor=time format="ddd d.MM.yyyy" align=right color=0,0,0 fontsize=8 font="Arial" bgcolor=120,120,120
#shadow=2



Linux a un noyau, Windows a un pépin ;-)

Poste le Tuesday 28 October 2003 09:56:45
Répondre     Citer    
Re: Besoin d'un programmeur !
Envoyé par: bluelambda

Et le script ;-)

# SuperKaramba Glas-Bar Theme v0.1 by GeniusR13
# designed on KDE 3.0.2 and still unfinished :-D
#
# The theme is mostly configured in the .theme file as it's adopted from my very first
# karamba theme. Python is used only for the taskbar and pager stuff.
# Beware: this is my first try in python programming (oooops :-)

import karamba
import os



#----- start customizing area -----
pager_x = 212 # y/x coordinates where the pager should appear
pager_y = 9
pager_h = 35 # h/w size of the pager
pager_w = 35
pager_mainpic = "Glas/pager-" # pager picture generic name (i.e. Glas/pager-1.png)

task_x = 250 # y/x coordinates where the taskbar should appear
task_y = 8
task_h = 45 # h/w size of the taskbar
task_w = 650
task_bg_pic = "Glas/task4.png" # Background pic for task list (looks ugly without)
#----- end customizing area -----



twidth = 0 # width of a task frame pic
theight = 0 # height of a task frame pic
task_list = [] # list of current running tasks
task_oldtextlist = [] # list of displayed task text widgets
task_frametextlist = [] # list of frame pics
pager_pic = 0 # currently displayed pager picture object



#This is called when you widget is initialized
def initWidget(widget):
global pager_pic
global pager_mainpic
global pager_x
global pager_y

pager_pic = SetPager(widget, pager_pic, pager_mainpic, pager_x, pager_y, 1)

pass



#this is called everytime your widget is updated
#the update inverval is specified in the .theme file
def widgetUpdated(widget):
global task_list
global task_oldtextlist
global task_frametextlist
global task_x
global task_y
global task_h
global task_w
global task_bg_pic
global twidth
global theight
global pager_pic
global pager_mainpic
global pager_x
global pager_y

for this_task in task_oldtextlist: # cleanup all displayed tasks
karamba.deleteText(widget, this_task)

for this_task in task_frametextlist: # cleanup corresponding task pics
karamba.deleteImage(widget, this_task)

task_oldtextlist = [] # remove deleted elements from list
task_frametextlist = []

task_list = karamba.getTaskList(widget) # list of all running tasks

taskcount = len(task_list) + (len(task_list) % 2) # count of vert. fields
twidth = task_w / (taskcount / 2) # width of a textfield
theight = task_h / 2 # heigt of a textfield
tx = task_x
ty = task_y
istop = 1

for this_task in task_list: # display tasks
task_info = karamba.getTaskInfo(widget,this_task) # get info of task

this_frame = karamba.createImage(widget, tx, ty, task_bg_pic) # build display frame
karamba.resizeImage(widget,this_frame,twidth,theight) # adjust frame size
task_frametextlist.append(this_frame)

this_text = karamba.createText(widget, tx+14, ty+3, twidth-20, theight-3, task_info[0])
karamba.changeTextColor(widget, this_text, 0, 0, 0)
karamba.changeTextSize(widget, this_text, 10)
task_oldtextlist.append(this_text)

if( istop == 1 ): # calc coordinates for next task
istop = 0
ty = ty + theight
else:
istop = 1
ty = task_y
tx = tx + twidth

pager_pic = SetPager(widget, pager_pic, pager_mainpic, pager_x, pager_y, 0)

pass



def widgetClicked(widget, x, y, button):
global task_list
global task_x
global task_y
global task_h
global task_w
global twidth
global theight
global pager_x
global pager_y
global pager_h
global pager_w

# only taskbar clicks
if( (button == 1) and (task_x <= x <= (task_x+task_w)) and (task_y <= y <= (task_y+task_h)) ):
tx = x - task_x # find the selected (clicked) task by x/y position
ty = y - task_y
listnum = (tx / twidth) * 2
if( ty > theight ):
listnum = listnum + 1

karamba.performTaskAction(widget, task_list[listnum], 8) # execute "smart focus"

# only pager clicks
if( (button == 1) and (pager_x <= x <= (pager_x+pager_w)) and (pager_y <= y <= (pager_y+pager_h)) ):
if( x < (pager_x + (pager_w/2)) ):
if( y < (pager_y + (pager_h/2)) ):
os.system("dcop kwin KWinInterface setCurrentDesktop 1")
else:
os.system("dcop kwin KWinInterface setCurrentDesktop 3")
else:
if( y < (pager_y + (pager_h/2)) ):
os.system("dcop kwin KWinInterface setCurrentDesktop 2")
else:
os.system("dcop kwin KWinInterface setCurrentDesktop 4")

pass



def widgetMouseMoved(widget, x, y, button):
#Warning: Don't do anything too intensive here
#You don't want to run some complex piece of code everytime the mouse moves
pass



def SetPager(widget, pager_pic, pager_mainpic, pager_x, pager_y, isnew):
temp = os.popen("dcop kwin KWinInterface currentDesktop")
this_desk = temp.read() # get current desktop from dcop
this_desk = this_desk.splitlines()
this_desk = this_desk[0]
temp.close()

pager_file = pager_mainpic + str(this_desk) + ".png" # build filename

if( isnew == 0 ): # if not new, remove old object
karamba.deleteImage(widget, pager_pic)
pager_pic = karamba.createImage(widget, pager_x, pager_y, pager_file) # create pager pic

return pager_pic # return the new pic object



# This will be printed when the widget loads.
print "Loaded my python extension!"



Linux a un noyau, Windows a un pépin ;-)

Poste le Tuesday 28 October 2003 09:57:15
Répondre     Citer    
Re: Besoin d'un programmeur !
Envoyé par: bluelambda

Oulà !
C'est plus gros que je pensais !

Voilà, alors j'aimerai savoir si quelqu'un sait comment faire pour que ma barre des taches soit mise a jour instantanément, et non toutes les 5 secondes comme ca a l'air d'être le cas.

J'ai pourtant bien cherché mais, pas trouvé :-(

J'ai une autre barre des taches (mais pas jolie) ou les fenetres actives sont mises à jour instantanément, ça doit donc être possible...

Enfin bon, merci d'avance, et désolé pour toute cette place prise dans le forum...



Linux a un noyau, Windows a un pépin ;-)

Poste le Tuesday 28 October 2003 09:59:45
Répondre     Citer    
Re: Besoin d'un programmeur !
Envoyé par: lebeny

Voici le code du thème :

# Formerly SuperKaramba Glas-Bar Theme v0.1 by GeniusR13
# Adapted by Chip2003
# Grafics by Chip2003 / KDE default icons

KARAMBA x=0 y=713 w=1020 h=58 BOTTOMBAR=true locked=true interval=2500

# The Bar Body
IMAGE x=0 y=0 x=851 h=70 PATH="Glas/bg_b1.png"

Dans la ligne

KARAMBA x=0 y=713 w=1020 h=58 BOTTOMBAR=true locked=true interval=2500

essais de mettre interval=00

mais je ne suis pas sur

Poste le Tuesday 16 May 2006 13:35:41
Répondre     Citer    

Veuillez vous authentifier auparavant pour commenter.

 

Ce forum !
Besoin d'un programmeur !
Posez dans ce forum les questions qui ne trouvent pas place dans les autres...

Sauf mention contraire, les documentations publiées sont sous licence Creative-Commons