pax_global_header00006660000000000000000000000064142253316150014514gustar00rootroot0000000000000052 comment=8498847f9878cf96ba8231ae78f04604cce0f5e5 mate-hud-22.04.4/000077500000000000000000000000001422533161500133715ustar00rootroot00000000000000mate-hud-22.04.4/.github/000077500000000000000000000000001422533161500147315ustar00rootroot00000000000000mate-hud-22.04.4/.github/FUNDING.yml000066400000000000000000000007071422533161500165520ustar00rootroot00000000000000# These are supported funding model platforms github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] patreon: ubuntu_mate open_collective: # Replace with a single Open Collective username ko_fi: ubuntumate tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry custom: https://ubuntu-mate.org/donate mate-hud-22.04.4/.gitignore000066400000000000000000000000231422533161500153540ustar00rootroot00000000000000build/* __pycache__mate-hud-22.04.4/COPYING000066400000000000000000000432541422533161500144340ustar00rootroot00000000000000 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. mate-hud-22.04.4/README.md000066400000000000000000000063661422533161500146630ustar00rootroot00000000000000# mate-hud Provides a way to run menubar commands through [rofi](https://github.com/davatorium/rofi), much like the Unity 7 Heads-Up Display (HUD). `mate-hud` was originally forked from `i3-hud-menu`: * https://jamcnaughton.com/2015/10/19/hud-for-xubuntu/ * https://github.com/jamcnaughton/i3-hud-menu * https://github.com/RafaelBocquet/i3-hud-menu It was subsequently improved by incorporating improvements from [snippins](https://gist.github.com/snippins) * [HUD.py](https://gist.github.com/snippins/ee943f2b25db555ef12107f7cee20241) ## What is a HUD and why should I care? A Heads-Up Display (HUD) allows you to search through an application's appmenu. So if you're trying to find that single filter in Gimp but can't remember which filter category it fits into or if you can't recall if preferences sits under File, Edit or Tools on your favourite browser, you can just search for it rather than hunting through the menus. ### Implementation [vala-panel-appmenu](https://github.com/rilian-la-te/vala-panel-appmenu) includes an implementation of the `com.canonical.AppMenu.Registrar` DBus service. Applications exporting their menu via `dbusmenu` need this service to run. `mate-hud.py` tries to get the menu of the currently focused window, lists possible actions and asks the user which one to run. `mate-hud.py`, binds itself to the `space` keyboard shortcut by default. ### Gsettings `mate-hud.py` reads two gsettings keys: * `org.mate.hud`: `shortcut` (Default: `'Alt_L'`) * `org.mate.hud`: `rofi-theme` (Default: `mate-hud`) `mate-hud.py` will not execute until those gsettings keys are created, which the `mate-hud` Debian package will do, and the `enabled` key is set to *True* using something like `dconf-editor`. MATE Tweak will soon add the functionality the endable/disable `mate-hud`. ### Themes `mate-hud.py` uses the `mate-hud` theme by default. The included `mate-hud` and `mate-hud-rounded` themes try to use colors from your GTK theme. You can see the available rofi themes in `/usr/share/rofi/themes` or add your own to `~/.local/share/rofi/themes` Theme files are named `.rasi` and you can change the theme using the following command: ``` gsettings set org.mate.hud rofi-theme ``` ### Manual Setup * The `vala-panel-appmenu` applet for MATE should be added to a panel. * `mate-hud.py` should be started on session start-up. * The following should be added to the users `~/.profile` or `/etc/profile.d` or `/etc/X11/Xsession.d/`. ``` if [ -n "$GTK_MODULES" ]; then GTK_MODULES="$GTK_MODULES:unity-gtk-module" else GTK_MODULES="unity-gtk-module" fi export GTK_MODULES export UBUNTU_MENUPROXY=1 ``` ## Dependencies * `appmenu-qt` * `gir1.2-gtk-3.0` * `mate-desktop` * `python3` * `python3-dbus` * `python3-setproctitle` * `python3-xlib` * `rofi` * `unity-gtk2-module` * `unity-gtk3-module` A reference package for Debian/Ubuntu is available from: * https://bitbucket.org/flexiondotorg/debian-packages ## Compatibility Compatibility may depend on your environment's compatability with the [rofi](https://github.com/davatorium/rofi/) package, which means environments using Wayland (e.g. Ubuntu 21.04) may not work (see [related rofi issue](https://github.com/davatorium/rofi/issues/446)). mate-hud-22.04.4/setup.py000077500000000000000000000051551422533161500151140ustar00rootroot00000000000000#!/usr/bin/python3 # -*- coding: utf-8 -*- # Copyright (C) 2016 by Martin Wimpress # # 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 St, Fifth Floor, Boston, MA 02110-1301, USA. import os import sys from glob import glob from setuptools import setup import DistUtilsExtra.command.build_extra import DistUtilsExtra.command.build_i18n import DistUtilsExtra.command.clean_i18n __VERSION__ = '22.04.4' def datafilelist(installbase, sourcebase): datafileList = [] for root, subFolders, files in os.walk(sourcebase): fileList = [] for f in files: fileList.append(os.path.join(root, f)) datafileList.append((root.replace(sourcebase, installbase), fileList)) return datafileList data_files = [ ('{prefix}/lib/mate-hud/'.format(prefix=sys.prefix), ['usr/lib/mate-hud/mate-hud']), ('{prefix}/share/mate/autostart/'.format(prefix=sys.prefix), ['usr/share/mate/autostart/mate-hud.desktop']), ('{prefix}/share/glib-2.0/schemas/'.format(prefix=sys.prefix), ['usr/share/glib-2.0/schemas/org.mate.hud.gschema.xml']), ('{prefix}/share/rofi/themes/'.format(prefix=sys.prefix), ['usr/share/rofi/themes/mate-hud.rasi']), ('{prefix}/share/rofi/themes/'.format(prefix=sys.prefix), ['usr/share/rofi/themes/mate-hud-hidpi.rasi']), ('{prefix}/share/rofi/themes/'.format(prefix=sys.prefix), ['usr/share/rofi/themes/mate-hud-rounded.rasi']), ('{prefix}/share/rofi/themes/'.format(prefix=sys.prefix), ['usr/share/rofi/themes/mate-hud-rounded-hidpi.rasi']), ] cmdclass = { "build" : DistUtilsExtra.command.build_extra.build_extra, "clean": DistUtilsExtra.command.clean_i18n.clean_i18n, } setup( name = "mate-hud", version = __VERSION__, description = "Run menubar commands, much like the Unity 7 HUD", license = 'GPLv2+', author = 'Martin Wimpress', url = 'https://github.com/ubuntu-mate/mate-hud/', #package_dir = {'': '.'}, data_files = data_files, install_requires = ['setuptools'], #scripts = [], cmdclass = cmdclass, ) mate-hud-22.04.4/usr/000077500000000000000000000000001422533161500142025ustar00rootroot00000000000000mate-hud-22.04.4/usr/lib/000077500000000000000000000000001422533161500147505ustar00rootroot00000000000000mate-hud-22.04.4/usr/lib/mate-hud/000077500000000000000000000000001422533161500164545ustar00rootroot00000000000000mate-hud-22.04.4/usr/lib/mate-hud/mate-hud000077500000000000000000001033351422533161500201130ustar00rootroot00000000000000#!/usr/bin/python3 import gi gi.require_version('Gdk', '3.0') gi.require_version("Gtk", "3.0") import dbus import logging import os import psutil import setproctitle import subprocess import time import threading from dbus.mainloop.glib import DBusGMainLoop from gi.repository import Gio, GLib, Gtk, Gdk, GObject from Xlib import display, protocol, X, Xatom, error def get_desktop_env(): desktop_env = '' try: desktop_env = os.environ['XDG_CURRENT_DESKTOP'] except: pass if not desktop_env: try: desktop_env = os.environ['XDG_SESSION_DESKTOP'] except: pass return desktop_env if 'XFCE' in get_desktop_env(): try: gi.require_version("Xfconf", "0") from gi.repository import Xfconf Xfconf.init() except: logging.debug('running XFCE, but xfconf gi repository not available') class EWMH: """This class provides the ability to get and set properties defined by the EWMH spec. It was blanty ripped out of pyewmh * https://github.com/parkouss/pyewmh """ def __init__(self, _display=None, root = None): self.display = _display or display.Display() self.root = root or self.display.screen().root def getActiveWindow(self): """Get the current active (toplevel) window or None (property _NET_ACTIVE_WINDOW) :return: Window object or None""" active_window = self._getProperty('_NET_ACTIVE_WINDOW') if active_window == None: return None return self._createWindow(active_window[0]) def _getProperty(self, _type, win=None): if not win: win = self.root atom = win.get_full_property(self.display.get_atom(_type), X.AnyPropertyType) if atom: return atom.value def _setProperty(self, _type, data, win=None, mask=None): """Send a ClientMessage event to the root window""" if not win: win = self.root if type(data) is str: dataSize = 8 else: data = (data+[0]*(5-len(data)))[:5] dataSize = 32 ev = protocol.event.ClientMessage(window=win, client_type=self.display.get_atom(_type), data=(dataSize, data)) if not mask: mask = (X.SubstructureRedirectMask|X.SubstructureNotifyMask) self.root.send_event(ev, event_mask=mask) def _createWindow(self, wId): if not wId: return None return self.display.create_resource_object('window', wId) def format_path(path): #logging.debug('Path:%s', path) result = path.replace('>', '', 1) result = result.replace('Root > ', '') result = result.replace('Label Empty > ', '') result = result.replace('_', '') return result.replace('>', u'\u0020\u0020\u00BB\u0020\u0020') def get_bool(schema, path, key): if path: settings = Gio.Settings.new_with_path(schema, path) else: settings = Gio.Settings.new(schema) return settings.get_boolean(key) def get_string(schema, path, key): if path: settings = Gio.Settings.new_with_path(schema, path) else: settings = Gio.Settings.new(schema) return settings.get_string(key) def get_number(schema, path, key): if path: settings = Gio.Settings.new_with_path(schema, path) else: settings = Gio.Settings.new(schema) return settings.get_int(key) def get_list(schema, path, key): if path: settings = Gio.Settings.new_with_path(schema, path) else: settings = Gio.Settings.new(schema) return settings.get_strv(key) def process_running(name): uid = os.getuid() for process in psutil.process_iter(): try: proc = process.as_dict(attrs=['name', 'uids']) except psutil.NoSuchProcess: pass else: if name == proc['name'] and uid == proc['uids'].real: return True return False def kill_process(name): uid = os.getuid() for process in psutil.process_iter(): try: proc = process.as_dict(attrs=['name', 'pid', 'uids']) except psutil.NoSuchProcess: pass else: if name == proc['name'] and uid == proc['uids'].real: try: target = psutil.Process(proc['pid']) target.kill() except psutil.NoSuchProcess: pass def terminate_appmenu_registrar(): # TODO: # - Use Dbus Quit method. # - Add checks for other Desktop Environments. if 'MATE' in get_desktop_env(): if process_running('appmenu-registrar') and not process_running('appmenu-mate'): kill_process('appmenu-registrar') elif process_running('xfce4-panel'): try: xfc_panel = Xfconf.Channel.new("xfce4-panel") panels = xfc_panel.get_arrayv("/panels") plugin_ids = [] for panel in panels: plugin_ids += xfc_panel.get_arrayv("/panels/panel-" + str(panel) + "/plugin-ids") appmenu_loaded = False for plugid in plugin_ids: if ( xfc_panel.get_string("/plugins/plugin-" + str(plugid), "") == 'appmenu' ): appmenu_loaded = True break if process_running('appmenu-registrar') and not appmenu_loaded: kill_process('appmenu-registrar') except: logging.debug('running XFCE panel, but xfconf gi repository not available') def rgba_to_hex(color): """ Return hexadecimal string for :class:`Gdk.RGBA` `color`. """ return "#{0:02x}{1:02x}{2:02x}".format( int(color.red * 255), int(color.green * 255), int(color.blue * 255)) def get_color(style_context, preferred_color, fallback_color): color = rgba_to_hex(style_context.lookup_color(preferred_color)[1]) if color == '#000000': color = rgba_to_hex(style_context.lookup_color(fallback_color)[1]) return color def get_menu(menuKeys): """ Generate menu of available menu items. """ if not menuKeys: return '' menu_string, *menu_items = menuKeys for menu_item in menu_items: menu_string += '\n' + menu_item # Get some colors from the currently selected theme. window = Gtk.Window() # Allow closing the HUD with the same modifier key that opens it shortcut = get_shortcut() keyval, modifiers = Gtk.accelerator_parse(shortcut) shortcut = '' if modifiers else ',' + shortcut desktop_name = get_desktop_env() # Calculate display DPI value screen = window.get_screen() scale = window.get_scale_factor() def get_dpi(pixels, mm): if mm >= 1: return scale * pixels / (mm / 25.4) else: return 0 width_dpi = get_dpi(screen.width(), screen.width_mm()) height_dpi = get_dpi(screen.height(), screen.height_mm()) dpi = scale * (width_dpi + height_dpi) / 2 rofi_theme = get_rofi_theme() mate_hud_themes = [ 'mate-hud', 'mate-hud-hidpi', 'mate-hud-rounded', 'mate-hud-rounded-hidpi' ] themes_hidpi_versions = { 'mate-hud': 'mate-hud-hidpi', 'mate-hud-rounded': 'mate-hud-rounded-hidpi' } # switch to the hidpi version of the theme if needed. if rofi_theme in mate_hud_themes: if scale > 1 and rofi_theme in themes_hidpi_versions.keys(): rofi_theme = themes_hidpi_versions[rofi_theme] cmd = ['rofi', '-dmenu', '-i', '-p', 'HUD', '-lines', '10', '-dpi', str(round(dpi)), '-separator-style', 'none', '-hide-scrollbar', '-click-to-exit', '-levenshtein-sort', '-line-padding', '2', '-kb-cancel', 'Escape' + shortcut, '-sync', # withhold display until menu entries are ready '-monitor', '-2', # show in the current application '-theme', rofi_theme, '-theme-str', 'window { location: north west; ' + \ ' anchor: north west; }' ] # Override the window location to the top left of the current window # If we use the default adaptive theme, we need to pull in some # color information from the GTK theme if rofi_theme in mate_hud_themes: # Get the currently active font. font_name = '' if 'MATE' in desktop_name: font_name = get_string('org.mate.interface', None, 'font-name') elif 'XFCE' in desktop_name: try: font_name = Xfconf.Channel.new_with_property_base("xsettings", "/Gtk").get_string("/FontName", "") except: logging.debug('running XFCE, but xfconf gi repository not available') elif 'X-Cinnamon' in desktop_name: font_name = get_string('org.cinnamon.desktop.interface', None, 'font-name') elif 'Budgie:GNOME' in desktop_name: font_name = get_string('org.gnome.desktop.interface', None, 'font-name') if font_name: cmd += [ '-theme-str', '* { font: "' + font_name + '"; } ' ] window = Gtk.Window() style_context = window.get_style_context() bg_color = get_color(style_context, 'dark_bg_color', 'theme_bg_color') fg_color = get_color(style_context, 'dark_fg_color', 'theme_fg_color') #borders = get_color(style_context, 'borders', 'border_color') logging.debug('bg_color: %s', str(bg_color)) logging.debug('fg_color: %s', str(fg_color)) #logging.debug('borders: %s', str(borders)) selected_bg_color = rgba_to_hex(style_context.lookup_color('theme_selected_bg_color')[1]) selected_fg_color = rgba_to_hex(style_context.lookup_color('theme_selected_fg_color')[1]) #error_bg_color = rgba_to_hex(style_context.lookup_color('error_bg_color')[1]) #error_fg_color = rgba_to_hex(style_context.lookup_color('error_fg_color')[1]) #info_bg_color = rgba_to_hex(style_context.lookup_color('info_bg_color')[1]) #info_fg_color = rgba_to_hex(style_context.lookup_color('info_fg_color')[1]) #text_color = rgba_to_hex(style_context.lookup_color('theme_text_color')[1]) # Overwrite some of the theme options theme_options = 'listview { background-color: ' + bg_color + '; ' + \ ' border-color: ' + selected_bg_color + '; } ' + \ 'element { text-color: ' + fg_color + '; } ' + \ 'element selected.normal { background-color: ' + selected_bg_color + '; ' + \ ' text-color: ' + selected_fg_color + '; } ' + \ 'inputbar { background-color: ' + bg_color + '; ' + \ ' border-color: ' + selected_bg_color + '; ' + \ ' text-color: ' + fg_color + '; } ' cmd += [ '-theme-str', theme_options ] menu_cmd = subprocess.Popen(cmd, stdout=subprocess.PIPE, stdin=subprocess.PIPE) menu_cmd.stdin.write(menu_string.encode('utf-8')) menu_result = menu_cmd.communicate()[0].decode('utf8').rstrip() menu_cmd.stdin.close() return menu_result """ try_appmenu_interface """ def try_appmenu_interface(window_id): # --- Get Appmenu Registrar DBus interface registrar_running = process_running("appmenu-registrar") session_bus = dbus.SessionBus() try: appmenu_registrar_object = session_bus.get_object('com.canonical.AppMenu.Registrar', '/com/canonical/AppMenu/Registrar') appmenu_registrar_object_iface = dbus.Interface(appmenu_registrar_object, 'com.canonical.AppMenu.Registrar') except dbus.exceptions.DBusException: logging.info('Unable to register with com.canonical.AppMenu.Registrar.') return False # --- Get dbusmenu object path try: dbusmenu_bus, dbusmenu_object_path = appmenu_registrar_object_iface.GetMenuForWindow(window_id) if not registrar_running: terminate_appmenu_registrar() except dbus.exceptions.DBusException: logging.info('Unable to get dbusmenu object path.') return False # --- Access dbusmenu items try: dbusmenu_object = session_bus.get_object(dbusmenu_bus, dbusmenu_object_path) dbusmenu_object_iface = dbus.Interface(dbusmenu_object, 'com.canonical.dbusmenu') except ValueError: logging.info('Unable to access dbusmenu items.') return False dbusmenu_root_item = dbusmenu_object_iface.GetLayout(0, 0, ["label", "children-display"]) dbusmenu_item_dict = dict() #For excluding items which have no action blacklist = [] """ expanse_all_menu_with_dbus """ def expanse_all_menu_with_dbus(item, root, path): item_id = item[0] item_props = item[1] # expand if necessary if 'children-display' in item_props: dbusmenu_object_iface.AboutToShow(item_id) dbusmenu_object_iface.Event(item_id, "opened", "not used", dbus.UInt32(time.time())) #fix firefox try: item = dbusmenu_object_iface.GetLayout(item_id, 1, ["label", "children-display"])[1] except: return item_children = item[2] if 'label' in item_props: new_path = path + " > " + item_props['label'] else: new_path = path if len(item_children) == 0: if new_path not in blacklist: dbusmenu_item_dict[format_path(new_path)] = item_id else: blacklist.append(new_path) for child in item_children: expanse_all_menu_with_dbus(child, False, new_path) expanse_all_menu_with_dbus(dbusmenu_root_item[1], True, "") menuKeys = sorted(dbusmenu_item_dict.keys()) menu_result = get_menu(menuKeys) # --- Use dmenu result if menu_result in dbusmenu_item_dict: action = dbusmenu_item_dict[menu_result] logging.debug('AppMenu Action : %s', str(action)) dbusmenu_object_iface.Event(action, 'clicked', 0, 0) # Firefox: # Send closed events to level 1 items to make sure nothing weird happens # Firefox will close the submenu items (luckily!) # VimFx extension wont work without this dbusmenu_level1_items = dbusmenu_object_iface.GetLayout(0, 1, ["label"])[1] for item in dbusmenu_level1_items[2]: item_id = item[0] dbusmenu_object_iface.Event(item_id, "closed", "not used", dbus.UInt32(time.time())) return True """ try_gtk_interface """ def try_gtk_interface(gtk_bus_name, gtk_menu_object_path, gtk_actions_paths_list): registrar_running = process_running("appmenu-registrar") session_bus = dbus.SessionBus() # --- Ask for menus over DBus --- Credit @1931186 try: gtk_menu_object = session_bus.get_object(gtk_bus_name, gtk_menu_object_path) gtk_menu_menus_iface = dbus.Interface(gtk_menu_object, dbus_interface='org.gtk.Menus') if not registrar_running: terminate_appmenu_registrar() except dbus.exceptions.DBusException: logging.info('Unable to connect with com.gtk.Menus.') return # Here's the deal: The idea is to reduce the number of calls to the proxy and keep it as low as possible # because the proxy is a potential bottleneck # This means we ignore GMenus standard building model and just iterate over all the information one Start() provides at once # Start() does these calls, returns the result and keeps track of all parents (the IDs used by org.gtk.Menus.Start()) we called # queue() adds a parent to a potential_new_layers list; we'll use this later to avoid starting() some layers twice # explore is for iterating over the information a Start() call provides gtk_menubar_action_dict = dict() gtk_menubar_action_target_dict = dict() usedLayers = [] def Start(i): usedLayers.append(i) return gtk_menu_menus_iface.Start([i]) # --- Construct menu list --- potential_new_layers = [] def queue(potLayer, label, path): # collects potentially new layers to check them against usedLayers # potLayer: ID of potential layer, label: None if nondescript, path potential_new_layers.append([potLayer, label, path]) def explore(parent, path): for node in parent: content = node[2] # node[0] = ID of parent # node[1] = ID of node under parent # node[2] = actuall content of a node; this is split up into several elements/ menu entries for element in content: # We distinguish between labeled entries and unlabeled ones # Unlabeled sections/ submenus get added under to parent ({parent: {content}}), labeled under a key in parent (parent: {label: {content}}) if 'label' in element: if ':section' in element or ':submenu' in element: # If there's a section we don't care about the action # There theoretically could be a section that is also a submenu, so we have to handel this via queue # submenus are more important than sections if ':submenu' in element: queue(element[':submenu'][0], None, path + " > " + element['label']) # We ignore whether or not a submenu points to a specific index, shouldn't matter because of the way the menu got exportet # Worst that can happen are some duplicates # Also we don't Start() directly which could mean we get nothing under this label but this shouldn't really happen because there shouldn't be two submenus # that point to the same parent. Even if this happens it's not that big of a deal. if ':section' in element: if element[':section'][0] != node[0]: queue(element['section'][0], element['label'], path) # section points to other parent, we only want to add the elements if their parent isn't referenced anywhere else # We do this because: # a) It shouldn't happen anyways # b) The worst that could happen is we fuck up the menu structure a bit and avoid double entries elif 'action' in element: # This is pretty straightforward: menu_action = str(element['action']).split(".",1)[1] action_path = format_path(path + " > " + element['label']) gtk_menubar_action_dict[action_path] = menu_action if 'target' in element: gtk_menubar_action_target_dict[action_path] = element['target'] else: if ':submenu' in element or ':section' in element: if ':section' in element: if element[':section'][0] != node[0] and element['section'][0] not in usedLayers: queue(element[':section'][0], None, path) # We will only queue a nondescript section if it points to a (potentially) new parent if ':submenu' in element: queue(element[':submenu'][0], None, path) # We queue the submenu under the parent without a label queue(0, None, "") # We queue the first parent, [0] # This means 0 gets added to potential_new_layers with a path of "" (it's the root node) while len(potential_new_layers) > 0: layer = potential_new_layers.pop() # usedLayers keeps track of all the parents Start() already called if layer[0] not in usedLayers: explore(Start(layer[0]), layer[2]) gtk_menu_menus_iface.End(usedLayers) menuKeys = sorted(gtk_menubar_action_dict.keys()) menu_result = get_menu(menuKeys) # --- Use menu result if menu_result in gtk_menubar_action_dict: action = gtk_menubar_action_dict[menu_result] target = [] try: target = gtk_menubar_action_target_dict[menu_result] if (not isinstance(target, list)): target = [target] except: pass for action_path in gtk_actions_paths_list: try: action_object = session_bus.get_object(gtk_bus_name, action_path) action_iface = dbus.Interface(action_object, dbus_interface='org.gtk.Actions') not_use_platform_data = dict() not_use_platform_data["not used"] = "not used" logging.debug('GTK Action : %s', str(action)) action_iface.Activate(action, target, not_use_platform_data) except Exception as e: logging.debug('action_path: %s', str(action_path)) def hud(widget, keystr, user_data): logging.debug("Handling %s", str(user_data)) # Get Window properties and GTK MenuModel Bus name ewmh = EWMH() win = ewmh.getActiveWindow() if win is None: logging.debug('ewmh.getActiveWindow returned None, giving up') return window_id = hex(ewmh._getProperty('_NET_ACTIVE_WINDOW')[0]) gtk_bus_name = ewmh._getProperty('_GTK_UNIQUE_BUS_NAME', win) gtk_menubar_object_path = ewmh._getProperty('_GTK_MENUBAR_OBJECT_PATH', win) gtk_app_object_path = ewmh._getProperty('_GTK_APPLICATION_OBJECT_PATH', win) gtk_win_object_path = ewmh._getProperty('_GTK_WINDOW_OBJECT_PATH', win) gtk_unity_object_path = ewmh._getProperty('_UNITY_OBJECT_PATH', win) gtk_bus_name, gtk_menubar_object_path, gtk_app_object_path, gtk_win_object_path, gtk_unity_object_path = \ [i.decode('utf8') if isinstance(i, bytes) \ else i for i in [gtk_bus_name, gtk_menubar_object_path, gtk_app_object_path, gtk_win_object_path, gtk_unity_object_path]] logging.debug('Window id is : %s', window_id) logging.debug('_GTK_UNIQUE_BUS_NAME: %s', gtk_bus_name) logging.debug('_GTK_MENUBAR_OBJECT_PATH: %s', gtk_menubar_object_path) logging.debug('_GTK_APPLICATION_OBJECT_PATH: %s', gtk_app_object_path) logging.debug('_GTK_WINDOW_OBJECT_PATH: %s', gtk_win_object_path) logging.debug('_UNITY_OBJECT_PATH: %s', gtk_unity_object_path) logging.debug('Trying AppMenu') registrar_running = process_running("appmenu-registrar") appmenu_success = try_appmenu_interface(int(window_id, 16)) if not registrar_running: terminate_appmenu_registrar() if not appmenu_success and gtk_menubar_object_path: logging.debug('Appmenu found nothing.') # Many apps do not respect menu action groups, such as # LibreOffice and gnome-mpv, so we have to include all action # groups. Many other apps have these properties point to the # same path, so we need to remove them. logging.debug('Trying GTK interface') gtk_actions_paths_list = list(set([gtk_win_object_path, gtk_menubar_object_path, gtk_app_object_path, gtk_unity_object_path])) try_gtk_interface(gtk_bus_name, gtk_menubar_object_path, gtk_actions_paths_list) else: logging.debug('_GTK_MENUBAR_OBJECT_PATH in None, giving up.') class GlobalKeyBinding(GObject.GObject, threading.Thread): __gsignals__ = { 'activate': (GObject.SignalFlags.RUN_LAST, None, ()), } def __init__(self): GObject.GObject.__init__(self) threading.Thread.__init__(self) self.daemon = True self.display = display.Display() self.screen = self.display.screen() self.window = self.screen.root self.keymap = Gdk.Keymap().get_default() self.keycodes = self.get_keycodes() self.ignored_masks = self.get_mask_combinations(X.LockMask | X.Mod2Mask | X.Mod5Mask) self.map_modifiers() self.tap_timeout = get_number('org.mate.hud', None, 'tap-timeout') def get_mask_combinations(self, mask): return [x for x in range(mask+1) if not (x & ~mask)] # Determine valid keycodes that can operate bindings within a window def get_keycodes(self): keycodes = [] # White-list shortcuts used by other MATE programs # Return opens up file properties # Up|Left|Right|Home are navigation shortcuts in Caja # BackSpace is a common shortcut in text editors whitelist = ['Return', 'Up', 'Down', 'Left', 'Right', 'Home', 'BackSpace'] for key in whitelist: sym = Gtk.accelerator_parse(key).accelerator_key code = self.display.keysym_to_keycode(sym) keycodes.append(code) # Allow replaying supported keycodes for sym, codes in self.display._keymap_syms.items(): keycode = self.display.keysym_to_keycode(sym) # Valid codes have keysyms from 8 to 255, inclusive if sym >= 8 and sym <= 255 and keycode not in keycodes: keycodes.append(keycode) keycodes.sort() return keycodes def map_modifiers(self): gdk_modifiers = (Gdk.ModifierType.CONTROL_MASK, Gdk.ModifierType.SHIFT_MASK, Gdk.ModifierType.MOD1_MASK, Gdk.ModifierType.MOD2_MASK, Gdk.ModifierType.MOD3_MASK, Gdk.ModifierType.MOD4_MASK, Gdk.ModifierType.MOD5_MASK, Gdk.ModifierType.SUPER_MASK, Gdk.ModifierType.HYPER_MASK) self.known_modifiers_mask = 0 for modifier in gdk_modifiers: if "Mod" not in Gtk.accelerator_name(0, modifier) or "Mod4" in Gtk.accelerator_name(0, modifier): self.known_modifiers_mask |= modifier def idle(self): self.emit("activate") return False def activate(self): GLib.idle_add(self.run) def grab(self, shortcut): accelerator = shortcut.replace("", "") keyval, modifiers = Gtk.accelerator_parse(accelerator) if not accelerator or (not keyval and not modifiers): self.keycode = None self.modifiers = None return False self.keycode = self.keymap.get_entries_for_keyval(keyval).keys[0].keycode self.modifiers = int(modifiers) # Request to receive key press/release reports from other windows that may not be using modifiers catch = error.CatchError(error.BadWindow) if self.modifiers: self.window.change_attributes(onerror=catch, event_mask=X.KeyPressMask|X.KeyReleaseMask) else: self.window.change_attributes(onerror=catch, event_mask=X.NoEventMask) if catch.get_error(): return False catch = error.CatchError(error.BadAccess) for ignored_mask in self.ignored_masks: mod = self.modifiers | ignored_mask self.window.grab_key(self.keycode, mod, True, X.GrabModeAsync, X.GrabModeSync, onerror=catch) self.display.flush() if catch.get_error(): return False catch = error.CatchError(error.BadCursor) if not self.modifiers: # We grab Alt+click so that we can forward it to the window manager and allow Alt+click bindings (window move, resize, etc.) self.window.grab_button(X.AnyButton, X.Mod1Mask, True, X.ButtonPressMask, X.GrabModeSync, X.GrabModeAsync, X.NONE, X.NONE) self.display.flush() if catch.get_error(): return False return True # Get which window manager we're currently using (Marco, Compiz, Metacity, etc...) def get_wm(self): name = '' wm_check = self.display.get_atom('_NET_SUPPORTING_WM_CHECK') win_id = self.window.get_full_property(wm_check, X.AnyPropertyType) if win_id: w = self.display.create_resource_object("window", win_id.value[0]) wm_name = self.display.get_atom('_NET_WM_NAME') prop = w.get_full_property(wm_name, X.AnyPropertyType) if prop: name = prop.value return name.lower() def run(self): self.running = True possible_tap = False tap_start = 0 while self.running: event = self.display.next_event() if self.modifiers: # Use simpler logic when using traditional combined keybindings modifiers = event.state & self.known_modifiers_mask if event.type == X.KeyPress and event.detail == self.keycode and modifiers == self.modifiers: GLib.idle_add(self.idle) self.display.allow_events(X.SyncKeyboard, X.CurrentTime) else: try: # Cancel waiting for the key release if it's not a tap if self.tap_timeout and event.time - tap_start > self.tap_timeout: possible_tap = False # KeyPress, determine if it's the begining of the tap if event.type == X.KeyPress and event.detail == self.keycode and not possible_tap: tap_start = event.time modifiers = event.state & self.known_modifiers_mask if modifiers == self.modifiers: possible_tap = True self.display.allow_events(X.SyncKeyboard, X.CurrentTime) # KeyRelease - determine if it's the end of the tap and activate the HUD elif event.type == X.KeyRelease and event.detail == self.keycode and possible_tap: GLib.idle_add(self.idle) possible_tap = False self.display.allow_events(X.AsyncKeyboard, X.CurrentTime) # Modifiers are often used with mouse events - don't let the system swallow those elif event.type == X.ButtonPress: self.display.allow_events(X.ReplayPointer, X.CurrentTime) # Compiz would rather not have the event sent to it and just read it from the replayed queue wm = self.get_wm() if wm != b'compiz': self.display.ungrab_keyboard(X.CurrentTime) self.display.ungrab_pointer(X.CurrentTime) query_pointer = self.window.query_pointer() self.display.send_event(query_pointer.child, event, X.ButtonPressMask, True) possible_tap = False # If the user presses another key in between the KeyPress and the KeyRelease, they # meant to use a different shortcut - determine what to do based on the keycode else: # Replay event if the display supports it as a window-based binding # otherwise send it asynchronously to let the top-level window grab it if event.detail in self.keycodes: self.display.allow_events(X.ReplayKeyboard, X.CurrentTime) else: self.display.allow_events(X.AsyncKeyboard, X.CurrentTime) self.display.ungrab_keyboard(X.CurrentTime) self.display.send_event(event.window, event, X.KeyPressMask | X.KeyReleaseMask, True) possible_tap = False except Exception as e: logging.error('Error processing keybinding: %s' % e) # Allow keybinding to go through and reset tap state self.display.allow_events(X.AsyncKeyboard, X.CurrentTime) possible_tap = False continue def stop(self): self.running = False self.ungrab() self.display.close() def ungrab(self): if self.keycode: self.window.ungrab_key(self.keycode, X.AnyModifier, self.window) def rebind(self, shortcut): self.ungrab() if shortcut != "": self.grab(shortcut) def get_shortcut(): shortcut = 'Alt_L' try: shortcut = get_string('org.mate.hud', None, 'shortcut') except: logging.error('org.mate.hud gsettings not found. Defaulting to %s.' % shortcut) return shortcut def get_rofi_theme(): rofi_theme = 'docu' try: rofi_theme = get_string('org.mate.hud', None, 'rofi-theme') except: logging.error('org.mate.hud gsettings not found. Defaulting to %s.' % rofi_theme) return rofi_theme def remove_autostart(filename): config_dir = GLib.get_user_config_dir() autostart_file = os.path.join(config_dir, 'autostart', filename) if os.path.exists(autostart_file): os.remove(autostart_file) if __name__ == "__main__": setproctitle.setproctitle('mate-hud') logging.basicConfig(level=logging.INFO) # Remove old-style autostart .desktop file for mate-hud remove_autostart('mate-hud.desktop') def change_shortcut(schema, key): shortcut = settings.get_string("shortcut") keybinder.rebind(shortcut) def change_tap_timeout(schema, key): tap_timeout = settings.get_int("tap-timeout") keybinder.tap_timeout = tap_timeout; enabled = False enabled = get_bool('org.mate.hud', None, 'enabled') if enabled: shortcut = get_shortcut() DBusGMainLoop(set_as_default=True) keybinder = GlobalKeyBinding() keybinder.grab(shortcut) keybinder.connect("activate", hud, shortcut, "keystring %s (user data)" % shortcut) keybinder.start() logging.info("Press %s to handle keybinding", shortcut) settings = Gio.Settings.new("org.mate.hud") settings.connect("changed::shortcut", change_shortcut) settings.connect("changed::tap-timeout", change_tap_timeout) try: GLib.MainLoop().run() except KeyboardInterrupt: GLib.MainLoop().quit() else: logging.info("The HUD is disabled via org.mate.hud in gsettings.") mate-hud-22.04.4/usr/share/000077500000000000000000000000001422533161500153045ustar00rootroot00000000000000mate-hud-22.04.4/usr/share/glib-2.0/000077500000000000000000000000001422533161500165165ustar00rootroot00000000000000mate-hud-22.04.4/usr/share/glib-2.0/schemas/000077500000000000000000000000001422533161500201415ustar00rootroot00000000000000mate-hud-22.04.4/usr/share/glib-2.0/schemas/org.mate.hud.gschema.xml000066400000000000000000000031641422533161500245700ustar00rootroot00000000000000 true Enable MATE HUD. If true, MATE HUD will run when invoked. 'Alt_L' The keyboard shortcut used to pop-up the MATE HUD The format looks like "a]]>" or "F1]]>". The parser is fairly liberal and allows lower or upper case, and also abbreviations such as "]]>" and "]]>". 'mate-hud-rounded' The rofi theme to use for the HUD MATE HUD uses rofi to display the HUD. Specify the rofi theme to use here. 'mate-hud' and 'mate-hud-rounded' try to pull colors from the GTK theme. Find available themes in /usr/share/rofi/themes or put your own in ~/.local/share/rofi/themes 250 The timeout between key press and release to determine if the user meant to open MATE HUD This only applies to single key shortcuts (e.g. `Alt_L`). It prevents the HUD from showing up if the user keeps the shortcut pressed for longer than the timeout. Set to 0 to disable the timeout. mate-hud-22.04.4/usr/share/mate/000077500000000000000000000000001422533161500162325ustar00rootroot00000000000000mate-hud-22.04.4/usr/share/mate/autostart/000077500000000000000000000000001422533161500202605ustar00rootroot00000000000000mate-hud-22.04.4/usr/share/mate/autostart/mate-hud.desktop000066400000000000000000000002321422533161500233540ustar00rootroot00000000000000[Desktop Entry] Type=Application Name=MATE HUD Exec=/usr/lib/mate-hud/mate-hud NoDisplay=true StartupNotify=false Terminal=false X-MATE-Autostart-Delay=5 mate-hud-22.04.4/usr/share/rofi/000077500000000000000000000000001422533161500162435ustar00rootroot00000000000000mate-hud-22.04.4/usr/share/rofi/themes/000077500000000000000000000000001422533161500175305ustar00rootroot00000000000000mate-hud-22.04.4/usr/share/rofi/themes/mate-hud-hidpi.rasi000066400000000000000000000035511422533161500232130ustar00rootroot00000000000000/** * mate-hud rofi theme * Incomplete theme designed to have certain properties applied at mate-hud runtime * Don't use this for anything else than mate-hud * Adapted by twa022 */ configuration { font: "Sans Regular 10"; display-ssh: ""; display-run: ""; display-drun: ""; display-window: ""; display-combi: ""; show-icons: true; } * { backlight: #ccffeedd; background-color: transparent; } window { location: north west; anchor: north west; width: 800px; transparency: "screenshot"; border: 0px; /* background-color: matched to GTK theme by mate-hud */ spacing: 0; children: [mainbox]; orientation: horizontal; margin: 24px 24px; font: "Sans Regular 10"; } mainbox { spacing: 0; children: [ inputbar, message, listview ]; } inputbar { /* text-color: matched to GTK theme by mate-hud */ padding: 22px; /* background-color: matched to GTK theme by mate-hud */ border: 2px; //border-radius: 6px 6px 0px 0px; /* border-color: matched to GTK theme by mate-hud */ } entry, prompt, case-indicator { text-font: inherit; text-color:inherit; } prompt { margin: 0px 0.3em 0em 0em ; } listview { padding: 16px; /* border-color: matched to GTK theme by mate-hud */ border: 0px 2px 2px 2px; /* background-color: matched to GTK theme by mate-hud */ dynamic: false; font: "Sans Regular 10"; } element { padding: 6px 0px; vertical-align: 0.5; background-color: transparent; /* text-color: matched to GTK theme by mate-hud */ } element selected.normal { /* background-color: matched to GTK theme by mate-hud */ /* text-color: matched to GTK theme by mate-hud */ } element-text, element-icon { background-color: inherit; text-color: inherit; } mate-hud-22.04.4/usr/share/rofi/themes/mate-hud-rounded-hidpi.rasi000066400000000000000000000037261422533161500246550ustar00rootroot00000000000000/** * mate-hud-rounded rofi theme (rounded corners) * Incomplete theme designed to have certain properties applied at mate-hud runtime * Don't use this for anything else than mate-hud * Adapted by twa022 */ configuration { font: "Sans Regular 10"; display-ssh: ""; display-run: ""; display-drun: ""; display-window: ""; display-combi: ""; show-icons: true; } * { backlight: #ccffeedd; background-color: transparent; } window { location: north west; anchor: north west; width: 800px; transparency: "screenshot"; border: 0px; border-radius: 12px; /* background-color: matched to GTK theme by mate-hud */ spacing: 0; children: [mainbox]; orientation: horizontal; margin: 24px 24px; font: "Sans Regular 10"; } mainbox { spacing: 0; children: [ inputbar, message, listview ]; } inputbar { /* text-color: matched to GTK theme by mate-hud */ padding: 22px; /* background-color: matched to GTK theme by mate-hud */ border: 2px; border-radius: 12px 12px 0px 0px; /* border-color: matched to GTK theme by mate-hud */ } entry, prompt, case-indicator { text-font: inherit; text-color:inherit; } prompt { margin: 0px 0.3em 0em 0em ; } listview { padding: 16px; border-radius: 0px 0px 12px 12px; /* border-color: matched to GTK theme by mate-hud */ border: 0px 2px 2px 2px; /* background-color: matched to GTK theme by mate-hud */ dynamic: false; font: "Sans Regular 10"; } element { padding: 6px; vertical-align: 0.5; border-radius: 8px; background-color: transparent; /* text-color: matched to GTK theme by mate-hud */ } element selected.normal { /* background-color: matched to GTK theme by mate-hud */ /* text-color: matched to GTK theme by mate-hud */ } element-text, element-icon { background-color: inherit; text-color: inherit; } mate-hud-22.04.4/usr/share/rofi/themes/mate-hud-rounded.rasi000066400000000000000000000037451422533161500235630ustar00rootroot00000000000000/** * mate-hud-rounded rofi theme (rounded corners) * Incomplete theme designed to have certain properties applied at mate-hud runtime * Don't use this for anything else than mate-hud * Adapted by twa022 */ configuration { font: "Sans Regular 10"; display-ssh: ""; display-run: ""; display-drun: ""; display-window: ""; display-combi: ""; show-icons: true; } * { backlight: #ccffeedd; background-color: transparent; } window { location: north west; anchor: north west; width: 400px; transparency: "screenshot"; //padding: 10px; border: 0px; border-radius: 6px; /* background-color: matched to GTK theme by mate-hud */ spacing: 0; children: [mainbox]; orientation: horizontal; margin: 12px 12px; font: "Sans Regular 10"; } mainbox { spacing: 0; children: [ inputbar, message, listview ]; } inputbar { /* text-color: matched to GTK theme by mate-hud */ padding: 11px; /* background-color: matched to GTK theme by mate-hud */ border: 1px; border-radius: 6px 6px 0px 0px; /* border-color: matched to GTK theme by mate-hud */ } entry, prompt, case-indicator { text-font: inherit; text-color:inherit; } prompt { margin: 0px 0.3em 0em 0em ; } listview { padding: 8px; border-radius: 0px 0px 6px 6px; /* border-color: matched to GTK theme by mate-hud */ border: 0px 1px 1px 1px; /* background-color: matched to GTK theme by mate-hud */ dynamic: false; font: "Sans Regular 10"; } element { padding: 3px; vertical-align: 0.5; border-radius: 4px; background-color: transparent; /* text-color: matched to GTK theme by mate-hud */ } element selected.normal { /* background-color: matched to GTK theme by mate-hud */ /* text-color: matched to GTK theme by mate-hud */ } element-text, element-icon { background-color: inherit; text-color: inherit; } mate-hud-22.04.4/usr/share/rofi/themes/mate-hud.rasi000066400000000000000000000035751422533161500221260ustar00rootroot00000000000000/** * mate-hud rofi theme * Incomplete theme designed to have certain properties applied at mate-hud runtime * Don't use this for anything else than mate-hud * Adapted by twa022 */ configuration { font: "Sans Regular 10"; display-ssh: ""; display-run: ""; display-drun: ""; display-window: ""; display-combi: ""; show-icons: true; } * { backlight: #ccffeedd; background-color: transparent; } window { location: north west; anchor: north west; width: 400px; transparency: "screenshot"; //padding: 10px; border: 0px; /* background-color: matched to GTK theme by mate-hud */ spacing: 0; children: [mainbox]; orientation: horizontal; margin: 12px 12px; font: "Sans Regular 10"; } mainbox { spacing: 0; children: [ inputbar, message, listview ]; } inputbar { /* text-color: matched to GTK theme by mate-hud */ padding: 11px; /* background-color: matched to GTK theme by mate-hud */ border: 1px; //border-radius: 6px 6px 0px 0px; /* border-color: matched to GTK theme by mate-hud */ } entry, prompt, case-indicator { text-font: inherit; text-color:inherit; } prompt { margin: 0px 0.3em 0em 0em ; } listview { padding: 8px; /* border-color: matched to GTK theme by mate-hud */ border: 0px 1px 1px 1px; /* background-color: matched to GTK theme by mate-hud */ dynamic: false; font: "Sans Regular 10"; } element { padding: 3px 0px; vertical-align: 0.5; background-color: transparent; /* text-color: matched to GTK theme by mate-hud */ } element selected.normal { /* background-color: matched to GTK theme by mate-hud */ /* text-color: matched to GTK theme by mate-hud */ } element-text, element-icon { background-color: inherit; text-color: inherit; }