Home Forums Wiki Doc Install Extras Screenshots Source Code Projects Blog Users Groups Register
Glx-Dock / Cairo-Dock List of forums Technical discussions | Discussions techniques Compiz: scale
The latest stable release is the *3.4.0* : How to install it here.
Note: We just switched from BZR to Git on Github! (only to host the code and your future pull requests)
Technical discussions | Discussions techniques

Subjects Author Language Messages Last message
[Locked] Compiz: scale
Page : 1 2
fabounet Français 23 fabounet [Read]
10 June 2011 à 12:11

fabounet, Thursday 20 January 2011 à 13:49


Subscription date : 30 November 2007
Messages : 17118
qqun arrive à faire marcher le plug-in Scale de Compiz via Dbus ?
j'ai essayé ça avec 2 nautilus ouvert, mais sans succès
dbus-send --type=method_call --dest=org.freedesktop.compiz /org/freedesktop/compiz/scale/allscreens/initiate_all org.freedesktop.compiz.activate string:'root' int32:`xwininfo -root | grep id: | awk '{ print $5 }'` string:"match" string:'class=nautilus'

(j'ai essayé avec print $4 au début, mais ça renvoyait pas le bon ID)

matttbe, Thursday 20 January 2011 à 14:59


Subscription date : 24 January 2009
Messages : 12573
Je n'ai aucun objet dans le bus org.freedesktop.compiz
Sinon moi, c'est print $4

Guest, Friday 21 January 2011 à 21:06

!!! Don't forget the Anti-spam filter !!!

Salut!
Avec l'information de ce forum:
http://forum.compiz.org/viewtopic.php?t=11763
je suis arrivé a le faire marcher de cette façon:
dbus-send --type=method_call --dest=org.freedesktop.compiz /org/freedesktop/compiz/scale/allscreens/initiate_all_edge org.freedesktop.compiz.activate string:'root' int32:`xwininfo -root | grep id: | awk '{ print $4 }'` string:"match" string:'class=.*Thunar*'

La différence c'est le initiate_all_edge (je ne sais pas qu'est ce que ça fait).

Tu veut utiliser le plugin scale pour choisir une fenêtre quand elles sont groupées?

matttbe, Sunday 23 January 2011 à 00:32


Subscription date : 24 January 2009
Messages : 12573
Merci invité!
Par contre, je ne peux pas confirmé avec Compiz 0.9.2

Guest, Sunday 23 January 2011 à 01:16

De rien!
J'ai Compiz 0.8.6, donc je ne sais pas si quelquechose a été changée dans le plugin dbus. Peut-être on obtiendra plus d'information si tu ajoute l'option --print-reply au commandement.

matttbe, Sunday 23 January 2011 à 01:51


Subscription date : 24 January 2009
Messages : 12573
J'ai rapporté le bug sur IRC et il semble que le plug-in DBus n'a pas encore été porté donc ça peut être normal que ça foire

matttbe, Sunday 23 January 2011 à 03:06


Subscription date : 24 January 2009
Messages : 12573
Merci à smspillaz, pour Compiz 0.9:
dbus-send --type=method_call --dest=org.freedesktop.compiz /org/freedesktop/compiz/scale/screen0/initiate_all_edge org.freedesktop.compiz.activate string:'root' int32:`xwininfo -root | grep id: | awk '{ print $4 }'` string:"match" string:'class=.*Gnome-terminal*'
Pour les autres, il faut utiliser allscreens au lieu de screen0

Guest, Tuesday 01 March 2011 à 19:36

Bonjour!
J'ai vu que vous avez implémenté cette fonction dans le PPA. SUPERB!
Mais elle no fonction pas avec certain plugins, comme musicPlayer ou Pidgin, au moins chez moi.
Salut!

matttbe, Wednesday 02 March 2011 à 09:33


Subscription date : 24 January 2009
Messages : 12573
Yep mais ça c'est parce que le clic gauche est déjà défini pour une autre action bien précise.

