pax_global_header00006660000000000000000000000064131170502760014514gustar00rootroot0000000000000052 comment=7a2bf93c47c7dccafa6366bb457c9996eae336aa fusion-icon-0.2.4/000077500000000000000000000000001311705027600137505ustar00rootroot00000000000000fusion-icon-0.2.4/COPYING000066400000000000000000000431201311705027600150030ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT 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 Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. fusion-icon-0.2.4/FusionIcon/000077500000000000000000000000001311705027600160245ustar00rootroot00000000000000fusion-icon-0.2.4/FusionIcon/__init__.py000066400000000000000000000000241311705027600201310ustar00rootroot00000000000000# -*- python -*- # fusion-icon-0.2.4/FusionIcon/data.py000066400000000000000000000057021311705027600173130ustar00rootroot00000000000000# -*- python -*- # This file is part of Fusion-icon. # Fusion-icon 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; either version 2 of the License, or # (at your option) any later version. # # Fusion-icon is distributed in the hope that it will be useful, # but WITHOUT 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 Publaic License # along with this program. If not, see . # # Original copyright 2007 Christopher Williams # Author(s): crdlb, kozec, raveit65 import os mesa_libgl_locations = ( # ubuntu '/usr/lib/fglrx/libGL.so.1.2.xlibmesa', '/usr/lib/nvidia/libGL.so.1.2.xlibmesa', # gentoo '/usr/lib/opengl/xorg-x11/lib/libGL.so.1.2', # archlinux '/opt/mesa-xgl/lib/libGL.so.1.2', '/lib/mesa/libGL.so.1.2', # debian '/usr/lib/fglrx/diversions/libGL.so.1.2', '/usr/share/nvidia-glx/diversions/libGL.so.1.2', ) compiz_args = ['ccp', '--replace', '--sm-disable', '--ignore-desktop-hints'] config_home = os.environ.get('XDG_CONFIG_HOME', os.path.join(os.environ['HOME'], '.config')) config_folder = os.path.join(config_home, 'compiz') config_file = os.path.join(config_folder, 'fusion-icon') #app # base command, full command line # label apps = { 'ccsm': ('ccsm', ['ccsm'], 'Settings Manager'), 'emerald theme manager': ('emerald-theme-manager', ['emerald-theme-manager'], 'Emerald Theme Manager'), } #wm # base command, full command line # label, desktop, special flags, command to run before replacing wms = { 'marco': ('marco', ['marco', '--replace'], 'Marco', 'mate', None, None,), 'metacity': ('metacity', ['metacity', '--replace'], 'Metacity', 'gnome', None, None,), 'mutter': ('mutter', ['mutter', '--replace'], 'Mutter', 'gnome', None, None,), 'kwin': ('kde', ['kwin', '--replace'], 'KWin', 'kde', None, None), 'xfwm4': ('xfwm4', ['xfwm4'], 'Xfwm4', 'xfce', ['noreplace'], ['killall', 'xfwm4']), 'openbox': ('openbox', ['openbox', '--replace'], 'Openbox', None, None, None), 'blackbox': ('blackbox', ['blackbox', '--replace'], 'Blackbox', None, None, None), 'fvwm': ('fvwm', ['fvwm', '--replace'], 'FVWM', None, None, None), 'icewm': ('icewm', ['icewm', '--replace'], 'IceWM', None, None, None), } #decorator # base command, full command line, # label, desktop environment decorators = { 'emerald': ('emerald', 'emerald --replace', 'Emerald', None), 'gwd': ('gtk-window-decorator', 'gtk-window-decorator --replace', 'GTK+ Window Decorator', 'mate'), } #option: # (unused), switch, # label options = { 'indirect rendering': (None, '--indirect-rendering', 'Indirect Rendering'), 'loose binding': (None, '--loose-binding', 'Loose Binding'), } fusion-icon-0.2.4/FusionIcon/environment.py000066400000000000000000000117611311705027600207500ustar00rootroot00000000000000# -*- python -*- # This file is part of Fusion-icon. # Fusion-icon 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; either version 2 of the License, or # (at your option) any later version. # # Fusion-icon is distributed in the hope that it will be useful, # but WITHOUT 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, see . # # Original copyright 2007 Christopher Williams # Author(s): crdlb, nesl247, raveit65 import os from FusionIcon.execute import run tfp = 'GLX_EXT_texture_from_pixmap' class Environment: '''Detects properties of the enviroment, and provides a set() method that uses this information to export environment variables needed to start compiz.''' def __init__(self): '''desktop: current desktop enviroment used to choose interface, fallback wm, and default decorator glxinfo: output of glxinfo command indirect_glxinfo: output of glxinfo with LIBGL_ALWAYS_INDIRECT xvinfo: output of xvinfo glx_vendor: 'client glx vendor:' usually one of SGI (for mesa-based drivers), NVIDIA Corporation, or ATI. tfp: 'direct' if texture_from_pixmap is present with direct rendering (implying presence with indirect as well), 'indirect' if only present with indirect context, False if not present at all Xgl: True in Xgl''' # Check for various desktop environments if os.getenv('XDG_CURRENT_DESKTOP') == 'MATE' or os.getenv('MATE_DESKTOP_SESSION_ID') is not None: self.desktop = 'mate' elif os.getenv('XDG_CURRENT_DESKTOP') == 'XFCE' or os.getenv('DESKTOP_SESSION') in ('xfce', 'xfce4', 'Xfce Session'): self.desktop = 'xfce' elif os.getenv('XDG_CURRENT_DESKTOP', '').endswith('GNOME') or os.getenv('GNOME_DESKTOP_SESSION_ID') is not None: self.desktop = 'gnome' elif os.getenv('XDG_CURRENT_DESKTOP') == 'KDE' or os.getenv('KDE_FULL_SESSION') is not None: self.desktop = 'kde' elif os.getenv('XDG_CURRENT_DESKTOP') == 'LXQt': self.desktop = 'lxqt' elif os.getenv("XDG_CURRENT_DESKTOP") is not None: self.desktop = os.getenv('XDG_CURRENT_DESKTOP', 'unknown').lower() else: self.desktop = os.getenv('DESKTOP_SESSION', 'unknown').lower() print(' * Detected Session: ' + self.desktop) ## Save the output of glxinfo and xvinfo for later use: # don't try to run glxinfo unless it's installed if run(['which', 'glxinfo'], 'call', quiet=True) == 0: self.glxinfo = run('glxinfo', 'output') else: raise SystemExit(' * Error: glxinfo not installed!') # make a temp environment indirect_environ = os.environ.copy() indirect_environ['LIBGL_ALWAYS_INDIRECT'] = '1' self.indirect_glxinfo = run('glxinfo', 'output', env=indirect_environ) if run(['which', 'xvinfo'], 'call', quiet=True) == 0: self.xvinfo = run('xvinfo', 'output') else: raise SystemExit(' * Error: xvinfo not installed!') self.glx_vendor = None line = [l for l in self.glxinfo.splitlines() if 'client glx vendor string:' in l] if line: self.glx_vendor = ' '.join(line[0].split()[4:]) ## Texture From Pixmap / Indirect self.tfp = False if self.glxinfo.count(tfp) < 3: if self.indirect_glxinfo.count(tfp) == 3: self.tfp = 'indirect' else: self.tfp = 'direct' ## Xgl if 'Xgl' in self.xvinfo: self.Xgl = True else: self.Xgl = False def set(self): '''Trigger all environment checks''' # Check for Intel and export INTEL_BATCH if 'Intel' in self.glxinfo: print(' * Intel detected, exporting: INTEL_BATCH=1') os.environ['INTEL_BATCH'] = '1' # Check TFP and export LIBGL_ALWAYS_INDIRECT if needed if self.tfp != 'direct': print(' * No ' + tfp + ' with direct rendering context') if self.tfp == 'indirect': print(' ... present with indirect rendering, exporting: LIBGL_ALWAYS_INDIRECT=1') os.environ['LIBGL_ALWAYS_INDIRECT'] = '1' else: # If using Xgl with a proprietary driver, exports LD_PRELOAD= if self.Xgl and self.glx_vendor != 'SGI': print(' * Non-mesa driver on Xgl detected') from data import mesa_libgl_locations location = [l for l in mesa_libgl_locations if os.path.exists(l)] if location: print(' ... exporting: LD_PRELOAD=' + location[0]) os.environ['LD_PRELOAD'] = location[0] if run(['glxinfo'], 'output').count(tfp) >= 3: self.tfp = 'direct' else: # kindly let the user know... but don't abort (maybe it will work :> ) print(' ... no mesa libGL found for preloading, this may not work!') else: print(' ... nor with indirect rendering, this isn\'t going to work!') # Check for nvidia on Xorg if not self.Xgl and self.glx_vendor == 'NVIDIA Corporation': print(' * NVIDIA on Xorg detected, exporting: __GL_YIELD=NOTHING') os.environ['__GL_YIELD'] = 'NOTHING' env = Environment() fusion-icon-0.2.4/FusionIcon/execute.py000066400000000000000000000041671311705027600200500ustar00rootroot00000000000000# -*- python -*- # This file is part of Fusion-icon. # Fusion-icon 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; either version 2 of the License, or # (at your option) any later version. # # Fusion-icon is distributed in the hope that it will be useful, # but WITHOUT 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, see . # # Original copyright 2007 Christopher Williams # Author(s): crdlb, nesl247, raveit65 import subprocess, signal, os # avoid zombies signal.signal(signal.SIGCHLD, signal.SIG_IGN) def run(command, mode='spawn', quiet=False, env=None): 'Simple wrapper for the subprocess module. Supported modes: spawn, call, and output' try: if mode == 'spawn': if not quiet: popen_object = subprocess.Popen(command) else: popen_object = subprocess.Popen(command, stdout=open(os.devnull, 'w')) return popen_object elif mode == 'call': # restore normal child handling signal.signal(signal.SIGCHLD, signal.SIG_DFL) if not quiet: exitcode = subprocess.call(command, stderr=subprocess.PIPE) else: exitcode = subprocess.call(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) # turn zombie protection back on signal.signal(signal.SIGCHLD, signal.SIG_IGN) return exitcode elif mode == 'output': signal.signal(signal.SIGCHLD, signal.SIG_DFL) if not env: output = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=open(os.devnull, "w"), universal_newlines=True).communicate()[0] else: output = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=open(os.devnull, "w"), universal_newlines=True, env=env).communicate()[0] signal.signal(signal.SIGCHLD, signal.SIG_IGN) return output except OSError: print(' * execution of "' + ' '.join(command) + '" failed') return None fusion-icon-0.2.4/FusionIcon/interface.py000066400000000000000000000045071311705027600203440ustar00rootroot00000000000000# -*- python -*- # This file is part of Fusion-icon. # Fusion-icon 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; either version 2 of the License, or # (at your option) any later version. # # Fusion-icon is distributed in the hope that it will be useful, # but WITHOUT 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, see . # # Author(s): crdlb, nesl247 # # Copyright 2007 Christopher Williams import sys, os from FusionIcon.util import env from FusionIcon import start interfaces={ 'qt': 'Qt', 'gtk': 'GTK+', } def import_interface(interface): try: if interface in interfaces: print(' * Using the ' + interfaces[interface] + ' Interface') __import__('FusionIcon.interface_' + interface) else: print(' *** Error: "' + interface + '" interface is invalid, this should not happen') raise SystemExit except ImportError as e: if [i for i in interfaces if 'interface_' + i in str(e)]: print(' * Interface not installed') else: print(' * ' + str(e)) #doesn't work so remove it from the dict del interfaces[interface] if interfaces: print(' ... Trying another interface') choose_interface() else: print(' *** Error: All interfaces failed, aborting!') raise SystemExit def choose_interface(try_first=None): chosen_interface = None # handle explicit choice first if try_first: if try_first in interfaces: chosen_interface = try_first else: raise SystemExit(' *** Error: No such interface: ' + try_first) else: # use qt for kde and lxqt; gtk for everything else: if os.getenv('FUSION_ICON_INTERFACE') in interfaces: chosen_interface = os.getenv('FUSION_ICON_INTERFACE') elif 'qt' in interfaces and env.desktop in ('kde', 'lxqt'): chosen_interface = 'qt' elif 'gtk' in interfaces: chosen_interface = 'gtk' elif 'qt' in interfaces: chosen_interface = 'qt' # interfaces is empty else: raise SystemExit(' *** no available interfaces, this should not happen') import_interface(chosen_interface) fusion-icon-0.2.4/FusionIcon/interface_gtk/000077500000000000000000000000001311705027600206315ustar00rootroot00000000000000fusion-icon-0.2.4/FusionIcon/interface_gtk/__init__.py000066400000000000000000000000741311705027600227430ustar00rootroot00000000000000# -*- python -*- from FusionIcon.interface_gtk import main fusion-icon-0.2.4/FusionIcon/interface_gtk/main.py.in000066400000000000000000000143331311705027600225400ustar00rootroot00000000000000# -*- python -*- # This file is part of Fusion-icon. # Fusion-icon 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; either version 2 of the License, or # (at your option) any later version. # # Fusion-icon is distributed in the hope that it will be useful, # but WITHOUT 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, see . # # Based on compiz-icon, Copyright 2007 Felix Bellanger # # Original author: crdlb # GI port: kozec # AppIndicator port: XRevan86 # author: raveit65 import os, time, gi try: gi.require_version('Gdk', '@gtkver@') gi.require_version('Gtk', '@gtkver@') gi.require_version('AppIndicator@aiver@', '0.1') except ValueError as e: # enable interface fallbacking (works only for ImportError) raise ImportError(e) from gi.repository import Gdk, Gtk from gi.repository import AppIndicator@aiver@ as AppIndicator from FusionIcon.start import wms, apps, options, decorators, init class TrayMenu(Gtk.Menu): def __init__(self): Gtk.Menu.__init__(self) #CCSM if 'ccsm' in apps: item = ApplicationItem('ccsm') item.set_image(Gtk.Image.new_from_icon_name('preferences-system', Gtk.IconSize.MENU)) self.append(item) #Emerald Theme Manager if 'emerald theme manager' in apps: item = ApplicationItem('emerald theme manager') if Gtk.IconTheme.get_default().lookup_icon('emerald-theme-manager-icon', 0, Gtk.IconLookupFlags.USE_BUILTIN) is not None: item.set_image(Gtk.Image.new_from_icon_name('emerald-theme-manager-icon', Gtk.IconSize.MENU)) else: item.set_image(Gtk.Image.new_from_icon_name('emerald-theme-manager', Gtk.IconSize.MENU)) self.append(item) if 'ccsm' in apps or 'emerald theme manager' in apps: item = Gtk.SeparatorMenuItem() self.append(item) #Reload item = Gtk.ImageMenuItem(label='Reload Window Manager') item.connect('activate', self.reload_activate) item.set_image(Gtk.Image.new_from_icon_name('view-refresh', Gtk.IconSize.MENU)) if not wms: item.set_sensitive(False) self.append(item) #Window Manager item = Gtk.ImageMenuItem(label='Select Window Manager') item.set_image(Gtk.Image.new_from_icon_name('view-restore', Gtk.IconSize.MENU)) submenu = WindowManagerMenu() item.set_submenu(submenu) if not wms: item.set_sensitive(False) self.append(item) #Compiz Options item = Gtk.ImageMenuItem(label='Compiz Options') item.set_image(Gtk.Image.new_from_icon_name('document-properties', Gtk.IconSize.MENU)) submenu = CompizOptionMenu() item.set_submenu(submenu) if not options: item.set_sensitive(False) else: self.append(item) #Window Decorator item = Gtk.ImageMenuItem(label='Select Window Decorator') item.set_image(Gtk.Image.new_from_icon_name('window-new', Gtk.IconSize.MENU)) submenu = CompizDecoratorMenu() item.set_submenu(submenu) if not decorators: item.set_sensitive(False) self.append(item) item = Gtk.SeparatorMenuItem() self.append(item) item = Gtk.ImageMenuItem.new_from_stock(Gtk.STOCK_QUIT) item.connect('activate', self.quit_activate) self.append(item) self.action_item = Gtk.MenuItem() self.action_item.connect('activate', self.show_menu_activate) self.action_item.show() # Fool libappindicator into thinking this is menu's child. self.action_item.set_parent(self) def show_menu_activate(self, widget): self.show_all() try: self.popup(None, None, None, None, 1, Gdk.CURRENT_TIME) except AttributeError: pass def reload_activate(self, widget): wms.restart() def quit_activate(self, widget): Gtk.main_quit() class ApplicationItem(Gtk.ImageMenuItem): def __init__(self, app): Gtk.ImageMenuItem.__init__(self, label=apps[app].label) self.app = app if app not in apps: self.set_sensitive(False) self.connect('activate', self.activate) def activate(self, widget): apps[self.app].launch() class WindowManagerItem(Gtk.RadioMenuItem): def __init__(self, wm, group): Gtk.RadioMenuItem.__init__(self, label=' %s' %wms[wm].label, group=group) self.wm = wm if wms.active == wm: self.set_active(True) self.connect('activate', self.activate) def activate(self, widget): if widget.get_active(): wms.active = self.wm wms.start() class WindowManagerMenu(Gtk.Menu): def __init__(self): Gtk.Menu.__init__(self) prev = None for wm in wms.ordered_list: item = WindowManagerItem(wm, prev) self.append(item) prev = item class CompizOptionItem(Gtk.CheckMenuItem): def __init__(self, option): Gtk.CheckMenuItem.__init__(self, label=' %s' %options[option].label) self.option = option self.set_active(options[option].enabled) if not options[option].sensitive: self.set_sensitive(False) self.connect('activate', self.activate) def activate(self, widget): options[self.option].enabled = widget.get_active() if wms.active == 'compiz': wms.start() class CompizOptionMenu(Gtk.Menu): def __init__(self): Gtk.Menu.__init__(self) for option in options: item = CompizOptionItem(option) self.append(item) class CompizDecoratorItem(Gtk.RadioMenuItem): def __init__(self, decorator, group): Gtk.RadioMenuItem.__init__(self, label=' %s' %decorators[decorator].label, group=group) self.decorator = decorator if decorators.active == decorator: self.set_active(True) self.connect('activate', self.activate) def activate(self, widget): if widget.get_active(): decorators.active = self.decorator class CompizDecoratorMenu(Gtk.Menu): def __init__(self): Gtk.Menu.__init__(self) prev = None for decorator in decorators: item = CompizDecoratorItem(decorator, prev) item.set_name(str(decorator)) self.append(item) prev = item icon = AppIndicator.Indicator.new('Fusion Icon', 'fusion-icon', AppIndicator.IndicatorCategory.APPLICATION_STATUS) icon.set_status(AppIndicator.IndicatorStatus.ACTIVE) menu = TrayMenu() icon.set_menu(menu) icon.set_secondary_activate_target(menu.action_item) menu.show_all() # active wm (possibly) starts here init() Gtk.main() fusion-icon-0.2.4/FusionIcon/interface_qt/000077500000000000000000000000001311705027600204705ustar00rootroot00000000000000fusion-icon-0.2.4/FusionIcon/interface_qt/__init__.py000066400000000000000000000000731311705027600226010ustar00rootroot00000000000000# -*- python -*- from FusionIcon.interface_qt import main fusion-icon-0.2.4/FusionIcon/interface_qt/main.py.in000066400000000000000000000111251311705027600223730ustar00rootroot00000000000000# -*- python -*- # This file is part of Fusion-icon. # Fusion-icon 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; either version 2 of the License, or # (at your option) any later version. # # Fusion-icon is distributed in the hope that it will be useful, # but WITHOUT 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, see . # Author(s): xsacha, XRevan86, raveit65 import sys, os, time from PyQt@qtver@ import QtCore, QtGui if tuple(map(int, (QtCore.QT_VERSION_STR.split('.')))) < (4, 6, 0): raise ImportError('Qt 4.6.x or later required') try: from PyQt@qtver@ import QtWidgets except ImportError: from PyQt@qtver@ import QtGui as QtWidgets from FusionIcon.start import wms, apps, options, decorators, init from FusionIcon.execute import run class Build(QtWidgets.QApplication): def reload_wm(self): wms.restart() def toggleWM(self, wm): if wms.active != wm: wms.active = wm wms.start() def toggleOP(self, option): options[option].enabled = not options[option].enabled if wms.active == 'compiz': wms.start() def toggleWD(self, decorator): decorators.active = decorator def __init__(self, parent=None): QtCore.QObject.__init__(self, parent) self.setApplicationName('Fusion Icon') image = QtGui.QIcon() for iconName in ('fusion-icon', 'image-missing'): if QtGui.QIcon.hasThemeIcon(iconName): image = QtGui.QIcon.fromTheme(iconName) break self.Tray = QtWidgets.QSystemTrayIcon(image) self.Tray.setToolTip('Fusion Icon') self.Tray.managerMenu = QtWidgets.QMenu() self.Tray.optionsMenu = QtWidgets.QMenu() self.Tray.decoratorMenu = QtWidgets.QMenu() self.groupManager = QtWidgets.QActionGroup(self.Tray.managerMenu) self.groupDecorator = QtWidgets.QActionGroup(self.Tray.decoratorMenu) for wm in wms.ordered_list: actionWM = self.groupManager.addAction(self.Tray.managerMenu.addAction(wms[wm].label, lambda val=wm : self.toggleWM(val))) actionWM.setCheckable(True) if wms.active == wm: actionWM.setChecked(True) for option in options: actionOP = self.Tray.optionsMenu.addAction(options[option].label, lambda val=option: self.toggleOP(val)) actionOP.setCheckable(True) if not options[option].sensitive: actionOP.setEnabled(False) actionOP.setChecked(options[option].enabled) for decorator in decorators: actionWD = self.groupDecorator.addAction(self.Tray.decoratorMenu.addAction(decorators[decorator].label, lambda val=decorator: self.toggleWD(val))) actionWD.setCheckable(True) if decorators.active == decorator: actionWD.setChecked(True) self.Tray.menu = QtWidgets.QMenu() if 'ccsm' in apps: self.Tray.menu.addAction(QtGui.QIcon.fromTheme('preferences-system'), apps['ccsm'].label, lambda: run(['ccsm'])) if 'emerald theme manager' in apps: self.Tray.menu.addAction(QtGui.QIcon.fromTheme('emerald-theme-manager', QtGui.QIcon('/usr/share/pixmaps/emerald-theme-manager-icon.png')), \ apps['emerald theme manager'].label, lambda: run(apps['emerald theme manager'].command)) if 'ccsm' in apps or 'emerald theme manager' in apps: self.Tray.menu.addSeparator() self.Tray.menu.addAction(QtGui.QIcon.fromTheme('view-refresh'), 'Reload Window Manager', self.reload_wm) self.Tray.menu.addAction(QtGui.QIcon.fromTheme('view-restore'), 'Select Window Manager').setMenu(self.Tray.managerMenu) self.Tray.menu.addAction(QtGui.QIcon.fromTheme('document-properties'), 'Compiz Options').setMenu(self.Tray.optionsMenu) self.Tray.menu.addAction(QtGui.QIcon.fromTheme('window-new'), 'Select Window Decorator').setMenu(self.Tray.decoratorMenu) self.Tray.menu.addSeparator() self.Tray.menu.addAction(QtGui.QIcon.fromTheme('application-exit'), 'Quit', self.exit) self.Tray.setContextMenu(self.Tray.menu) self.Tray.show() self.Tray.activated.connect(self.showMenu) init() def showMenu(self, reason): # Show the menu on left clicking as well. if reason == QtWidgets.QSystemTrayIcon.Trigger: pos = None if self.Tray.geometry().isValid(): rect = self.Tray.geometry() pos = QtCore.QPoint(rect.left() + (rect.width() / 2), rect.bottom() + 1) elif int(QtCore.QT_VERSION_STR.split('.')[0]) >= 5: # With SNI this will be used, unless Qt4 (sni-qt). pos = QtGui.QCursor.pos() if pos: self.Tray.contextMenu().popup(pos) Build(sys.argv).exec_() fusion-icon-0.2.4/FusionIcon/parser.py000066400000000000000000000040501311705027600176710ustar00rootroot00000000000000# -*- python -*- # This file is part of Fusion-icon. # Fusion-icon 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; either version 2 of the License, or # (at your option) any later version. # # Fusion-icon is distributed in the hope that it will be useful, # but WITHOUT 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, see . # # Original copyright 2007 Christopher Williams # Author(s): crdlb, kozec, raveit65 from optparse import OptionParser, OptionGroup parser = OptionParser(usage='usage: %prog [options|action]', version='%prog-0.0.0') parser.add_option('--reset', action='store_true', dest='reset', help='remove configuration file and exit') parser.add_option('-s', '--sleep', type='int', dest='seconds', help='Sleep before launching') parser.add_option('-v', '--verbose', action='store_true', dest='verbose', help='Print extra output') interface_group = OptionGroup(parser, 'Interface Options') interface_group.add_option('-i', '--interface', dest='interface', help='Try a certain interface first') interface_group.add_option('-u', '--no-interface', action='store_true', dest='no_interface', help='Do not use any interface') parser.add_option_group(interface_group) startup_group = OptionGroup(parser, 'Startup Options') startup_group.add_option('-f', '--force-compiz', action='store_true', dest='force_compiz', help='Start compiz regardless of environment or configuration') startup_group.add_option('-n', '--no-start', action='store_true', dest='no_start', help='Run, but do not start a window manager') parser.add_option_group(startup_group) options, args = parser.parse_args() # fusion-icon accepts no arguments if args: parser.error('no such argument: ' + args[0]) fusion-icon-0.2.4/FusionIcon/start.py000066400000000000000000000041011311705027600175270ustar00rootroot00000000000000# -*- python -*- # This file is part of Fusion-icon. # Fusion-icon 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; either version 2 of the License, or # (at your option) any later version. # # Fusion-icon is distributed in the hope that it will be useful, # but WITHOUT 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, see . # # Original copyright 2007 Christopher Williams # Author(s): crdlb, nesl247, raveit65 from FusionIcon.parser import options as parser_options from FusionIcon.util import env, config, apps, options, wms, decorators def init(): 'Final start function, should be called once when fusion-icon starts' if not parser_options.no_start: # Do not restart the wm if it's already running if wms.active == wms.active == wms.old != 'compiz': #always restart compiz since we can't know compiz was started correctly print(' * ' + wms[wms.active].label + ' is already running') else: print(' * Starting ' + wms[wms.active].label) wms.start() config.check() # Make some changes if not parser_options.force_compiz: if wms.active not in wms: print(' * "' + wms.active + '" not installed') if wms.fallback: print(' ... setting to fallback...') else: print(' ... No fallback window manager chosen') wms.active = wms.fallback elif 'compiz' in wms: wms.active = 'compiz' else: raise SystemExit(' *** Error: "--force-compiz" used and compiz not installed!') # Set True if using Xorg AIGLX since the '--indirect-rendering' option has no effect in that situation. env.set() if env.tfp == 'indirect' and 'indirect rendering' in options: options['indirect rendering'].sensitive = False if not options['indirect rendering'].enabled: options['indirect rendering'].enabled = True fusion-icon-0.2.4/FusionIcon/util.py000066400000000000000000000263211311705027600173570ustar00rootroot00000000000000# -*- python -*- # This file is part of Fusion-icon. # Fusion-icon 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; either version 2 of the License, or # (at your option) any later version. # # Fusion-icon is distributed in the hope that it will be useful, # but WITHOUT 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, see . # # Based on compiz-icon, Copyright 2007 Felix Bellanger # # Original copyright 2007 Christopher Williams # Author(s): crdlb, kozec, raveit65 import os, compizconfig, time try: import configparser except ImportError: # Python 2.x compatibility. import ConfigParser as configparser import FusionIcon.data as _data from FusionIcon.parser import options as parser_options from FusionIcon.environment import env from FusionIcon.execute import run import subprocess, signal def is_running(app): 'Use pgrep to determine if an app is running' if run(['pgrep', app], 'call', quiet=True) == 0: return True class Application(object): def __init__(self, name, apps, installed): self.name = name self.apps = apps self.base = installed.apps[name][0] self.command = installed.apps[name][1] self.label = installed.apps[name][2] def launch(self): print(' * Launching ' + self.label) run(self.command) class Applications(dict): def __init__(self, installed): for app in installed.apps: self[app] = Application(app, self, installed) class CompizOption(object): def __init__(self, name, options, installed, config): self.options = options self.config = config self.name = name self.switch = installed.options[name][1] self.label = installed.options[name][2] self.sensitive = True def __get(self): return self.config.getboolean('compiz options', self.name) def __set(self, value): print(' * Setting option ' + self.label + ' to ' + value) self.config.set('compiz options', self.name, str(bool(value)).lower()) self.config.write(open(self.config.config_file, 'w')) enabled = property(__get, __set) class CompizOptions(dict): def __init__(self, installed, config): for option in installed.options: self[option] = CompizOption(option, self, installed, config) class WindowManager(object): def __init__(self, name, wms, installed): self.wms = wms self.name = name self.base = installed.wms[name][0] self.command = installed.wms[name][1] self.label = installed.wms[name][2] self.desktop = installed.wms[name][3] if installed.wms[name][4]: self.flags = installed.wms[name][4] else: self.flags = [] self.killcmd = installed.wms[name][5] class WindowManagers(dict): def __init__(self, installed, config): self.config = config for wm in installed.wms: self[wm] = WindowManager(wm, self, installed) self.fallback = None wm = [w for w in self if self[w].desktop == env.desktop] if wm: self.fallback = wm[0] elif [w for w in self if w != 'compiz']: self.fallback = list([w for w in self if w != 'compiz'])[0] self.__set_old() self.ordered_list = [] for wm in ('compiz', self.fallback): if wm in self: self.ordered_list.append(wm) self.ordered_list.extend([wm for wm in self if wm not in self.ordered_list]) def __get(self): return self.config.get('window manager', 'active wm') def __set(self, value): if value in wms: print(' * Setting window manager to ' + wms[value].label) elif not value: print(' * Setting window manager to empty value') self.config.set('window manager', 'active wm', str(value)) self.config.write(open(self.config.config_file, 'w')) def __set_old(self): self.old = None running_wm = [wm for wm in self if is_running(wm)] if running_wm: # not perfect, but good enough self.old = running_wm[0] def start(self): 'Start the active window manager' self.__set_old() if self.active == 'compiz' and self.old and self[self.old].killcmd: if run(['which', self[self.old].killcmd[0]], 'call', quiet=True) == 0: run(self[self.old].killcmd, 'call') time.sleep(1) if self.active and self.old and 'noreplace' in self[self.active].flags: run(['killall', self[self.old].base], 'call') time.sleep(1) if self.active == 'compiz': # use a copy, not the original compiz_command = self['compiz'].command[:] for option in options: if options[option].enabled: if options[option].switch is not None: compiz_command.append(options[option].switch) kill_list = ['killall'] for decorator in decorators: kill_list.append(decorators[decorator].base) run(kill_list, 'call') time.sleep(0.5) # do it print(' ... executing: ' + ' '.join(compiz_command)) run(compiz_command, quiet=False) elif self.active: run(self[self.active].command) else: print(' * No active WM set; not going to do anything.') def restart(self): if wms.active: print(' * Reloading ' + wms.active) self.start() else: print(' * Not reloading, no active window manager set') active = property(__get, __set) class CompizDecorator(object): def __init__(self, name, decorators, installed): self.decorators = decorators self.name = name self.base = installed.decorators[name][0] self.command = installed.decorators[name][1] self.label = installed.decorators[name][2] self.desktop = installed.decorators[name][3] def kill_others(self): killall = ['killall'] for decorator in [x for x in self.decorators if x != self.name]: killall.append(self.decorators[decorator].base) run(killall, 'call') class CompizDecorators(dict): def __init__(self, installed): # Open CompizConfig context if parser_options.verbose: print(' * Opening CompizConfig context') context = compizconfig.Context() # Either Compiz 0.9.x or Compiz 0.8.x. if 'decor' in context.Plugins: self.command = context.Plugins['decor'].Screen['command'] else: self.command = context.Plugins['decoration'].Display['command'] for decorator in installed.decorators: self[decorator] = CompizDecorator(decorator, self, installed) self.default = None decorator = [d for d in self if self[d].desktop == env.desktop] if decorator: self.default = decorator[0] elif 'emerald' in self: self.default = 'emerald' elif self: self.default = next(iter(self)) def __set(self, decorator): if decorator in self: decorators[decorator].kill_others() time.sleep(0.5) self.command.Plugin.Context.ProcessEvents() print(' * Setting decorator to ' + self[decorator].label + \ ' ("' + self[decorator].command + '")') self.command.Value = self[decorator].command self.command.Plugin.Context.Write() elif not decorator: print(' * Not setting decorator to none') def __get(self): _decorator = [d for d in self if self.command.Value == self[d].command] if _decorator: decorator = _decorator[0] else: print(' * Decorator "' + self.command.Value + '" is invalid.') self.active = self.default decorator = self.command.Value return decorator active = property(__get, __set) class Installed(object): def __init__(self, data): print(' * Searching for installed applications...') ### Compiz Detection bins = {} for name in ('compiz', 'compiz.real'): bin = run(['which', name], 'output') if bin: bins[name] = bin if 'compiz' in bins and 'compiz.real' in bins: if bins['compiz'].split(os.sep)[:-1] == bins['compiz.real'].split(os.sep)[:-1]: compiz = 'compiz.real' else: compiz = 'compiz' elif 'compiz.real' in bins: compiz = 'compiz.real' elif 'compiz' in bins: compiz = 'compiz' else: compiz = None output = '' for name in bins: if len(bins) > 1 and name == compiz: selected = ' <*>' else: selected = '' output += ' -- ' + bins[name] + selected ### Everything Else self.wms = data.wms.copy() for wm in data.wms: which = run(['which', data.wms[wm][0]], 'output') if which: output += ' -- ' + which else: del self.wms[wm] if compiz: data.compiz_args.insert(0, compiz) self.wms['compiz'] = (compiz, data.compiz_args, 'Compiz', None, None, None) self.decorators = data.decorators.copy() for decorator in data.decorators: which = run(['which', data.decorators[decorator][0]], 'output') if which: output += ' -- ' + which else: del self.decorators[decorator] self.apps = data.apps.copy() for app in data.apps: which = run(['which', data.apps[app][0]], 'output') if which: output += ' -- ' + which else: del self.apps[app] if parser_options.verbose: print(output.rstrip()) compiz_optionlist = [] self.options = data.options.copy() if compiz: compiz_help = run([compiz, '--help'], 'output') for item in compiz_help.split(): item = item[1:].strip(" \r\n\t]") if item.startswith('--'): compiz_optionlist.append(item) for option in data.options: if data.options[option][1] not in compiz_optionlist: del self.options[option] class Configuration(configparser.ConfigParser): def __init__(self, data): configparser.ConfigParser.__init__(self) self.config_folder = data.config_folder self.config_file = data.config_file def check(self): # Configuration file setup if not os.path.exists(self.config_folder): if parser_options.verbose: print(' * Creating configuration folder...') os.makedirs(self.config_folder) if not os.path.exists(self.config_file): if parser_options.verbose: print(' * Creating configuration file...') self.create_config_file() try: # Read the file self.read(self.config_file) # Validate the file by trying to read all values for option in options: value = options[option].enabled value = wms.active except: # back it up and make a new one print(' * Configuration file (' + self.config_file + ') invalid') self.reset_config_file() print(' * Generating new configuration file') self.create_config_file() def create_config_file(self): 'Set default values for configuration file' def prune(section, optlist): for option in [o for o in self.options(section) if o not in optlist]: self.remove_option(section, option) for section in ('compiz options', 'window manager'): if not self.has_section(section): self.add_section(section) for option in options: self.set('compiz options', option, 'false') self.set('window manager', 'active wm', 'compiz') prune('compiz options', options) prune('window manager', ['active wm']) self.write(open(self.config_file, 'w')) def reset_config_file(self): 'Backup configuration file' if os.path.exists(self.config_file): config_backup = '%s.backup.%s' \ %(self.config_file, time.strftime('%Y%m%d%H%M%S')) os.rename(self.config_file, config_backup) print(' ... backed up to: ' + config_backup) else: print(' ... no configuration file found') # Instantiate... _installed = Installed(_data) config = Configuration(_data) apps = Applications(_installed) options = CompizOptions(_installed, config) wms = WindowManagers(_installed, config) decorators = CompizDecorators(_installed) fusion-icon-0.2.4/MANIFEST000066400000000000000000000010611311705027600150770ustar00rootroot00000000000000fusion-icon setup.py Makefile VERSION COPYING NEWS fusion-icon.desktop fusion-icon.appdata.xml FusionIcon/__init__.py FusionIcon/data.py FusionIcon/interface.py FusionIcon/parser.py FusionIcon/interface_qt/__init__.py FusionIcon/interface_qt/main.py.in FusionIcon/interface_gtk/__init__.py FusionIcon/interface_gtk/main.py.in FusionIcon/util.py FusionIcon/environment.py FusionIcon/execute.py FusionIcon/start.py images/22x22/fusion-icon.png images/24x24/fusion-icon.png images/32x32/fusion-icon.png images/48x48/fusion-icon.png images/scalable/fusion-icon.svg fusion-icon-0.2.4/Makefile000066400000000000000000000003331311705027600154070ustar00rootroot00000000000000PREFIX = '/usr' DESTDIR = '/' interfaces = 'qt gtk' all: @python setup.py build install: @python setup.py install --prefix=${PREFIX} --root=${DESTDIR} uninstall: @python setup.py uninstall clean: rm -rf build/ fusion-icon-0.2.4/NEWS000066400000000000000000000050541311705027600144530ustar00rootroot00000000000000Release 0.2.4 (2017-06-10 Sorokin Alexei ) =============================================================== Make the application ID for SNI the same as in AppIndicator in Qt5: "Fusion Icon". Can affect the icon ordering. Stop using fusion-icon-panel in the Qt frontend. The icon is expected to sometimes be symbolic. Hence explicit lookup for it can cause problems. Implement left-click action with SNI on Qt5. Open menu on "secondary action" in GTK+3. Fix an issue with Python 3. Release 0.2.3 (2017-04-18 Sorokin Alexei ) =============================================================== Fix fail to fallback from GTK+ if deps are not met. Add Python3 support. Use /usr/local as a default prefix path. Release 0.2.2 (2016-03-09 Sorokin Alexei ) =============================================================== Fix a crash in some cases caused by an error in DE detection. Acknowledge fusion-icon-panel icon in Qt frontend. Some minor fixes. Release 0.2.1 (2016-02-21 Sorokin Alexei ) =============================================================== Add left click action on Qt frontend. Fix an icon of Emerald Theme Manager 0.8.12.1 on Gtk frontend. Release 0.2.0 (2016-02-12 Sorokin Alexei ) =============================================================== Restore Qt frontend with fixes, menu entry icons and Qt5 support (Qt version is selectable via --with-qt=4.0/5.0 setup.py arg). Restore Gtk2 support (selectable via --with-gtk=2.0/3.0 setup.py argument). Gtk frontend is the default one, except for KDE and LXQt where Qt is defaulted instead. Note that one can select desired frontend manually with $FUSION_ICON_INTERFACE environment variable. Replace icons for Window Manager and Window Decorator entries with icons from icon themes (were from deprecated GtkStock). Drop mate-window-decorator.py hacks as script itself was removed. Release 0.1.2 (2015-12-20 Sorokin Alexei ) ================================================================ Create the tray icon using appindicators (SNI-tray). Actualise desktop environments detection. Use mate-window-decorator instead of setting Marco theme manually. Add partial Compiz 0.9.x support. Make it possible to set fusion-icon as a WM in MATE. Release 0.1.1 (2015-11-20 Wolfgang Ulbrich ) ================================================================== Add Gtk3 frontend. Drop Gtk2 and Qt4 frontends. If no options are available, do not show the menu. Add Marco support. fusion-icon-0.2.4/README.md000066400000000000000000000001211311705027600152210ustar00rootroot00000000000000fusion-icon =========== Fusion Icon (Compiz tray icon) for Compiz 0.8.x series. fusion-icon-0.2.4/VERSION000066400000000000000000000000061311705027600150140ustar00rootroot000000000000000.2.4 fusion-icon-0.2.4/fusion-icon000077500000000000000000000035341311705027600161340ustar00rootroot00000000000000#!/usr/bin/env python # This file is part of Fusion-icon. # Fusion-icon 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; either version 2 of the License, or # (at your option) any later version. # # Fusion-icon is distributed in the hope that it will be useful, # but WITHOUT 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, see . import os, sys, time, signal try: import FusionIcon except ImportError: raise SystemExit(' * Error: the "FusionIcon" module is missing. If you did not install fusion-icon to /usr, you may need to add the appropriate site-packages directory to your PYTHONPATH') signal.signal(signal.SIGINT, signal.SIG_DFL) # parse command line from FusionIcon.parser import options if options.reset: try: from FusionIcon.data import config_file print(' * Configuration file (' + config_file + ') being reset') if os.path.exists(config_file): config_backup = '%s.backup.%s' %(config_file, time.strftime('%Y%m%d%H%M%S')) os.rename(config_file, config_backup) print(' ... backed up to: ' + config_backup) else: print(' ... no configuration file found') except: print(' *** Error: configuration reset failed:') raise SystemExit sys.exit() if options.seconds and 0 < options.seconds <= 60: print(' * Sleeping for ' + options.seconds + ' seconds') time.sleep(options.seconds) if options.no_interface: # a skeleton interface from FusionIcon.start import init init() else: from FusionIcon.interface import choose_interface choose_interface(try_first=options.interface) fusion-icon-0.2.4/fusion-icon.appdata.xml000066400000000000000000000010721311705027600203340ustar00rootroot00000000000000 fusion-icon.desktop CC0-1.0 GPL-2.0+

