├── .clang-format ├── .github ├── FUNDING.yml └── workflows │ ├── checks.yml │ └── deploy.yml ├── .gitignore ├── .reuse └── dep5 ├── LICENSES ├── CC-BY-4.0.txt ├── CC0-1.0.txt └── MIT.txt ├── Makefile ├── README.md ├── extension.js ├── metadata.json ├── schemas └── org.gnome.shell.extensions.kando-integration.gschema.xml ├── scripts └── clang-format.sh └── src ├── InputManipulator.js └── Shortcuts.js /.clang-format: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Simon Schneegans 2 | # SPDX-License-Identifier: CC0-1.0 3 | 4 | BasedOnStyle: Google 5 | AlignConsecutiveAssignments: true 6 | AlignAfterOpenBracket: Align 7 | ContinuationIndentWidth: 2 8 | KeepEmptyLinesAtTheStartOfBlocks: true 9 | ColumnLimit: 90 -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Simon Schneegans 2 | # SPDX-License-Identifier: CC0-1.0 3 | 4 | # These are supported funding model platforms 5 | 6 | github: schneegans 7 | patreon: # Replace with a single Patreon username 8 | open_collective: # Replace with a single Open Collective username 9 | ko_fi: schneegans 10 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 11 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 12 | liberapay: # Schneegans 13 | issuehunt: # Replace with a single IssueHunt username 14 | otechie: # Replace with a single Otechie username 15 | custom: ['https://www.paypal.com/donate/?hosted_button_id=3F7UFL8KLVPXE'] 16 | -------------------------------------------------------------------------------- /.github/workflows/checks.yml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Simon Schneegans 2 | # SPDX-License-Identifier: CC0-1.0 3 | 4 | name: Checks 5 | 6 | on: 7 | push: 8 | branches: 9 | - "**" 10 | 11 | jobs: 12 | clang_format: 13 | name: Check Clang-Format 14 | runs-on: ubuntu-latest 15 | steps: 16 | - name: Checkout Repository 17 | uses: actions/checkout@v4 18 | - name: Download Clang-Format 19 | run: | 20 | sudo apt update -qq 21 | sudo apt install clang-format -qq 22 | - name: Run Clang-Format 23 | run: scripts/clang-format.sh 24 | - name: Compare Results 25 | run: | 26 | DIFF=$(git diff) 27 | if [ ! -z "$DIFF" ]; then echo $DIFF && exit 1; fi 28 | 29 | reuse: 30 | name: Check Compliance with REUSE Specification 31 | runs-on: ubuntu-latest 32 | steps: 33 | - uses: actions/checkout@v4 34 | - name: REUSE Compliance Check 35 | uses: fsfe/reuse-action@v1 36 | -------------------------------------------------------------------------------- /.github/workflows/deploy.yml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Simon Schneegans 2 | # SPDX-License-Identifier: CC0-1.0 3 | 4 | name: Deploy 5 | 6 | permissions: 7 | contents: write 8 | 9 | on: 10 | push: 11 | tags: 12 | - "**" 13 | 14 | jobs: 15 | extension_bundle: 16 | name: Extension Bundle 17 | runs-on: ubuntu-latest 18 | steps: 19 | - name: Checkout Repository 20 | uses: actions/checkout@v4 21 | - name: Create Release 22 | run: | 23 | make zip 24 | - name: Upload Release 25 | uses: svenstaro/upload-release-action@2.9.0 26 | with: 27 | repo_token: ${{ secrets.GITHUB_TOKEN }} 28 | file: kando-integration@kando-menu.github.io.zip 29 | tag: ${{ github.ref }} 30 | overwrite: true 31 | prerelease: true 32 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Simon Schneegans 2 | # SPDX-License-Identifier: CC0-1.0 3 | 4 | *~ 5 | *.zip -------------------------------------------------------------------------------- /.reuse/dep5: -------------------------------------------------------------------------------- 1 | Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | 3 | Files: metadata.json 4 | Copyright: Simon Schneegans 5 | License: CC0-1.0 -------------------------------------------------------------------------------- /LICENSES/CC-BY-4.0.txt: -------------------------------------------------------------------------------- 1 | Creative Commons Attribution 4.0 International 2 | 3 | Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible. 4 | 5 | Using Creative Commons Public Licenses 6 | 7 | Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses. 8 | 9 | Considerations for licensors: Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. More considerations for licensors. 10 | 11 | Considerations for the public: By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensor’s permission is not necessary for any reason–for example, because of any applicable exception or limitation to copyright–then that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable. More considerations for the public. 12 | 13 | Creative Commons Attribution 4.0 International Public License 14 | 15 | By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions. 16 | 17 | Section 1 – Definitions. 18 | 19 | a. Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image. 20 | 21 | b. Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License. 22 | 23 | c. Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights. 24 | 25 | d. Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements. 26 | 27 | e. Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material. 28 | 29 | f. Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License. 30 | 31 | g. Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license. 32 | 33 | h. Licensor means the individual(s) or entity(ies) granting rights under this Public License. 34 | 35 | i. Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them. 36 | 37 | j. Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world. 38 | 39 | k. You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning. 40 | 41 | Section 2 – Scope. 42 | 43 | a. License grant. 44 | 45 | 1. Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to: 46 | 47 | A. reproduce and Share the Licensed Material, in whole or in part; and 48 | 49 | B. produce, reproduce, and Share Adapted Material. 50 | 51 | 2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions. 52 | 53 | 3. Term. The term of this Public License is specified in Section 6(a). 54 | 55 | 4. Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material. 56 | 57 | 5. Downstream recipients. 58 | 59 | A. Offer from the Licensor – Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License. 60 | 61 | B. No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material. 62 | 63 | 6. No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i). 64 | 65 | b. Other rights. 66 | 67 | 1. Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise. 68 | 69 | 2. Patent and trademark rights are not licensed under this Public License. 70 | 71 | 3. To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties. 72 | 73 | Section 3 – License Conditions. 74 | 75 | Your exercise of the Licensed Rights is expressly made subject to the following conditions. 76 | 77 | a. Attribution. 78 | 79 | 1. If You Share the Licensed Material (including in modified form), You must: 80 | 81 | A. retain the following if it is supplied by the Licensor with the Licensed Material: 82 | 83 | i. identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated); 84 | 85 | ii. a copyright notice; 86 | 87 | iii. a notice that refers to this Public License; 88 | 89 | iv. a notice that refers to the disclaimer of warranties; 90 | 91 | v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable; 92 | 93 | B. indicate if You modified the Licensed Material and retain an indication of any previous modifications; and 94 | 95 | C. indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License. 96 | 97 | 2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information. 98 | 99 | 3. If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable. 100 | 101 | 4. If You Share Adapted Material You produce, the Adapter's License You apply must not prevent recipients of the Adapted Material from complying with this Public License. 102 | 103 | Section 4 – Sui Generis Database Rights. 104 | 105 | Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material: 106 | 107 | a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database; 108 | 109 | b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material; and 110 | 111 | c. You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database. 112 | For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights. 113 | 114 | Section 5 – Disclaimer of Warranties and Limitation of Liability. 115 | 116 | a. Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You. 117 | 118 | b. To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You. 119 | 120 | c. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability. 121 | 122 | Section 6 – Term and Termination. 123 | 124 | a. This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically. 125 | 126 | b. Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates: 127 | 128 | 1. automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or 129 | 130 | 2. upon express reinstatement by the Licensor. 131 | 132 | c. For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License. 133 | 134 | d. For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License. 135 | 136 | e. Sections 1, 5, 6, 7, and 8 survive termination of this Public License. 137 | 138 | Section 7 – Other Terms and Conditions. 139 | 140 | a. The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed. 141 | 142 | b. Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License. 143 | 144 | Section 8 – Interpretation. 145 | 146 | a. For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License. 147 | 148 | b. To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions. 149 | 150 | c. No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor. 151 | 152 | d. Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority. 153 | 154 | Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at creativecommons.org/policies, Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses. 155 | 156 | Creative Commons may be contacted at creativecommons.org. 157 | -------------------------------------------------------------------------------- /LICENSES/CC0-1.0.txt: -------------------------------------------------------------------------------- 1 | Creative Commons Legal Code 2 | 3 | CC0 1.0 Universal 4 | 5 | CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE 6 | LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN 7 | ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS 8 | INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES 9 | REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS 10 | PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM 11 | THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED 12 | HEREUNDER. 13 | 14 | Statement of Purpose 15 | 16 | The laws of most jurisdictions throughout the world automatically confer 17 | exclusive Copyright and Related Rights (defined below) upon the creator 18 | and subsequent owner(s) (each and all, an "owner") of an original work of 19 | authorship and/or a database (each, a "Work"). 20 | 21 | Certain owners wish to permanently relinquish those rights to a Work for 22 | the purpose of contributing to a commons of creative, cultural and 23 | scientific works ("Commons") that the public can reliably and without fear 24 | of later claims of infringement build upon, modify, incorporate in other 25 | works, reuse and redistribute as freely as possible in any form whatsoever 26 | and for any purposes, including without limitation commercial purposes. 27 | These owners may contribute to the Commons to promote the ideal of a free 28 | culture and the further production of creative, cultural and scientific 29 | works, or to gain reputation or greater distribution for their Work in 30 | part through the use and efforts of others. 31 | 32 | For these and/or other purposes and motivations, and without any 33 | expectation of additional consideration or compensation, the person 34 | associating CC0 with a Work (the "Affirmer"), to the extent that he or she 35 | is an owner of Copyright and Related Rights in the Work, voluntarily 36 | elects to apply CC0 to the Work and publicly distribute the Work under its 37 | terms, with knowledge of his or her Copyright and Related Rights in the 38 | Work and the meaning and intended legal effect of CC0 on those rights. 39 | 40 | 1. Copyright and Related Rights. A Work made available under CC0 may be 41 | protected by copyright and related or neighboring rights ("Copyright and 42 | Related Rights"). Copyright and Related Rights include, but are not 43 | limited to, the following: 44 | 45 | i. the right to reproduce, adapt, distribute, perform, display, 46 | communicate, and translate a Work; 47 | ii. moral rights retained by the original author(s) and/or performer(s); 48 | iii. publicity and privacy rights pertaining to a person's image or 49 | likeness depicted in a Work; 50 | iv. rights protecting against unfair competition in regards to a Work, 51 | subject to the limitations in paragraph 4(a), below; 52 | v. rights protecting the extraction, dissemination, use and reuse of data 53 | in a Work; 54 | vi. database rights (such as those arising under Directive 96/9/EC of the 55 | European Parliament and of the Council of 11 March 1996 on the legal 56 | protection of databases, and under any national implementation 57 | thereof, including any amended or successor version of such 58 | directive); and 59 | vii. other similar, equivalent or corresponding rights throughout the 60 | world based on applicable law or treaty, and any national 61 | implementations thereof. 62 | 63 | 2. Waiver. To the greatest extent permitted by, but not in contravention 64 | of, applicable law, Affirmer hereby overtly, fully, permanently, 65 | irrevocably and unconditionally waives, abandons, and surrenders all of 66 | Affirmer's Copyright and Related Rights and associated claims and causes 67 | of action, whether now known or unknown (including existing as well as 68 | future claims and causes of action), in the Work (i) in all territories 69 | worldwide, (ii) for the maximum duration provided by applicable law or 70 | treaty (including future time extensions), (iii) in any current or future 71 | medium and for any number of copies, and (iv) for any purpose whatsoever, 72 | including without limitation commercial, advertising or promotional 73 | purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each 74 | member of the public at large and to the detriment of Affirmer's heirs and 75 | successors, fully intending that such Waiver shall not be subject to 76 | revocation, rescission, cancellation, termination, or any other legal or 77 | equitable action to disrupt the quiet enjoyment of the Work by the public 78 | as contemplated by Affirmer's express Statement of Purpose. 79 | 80 | 3. Public License Fallback. Should any part of the Waiver for any reason 81 | be judged legally invalid or ineffective under applicable law, then the 82 | Waiver shall be preserved to the maximum extent permitted taking into 83 | account Affirmer's express Statement of Purpose. In addition, to the 84 | extent the Waiver is so judged Affirmer hereby grants to each affected 85 | person a royalty-free, non transferable, non sublicensable, non exclusive, 86 | irrevocable and unconditional license to exercise Affirmer's Copyright and 87 | Related Rights in the Work (i) in all territories worldwide, (ii) for the 88 | maximum duration provided by applicable law or treaty (including future 89 | time extensions), (iii) in any current or future medium and for any number 90 | of copies, and (iv) for any purpose whatsoever, including without 91 | limitation commercial, advertising or promotional purposes (the 92 | "License"). The License shall be deemed effective as of the date CC0 was 93 | applied by Affirmer to the Work. Should any part of the License for any 94 | reason be judged legally invalid or ineffective under applicable law, such 95 | partial invalidity or ineffectiveness shall not invalidate the remainder 96 | of the License, and in such case Affirmer hereby affirms that he or she 97 | will not (i) exercise any of his or her remaining Copyright and Related 98 | Rights in the Work or (ii) assert any associated claims and causes of 99 | action with respect to the Work, in either case contrary to Affirmer's 100 | express Statement of Purpose. 101 | 102 | 4. Limitations and Disclaimers. 103 | 104 | a. No trademark or patent rights held by Affirmer are waived, abandoned, 105 | surrendered, licensed or otherwise affected by this document. 106 | b. Affirmer offers the Work as-is and makes no representations or 107 | warranties of any kind concerning the Work, express, implied, 108 | statutory or otherwise, including without limitation warranties of 109 | title, merchantability, fitness for a particular purpose, non 110 | infringement, or the absence of latent or other defects, accuracy, or 111 | the present or absence of errors, whether or not discoverable, all to 112 | the greatest extent permissible under applicable law. 113 | c. Affirmer disclaims responsibility for clearing rights of other persons 114 | that may apply to the Work or any use thereof, including without 115 | limitation any person's Copyright and Related Rights in the Work. 116 | Further, Affirmer disclaims responsibility for obtaining any necessary 117 | consents, permissions or other rights required for any use of the 118 | Work. 119 | d. Affirmer understands and acknowledges that Creative Commons is not a 120 | party to this document and has no duty or obligation with respect to 121 | this CC0 or use of the Work. 122 | -------------------------------------------------------------------------------- /LICENSES/MIT.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Simon Schneegans 2 | # SPDX-License-Identifier: MIT 3 | 4 | SHELL := /bin/bash 5 | 6 | # We define these here to make the makefile easier to port to another extension. 7 | NAME := kando-integration 8 | DOMAIN := kando-menu.github.io 9 | ZIP_NAME := $(NAME)@$(DOMAIN).zip 10 | 11 | # These files will be included in the extension zip file. 12 | ZIP_CONTENT = extension.js metadata.json src/*.js schemas/org.gnome.shell.extensions.$(NAME).gschema.xml 13 | 14 | # These five recipes can be invoked by the user. 15 | .PHONY: zip install uninstall clean 16 | 17 | # The zip recipes only bundles the extension without installing it. 18 | zip: $(ZIP_NAME) 19 | 20 | # The install recipes creates the extension zip and installs it. 21 | install: $(ZIP_NAME) 22 | gnome-extensions install "$(ZIP_NAME)" --force 23 | @echo "Extension installed successfully! Now restart the Shell ('Alt'+'F2', then 'r')." 24 | 25 | # This uninstalls the previously installed extension. 26 | uninstall: 27 | gnome-extensions uninstall "$(NAME)@$(DOMAIN)" 28 | 29 | # This removes all temporary files created with the other recipes. 30 | clean: 31 | rm $(ZIP_NAME) 32 | 33 | # This bundles the extension and checks whether it is small enough to be uploaded to 34 | # extensions.gnome.org. We do not use "gnome-extensions pack" for this, as this is not 35 | # readily available on the GitHub runners. 36 | $(ZIP_NAME): $(ZIP_CONTENT) 37 | @echo "Packing zip file..." 38 | @rm --force $(ZIP_NAME) 39 | @zip $(ZIP_NAME) -- $(ZIP_CONTENT) 40 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 5 | 6 | # GNOME Shell Integration for Kando 7 | 8 | > [!IMPORTANT] 9 | > The code in the `main` branch is for GNOME Shell 45+. For older GNOME versions, please use the `gnome-40-44` branch. 10 | 11 | This GNOME Shell extension is required for [🥧 Kando](https://github.com/kando-menu/kando) on GNOME under Wayland. 12 | Via a D-Bus interface, it provides the name of the currently focused window, and the current mouse pointer position. 13 | Furthermore, it allows registering and simulating keyboard shortcuts. 14 | 15 | ## ⬇️ Installation 16 | 17 | ### From the GNOME Extensions Website 18 | 19 | Just head over to [extensions.gnome.org](https://extensions.gnome.org/extension/7068/kando-integration/) and flip the switch to install the extension! 20 | 21 | ### From Source Code 22 | 23 | To install the extension directly from the `main` branch on GitHub, clone this repository and run `make install`: 24 | 25 | ```bash 26 | git clone https://github.com/kando-menu/gnome-shell-integration.git 27 | cd gnome-shell-integration 28 | make install 29 | ``` 30 | 31 | Afterwards, restart GNOME Shell by logging out and back in. 32 | Finally, enable the extension: 33 | 34 | ```bash 35 | gnome-extensions enable kando-integration@kando-menu.github.io 36 | ``` 37 | 38 | ## 🗒️ Changelog 39 | 40 | We do not maintain a separate changelog for this repository. 41 | Changes are documented alongside other changes in Kando's [changelog](https://github.com/kando-menu/kando/blob/main/docs/changelog.md). 42 | -------------------------------------------------------------------------------- /extension.js: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////////////////// 2 | // _ _ ____ _ _ ___ ____ // 3 | // |_/ |__| |\ | | \ | | This file belongs to Kando, the cross-platform // 4 | // | \_ | | | \| |__/ |__| pie menu. Read more on github.com/kando-menu/kando // 5 | // // 6 | ////////////////////////////////////////////////////////////////////////////////////////// 7 | 8 | // SPDX-FileCopyrightText: Simon Schneegans 9 | // SPDX-License-Identifier: MIT 10 | 11 | 'use strict'; 12 | 13 | import Gio from 'gi://Gio'; 14 | import GLib from 'gi://GLib'; 15 | import Meta from 'gi://Meta'; 16 | import Clutter from 'gi://Clutter'; 17 | 18 | import {Extension} from 'resource:///org/gnome/shell/extensions/extension.js'; 19 | import {Shortcuts} from './src/Shortcuts.js'; 20 | import {InputManipulator} from './src/InputManipulator.js'; 21 | 22 | // This is the DBus interface which will be exported by this extension. It provides 23 | // methods to get information about the currently focused window and the mouse pointer 24 | // position. It also allows to move the mouse pointer, simulate key strokes and bind 25 | // shortcuts. 26 | const DBUS_INTERFACE = ` 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | `; 57 | 58 | export default class KandoIntegration extends Extension { 59 | 60 | // Exports the DBus interface. 61 | enable() { 62 | 63 | // Do nothing on X11. 64 | if (!Meta.is_wayland_compositor()) { 65 | return; 66 | } 67 | 68 | // This is used to get the desktop's text scaling factor. 69 | this._shellSettings = new Gio.Settings({schema: 'org.gnome.desktop.interface'}); 70 | 71 | this._dbus = Gio.DBusExportedObject.wrapJSObject(DBUS_INTERFACE, this); 72 | this._dbus.export(Gio.DBus.session, '/org/gnome/shell/extensions/KandoIntegration'); 73 | 74 | this._shortcuts = new Shortcuts(); 75 | this._inputManipulator = new InputManipulator(); 76 | 77 | this._shortcuts.connect('activated', (s, shortcut) => { 78 | this._dbus.emit_signal('ShortcutPressed', new GLib.Variant('(s)', [shortcut])); 79 | }); 80 | 81 | // Re-bind all shortcuts that were bound before the extension was disabled. 82 | this._settings = this.getSettings(); 83 | this._settings.get_strv('shortcuts').forEach((shortcut) => { 84 | this._shortcuts.bind(shortcut); 85 | }); 86 | 87 | this._backend = global.backend ? global.backend : Meta.get_backend(); 88 | this._lastPointerDevice = null; 89 | 90 | this._deviceChangedID = this._backend.connect('last-device-changed', (b, device) => { 91 | // For now, we assume that tablets, pens and erasers create a secondary cursor. 92 | // Is this true? For all other pointer-input devices, we use the main mouse pointer 93 | // location. 94 | if (device.get_device_type() == Clutter.InputDeviceType.TABLET_DEVICE || 95 | device.get_device_type() == Clutter.InputDeviceType.PEN_DEVICE || 96 | device.get_device_type() == Clutter.InputDeviceType.ERASER_DEVICE) { 97 | 98 | this._lastPointerDevice = device; 99 | } else if (device.get_device_type() == Clutter.InputDeviceType.POINTER_DEVICE || 100 | device.get_device_type() == Clutter.InputDeviceType.TOUCHPAD_DEVICE || 101 | device.get_device_type() == Clutter.InputDeviceType.TOUCHSCREEN_DEVICE) { 102 | 103 | const seat = Clutter.get_default_backend().get_default_seat(); 104 | this._lastPointerDevice = seat.get_pointer(); 105 | } 106 | }); 107 | } 108 | 109 | // Unbinds all shortcuts and unexports the DBus interface. 110 | disable() { 111 | 112 | // Do nothing on X11. 113 | if (!Meta.is_wayland_compositor()) { 114 | return; 115 | } 116 | 117 | this._shellSettings = null; 118 | 119 | this._dbus.flush(); 120 | this._dbus.unexport(); 121 | this._dbus = null; 122 | 123 | this._shortcuts.destroy(); 124 | this._shortcuts = null; 125 | 126 | this._settings = null; 127 | 128 | this._inputManipulator = null; 129 | 130 | this._backend.disconnect(this._deviceChangedID); 131 | this._backend = null; 132 | } 133 | 134 | // Returns the title and class of the currently focused window as well as the current 135 | // pointer position. 136 | GetWMInfo() { 137 | let windowName = ''; 138 | let windowClass = ''; 139 | 140 | for (let actor of global.get_window_actors()) { 141 | if (actor.meta_window.has_focus()) { 142 | windowName = actor.meta_window.get_title(); 143 | windowClass = actor.meta_window.get_wm_class(); 144 | 145 | break; 146 | } 147 | } 148 | 149 | let [x, y] = [0, 0]; 150 | 151 | if (this._lastPointerDevice != null) { 152 | const seat = Clutter.get_default_backend().get_default_seat(); 153 | const [ok, coords, mods] = seat.query_state(this._lastPointerDevice, null); 154 | [x, y] = [coords.x, coords.y]; 155 | } else { 156 | [x, y] = global.get_pointer(); 157 | } 158 | 159 | const scalingFactor = this._shellSettings.get_double('text-scaling-factor'); 160 | 161 | return [ 162 | windowName, windowClass, Math.round(x / scalingFactor), 163 | Math.round(y / scalingFactor) 164 | ]; 165 | } 166 | 167 | // Warps the mouse pointer by the given distance. 168 | MovePointer(dx, dy) { 169 | this._inputManipulator.movePointer(dx, dy); 170 | } 171 | 172 | // Simulates the given key strokes. The keys argument is an array of arrays. Each 173 | // sub-array contains three elements: The keysym, a boolean indicating whether the key 174 | // should be pressed or released and an optional delay in milliseconds. 175 | SimulateKeys(keys) { 176 | this._inputManipulator.simulateKeys(keys); 177 | } 178 | 179 | // Binds the given shortcut. When it's pressed, the "ShortcutPressed" signal will be 180 | // emitted. 181 | BindShortcut(shortcut) { 182 | const success = this._shortcuts.bind(shortcut); 183 | 184 | if (success) { 185 | const shortcuts = this._settings.get_strv('shortcuts'); 186 | shortcuts.push(shortcut); 187 | this._settings.set_strv('shortcuts', shortcuts); 188 | } 189 | 190 | return success; 191 | } 192 | 193 | // Unbinds a previously bound shortcut. 194 | UnbindShortcut(shortcut) { 195 | const success = this._shortcuts.unbind(shortcut); 196 | 197 | if (success) { 198 | const shortcuts = this._settings.get_strv('shortcuts'); 199 | this._settings.set_strv('shortcuts', shortcuts.filter((s) => s !== shortcut)); 200 | } 201 | 202 | return success; 203 | } 204 | 205 | // Unbinds all previously bound shortcuts. 206 | UnbindAllShortcuts() { 207 | this._shortcuts.unbindAll(); 208 | this._settings.set_strv('shortcuts', []); 209 | } 210 | } 211 | -------------------------------------------------------------------------------- /metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Kando Integration", 3 | "description": "This extension is required for Kando to work on Wayland. It allows Kando to bind global shortcuts, and provides information about your currently focused application window and the position of your mouse pointer.", 4 | "uuid": "kando-integration@kando-menu.github.io", 5 | "settings-schema": "org.gnome.shell.extensions.kando-integration", 6 | "donations": { 7 | "kofi": "schneegans", 8 | "github": "schneegans", 9 | "paypal": "simonschneegans" 10 | }, 11 | "shell-version": ["45", "46", "47", "48"], 12 | "version-name": "v0.6.0", 13 | "url": "https://github.com/kando-menu" 14 | } 15 | -------------------------------------------------------------------------------- /schemas/org.gnome.shell.extensions.kando-integration.gschema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | [] 14 | Shortcuts 15 | A list of all currently bound accelerators. 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /scripts/clang-format.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # -------------------------------------------------------------------------------------- # 4 | # ,-. ,--. ,-. , , ,---. ,-. ;-. ,-. . . ,-. ,--. # 5 | # | \ | ( ` | / | / \ | ) / | | | ) | # 6 | # | | |- `-. |< | | | |-' | | | |-< |- # 7 | # | / | . ) | \ | \ / | \ | | | ) | # 8 | # `-' `--' `-' ' ` ' `-' ' `-' `--` `-' `--' # 9 | # -------------------------------------------------------------------------------------- # 10 | 11 | # SPDX-FileCopyrightText: Simon Schneegans 12 | # SPDX-License-Identifier: MIT 13 | 14 | # Exit the script when one command fails. 15 | set -e 16 | 17 | # Go to the repo root. 18 | cd "$( cd "$( dirname "$0" )" && pwd )/.." || \ 19 | { echo "ERROR: Could not find the repo root."; exit 1; } 20 | 21 | # Execute clang format for all *.js files. 22 | find . -type f -name '*.js' -exec sh -c ' 23 | for file do 24 | echo "Formatting $file..." 25 | clang-format -i "$file" 26 | done 27 | ' sh {} + 28 | -------------------------------------------------------------------------------- /src/InputManipulator.js: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////////////////// 2 | // _ _ ____ _ _ ___ ____ // 3 | // |_/ |__| |\ | | \ | | This file belongs to Kando, the cross-platform // 4 | // | \_ | | | \| |__/ |__| pie menu. Read more on github.com/kando-menu/kando // 5 | // // 6 | ////////////////////////////////////////////////////////////////////////////////////////// 7 | 8 | // SPDX-FileCopyrightText: Simon Schneegans 9 | // SPDX-License-Identifier: MIT 10 | 11 | 'use strict'; 12 | 13 | import Clutter from 'gi://Clutter'; 14 | 15 | ////////////////////////////////////////////////////////////////////////////////////////// 16 | // An instance of this class can be used to create faked input events. You can use it // 17 | // to move the mouse pointer or to press accelerator key strokes. // 18 | ////////////////////////////////////////////////////////////////////////////////////////// 19 | 20 | export class InputManipulator { 21 | 22 | // ------------------------------------------------------------ constructor / destructor 23 | 24 | constructor() { 25 | const dev = Clutter.get_default_backend().get_default_seat(); 26 | this._mouse = dev.create_virtual_device(Clutter.InputDeviceType.POINTER_DEVICE); 27 | this._keyboard = dev.create_virtual_device(Clutter.InputDeviceType.KEYBOARD_DEVICE); 28 | } 29 | 30 | // -------------------------------------------------------------------- public interface 31 | 32 | // Warps the mouse pointer by the given distance. 33 | movePointer(dx, dy) { 34 | this._mouse.notify_relative_motion(0, dx, dy); 35 | } 36 | 37 | // Simulates the given key strokes. The keys argument is an array of arrays. Each 38 | // sub-array contains three elements: The keysym, a boolean indicating whether the key 39 | // should be pressed or released and an optional delay in milliseconds. 40 | async simulateKeys(keys) { 41 | for (const key of keys) { 42 | const [keycode, down, delay] = key; 43 | 44 | // Wait a couple of milliseconds if the key a delay is specified. 45 | if (delay > 0) { 46 | await new Promise(resolve => { 47 | setTimeout(resolve, delay); 48 | }); 49 | } 50 | 51 | // https://gitlab.gnome.org/GNOME/mutter/-/blob/main/src/backends/native/meta-xkb-utils.c#L61 52 | // https://gitlab.gnome.org/GNOME/mutter/-/blob/main/src/backends/native/meta-xkb-utils.c#L123 53 | this._keyboard.notify_key( 54 | 0, keycode - 8, down ? Clutter.KeyState.PRESSED : Clutter.KeyState.RELEASED); 55 | } 56 | } 57 | }; 58 | -------------------------------------------------------------------------------- /src/Shortcuts.js: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////////////////// 2 | // _ _ ____ _ _ ___ ____ // 3 | // |_/ |__| |\ | | \ | | This file belongs to Kando, the cross-platform // 4 | // | \_ | | | \| |__/ |__| pie menu. Read more on github.com/kando-menu/kando // 5 | // // 6 | ////////////////////////////////////////////////////////////////////////////////////////// 7 | 8 | // SPDX-FileCopyrightText: Simon Schneegans 9 | // SPDX-License-Identifier: MIT 10 | 11 | 'use strict'; 12 | 13 | import * as Main from 'resource:///org/gnome/shell/ui/main.js'; 14 | 15 | import Shell from 'gi://Shell'; 16 | import Meta from 'gi://Meta'; 17 | import GObject from 'gi://GObject'; 18 | 19 | ////////////////////////////////////////////////////////////////////////////////////////// 20 | // This class can be used to bind a function to global hot keys. It's designed in the // 21 | // following way: An arbitrary number of shortcuts can be registered. If one of the // 22 | // shortcuts is pressed, the "activated" signal will be executed. The pressed shortcut // 23 | // is passed as a parameter to the callback. // 24 | ////////////////////////////////////////////////////////////////////////////////////////// 25 | 26 | export var Shortcuts = GObject.registerClass( 27 | 28 | // Whenever one of the registered shortcuts is pressed, the "activated" callback 29 | // will be executed. The pressed shortcut is given as parameter. 30 | {Properties: {}, Signals: {'activated': {param_types: [GObject.TYPE_STRING]}}}, 31 | 32 | class Shortcuts extends GObject.Object { 33 | _init() { 34 | super._init(); 35 | 36 | // All registered callbacks are stored in this map. 37 | this._shortcuts = new Map(); 38 | 39 | // Listen for global shortcut activations and execute the given callback if it's 40 | // one of ours. 41 | this._displayConnection = 42 | global.display.connect('accelerator-activated', (display, action) => { 43 | for (let it of this._shortcuts) { 44 | if (it[1].action == action) { 45 | this.emit('activated', it[0]); 46 | } 47 | } 48 | }); 49 | } 50 | 51 | // Unbinds all registered shortcuts. 52 | destroy() { 53 | global.display.disconnect(this._displayConnection); 54 | this.unbindAll(); 55 | } 56 | 57 | // Binds the given shortcut. When it's pressed, the callback given to this class 58 | // instance at construction time will be executed. 59 | bind(shortcut) { 60 | 61 | const action = global.display.grab_accelerator(shortcut, Meta.KeyBindingFlags.NONE); 62 | 63 | if (action == Meta.KeyBindingAction.NONE) { 64 | return false; 65 | } 66 | 67 | const name = Meta.external_binding_name_for_action(action); 68 | Main.wm.allowKeybinding(name, Shell.ActionMode.NORMAL); 69 | 70 | this._shortcuts.set(shortcut, {name: name, action: action}); 71 | 72 | return true; 73 | } 74 | 75 | // Un-binds any previously bound shortcut. 76 | unbind(shortcut) { 77 | const it = this._shortcuts.get(shortcut); 78 | 79 | if (it) { 80 | global.display.ungrab_accelerator(it.action); 81 | Main.wm.allowKeybinding(it.name, Shell.ActionMode.NONE); 82 | this._shortcuts.delete(shortcut); 83 | 84 | return true; 85 | } 86 | 87 | return false; 88 | } 89 | 90 | unbindAll() { 91 | for (let shortcut of this._shortcuts) { 92 | this.unbind(shortcut[0]); 93 | } 94 | } 95 | }); 96 | --------------------------------------------------------------------------------