@ fabounet: Pour Compiz 0.9, il faut utiliser bien cette commande:
dbus-send --type=method_call --dest=org.freedesktop.compiz /org/freedesktop/compiz/scale/screen0/initiate_all_edge org.freedesktop.compiz.activate string:'root' int32:`xwininfo -root | grep id: | awk '{ print $4 }'` string:"match" string:'class=.*Gnome-terminal*'
Mais il faut que le plug-in DBus de Compiz soit activé... ce qui n'est pas le cas lors d'une installation en compilant Compiz depuis les paquets de sources.
Mais il faut pouvoir détecter que c'est compiz 0.9 (si le dossier '~/.config/compiz-1/compizconfig/config' existe) et si les plug-ins dbus et scale sont activés => faut vérifier là dedans
~/.config/compiz-1/compizconfig/Default.ini
~/.gconf/apps/compiz-1/general/screen0/options/%gconf.xml:
~/.gconf-apps-compiz/general/screen0/options/%gconf.xml
(je ne sais pas trop d'où vient le dernier dossier )
Mais il y a p-ê d'autres moyens, faudrait p-ê voir avec les devs de Compiz

matttbe, Thursday 03 March 2011 à 12:24


Subscription date : 24 January 2009
Messages : 12573
En remplaçant allscreens par screen0 dans le code de la dernière révision, ça fonctionne très bien (mais il faut activer les 2 plug-ins de compiz, ou le faire via gconf ou leur fichier de conf!)

fabounet, Sunday 06 March 2011 à 12:46


Subscription date : 30 November 2007
Messages : 17118
j'ai ajouté le support de Compiz 0.9 dans la dernière rev, tu pourrais tester stp ?

matttbe, Sunday 06 March 2011 à 15:55


Subscription date : 24 January 2009
Messages : 12573
OK qd je serai sur mon pc

matttbe, Tuesday 08 March 2011 à 11:19


Subscription date : 24 January 2009
Messages : 12573
Je confirme, ça fonctionne bien

fabounet, Wednesday 09 March 2011 à 12:43


Subscription date : 30 November 2007
Messages : 17118
merci

quelqu'un pour tester sous KDE4.5 et KDE4.6 ?

matttbe, Monday 30 May 2011 à 14:48


Subscription date : 24 January 2009
Messages : 12573
Par hasard, ne serait-il pas possible de forcer l'activation du plugin DBus de Compiz? Il y a p-ê une commande DBus mais ce serait étonnant

Sinon, passer par gconf (apps/compiz-1) ou la config (.config/compiz-1)

fabounet, Tuesday 31 May 2011 à 15:58


Subscription date : 30 November 2007
Messages : 17118
n'est-il pas activé par défaut ? (il faudra que je vérifie ça pendant mon install; hier le LiveCD de Debian ne reconnaissait pas le clic sur le touchpad de mon netbook )
en tout cas Ubuntu en a besoin donc pour eux c'est sûr.

et je doute fort qu'une commande Dbus existe pour lancer le plug-in qui se charge justement d'écouter

matttbe, Tuesday 31 May 2011 à 17:01


Subscription date : 24 January 2009
Messages : 12573
et je doute fort qu'une commande Dbus existe pour lancer le plug-in qui se charge justement d'écouter


en tout cas Ubuntu en a besoin donc pour eux c'est sûr.
Et bien justement non... Unity est un plugin de Compiz, il dialogue donc très facilement avec les autres plug-ins...

fabounet, Monday 06 June 2011 à 15:49


Subscription date : 30 November 2007
Messages : 17118
ah oui, ils trichent

mais tout de même, c'est bien un process à part non ? si c'est le cas, je pense qu'ils communiquent via Dbus avec Compiz.

matttbe, Monday 06 June 2011 à 16:02


Subscription date : 24 January 2009
Messages : 12573
Non non, c'est bien un plugin de Compiz et donc il communique avec Compiz grâce à l'API en C+.+ de Compiz.
D'ailleurs, voici le contenu du binaire unity (/usr/bin/unity) :
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2010 Canonical
#
# Authors:
#  Didier Roche <didrocks@ (...) .com>
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; version 3.
#
# This program is distributed in the hope that it will be useful, but WITHOUTa
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

import gconf
import glob
from optparse import OptionParser
import os
import shutil
import signal
import subprocess
import sys
import time

home_dir 
os.path.expanduser("~%s" os.getenv("SUDO_USER"))
supported_prefix "/usr/local"

well_known_local_path = ("%s/share/unity" supported_prefix,
                         
"%s/share/ccsm/icons/*/*/*/*unity*" supported_prefix,
                         
"%s/share/locale/*/LC_MESSAGES/*unity*" supported_prefix,
                         
"%s/.compiz-1/*/*unity*" home_dir,
                         
"%s/.gconf/schemas/*unity*" home_dir,
                         
"%s/lib/*unity*"  supported_prefix,
                         
"%s/share/dbus-1/services/*Unity*"  supported_prefix,
                         
"%s/bin/*unity*"  supported_prefix,
                         
"%s/share/man/man1/*unity*"  supported_prefix,
                         
"%s/lib/*nux*"  supported_prefix,
                         
"%s/lib/pkgconfig/nux*"  supported_prefix,
                         
"%s/include/Nux*"  supported_prefix
                         
)


def set_unity_env ():
    
'''set variable environnement for unity to run'''

    
os.environ['COMPIZ_CONFIG_PROFILE'] = 'ubuntu'
    
    
if not 'DISPLAY' in os.environ:
        
# take an optimistic chance and warn about it :)
        
print "WARNING: no DISPLAY variable set, setting it to :0"
        
os.environ['DISPLAY'] = ':0'

def reset_unity_compiz_profile ():
    
'''reset the compiz/unity profile to a vanilla one'''
    
    
client gconf.client_get_default()
    
    if 
not client:
        print 
"WARNING: no gconf client found. No reset will be done"
        
return
    
    
# get current compiz profile to know if we need to switch or not
    # as compiz is setting that as a default key schema each time you
    # change the profile, the key isn't straightforward to get and set
    # as compiz set a new schema instead of a value..
    
try:
        
current_profile_schema client.get_schema("/apps/compizconfig-1/current_profile")
    
except (GErrorAttributeError), e:
        print 
"WARNING: environment is incorrect: %s\nDid you just try to reset in a tty?" e
        
return
    
    
# default value to not force reset if current_profile is unset
    
current_profile_gconfvalue ""
    
if current_profile_schema:
        
current_profile_gconfvalue current_profile_schema.get_default_value()

    if 
current_profile_gconfvalue.get_string() == 'unity':
        print 
"WARNING: Unity currently default profile, so switching to metacity while resetting the values"
        
subprocess.Popen(["metacity""--replace"]) #TODO: check if compiz is indeed running
        # wait for compiz to stop
        
time.sleep(2)
        
current_profile_gconfvalue.set_string('fooo')
        
current_profile_schema.set_default_value(current_profile_gconfvalue)
        
client.set_schema("/apps/compizconfig-1/current_profile"current_profile_schema)
        
# the python binding doesn't recursive-unset right
        
subprocess.Popen(["gconftool-2""--recursive-unset""/apps/compiz-1"]).communicate()
    
subprocess.Popen(["gconftool-2""--recursive-unset""/apps/compizconfig-1/profiles/unity"]).communicate()

def reset_launcher_icons ():
    
'''Reset the default launcher icon and restart it.'''
    
subprocess.Popen(["gsettings""reset" ,"com.canonical.Unity.Launcher" "favorites"]) 

def process_and_start_unity (verbosedebugcompiz_argslog_file):
    
'''launch unity under compiz (replace the current shell in any case)'''
    
    
cli = []
    
    if 
debug:
        
# we can do more check later as if it's in PATH...
        
if not os.path.isfile('/usr/bin/gdb'):
            print(
"ERROR: you don't have gdb in your system. Please install it to run in advanced debug mode.")
            
sys.exit(1)
        
elif 'DESKTOP_SESSION' in os.environ:
            print(
"ERROR: it seems you are under a graphical environment. That's incompatible with executing advanced-debug option. You should be in a tty.")
            
sys.exit(1)
        else:
            
cli.extend(['gdb''--args'])
    
    
cli.extend(['compiz''--replace'])
    if 
options.verbose:
        
cli.append("--debug")    
    if 
args:
        
cli.extend(compiz_args)
    
    if 
log_file:
        
cli.extend(['2>&1''|''tee'log_file])

    
# shell = True as it's the simpest way to | tee.
    # In this case, we need a string and not a list
    # FIXME: still some bug with 2>&1 not showing everything before wait()
    
return subprocess.Popen(" ".join(cli), env=dict(os.environ), shell=True)
    

def run_unity (verbosedebugcompiz_argslog_file):
    
'''run the unity shell and handle Ctrl + C'''

    
try:
        
unity_instance process_and_start_unity (verbosedebugcompiz_argslog_file)
        
subprocess.Popen(["killall""unity-panel-service"])
        
unity_instance.wait()
    
except KeyboardInterrupte:
        try:
            
os.kill(unity_instance.pidsignal.SIGKILL)
        
except:
            
pass
        unity_instance
.wait()
    
sys.exit(unity_instance.returncode)

def reset_to_distro():
    
''' remove all known default local installation path '''
    
    
# check if we are root, we need to be root
    
if os.getuid() != 0:
        print 
"Error: You need to be root to remove your local unity installation"
        
return 1
    error 
False
    
    
for filedir in well_known_local_path:
        for 
elem in glob.glob(filedir):
            try:
                
shutil.rmtree(elem)
            
except OSErrore:
                if 
os.path.isfile(elem) or os.path.islink(elem):
                    
os.remove(elem)
                else:
                    print 
"ERROR: Cannot remove %s: %s" % (eleme)
                    
error True
    
    
if error:
        print 
"See above: some error happened and you should clean them before trying to restart unity"
        
return 1
    
else:
        print 
"Unity local install cleaned, you can now restart unity"
        
return 0

if __name__ == '__main__':
    
usage "usage: %prog [options]"
    
parser OptionParser(version"%prog 3.8.14"usage=usage)

    
parser.add_option("--advanced-debug"action="store_true",
                      
help="Run unity under debugging to help debugging an issue. /!\ Only if devs ask for it.")    
    
parser.add_option("--distro"action="store_true",
                      
help="Remove local build if present with default values to return to the package value (this doesn't run unity and need root access)")    
    
parser.add_option("--log"action="store",
                      
help="Store log under filename.")
    
parser.add_option("--replace"action="store_true",
                      
help="Run unity /!\ This is for compatibility with other desktop interfaces and acts the same as running unity without --replace")
    
parser.add_option("--reset"action="store_true",
                      
help="Reset the unity profile in compiz and restart it.")  
    
parser.add_option("--reset-icons"action="store_true",
                      
help="Reset the default launcher icon.")  
    
parser.add_option("-v""--verbose"action="store_true",
                      
help="Get additional debug output from unity.")
    (
optionsargs) = parser.parse_args()

    
set_unity_env()

    if 
options.distro:
        
sys.exit(reset_to_distro())
    
    if 
options.reset:
        
reset_unity_compiz_profile ()
    
    if 
options.reset_icons:
        
reset_launcher_icons ()
    
    if 
options.replace:
        print (
"WARNING: This is for compatibility with other desktop interfaces please use unity without --replace")
            
    
run_unity (options.verboseoptions.advanced_debugargsoptions.log)
Et
$ ls /usr/lib/unity
autopilot.py makebootchart.py migrate_favorites.py unity-panel-service

fabounet, Wednesday 08 June 2011 à 12:47


Subscription date : 30 November 2007
Messages : 17118
ok, dans ce cas effectivement il faudrait pouvoir le forcer au 1er lancement.
gconf devrait pouvoir marcher dynamiquement.

Technical discussions | Discussions techniques

Subjects Author Language Messages Last message
[Locked] Compiz: scale
Page : 1 2
fabounet Français 23 fabounet [Read]
10 June 2011 à 12:11


Glx-Dock / Cairo-Dock List of forums Technical discussions | Discussions techniques Compiz: scale Top

Online users :

Powered by ElementSpeak © 2007 Adrien Pilleboue, 2009-2013 Matthieu Baerts.
Dock based on CSS Dock Menu (Ndesign) with jQuery. Icons by zgegball
Cairo-Dock is a free software under GNU-GPL3 licence. First stable version created by Fabounet.
Many thanks to TuxFamily for the web Hosting and Mav for the domain name.