This package provides a tray icon that allows you to easily enable, disable and restart Compiz, and change the currently used window manager and/or window decorator.

https://github.com/compiz-reloaded/fusion-icon
fusion-icon-0.2.4/fusion-icon.desktop000066400000000000000000000005331311705027600175750ustar00rootroot00000000000000[Desktop Entry] Name=Compiz Fusion Icon Comment=Start and manage Compiz Exec=fusion-icon Icon=fusion-icon Terminal=false Type=Application Categories=Utility; X-MATE-Autostart-Phase=WindowManager X-MATE-Provides=windowmanager X-MATE-WMName=fusion-icon X-GNOME-Autostart-Phase=WindowManager X-GNOME-Provides=windowmanager X-GNOME-WMName=fusion-icon fusion-icon-0.2.4/images/000077500000000000000000000000001311705027600152155ustar00rootroot00000000000000fusion-icon-0.2.4/images/22x22/000077500000000000000000000000001311705027600157745ustar00rootroot00000000000000fusion-icon-0.2.4/images/22x22/fusion-icon.png000066400000000000000000000021111311705027600207260ustar00rootroot00000000000000PNG  IHDRĴl;bKGD pHYs  tIME (XIDAT8˭KlTU{gδc iS#P@QB!+W\I0&hb{W. L#ƸB HȻ@>13N-I$=qxۆΪmWfyoO]rxDc gC5 k!JʓkxLbB,9x!Ϝ4l8 Jו")JJl9jnA *OFE2MϜz0;Ofy6=FߤGwDgw>/\di2nBҦEGPୗٔ\C5^0^* \l.L!xAosx&BuEݮ`l 2V!@ V+|š_0V"|0 k[[N.PơL۵W+ 17I25%T[+Su1$Qp'58y<ĩi"^4 Ɨ=΃'yu߫ˍ[XBk+LsE&S{{/>śGoDj5Sz+ke,3eQ\ Fٱs<^`Wɒե-IekTRm8z35ڎf[X,6K-Ib4uy^6wז*Q^5%kg\!P3I!CWgM%[5-jq:mݹwp``K%+( <(b in.OEtf:r|&7h.TK($￸<}@ .k7m}ɾrOOgw(0L֛)f#?Tv,3 ho]JA?j_䏇Nٴ1\ym3jxIENDB`fusion-icon-0.2.4/images/24x24/000077500000000000000000000000001311705027600160005ustar00rootroot00000000000000fusion-icon-0.2.4/images/24x24/fusion-icon.png000066400000000000000000000034331311705027600207420ustar00rootroot00000000000000PNG  IHDRbKGD pHYs   vpAgxLIDATXWMlU=͌=dخ jnURbX !6EYDE,ZT+*QPWI$7;ߌy,&'i!},uX$i qK!ɹ۶Bժx@!ǏӔO_t6@mS:991qf_|CCoJq3MJ|E!$g $sۮT_Ά+utHZK]((أ>|XOO,r3fi++lThwIENDB`fusion-icon-0.2.4/images/32x32/000077500000000000000000000000001311705027600157765ustar00rootroot00000000000000fusion-icon-0.2.4/images/32x32/fusion-icon.png000066400000000000000000000031151311705027600207350ustar00rootroot00000000000000PNG  IHDR szzsBIT|d pHYs:tEXtSoftwarewww.inkscape.org<IDATX͗Kl\Wy{ǎS۩`&TEl) $*$Bleق`v%A,PU*inv4}y|,yO@BB\)Dz'ϧj'Ώ$.*򝝯C7Ŧ(}ISJ @zũ5)IU V(;ᛣ g>2W+e8"]h(qA8Ak3m)eOXihZXDx{ƆW9S~[/USi=DTlεRA姟;`!u5"Frq8ۿ?4T&6}$ :aȏAqr-]AE ݪp9" {dȆ.PS['m#}^m(cIƢHOLp"_K%E|['ij䇴!xNբ*ۜ幅A~67QNUB^?%y*>X̧6QX!hk)Bwye-"6 gIG\"/l b ^xmSlˠ<0 bϊO<܆b`gS)l.Õ۔bc̤}{V,m 8j+RJ]|9a=*@:ލ{PbOE|{*ϱR 4d@ITB)R*k׮lZlZ3jϝeJF)qz7N*xཐI)$}a֬ $dP(L7mlozElJlKE D͕M&<}uE54(M}4} A\Yk$FTj'/.L~ɡ㓣lvDoh&2FJܸBԯw^@+_io߽[߀]O UK 3O|in|f~fxhvtb`pDOfXX)W.V(El|X.vRmJ%@ z]{cyW^z=` J/U:T}ծZ@(JSC>&X]f黭AĀcBCמ>aN+v,IENDB`fusion-icon-0.2.4/images/48x48/000077500000000000000000000000001311705027600160145ustar00rootroot00000000000000fusion-icon-0.2.4/images/48x48/fusion-icon.png000066400000000000000000000046331311705027600207610ustar00rootroot00000000000000PNG  IHDR00WbKGDtIME0N =IDAThYlw?ٙcmv8.9hB (E P+>' OPZ(E#i(%u!I=g0zYҟ/|!_1s-ϊQ1|^^BFщnsƺցq%v+ ..{;ƁF׺nx)WcMbog8t]IDLq1AAC† Kl>ytu'Pp]I=qlKƬt!cPԂeeX,! 9:RVbMs9W=9 xdOX\Iф-HH%`YsҐUPP[g߽= ۚ4VC-̕>("kxtbJ<,v79bV( 9 6Xޙ '/8~TQ?ϮIx1'/EJ=4*l#o}DWm}`}K#kPvqB~f + ,j:!z',v{/^)Wʪ&V` ^%OTKfp_mނv -W+fJ*Aq]_sFҠ+UhMZ5LLVJڷsѡZHy铢_ݱnCݨzJʵPʠK$>u̅ORy JwfJ5+ %ïL OHIX_'1L@ J2 (WW~{t9f3s$ 4w0T& O}@)ͧv7O.Z0qn@ LiY_LoW%`h̊ui]Yt[X CP=m %^)CHh_xo #GU&Ľ_߁uB(EYv[,vܡձV sS5V>{c2H6JӗiAfZe vx@.dZSؾsLˋpd1(mb|n%vk hځ~`h;ٞʌ fFRC]o )m+$=שIoVyAjg(/Qm$;RdZZO':_槎G! V7hu, @ztc]SmTwz#nJgm;]fY"yLY)`yf%i73G \5s?xOO.\8:p(ZY)G՜ת$r}ei {G2==pKW_&Re#94vP墼xS?Tҹl p7]$QZKXV@% '=chftH`jpkwO:3{Y{ gϽُؓBz"""cQX28p:VYWڨDzj+kp)25VYhFa%7TL_OQK6 +|]E^ԋjrFוg image/svg+xml Compiz Logo (fancy) Jakub Steiner Based on logo design by Srdjan Prodanovic (some1else) - http://forum.go-compiz.org/viewtopic.php?p=1839 compiz logo bling http://jimmac.musichall.cz fusion-icon-0.2.4/setup.py000077500000000000000000000101571311705027600154710ustar00rootroot00000000000000#!/usr/bin/env python import sys, os from stat import * from distutils.core import setup from distutils.command.install import install as _install INSTALLED_FILES = '.installed_files' #stolen from ccsm class install (_install): def run (self): _install.run(self) outputs = self.get_outputs() data = '\n'.join(outputs) try: f = open(INSTALLED_FILES, 'w') except: self.warn ('Could not write installed files list ' + INSTALLED_FILES) return f.write(data) f.close() class uninstall(_install): def run(self): try: files = file(INSTALLED_FILES, 'r').readlines() except: self.warn('Could not read installed files list ' + INSTALLED_FILES) return for f in files: print('Uninstalling ' + f.strip()) try: os.unlink(f.strip()) except: self.warn('Could not remove file ' + f) os.remove(INSTALLED_FILES) #Stolen from ccsm's setup.py if sys.argv[1] == 'build': qtver = '5.0' gtkver = '3.0' if len (sys.argv) > 2: i = 0 for o in sys.argv: if o.startswith('--with-qt'): if o == '--with-qt': if len(sys.argv) >= i: qtver = sys.argv[i + 1] sys.argv.remove(qtver) elif o.startswith('--with-qt=') and len(o[10:]): qtver = o[10:] sys.argv.remove(o) i += 1 i = 0 for o in sys.argv: if o.startswith('--with-gtk'): if o == '--with-gtk': if len(sys.argv) >= i: gtkver = sys.argv[i + 1] sys.argv.remove(gtkver) elif o.startswith('--with-gtk=') and len(o[11:]): gtkver = o[11:] sys.argv.remove(o) i += 1 f = open(os.path.join ('FusionIcon/interface_qt/main.py.in'), 'rt') data = f.read() f.close() data = data.replace('@qtver@', qtver.split('.')[0]) f = open(os.path.join('FusionIcon/interface_qt/main.py'), 'wt') f.write(data) f.close() f = open(os.path.join ('FusionIcon/interface_gtk/main.py.in'), 'rt') data = f.read() f.close() data = data.replace('@gtkver@', gtkver) if gtkver == '2.0': data = data.replace('@aiver@', '') else: data = data.replace('@aiver@', '3') f = open(os.path.join('FusionIcon/interface_gtk/main.py'), 'wt') f.write(data) f.close() version = open('VERSION', 'r').read().strip() packages = ['FusionIcon'] available_interfaces = { 'qt': 'FusionIcon.interface_qt', 'gtk': 'FusionIcon.interface_gtk', } #if 'interfaces' in os.environ: # for interface in os.environ['interfaces'].split(): # if interface in available_interfaces: # packages.append(available_interfaces[interface]) #else: packages.extend(available_interfaces.values()) data_files = [ ('share/icons/hicolor/22x22/apps',['images/22x22/fusion-icon.png']), ('share/icons/hicolor/24x24/apps',['images/24x24/fusion-icon.png']), ('share/icons/hicolor/32x32/apps',['images/32x32/fusion-icon.png']), ('share/icons/hicolor/48x48/apps',['images/48x48/fusion-icon.png']), ('share/icons/hicolor/scalable/apps',['images/scalable/fusion-icon.svg']), ('share/applications',['fusion-icon.desktop']), ('share/metainfo',['fusion-icon.appdata.xml']), ] setup( name='fusion-icon', version=version, description='User-friendly tray icon for launching and managing Compiz', author='Wolfgang Ulbrich', author_email='chat-to-me@raveit.de', url='https://github.com/compiz-reloaded/fusion-icon', packages=packages, scripts=['fusion-icon'], data_files=data_files, cmdclass={ 'uninstall': uninstall, 'install': install}, ) #Stolen from ccsm's setup.py if sys.argv[1] == 'install': prefix = None if len (sys.argv) > 2: i = 0 for o in sys.argv: if o.startswith ("--prefix"): if o == "--prefix": if len (sys.argv) >= i: prefix = sys.argv[i + 1] sys.argv.remove (prefix) elif o.startswith ("--prefix=") and len (o[9:]): prefix = o[9:] sys.argv.remove (o) break i += 1 if not prefix: prefix = '/usr/local' gtk_update_icon_cache = '''gtk-update-icon-cache -f -t \ %s/share/icons/hicolor''' % prefix root_specified = [s for s in sys.argv if s.startswith('--root')] if not root_specified or root_specified[0] == '--root=/': print('Updating Gtk icon cache.') os.system(gtk_update_icon_cache) else: print('''*** Icon cache not updated. After install, run this: *** %s''' % gtk_update_icon_cache)