├── .gitignore ├── LICENSE ├── Makefile ├── README.md ├── img └── ego.svg ├── src ├── extension.js ├── metadata.json ├── po │ ├── de.po │ ├── el.po │ ├── fa.po │ ├── fr.po │ ├── it.po │ ├── nl.po │ ├── pt.po │ ├── ru.po │ ├── sk.po │ ├── sr.po │ ├── sr@latin.po │ ├── template.pot │ └── uk.po ├── prefs.js ├── schemas │ └── org.gnome.shell.extensions.middleclickclose.gschema.xml └── settingsWatch.js └── typos.toml /.gitignore: -------------------------------------------------------------------------------- 1 | /*.shell-extension.zip 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | {description} 294 | Copyright (C) {year} {fullname} 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | {signature of Ty Coon}, 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | UUID := middleclickclose@paolo.tranquilli.gmail.com 2 | POT_SOURCE_FILES := $(wildcard src/schemas/*.gschema.xml src/*.js) 3 | SOURCE_FILES := ${POT_SOURCE_FILES} src/metadata.json 4 | EXTRA_SOURCE_FILES := settingsWatch.js 5 | 6 | PREFIX ?= /usr/local 7 | EXTENSION_DIR := $(abspath ${PREFIX}/share/gnome-shell/extensions/${UUID}) 8 | 9 | all: pack 10 | 11 | pack: ${UUID}.shell-extension.zip 12 | 13 | install: pack 14 | gnome-extensions install --force ${UUID}.shell-extension.zip 15 | 16 | install-system: pack 17 | mkdir -p "${EXTENSION_DIR}" 18 | unzip -o ${UUID}.shell-extension.zip -d "${EXTENSION_DIR}" 19 | glib-compile-schemas "${EXTENSION_DIR}/schemas" 20 | 21 | po: $(wildcard src/po/*.po) 22 | pot: src/po/template.pot 23 | 24 | clean: 25 | rm -f ${UUID}.shell-extension.zip 26 | rm -f src/po/template.pot 27 | 28 | .PHONY: clean all install install-system po pot pack 29 | 30 | # --- 31 | 32 | ${UUID}.shell-extension.zip: ${SOURCE_FILES} 33 | gnome-extensions pack --force src/ $(addprefix --extra-source=,${EXTRA_SOURCE_FILES}) 34 | 35 | src/po/template.pot: ${POT_SOURCE_FILES} 36 | xgettext -F --from-code=UTF-8 --output=src/po/template.pot ${POT_SOURCE_FILES} 37 | 38 | src/po/%.po: pot 39 | msgmerge --quiet --backup off --update $@ src/po/template.pot 40 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Quick Close in Overview 2 | ----------------------- 3 | GNOME shell extension for quickly closing apps in the overview. 4 | 5 | [![Download from extensions.gnome.org](img/ego.svg)](https://extensions.gnome.org/extension/352/middle-click-to-close-in-overview/) 6 | 7 | ## Features 8 | 9 | - **Middle click to close**: Just hover over the app you want to close in the overview, and middle 10 | click. The mouse button that will trigger closing can be adjusted in the settings. 11 | - **`Alt+F4` in the overview**: When triggering the close action (typically `Alt+F4`), the focused 12 | window will be closed. This can be turned off in the settings. 13 | - **Adjustable rearrange delay**: After closing an application, GNOME will wait a bit before 14 | rearranging the remaining windows. This extension allows configuring that delay. 15 | 16 | ## Building 17 | 18 | Make sure `gettext` is installed on your system and the `gnome-extensions` executable is available 19 | on your `PATH` (It is typically bundled with `gnome-shell`). 20 | 21 | Afterwards, simply run `make` to build a zip suitable for submission to 22 | [EGO](https://extensions.gnome.org/). 23 | 24 | `make install` can also be used to install the extension for the current user. 25 | 26 | ## Packaging 27 | 28 | ```bash 29 | # Build 30 | make pack 31 | 32 | # Install 33 | make install-system PREFIX=/usr 34 | ``` 35 | 36 | For a successful build, these binaries need to be present: 37 | - `gnome-extensions` 38 | - `glib-compile-schemas` 39 | - `unzip` 40 | 41 | ## Debugging 42 | 43 | - `journalctl -f --user` is your friend. 44 | - `make install && dbus-run-session -- gnome-shell --nested --wayland` allows for quick prototyping 45 | without having to log out and back in every single time when running under wayland. 46 | - `make install`, then `Alt+F2`, `r` and `Enter` allow for quick prototyping under X11. 47 | 48 | ## Translations 49 | 50 | If you're interested in contributing a translation, import the translation template file under 51 | `src/po/template.pot` to your favourite po-editing software and create a `*.po` file under `src/po`. 52 | 53 | To update all existing translations after changing the code, run `make po`. To regenerate only the 54 | `template.pot` file, run `make pot`. 55 | -------------------------------------------------------------------------------- /img/ego.svg: -------------------------------------------------------------------------------- 1 | 2 | Download From EGO 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/extension.js: -------------------------------------------------------------------------------- 1 | /* This extension is a derived work of the Gnome Shell. 2 | * 3 | * Copyright (c) 2013 Paolo Tranquilli 4 | * 5 | * This extension is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This extension is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this extension; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | import GLib from 'gi://GLib'; 21 | import GObject from 'gi://GObject'; 22 | import Meta from 'gi://Meta'; 23 | import Clutter from 'gi://Clutter'; 24 | 25 | import { Extension, InjectionManager } 26 | from 'resource:///org/gnome/shell/extensions/extension.js'; 27 | import { Workspace } from 'resource:///org/gnome/shell/ui/workspace.js'; 28 | import { WindowPreview } from 'resource:///org/gnome/shell/ui/windowPreview.js'; 29 | import { ControlsState } from 'resource:///org/gnome/shell/ui/overviewControls.js'; 30 | 31 | import { SettingsWatch } from './settingsWatch.js'; 32 | 33 | export default class MiddleClickClose extends Extension { 34 | #settings; 35 | #injectionManager; 36 | 37 | #refocusOnClose; 38 | 39 | enable() { 40 | this.#settings = new SettingsWatch(this.getSettings(), { 41 | close_button: { get: v => v.value, }, 42 | close_button_modifiers: { 43 | get(nicks) { 44 | let flags = 0; 45 | for (const nick of nicks) { 46 | switch (nick) { 47 | case 'shift': 48 | flags |= Clutter.ModifierType.SHIFT_MASK; 49 | break; 50 | case 'control': 51 | flags |= Clutter.ModifierType.CONTROL_MASK; 52 | break; 53 | default: 54 | throw new GObject.NotImplementedError(); 55 | } 56 | } 57 | return flags; 58 | } 59 | }, 60 | rearrange_delay: {}, 61 | keyboard_close: {}, 62 | }); 63 | 64 | this.#refocusOnClose = new WeakSet(); 65 | 66 | this.#injectionManager = new InjectionManager(); 67 | this.#patchClickHandler(); 68 | this.#patchWindowRepositioningDelay(); 69 | this.#patchKeyClose(); 70 | } 71 | 72 | disable() { 73 | this.#injectionManager.clear(); 74 | this.#injectionManager = null; 75 | 76 | this.#refocusOnClose = null; 77 | 78 | this.#settings.clear(); 79 | this.#settings = null; 80 | } 81 | 82 | #patchClickHandler() { 83 | // Patch _addWindowClone() to override the clicked signal handler for window clones (which 84 | // is what gnome calls window previews). 85 | const settings = this.#settings; 86 | 87 | this.#injectionManager.overrideMethod(Workspace.prototype, '_addWindowClone', 88 | original => function () { 89 | let clone = original.apply(this, arguments); 90 | 91 | // Normally we should just be able to access the modifiers via 92 | // ClickAction.get_state(). However as of gnome 48, it is straight up broken. This 93 | // is a workaround until I get around to submitting a fix upstream. 94 | let modifier_state = 0; 95 | clone.connect('captured-event', (_actor, event) => { 96 | switch (event.type()) { 97 | case Clutter.EventType.BUTTON_PRESS: 98 | modifier_state = event.get_state(); 99 | break; 100 | case Clutter.EventType.BUTTON_RELEASE: 101 | modifier_state &= event.get_state(); 102 | break; 103 | } 104 | }); 105 | 106 | // This relies on implementation details of both gnome and gobject. Mainly the order 107 | // the clone's actions are defined and the order with which signal handlers are 108 | // connected on the click action. Just pray this never breaks... Or that gnome moves 109 | // the click handler into a named function. That'd be nice too :) 110 | let [clickAction] = clone.get_actions(); 111 | let id = GObject.signal_handler_find(clickAction, { signalId: 'clicked' }); 112 | clickAction.disconnect(id); 113 | clickAction.connect('clicked', action => { 114 | const close_modifiers = settings.close_button_modifiers; 115 | if (action.get_button() == settings.close_button 116 | && (modifier_state & close_modifiers) == close_modifiers) { 117 | clone._deleteAll(); 118 | } else { 119 | clone._activate(); 120 | } 121 | }); 122 | 123 | return clone; 124 | } 125 | ); 126 | } 127 | 128 | #patchWindowRepositioningDelay() { 129 | // It'd be nice to just change the WINDOW_REPOSITIONING_DELAY in workspace.js, but 130 | // apparently that is impossible with the switch to ESM. Instead, we'll monkey-patch 131 | // _doRemoveWindow() and change the timeout after the fact. 132 | const settings = this.#settings; 133 | const refocusOnClose = this.#refocusOnClose; 134 | const lastLayoutFrozenIds = new WeakMap(); 135 | 136 | this.#injectionManager.overrideMethod(Workspace.prototype, '_doRemoveWindow', 137 | original => function (metaWin) { 138 | 139 | // Grab the old window's focus chain index. 140 | let focus_idx = this.get_focus_chain() 141 | .findIndex(clone => clone.metaWindow == metaWin); 142 | 143 | // Call the original method. 144 | const ret = original.apply(this, arguments); 145 | 146 | if (refocusOnClose.has(metaWin)) { 147 | // Find a "nearby" window to refocus to, based on the old index 148 | const chain = this.get_focus_chain(); 149 | if (focus_idx >= chain.length) { 150 | focus_idx = chain.length - 1; 151 | } 152 | 153 | // Focus on the selected window. 154 | if (focus_idx >= 0) { 155 | global.stage.key_focus = chain[focus_idx]; 156 | } 157 | } 158 | 159 | // Adjust the freeze delay. 160 | if (this._layoutFrozenId > 0 161 | && this._layoutFrozenId != lastLayoutFrozenIds.get(this) 162 | ) { 163 | const src = GLib.MainContext.default().find_source_by_id(this._layoutFrozenId); 164 | src.set_ready_time(src.get_time() + settings.rearrange_delay * 1000); 165 | } 166 | 167 | // Need to keep the last id to avoid adjusting the layout freeze delay more than 168 | // once. 169 | lastLayoutFrozenIds.set(this, this._layoutFrozenId); 170 | return ret; 171 | }) 172 | } 173 | 174 | #patchKeyClose() { 175 | // If Meta.KeyBindingAction.CLOSE is fired in while a WindowPreview is focused, close it. 176 | const settings = this.#settings; 177 | const refocusOnClose = this.#refocusOnClose; 178 | 179 | function handleKeyPress(event) { 180 | 181 | // Keyboard close disabled in settings. 182 | if (!settings.keyboard_close) { 183 | return false; 184 | } 185 | 186 | // We only care about window picker mode. 187 | if (this._workspace._overviewAdjustment.value !== ControlsState.WINDOW_PICKER) { 188 | return false; 189 | } 190 | 191 | const action = global.display.get_keybinding_action( 192 | event.get_key_code(), event.get_state()); 193 | if (action == Meta.KeyBindingAction.CLOSE) { 194 | 195 | if (this._workspace.metaWorkspace?.active) { 196 | // Immediately refocus on another window when closing via keyboard. 197 | refocusOnClose.add(this.metaWindow); 198 | 199 | // Close the window. 200 | this._deleteAll(); 201 | } else { 202 | // Switch to the workspace the focused window is in. 203 | this._workspace.metaWorkspace?.activate(global.get_current_time()) 204 | } 205 | 206 | return true; 207 | } 208 | 209 | return false; 210 | } 211 | 212 | this.#injectionManager.overrideMethod(WindowPreview.prototype, 'vfunc_key_press_event', 213 | original => function () { 214 | return handleKeyPress.apply(this, arguments) 215 | || original.apply(this, arguments); 216 | } 217 | ) 218 | } 219 | }; 220 | -------------------------------------------------------------------------------- /src/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Quick Close in Overview", 3 | "description": "Close windows with a button click (the middle one by default) when in overview mode", 4 | "url": "https://github.com/p91paul/middleclickclose", 5 | "shell-version": [ 6 | "45", 7 | "46", 8 | "47", 9 | "48" 10 | ], 11 | "uuid": "middleclickclose@paolo.tranquilli.gmail.com", 12 | "settings-schema": "org.gnome.shell.extensions.middleclickclose", 13 | "gettext-domain": "org.gnome.shell.extensions.middleclickclose" 14 | } -------------------------------------------------------------------------------- /src/po/de.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # Onno Giesmann , 2019. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: gnome-shell-extensions-middleclickclose\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2025-04-16 10:02+0300\n" 11 | "PO-Revision-Date: 2019-06-17 20:44+0200\n" 12 | "Last-Translator: Onno Giesmann \n" 13 | "Language-Team: German <--->\n" 14 | "Language: de\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "X-Generator: Gtranslator 3.32.1\n" 19 | "Plural-Forms: nplurals=2; plural=(n != 1)\n" 20 | 21 | #: src/prefs.js:31 22 | msgid "Primary" 23 | msgstr "" 24 | 25 | #: src/prefs.js:32 26 | msgid "Middle" 27 | msgstr "Mittlere" 28 | 29 | #: src/prefs.js:33 30 | msgid "Secondary" 31 | msgstr "" 32 | 33 | #: src/prefs.js:34 34 | msgid "Button 4" 35 | msgstr "Taste 4" 36 | 37 | #: src/prefs.js:35 38 | msgid "Button 5" 39 | msgstr "Taste 5" 40 | 41 | #: src/prefs.js:36 42 | msgid "Button 6" 43 | msgstr "Taste 6" 44 | 45 | #: src/prefs.js:37 46 | msgid "Button 7" 47 | msgstr "Taste 7" 48 | 49 | #: src/prefs.js:38 50 | msgid "Button 8" 51 | msgstr "Taste 8" 52 | 53 | #: src/prefs.js:39 54 | msgid "Button 9" 55 | msgstr "Taste 9" 56 | 57 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:21 58 | msgid "Mouse button to close" 59 | msgstr "Maustaste zum Schließen" 60 | 61 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:22 62 | msgid "Which mouse button triggers closing in overview." 63 | msgstr "Gibt an, welche Maustaste das Schließen in der Übersicht auslöst." 64 | 65 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:26 66 | #, fuzzy 67 | msgid "Modifiers for mouse button close" 68 | msgstr "Maustaste zum Schließen" 69 | 70 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:27 71 | #, fuzzy 72 | msgid "" 73 | "Modifiers that need to be pressed in order for the mouse button to trigger " 74 | "closing in the overview." 75 | msgstr "Gibt an, welche Maustaste das Schließen in der Übersicht auslöst." 76 | 77 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:31 78 | msgid "Close with keyboard" 79 | msgstr "" 80 | 81 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:32 82 | msgid "Allow closing windows in overview via keyboard shortcuts." 83 | msgstr "" 84 | 85 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:37 86 | msgid "Rearrange delay" 87 | msgstr "Verzögerung bis zur Neuanordnung" 88 | 89 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:38 90 | msgid "" 91 | "How much time must pass with the pointer not moving for windows in overview " 92 | "to rearrange after one was closed." 93 | msgstr "" 94 | "Gibt die Zeit an, die bei stillstehender Maus vergehen muss, bevor sich die " 95 | "Fenster in der Übersicht neu anordnen, nachdem ein Fenster geschlossen wurde." 96 | 97 | #~ msgid "Left" 98 | #~ msgstr "Linke" 99 | 100 | #~ msgid "Right" 101 | #~ msgstr "Rechte" 102 | -------------------------------------------------------------------------------- /src/po/el.po: -------------------------------------------------------------------------------- 1 | # George Tsiamasiotis , 2025. 2 | 3 | msgid "" 4 | msgstr "" 5 | "Project-Id-Version: gnome-shell-extensions-middleclickclose\n" 6 | "Report-Msgid-Bugs-To: \n" 7 | "POT-Creation-Date: 2025-04-16 10:02+0300\n" 8 | "PO-Revision-Date: 2025-04-17 08:42+0300\n" 9 | "Last-Translator: George Tsiamasiotis \n" 10 | "Language-Team: \n" 11 | "Language: el\n" 12 | "MIME-Version: 1.0\n" 13 | "Content-Type: text/plain; charset=UTF-8\n" 14 | "Content-Transfer-Encoding: 8bit\n" 15 | "X-Generator: Poedit 3.5\n" 16 | 17 | #: src/prefs.js:31 18 | msgid "Primary" 19 | msgstr "Πρωτεύων" 20 | 21 | #: src/prefs.js:32 22 | msgid "Middle" 23 | msgstr "Μεσαίο" 24 | 25 | #: src/prefs.js:33 26 | msgid "Secondary" 27 | msgstr "Δευτερεύων" 28 | 29 | #: src/prefs.js:34 30 | msgid "Button 4" 31 | msgstr "Κουμπί 4" 32 | 33 | #: src/prefs.js:35 34 | msgid "Button 5" 35 | msgstr "Κουμπί 5" 36 | 37 | #: src/prefs.js:36 38 | msgid "Button 6" 39 | msgstr "Κουμπί 6" 40 | 41 | #: src/prefs.js:37 42 | msgid "Button 7" 43 | msgstr "Κουμπί 7" 44 | 45 | #: src/prefs.js:38 46 | msgid "Button 8" 47 | msgstr "Κουμπί 8" 48 | 49 | #: src/prefs.js:39 50 | msgid "Button 9" 51 | msgstr "Κουμπί 9" 52 | 53 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:21 54 | msgid "Mouse button to close" 55 | msgstr "Κουμπί ποντικιού για κλείσιμο" 56 | 57 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:22 58 | msgid "Which mouse button triggers closing in overview." 59 | msgstr "Ποιο κουμπί του ποντικιού κλείνει παράθυρα στην επισκόπηση." 60 | 61 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:26 62 | msgid "Modifiers for mouse button close" 63 | msgstr "Συνδυαστικά κουμπιά για κλείσιμο με το ποντίκι" 64 | 65 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:27 66 | msgid "" 67 | "Modifiers that need to be pressed in order for the mouse button to trigger " 68 | "closing in the overview." 69 | msgstr "" 70 | "Κουμπιά που πρέπει να είναι πατημένα για να κλείσει το ποντίκι παράθυρο στην " 71 | "επισκόπηση." 72 | 73 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:31 74 | msgid "Close with keyboard" 75 | msgstr "Κλείσιμο με πληκτρολόγιο" 76 | 77 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:32 78 | msgid "Allow closing windows in overview via keyboard shortcuts." 79 | msgstr "" 80 | "Επιτρέπει το κλείσιμο παραθύρων στην επισκόπηση μέσω συντομεύσεων " 81 | "πληκτρολογίου." 82 | 83 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:37 84 | msgid "Rearrange delay" 85 | msgstr "Καθυστέρηση ανακατονομής" 86 | 87 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:38 88 | msgid "" 89 | "How much time must pass with the pointer not moving for windows in overview " 90 | "to rearrange after one was closed." 91 | msgstr "" 92 | "Πόσος χρόνος πρέπει να περάσει με τον κέρσορα αδρανή στην επισκόπηση μετά το " 93 | "κλείσιμο ενός παραθύρου για να γίνει ανακατανομή." 94 | 95 | #~ msgid "Left" 96 | #~ msgstr "Αριστερό" 97 | 98 | #~ msgid "Right" 99 | #~ msgstr "Δεξί" 100 | -------------------------------------------------------------------------------- /src/po/fa.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # آوید , 2024. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: gnome-shell-extensions-middleclickclose\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2025-04-16 10:02+0300\n" 12 | "PO-Revision-Date: 2024-10-12 19:48+0330\n" 13 | "Last-Translator: آوید \n" 14 | "Language-Team: \n" 15 | "Language: fa\n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=UTF-8\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | "X-Generator: Poedit 3.4.2\n" 20 | 21 | #: src/prefs.js:31 22 | msgid "Primary" 23 | msgstr "" 24 | 25 | #: src/prefs.js:32 26 | msgid "Middle" 27 | msgstr "وسط" 28 | 29 | #: src/prefs.js:33 30 | msgid "Secondary" 31 | msgstr "" 32 | 33 | #: src/prefs.js:34 34 | msgid "Button 4" 35 | msgstr "دکمهٔ ۴" 36 | 37 | #: src/prefs.js:35 38 | msgid "Button 5" 39 | msgstr "دکمهٔ ۵" 40 | 41 | #: src/prefs.js:36 42 | msgid "Button 6" 43 | msgstr "دکمهٔ ۶" 44 | 45 | #: src/prefs.js:37 46 | msgid "Button 7" 47 | msgstr "دکمهٔ ۷" 48 | 49 | #: src/prefs.js:38 50 | msgid "Button 8" 51 | msgstr "دکمهٔ ۸" 52 | 53 | #: src/prefs.js:39 54 | msgid "Button 9" 55 | msgstr "دکمهٔ ۹" 56 | 57 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:21 58 | msgid "Mouse button to close" 59 | msgstr "دکمهٔ موشی برای بستن" 60 | 61 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:22 62 | msgid "Which mouse button triggers closing in overview." 63 | msgstr "کدام دکمهٔ موشی باعث بسته شدن در نمای کلی شود." 64 | 65 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:26 66 | #, fuzzy 67 | msgid "Modifiers for mouse button close" 68 | msgstr "دکمهٔ موشی برای بستن" 69 | 70 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:27 71 | #, fuzzy 72 | msgid "" 73 | "Modifiers that need to be pressed in order for the mouse button to trigger " 74 | "closing in the overview." 75 | msgstr "کدام دکمهٔ موشی باعث بسته شدن در نمای کلی شود." 76 | 77 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:31 78 | msgid "Close with keyboard" 79 | msgstr "بستن با صفحه‌کلید" 80 | 81 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:32 82 | msgid "Allow closing windows in overview via keyboard shortcuts." 83 | msgstr "بستن پنجره‌ها در نمای کلی با میانبرهای صفحه‌کلید مجاز است." 84 | 85 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:37 86 | msgid "Rearrange delay" 87 | msgstr "تنظیم دوبارهٔ تاخیر" 88 | 89 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:38 90 | msgid "" 91 | "How much time must pass with the pointer not moving for windows in overview " 92 | "to rearrange after one was closed." 93 | msgstr "" 94 | "چقدر زمان باید هنگام جابه‌جا نشدن نشانگر بگذرد تا پنجره‌های نمای کلی پس از " 95 | "بسته شدن یکی دوباره مرتب شوند." 96 | 97 | #~ msgid "Left" 98 | #~ msgstr "چپ" 99 | 100 | #~ msgid "Right" 101 | #~ msgstr "راست" 102 | -------------------------------------------------------------------------------- /src/po/fr.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: gnome-shell-extensions-middleclickclose\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2025-04-16 10:02+0300\n" 11 | "PO-Revision-Date: 2015-12-30 07:08+0100\n" 12 | "Last-Translator: DAEM Q.\n" 13 | "Language-Team: \n" 14 | "Language: fr\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "X-Generator: Poedit 1.8.5\n" 19 | "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" 20 | 21 | #: src/prefs.js:31 22 | msgid "Primary" 23 | msgstr "" 24 | 25 | #: src/prefs.js:32 26 | msgid "Middle" 27 | msgstr "Milieu" 28 | 29 | #: src/prefs.js:33 30 | msgid "Secondary" 31 | msgstr "" 32 | 33 | #: src/prefs.js:34 34 | msgid "Button 4" 35 | msgstr "Bouton 4" 36 | 37 | #: src/prefs.js:35 38 | msgid "Button 5" 39 | msgstr "Bouton 5" 40 | 41 | #: src/prefs.js:36 42 | msgid "Button 6" 43 | msgstr "Bouton 6" 44 | 45 | #: src/prefs.js:37 46 | msgid "Button 7" 47 | msgstr "Bouton 7" 48 | 49 | #: src/prefs.js:38 50 | msgid "Button 8" 51 | msgstr "Bouton 8" 52 | 53 | #: src/prefs.js:39 54 | msgid "Button 9" 55 | msgstr "Bouton 9" 56 | 57 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:21 58 | msgid "Mouse button to close" 59 | msgstr "Bouton de souris pour fermer la fenêtre" 60 | 61 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:22 62 | msgid "Which mouse button triggers closing in overview." 63 | msgstr "" 64 | "Le bouton de la souris qui déclenche la fermeture d'une fenêtre dans la Vue " 65 | "d'ensemble." 66 | 67 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:26 68 | #, fuzzy 69 | msgid "Modifiers for mouse button close" 70 | msgstr "Bouton de souris pour fermer la fenêtre" 71 | 72 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:27 73 | #, fuzzy 74 | msgid "" 75 | "Modifiers that need to be pressed in order for the mouse button to trigger " 76 | "closing in the overview." 77 | msgstr "" 78 | "Le bouton de la souris qui déclenche la fermeture d'une fenêtre dans la Vue " 79 | "d'ensemble." 80 | 81 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:31 82 | msgid "Close with keyboard" 83 | msgstr "" 84 | 85 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:32 86 | msgid "Allow closing windows in overview via keyboard shortcuts." 87 | msgstr "" 88 | 89 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:37 90 | msgid "Rearrange delay" 91 | msgstr "Délai avant réarrangement" 92 | 93 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:38 94 | msgid "" 95 | "How much time must pass with the pointer not moving for windows in overview " 96 | "to rearrange after one was closed." 97 | msgstr "" 98 | "Temps qu'il doit se passer sans que le pointeur de la souris ne bouge dans " 99 | "la Vue d'ensemble avant réarrangement des fenêtres." 100 | 101 | #~ msgid "Left" 102 | #~ msgstr "Gauche" 103 | 104 | #~ msgid "Right" 105 | #~ msgstr "Droit" 106 | -------------------------------------------------------------------------------- /src/po/it.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: gnome-shell-extensions-middleclickclose\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2025-04-16 10:02+0300\n" 11 | "PO-Revision-Date: 2017-04-21 10:06+0200\n" 12 | "Last-Translator: Jimmy Scionti \n" 13 | "Language-Team: Jimmy Scionti \n" 14 | "Language: it\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "X-Generator: Poedit 1.8.7.1\n" 19 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 20 | 21 | #: src/prefs.js:31 22 | msgid "Primary" 23 | msgstr "" 24 | 25 | #: src/prefs.js:32 26 | msgid "Middle" 27 | msgstr "Centrale" 28 | 29 | #: src/prefs.js:33 30 | msgid "Secondary" 31 | msgstr "" 32 | 33 | #: src/prefs.js:34 34 | msgid "Button 4" 35 | msgstr "Pulsante 4" 36 | 37 | #: src/prefs.js:35 38 | msgid "Button 5" 39 | msgstr "Pulsante 5" 40 | 41 | #: src/prefs.js:36 42 | msgid "Button 6" 43 | msgstr "Pulsante 6" 44 | 45 | #: src/prefs.js:37 46 | msgid "Button 7" 47 | msgstr "Pulsante 7" 48 | 49 | #: src/prefs.js:38 50 | msgid "Button 8" 51 | msgstr "Pulsante 8" 52 | 53 | #: src/prefs.js:39 54 | msgid "Button 9" 55 | msgstr "Pulsante 9" 56 | 57 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:21 58 | msgid "Mouse button to close" 59 | msgstr "Pulsante del mouse per chiudere la finestra" 60 | 61 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:22 62 | msgid "Which mouse button triggers closing in overview." 63 | msgstr "Seleziona quale pulsante del mouse premere per chiudere una finestra." 64 | 65 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:26 66 | #, fuzzy 67 | msgid "Modifiers for mouse button close" 68 | msgstr "Pulsante del mouse per chiudere la finestra" 69 | 70 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:27 71 | #, fuzzy 72 | msgid "" 73 | "Modifiers that need to be pressed in order for the mouse button to trigger " 74 | "closing in the overview." 75 | msgstr "Seleziona quale pulsante del mouse premere per chiudere una finestra." 76 | 77 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:31 78 | msgid "Close with keyboard" 79 | msgstr "" 80 | 81 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:32 82 | msgid "Allow closing windows in overview via keyboard shortcuts." 83 | msgstr "" 84 | 85 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:37 86 | msgid "Rearrange delay" 87 | msgstr "Ritardo del riordinamento" 88 | 89 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:38 90 | msgid "" 91 | "How much time must pass with the pointer not moving for windows in overview " 92 | "to rearrange after one was closed." 93 | msgstr "" 94 | "Seleziona il tempo di attesa tra la chiusura di una finestra e il " 95 | "riordinamento delle altre finestre nell'anteprima." 96 | 97 | #~ msgid "Left" 98 | #~ msgstr "Sinistro" 99 | 100 | #~ msgid "Right" 101 | #~ msgstr "Destro" 102 | -------------------------------------------------------------------------------- /src/po/nl.po: -------------------------------------------------------------------------------- 1 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 2 | # This file is distributed under the same license as the PACKAGE package. 3 | # 4 | # Heimen Stoffels , 2019. 5 | msgid "" 6 | msgstr "" 7 | "Project-Id-Version: gnome-shell-extensions-middleclickclose\n" 8 | "Report-Msgid-Bugs-To: \n" 9 | "POT-Creation-Date: 2025-04-16 10:02+0300\n" 10 | "PO-Revision-Date: 2019-09-15 20:17+0200\n" 11 | "Last-Translator: Heimen Stoffels \n" 12 | "Language-Team: Dutch \n" 13 | "Language: it\n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | "X-Generator: Poedit 2.2.1\n" 18 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 19 | 20 | #: src/prefs.js:31 21 | msgid "Primary" 22 | msgstr "" 23 | 24 | #: src/prefs.js:32 25 | msgid "Middle" 26 | msgstr "Scrollwiel" 27 | 28 | #: src/prefs.js:33 29 | msgid "Secondary" 30 | msgstr "" 31 | 32 | #: src/prefs.js:34 33 | msgid "Button 4" 34 | msgstr "Knop 4" 35 | 36 | #: src/prefs.js:35 37 | msgid "Button 5" 38 | msgstr "Knop 5" 39 | 40 | #: src/prefs.js:36 41 | msgid "Button 6" 42 | msgstr "Knop 6" 43 | 44 | #: src/prefs.js:37 45 | msgid "Button 7" 46 | msgstr "Knop 7" 47 | 48 | #: src/prefs.js:38 49 | msgid "Button 8" 50 | msgstr "Knop 8" 51 | 52 | #: src/prefs.js:39 53 | msgid "Button 9" 54 | msgstr "Knop 9" 55 | 56 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:21 57 | msgid "Mouse button to close" 58 | msgstr "Muisknop om vensters mee te sluiten" 59 | 60 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:22 61 | msgid "Which mouse button triggers closing in overview." 62 | msgstr "Met welke muisknop je vensters kunt sluiten op het overzicht." 63 | 64 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:26 65 | #, fuzzy 66 | msgid "Modifiers for mouse button close" 67 | msgstr "Muisknop om vensters mee te sluiten" 68 | 69 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:27 70 | #, fuzzy 71 | msgid "" 72 | "Modifiers that need to be pressed in order for the mouse button to trigger " 73 | "closing in the overview." 74 | msgstr "Met welke muisknop je vensters kunt sluiten op het overzicht." 75 | 76 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:31 77 | msgid "Close with keyboard" 78 | msgstr "" 79 | 80 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:32 81 | msgid "Allow closing windows in overview via keyboard shortcuts." 82 | msgstr "" 83 | 84 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:37 85 | msgid "Rearrange delay" 86 | msgstr "Vertraging bij herschikken" 87 | 88 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:38 89 | msgid "" 90 | "How much time must pass with the pointer not moving for windows in overview " 91 | "to rearrange after one was closed." 92 | msgstr "" 93 | "Hoeveel tijd er moet verstrijken na het sluiten van een venster voordat " 94 | "vensters worden herschikt." 95 | 96 | #~ msgid "Left" 97 | #~ msgstr "Links" 98 | 99 | #~ msgid "Right" 100 | #~ msgstr "Rechts" 101 | -------------------------------------------------------------------------------- /src/po/pt.po: -------------------------------------------------------------------------------- 1 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 2 | # This file is distributed under the same license as the PACKAGE package. 3 | # Tomás Marques , 2023 4 | # 5 | msgid "" 6 | msgstr "" 7 | "Project-Id-Version: gnome-shell-extensions-middleclickclose\n" 8 | "Report-Msgid-Bugs-To: \n" 9 | "POT-Creation-Date: 2025-04-16 10:02+0300\n" 10 | "PO-Revision-Date: 2023-10-11 23:56+0100\n" 11 | "Last-Translator: Tomás Marques \n" 12 | "Language-Team: \n" 13 | "Language: pt\n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | 18 | #: src/prefs.js:31 19 | msgid "Primary" 20 | msgstr "" 21 | 22 | #: src/prefs.js:32 23 | msgid "Middle" 24 | msgstr "Meio" 25 | 26 | #: src/prefs.js:33 27 | msgid "Secondary" 28 | msgstr "" 29 | 30 | #: src/prefs.js:34 31 | msgid "Button 4" 32 | msgstr "Botão 4" 33 | 34 | #: src/prefs.js:35 35 | msgid "Button 5" 36 | msgstr "Botão 5" 37 | 38 | #: src/prefs.js:36 39 | msgid "Button 6" 40 | msgstr "Botão 6" 41 | 42 | #: src/prefs.js:37 43 | msgid "Button 7" 44 | msgstr "Botão 7" 45 | 46 | #: src/prefs.js:38 47 | msgid "Button 8" 48 | msgstr "Botão 8" 49 | 50 | #: src/prefs.js:39 51 | msgid "Button 9" 52 | msgstr "Botão 9" 53 | 54 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:21 55 | msgid "Mouse button to close" 56 | msgstr "Botão do meio do rato" 57 | 58 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:22 59 | msgid "Which mouse button triggers closing in overview." 60 | msgstr "Qual o botão do rato que fecha uma janela na vista geral." 61 | 62 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:26 63 | #, fuzzy 64 | msgid "Modifiers for mouse button close" 65 | msgstr "Botão do meio do rato" 66 | 67 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:27 68 | #, fuzzy 69 | msgid "" 70 | "Modifiers that need to be pressed in order for the mouse button to trigger " 71 | "closing in the overview." 72 | msgstr "Qual o botão do rato que fecha uma janela na vista geral." 73 | 74 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:31 75 | msgid "Close with keyboard" 76 | msgstr "" 77 | 78 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:32 79 | msgid "Allow closing windows in overview via keyboard shortcuts." 80 | msgstr "" 81 | 82 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:37 83 | msgid "Rearrange delay" 84 | msgstr "Duração de reorganizar" 85 | 86 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:38 87 | msgid "" 88 | "How much time must pass with the pointer not moving for windows in overview " 89 | "to rearrange after one was closed." 90 | msgstr "" 91 | "Quanto tempo tem de passar sem que o cursor se mova para que as janelas na " 92 | "visão geral se reorganizem depois de uma ter sido fechada." 93 | 94 | #~ msgid "Left" 95 | #~ msgstr "Esquerda" 96 | 97 | #~ msgid "Right" 98 | #~ msgstr "Direita" 99 | -------------------------------------------------------------------------------- /src/po/ru.po: -------------------------------------------------------------------------------- 1 | # Russian translation 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # derVedro, 2024. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: gnome-shell-extensions-middleclickclose\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2025-04-16 10:02+0300\n" 11 | "PO-Revision-Date: 2024-11-18 22:00+0100\n" 12 | "Last-Translator: derVedro\n" 13 | "Language-Team: LANGUAGE \n" 14 | "Language: Russian\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | 19 | #: src/prefs.js:31 20 | msgid "Primary" 21 | msgstr "" 22 | 23 | #: src/prefs.js:32 24 | msgid "Middle" 25 | msgstr "Средняя" 26 | 27 | #: src/prefs.js:33 28 | msgid "Secondary" 29 | msgstr "" 30 | 31 | #: src/prefs.js:34 32 | msgid "Button 4" 33 | msgstr "Кнопка 4" 34 | 35 | #: src/prefs.js:35 36 | msgid "Button 5" 37 | msgstr "Кнопка 5" 38 | 39 | #: src/prefs.js:36 40 | msgid "Button 6" 41 | msgstr "Кнопка 6" 42 | 43 | #: src/prefs.js:37 44 | msgid "Button 7" 45 | msgstr "Кнопка 7" 46 | 47 | #: src/prefs.js:38 48 | msgid "Button 8" 49 | msgstr "Кнопка 8" 50 | 51 | #: src/prefs.js:39 52 | msgid "Button 9" 53 | msgstr "Кнопка 9" 54 | 55 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:21 56 | msgid "Mouse button to close" 57 | msgstr "Кнопка мышки для закрытия" 58 | 59 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:22 60 | msgid "Which mouse button triggers closing in overview." 61 | msgstr "Какая кнопка мышки вызывает закрытие в овервью." 62 | 63 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:26 64 | #, fuzzy 65 | msgid "Modifiers for mouse button close" 66 | msgstr "Кнопка мышки для закрытия" 67 | 68 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:27 69 | #, fuzzy 70 | msgid "" 71 | "Modifiers that need to be pressed in order for the mouse button to trigger " 72 | "closing in the overview." 73 | msgstr "Какая кнопка мышки вызывает закрытие в овервью." 74 | 75 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:31 76 | msgid "Close with keyboard" 77 | msgstr "Закрытие клавиатурой" 78 | 79 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:32 80 | msgid "Allow closing windows in overview via keyboard shortcuts." 81 | msgstr "Разрешить закрытие окон в овервью с помощью связки клавиш." 82 | 83 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:37 84 | msgid "Rearrange delay" 85 | msgstr "Задержка перестановки" 86 | 87 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:38 88 | msgid "" 89 | "How much time must pass with the pointer not moving for windows in overview " 90 | "to rearrange after one was closed." 91 | msgstr "" 92 | "Сколько времени при неподвижном указателе мышки должно пройти после закрытия " 93 | "окна, прежде чем произойдёт перестановка окон." 94 | 95 | #~ msgid "Left" 96 | #~ msgstr "Левая" 97 | 98 | #~ msgid "Right" 99 | #~ msgstr "Правая" 100 | -------------------------------------------------------------------------------- /src/po/sk.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: gnome-shell-extensions-middleclickclose\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2025-04-16 10:02+0300\n" 11 | "PO-Revision-Date: 2015-10-30 07:08+0100\n" 12 | "Last-Translator: Juraj Fiala \n" 13 | "Language-Team: \n" 14 | "Language: sk\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "X-Generator: Poedit 1.8.5\n" 19 | "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" 20 | 21 | #: src/prefs.js:31 22 | msgid "Primary" 23 | msgstr "" 24 | 25 | #: src/prefs.js:32 26 | msgid "Middle" 27 | msgstr "Stredné" 28 | 29 | #: src/prefs.js:33 30 | msgid "Secondary" 31 | msgstr "" 32 | 33 | #: src/prefs.js:34 34 | msgid "Button 4" 35 | msgstr "Tlačidlo 4" 36 | 37 | #: src/prefs.js:35 38 | msgid "Button 5" 39 | msgstr "Tlačidlo 5" 40 | 41 | #: src/prefs.js:36 42 | msgid "Button 6" 43 | msgstr "Tlačidlo 6" 44 | 45 | #: src/prefs.js:37 46 | msgid "Button 7" 47 | msgstr "Tlačidlo 7" 48 | 49 | #: src/prefs.js:38 50 | msgid "Button 8" 51 | msgstr "Tlačidlo 8" 52 | 53 | #: src/prefs.js:39 54 | msgid "Button 9" 55 | msgstr "Tlačidlo 9" 56 | 57 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:21 58 | msgid "Mouse button to close" 59 | msgstr "Tlačidlo myši na zavretie" 60 | 61 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:22 62 | msgid "Which mouse button triggers closing in overview." 63 | msgstr "Ktoré tlačidlo myši spustí zavretie v prehľade aktivít." 64 | 65 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:26 66 | #, fuzzy 67 | msgid "Modifiers for mouse button close" 68 | msgstr "Tlačidlo myši na zavretie" 69 | 70 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:27 71 | #, fuzzy 72 | msgid "" 73 | "Modifiers that need to be pressed in order for the mouse button to trigger " 74 | "closing in the overview." 75 | msgstr "Ktoré tlačidlo myši spustí zavretie v prehľade aktivít." 76 | 77 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:31 78 | msgid "Close with keyboard" 79 | msgstr "" 80 | 81 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:32 82 | msgid "Allow closing windows in overview via keyboard shortcuts." 83 | msgstr "" 84 | 85 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:37 86 | msgid "Rearrange delay" 87 | msgstr "Oneskorenie preskúpenia" 88 | 89 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:38 90 | msgid "" 91 | "How much time must pass with the pointer not moving for windows in overview " 92 | "to rearrange after one was closed." 93 | msgstr "" 94 | "Koľko času musí prejsť od posledného pohnutia kurzora myši aby sa okná v " 95 | "prehľade znovu usporiadali po tom ako bolo jedno zavreté." 96 | 97 | #~ msgid "Left" 98 | #~ msgstr "Ľavé" 99 | 100 | #~ msgid "Right" 101 | #~ msgstr "Pravé" 102 | -------------------------------------------------------------------------------- /src/po/sr.po: -------------------------------------------------------------------------------- 1 | # Translation for gnome-shell-extension-middleclickclose in Serbian (Cyrillic). 2 | # Copyright (C) 2023 3 | # This file is distributed under the same license as the gnome-shell-extension-middleclickclose package. 4 | # Fifty Dinar , 2023. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: \n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2025-04-16 10:02+0300\n" 11 | "PO-Revision-Date: 2023-10-15 18:51+0200\n" 12 | "Last-Translator: \n" 13 | "Language-Team: \n" 14 | "Language: sr\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "X-Generator: Poedit 3.4\n" 19 | 20 | #: src/prefs.js:31 21 | msgid "Primary" 22 | msgstr "" 23 | 24 | #: src/prefs.js:32 25 | msgid "Middle" 26 | msgstr "Средње" 27 | 28 | #: src/prefs.js:33 29 | msgid "Secondary" 30 | msgstr "" 31 | 32 | #: src/prefs.js:34 33 | msgid "Button 4" 34 | msgstr "Дугме 4" 35 | 36 | #: src/prefs.js:35 37 | msgid "Button 5" 38 | msgstr "Дугме 5" 39 | 40 | #: src/prefs.js:36 41 | msgid "Button 6" 42 | msgstr "Дугме 6" 43 | 44 | #: src/prefs.js:37 45 | msgid "Button 7" 46 | msgstr "Дугме 7" 47 | 48 | #: src/prefs.js:38 49 | msgid "Button 8" 50 | msgstr "Дугме 8" 51 | 52 | #: src/prefs.js:39 53 | msgid "Button 9" 54 | msgstr "Дугме 9" 55 | 56 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:21 57 | msgid "Mouse button to close" 58 | msgstr "Дугме на мишу за затварање апликација" 59 | 60 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:22 61 | msgid "Which mouse button triggers closing in overview." 62 | msgstr "Које дугме на мишу затвара апликацију у прегледнику." 63 | 64 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:26 65 | #, fuzzy 66 | msgid "Modifiers for mouse button close" 67 | msgstr "Дугме на мишу за затварање апликација" 68 | 69 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:27 70 | #, fuzzy 71 | msgid "" 72 | "Modifiers that need to be pressed in order for the mouse button to trigger " 73 | "closing in the overview." 74 | msgstr "Које дугме на мишу затвара апликацију у прегледнику." 75 | 76 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:31 77 | msgid "Close with keyboard" 78 | msgstr "" 79 | 80 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:32 81 | msgid "Allow closing windows in overview via keyboard shortcuts." 82 | msgstr "" 83 | 84 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:37 85 | msgid "Rearrange delay" 86 | msgstr "Задршка у распоређивању" 87 | 88 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:38 89 | msgid "" 90 | "How much time must pass with the pointer not moving for windows in overview " 91 | "to rearrange after one was closed." 92 | msgstr "" 93 | "Колико времена мора да прође приликом непомерања показивача миша за прозоре " 94 | "апликација у прегледнику, како би се прозори распоредили након затварања " 95 | "апликације." 96 | 97 | #~ msgid "Left" 98 | #~ msgstr "Лево" 99 | 100 | #~ msgid "Right" 101 | #~ msgstr "Десно" 102 | -------------------------------------------------------------------------------- /src/po/sr@latin.po: -------------------------------------------------------------------------------- 1 | # Translation for gnome-shell-extension-middleclickclose in Serbian (Latin). 2 | # Copyright (C) 2023 3 | # This file is distributed under the same license as the gnome-shell-extension-middleclickclose package. 4 | # Fifty Dinar , 2023. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: \n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2025-04-16 10:02+0300\n" 11 | "PO-Revision-Date: 2023-10-15 18:52+0200\n" 12 | "Last-Translator: \n" 13 | "Language-Team: \n" 14 | "Language: sr@latin\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "X-Generator: Poedit 3.4\n" 19 | 20 | #: src/prefs.js:31 21 | msgid "Primary" 22 | msgstr "" 23 | 24 | #: src/prefs.js:32 25 | msgid "Middle" 26 | msgstr "Srednje" 27 | 28 | #: src/prefs.js:33 29 | msgid "Secondary" 30 | msgstr "" 31 | 32 | #: src/prefs.js:34 33 | msgid "Button 4" 34 | msgstr "Dugme 4" 35 | 36 | #: src/prefs.js:35 37 | msgid "Button 5" 38 | msgstr "Dugme 5" 39 | 40 | #: src/prefs.js:36 41 | msgid "Button 6" 42 | msgstr "Dugme 6" 43 | 44 | #: src/prefs.js:37 45 | msgid "Button 7" 46 | msgstr "Dugme 7" 47 | 48 | #: src/prefs.js:38 49 | msgid "Button 8" 50 | msgstr "Dugme 8" 51 | 52 | #: src/prefs.js:39 53 | msgid "Button 9" 54 | msgstr "Dugme 9" 55 | 56 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:21 57 | msgid "Mouse button to close" 58 | msgstr "Dugme na mišu za zatvaranje aplikacija" 59 | 60 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:22 61 | msgid "Which mouse button triggers closing in overview." 62 | msgstr "Koje dugme na mišu zatvara aplikaciju u pregledniku." 63 | 64 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:26 65 | #, fuzzy 66 | msgid "Modifiers for mouse button close" 67 | msgstr "Dugme na mišu za zatvaranje aplikacija" 68 | 69 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:27 70 | #, fuzzy 71 | msgid "" 72 | "Modifiers that need to be pressed in order for the mouse button to trigger " 73 | "closing in the overview." 74 | msgstr "Koje dugme na mišu zatvara aplikaciju u pregledniku." 75 | 76 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:31 77 | msgid "Close with keyboard" 78 | msgstr "" 79 | 80 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:32 81 | msgid "Allow closing windows in overview via keyboard shortcuts." 82 | msgstr "" 83 | 84 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:37 85 | msgid "Rearrange delay" 86 | msgstr "Zadrška u raspoređivanju" 87 | 88 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:38 89 | msgid "" 90 | "How much time must pass with the pointer not moving for windows in overview " 91 | "to rearrange after one was closed." 92 | msgstr "" 93 | "Koliko vremena mora da prođe prilikom nepomeranja pokazivača miša za prozore " 94 | "aplikacija u pregledniku, kako bi se prozori rasporedili nakon zatvaranja " 95 | "aplikacije." 96 | 97 | #~ msgid "Left" 98 | #~ msgstr "Levo" 99 | 100 | #~ msgid "Right" 101 | #~ msgstr "Desno" 102 | -------------------------------------------------------------------------------- /src/po/template.pot: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: PACKAGE VERSION\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2025-04-16 10:02+0300\n" 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 | "Last-Translator: FULL NAME \n" 14 | "Language-Team: LANGUAGE \n" 15 | "Language: \n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=CHARSET\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | 20 | #: src/prefs.js:31 21 | msgid "Primary" 22 | msgstr "" 23 | 24 | #: src/prefs.js:32 25 | msgid "Middle" 26 | msgstr "" 27 | 28 | #: src/prefs.js:33 29 | msgid "Secondary" 30 | msgstr "" 31 | 32 | #: src/prefs.js:34 33 | msgid "Button 4" 34 | msgstr "" 35 | 36 | #: src/prefs.js:35 37 | msgid "Button 5" 38 | msgstr "" 39 | 40 | #: src/prefs.js:36 41 | msgid "Button 6" 42 | msgstr "" 43 | 44 | #: src/prefs.js:37 45 | msgid "Button 7" 46 | msgstr "" 47 | 48 | #: src/prefs.js:38 49 | msgid "Button 8" 50 | msgstr "" 51 | 52 | #: src/prefs.js:39 53 | msgid "Button 9" 54 | msgstr "" 55 | 56 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:21 57 | msgid "Mouse button to close" 58 | msgstr "" 59 | 60 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:22 61 | msgid "Which mouse button triggers closing in overview." 62 | msgstr "" 63 | 64 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:26 65 | msgid "Modifiers for mouse button close" 66 | msgstr "" 67 | 68 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:27 69 | msgid "" 70 | "Modifiers that need to be pressed in order for the mouse button to trigger " 71 | "closing in the overview." 72 | msgstr "" 73 | 74 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:31 75 | msgid "Close with keyboard" 76 | msgstr "" 77 | 78 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:32 79 | msgid "Allow closing windows in overview via keyboard shortcuts." 80 | msgstr "" 81 | 82 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:37 83 | msgid "Rearrange delay" 84 | msgstr "" 85 | 86 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:38 87 | msgid "" 88 | "How much time must pass with the pointer not moving for windows in overview " 89 | "to rearrange after one was closed." 90 | msgstr "" 91 | -------------------------------------------------------------------------------- /src/po/uk.po: -------------------------------------------------------------------------------- 1 | # StandWithUkraine 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # Artem Prokop , 2023. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: gnome-shell-extensions-middleclickclose\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2025-03-20 22:07+0200\n" 11 | "PO-Revision-Date: 2025-03-20 23:50+0200\n" 12 | "Last-Translator: Yevhen Popok \n" 13 | "Language-Team: \n" 14 | "Language: uk\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "X-Generator: Poedit 3.4.4\n" 19 | 20 | #: src/prefs.js:31 21 | msgid "Primary" 22 | msgstr "Основна" 23 | 24 | #: src/prefs.js:32 25 | msgid "Middle" 26 | msgstr "Середня" 27 | 28 | #: src/prefs.js:33 29 | msgid "Secondary" 30 | msgstr "Вторинна" 31 | 32 | #: src/prefs.js:34 33 | msgid "Button 4" 34 | msgstr "Кнопка 4" 35 | 36 | #: src/prefs.js:35 37 | msgid "Button 5" 38 | msgstr "Кнопка 5" 39 | 40 | #: src/prefs.js:36 41 | msgid "Button 6" 42 | msgstr "Кнопка 6" 43 | 44 | #: src/prefs.js:37 45 | msgid "Button 7" 46 | msgstr "Кнопка 7" 47 | 48 | #: src/prefs.js:38 49 | msgid "Button 8" 50 | msgstr "Кнопка 8" 51 | 52 | #: src/prefs.js:39 53 | msgid "Button 9" 54 | msgstr "Кнопка 9" 55 | 56 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:21 57 | msgid "Mouse button to close" 58 | msgstr "Кнопка миші для закриття" 59 | 60 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:22 61 | msgid "Which mouse button triggers closing in overview." 62 | msgstr "Якою кнопкою миші закривати вікна в огляді." 63 | 64 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:26 65 | #, fuzzy 66 | msgid "Modifiers for mouse button close" 67 | msgstr "Кнопка миші для закриття" 68 | 69 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:27 70 | #, fuzzy 71 | msgid "" 72 | "Modifiers that need to be pressed in order for the mouse button to trigger " 73 | "closing in the overview." 74 | msgstr "Яка кнопка миші закриває вікно в оверв'ю" 75 | 76 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:31 77 | msgid "Close with keyboard" 78 | msgstr "Закривати з клавіатури" 79 | 80 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:32 81 | msgid "Allow closing windows in overview via keyboard shortcuts." 82 | msgstr "Дозволити закривати вікна в огляді клавіатурними скороченнями." 83 | 84 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:37 85 | msgid "Rearrange delay" 86 | msgstr "Затримка перерозташування" 87 | 88 | #: src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml:38 89 | msgid "" 90 | "How much time must pass with the pointer not moving for windows in overview " 91 | "to rearrange after one was closed." 92 | msgstr "" 93 | "Скільки часу вказівник має лишатися нерухомим, щоб після закриття одного " 94 | "вікна в огляді, інші перерозташувалися." 95 | -------------------------------------------------------------------------------- /src/prefs.js: -------------------------------------------------------------------------------- 1 | /** 2 | This program is free software: you can redistribute it and/or modify 3 | it under the terms of the GNU General Public License as published by 4 | the Free Software Foundation, either version 2 of the License, or 5 | (at your option) any later version. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program. If not, see . 14 | **/ 15 | 16 | import Adw from 'gi://Adw'; 17 | import Gtk from 'gi://Gtk'; 18 | import GLib from 'gi://GLib'; 19 | import GObject from 'gi://GObject'; 20 | 21 | import { ExtensionPreferences, gettext as _ } 22 | from 'resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js'; 23 | 24 | export default class MiddleClickClosePreferences extends ExtensionPreferences { 25 | getPreferencesWidget() { 26 | let page = new Adw.PreferencesPage(); 27 | let group = new Adw.PreferencesGroup(); 28 | 29 | group.add(this.buildPreference("close-button", { 30 | nicks: { 31 | primary: _("Primary"), 32 | middle: _("Middle"), 33 | secondary: _("Secondary"), 34 | 'button 4': _("Button 4"), 35 | 'button 5': _("Button 5"), 36 | 'button 6': _("Button 6"), 37 | 'button 7': _("Button 7"), 38 | 'button 8': _("Button 8"), 39 | 'button 9': _("Button 9"), 40 | }, 41 | })); 42 | 43 | group.add(this.buildPreference("close-button-modifiers")); 44 | 45 | group.add(this.buildPreference("keyboard-close")); 46 | 47 | page.add(group); 48 | 49 | group = new Adw.PreferencesGroup(); 50 | group.add(this.buildPreference("rearrange-delay", { 51 | step: 50, 52 | })); 53 | 54 | page.add(group); 55 | return page; 56 | } 57 | 58 | buildPreference(key, opts) { 59 | opts ??= {} 60 | 61 | const settings = this.getSettings(); 62 | const setting = settings.create_action(key); 63 | const schema = settings.settings_schema.get_key(key); 64 | 65 | opts.title ??= schema.get_summary() || schema.get_name(); 66 | opts.subtitle ??= schema.get_description(); 67 | 68 | const ty = schema.get_value_type().dup_string(); 69 | const [range_ty, range] = schema.get_range().recursiveUnpack(); 70 | 71 | if (range_ty == "enum") { 72 | opts.nicks ??= {}; 73 | let row = new Adw.ComboRow({ 74 | title: opts.title, 75 | subtitle: opts.subtitle, 76 | model: new Gtk.StringList({ strings: range.map(nick => opts.nicks[nick] ?? nick) }), 77 | selected: range.indexOf(setting.state.unpack()), 78 | }); 79 | 80 | row.connect('notify::selected', () => { 81 | setting.change_state(GLib.Variant.new_string(range[row.selected])); 82 | }); 83 | 84 | return row; 85 | } if (range_ty == "flags") { 86 | opts.nicks ??= {}; 87 | 88 | let row = new Adw.ExpanderRow({ 89 | title: opts.title, 90 | subtitle: opts.subtitle, 91 | }); 92 | 93 | let label = new Gtk.Label(); 94 | row.add_suffix(label); 95 | 96 | let selected = new Map(setting.state.unpack().map(nick => [nick.unpack(), undefined])); 97 | let update_selected = () => label.label = range 98 | .filter(nick => selected.has(nick)) 99 | .map(nick => selected.get(nick)) 100 | .join(', '); 101 | 102 | for (const nick of range) { 103 | let title = opts.nicks[nick] ?? nick; 104 | title = title.replace(/^./u, c => c.toUpperCase()); 105 | 106 | let active = selected.has(nick); 107 | 108 | if (active) { 109 | selected.set(nick, title); 110 | } 111 | 112 | let flag_switch = new Adw.SwitchRow({ title, active }); 113 | 114 | flag_switch.connect('notify::active', () => { 115 | if (flag_switch.active) { 116 | selected.set(nick, title); 117 | } else { 118 | selected.delete(nick); 119 | } 120 | 121 | update_selected(); 122 | 123 | let new_state = GLib.Variant.new_array( 124 | new GLib.VariantType('s'), 125 | Array.from(selected.keys()).map(s => GLib.Variant.new_string(s)) 126 | ); 127 | setting.change_state(new_state); 128 | }); 129 | 130 | row.add_row(flag_switch); 131 | } 132 | 133 | update_selected(); 134 | 135 | return row; 136 | } else if (range_ty == "range") { 137 | opts.lower ??= range[0] 138 | opts.upper ??= range[1] 139 | } 140 | 141 | 142 | if (ty == "b") { 143 | let row = new Adw.SwitchRow({ 144 | title: opts.title, 145 | subtitle: opts.subtitle, 146 | active: setting.state.unpack() 147 | }); 148 | 149 | row.connect('notify::active', () => { 150 | setting.change_state(GLib.Variant.new_boolean(row.active)); 151 | }); 152 | 153 | return row; 154 | 155 | } else if (ty == "i") { 156 | let adjustment = new Gtk.Adjustment({ 157 | lower: opts.lower, 158 | upper: opts.upper, 159 | step_increment: opts.step, 160 | value: setting.state.unpack(), 161 | }); 162 | 163 | let row = new Adw.SpinRow({ 164 | title: opts.title, 165 | subtitle: opts.subtitle, 166 | numeric: true, 167 | adjustment, 168 | }); 169 | 170 | adjustment.connect("value-changed", adj => { 171 | setting.change_state(GLib.Variant.new_int32(adj.value)); 172 | }); 173 | 174 | return row; 175 | } 176 | 177 | // Yeah... I'm not gonna implement a full introspector here. Just add whatever is required 178 | // when needed. 179 | throw new GObject.NotImplementedError(); 180 | } 181 | }; 182 | -------------------------------------------------------------------------------- /src/schemas/org.gnome.shell.extensions.middleclickclose.gschema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 'middle' 21 | Mouse button to close 22 | Which mouse button triggers closing in overview. 23 | 24 | 25 | [] 26 | Modifiers for mouse button close 27 | Modifiers that need to be pressed in order for the mouse button to trigger closing in the overview. 28 | 29 | 30 | true 31 | Close with keyboard 32 | Allow closing windows in overview via keyboard shortcuts. 33 | 34 | 35 | 750 36 | 37 | Rearrange delay 38 | How much time must pass with the pointer not moving for windows in overview to rearrange after one was closed. 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/settingsWatch.js: -------------------------------------------------------------------------------- 1 | export class SettingsWatch { 2 | #settings; 3 | #key_data = new Map(); 4 | 5 | constructor(settings, ...opts) { 6 | this.#settings = settings; 7 | 8 | for (const opt of opts) { 9 | if (typeof opt == 'string') { 10 | this.#addSetting(opt, {}); 11 | } else { 12 | for (const [prop_name, opts] of Object.entries(opt)) { 13 | this.#addSetting(prop_name, opts) 14 | } 15 | } 16 | } 17 | } 18 | 19 | #addSetting(prop_name, opts) { 20 | let key; 21 | if (typeof opts == 'string') { 22 | key = opts; 23 | opts = {}; 24 | } else { 25 | key = opts.key ?? prop_name.replace(/_/g, '-'); 26 | } 27 | 28 | const settings = this.#settings; 29 | const raw_getter = opts.get_raw ?? this.#defaultRawGetter(settings, key); 30 | const getter = opts.get ?? (x => x); 31 | 32 | const update_cb = () => { 33 | let value = getter(raw_getter(settings.get_value(key))); 34 | this.#key_data.get(prop_name).value = value; 35 | 36 | return value; 37 | }; 38 | 39 | this.#key_data.set(prop_name, {}); 40 | Object.defineProperty(this, prop_name, { 41 | enumerable: true, 42 | configurable: true, 43 | get() { 44 | let data = this.#key_data.get(prop_name); 45 | if (data.value === undefined) { 46 | data.handler_id = settings.connect('changed::' + key, update_cb); 47 | data.value = update_cb(); 48 | } 49 | 50 | return data.value; 51 | } 52 | }); 53 | } 54 | 55 | #defaultRawGetter(settings, key) { 56 | const schema = settings.settings_schema.get_key(key); 57 | const [range_ty, _range] = schema.get_range().recursiveUnpack(); 58 | 59 | if (range_ty == "enum") { 60 | return value => { 61 | return { 62 | nick: value.unpack(), 63 | 64 | // FIXME: remove unnecessary lookup if/when g_settings_schema_key_to_enum() 65 | // becomes available. But for now, an extra lookup will have to do. 66 | value: settings.get_enum(key), 67 | }; 68 | }; 69 | } 70 | 71 | return value => value.recursiveUnpack(); 72 | } 73 | 74 | clear() { 75 | for (const [key, data] of this.#key_data.entries()) { 76 | if (data.handler_id !== undefined) 77 | this.#settings.disconnect(data.handler_id); 78 | 79 | delete this[key]; 80 | } 81 | 82 | this.#key_data.clear(); 83 | } 84 | } 85 | 86 | // Allow calling clear as a static function. 87 | SettingsWatch.clear = obj => SettingsWatch.prototype.clear.apply(obj); 88 | -------------------------------------------------------------------------------- /typos.toml: -------------------------------------------------------------------------------- 1 | [files] 2 | extend-exclude = ["src/po"] 3 | --------------------------------------------------------------------------------