├── .github └── workflows │ ├── prepare-release.yml │ ├── publish-testing.yml │ ├── publish-unstable.yml │ └── test-pr.yml ├── .gitignore ├── COPYING ├── README.md ├── build-aux └── meson │ └── postinstall.py ├── data ├── meson.build ├── org.regolith-linux.remontoire.appdata.xml.in ├── org.regolith-linux.remontoire.desktop.in ├── org.regolith-linux.remontoire.gschema.xml ├── style.css └── style.xml ├── debian ├── changelog ├── compat ├── control ├── copyright ├── rules └── source │ └── format ├── meson.build ├── org.gnome.Remontoire.json ├── po ├── LINGUAS ├── POTFILES └── meson.build ├── src ├── arg_parser.vala ├── config_parser.vala ├── grelier.vala ├── helper.vala ├── main.vala ├── meson.build └── slider_window.vala └── uncrustify.cfg /.github/workflows/prepare-release.yml: -------------------------------------------------------------------------------- 1 | name: Prepare a Release 2 | 3 | on: 4 | workflow_dispatch: 5 | push: 6 | branches: 7 | - master 8 | paths: 9 | - debian/changelog 10 | 11 | concurrency: 12 | group: ${{ github.workflow }}-${{ github.ref }} 13 | cancel-in-progress: true 14 | 15 | jobs: 16 | release: 17 | runs-on: ubuntu-24.04 18 | container: "ghcr.io/regolith-linux/ci-ubuntu:noble-amd64" 19 | steps: 20 | - name: Checkout 21 | uses: actions/checkout@v4 22 | 23 | - name: Prepare Release 24 | id: prepare 25 | uses: regolith-linux/actions/prepare-release@main 26 | env: 27 | GITHUB_TOKEN: ${{ secrets.ORG_BROADCAST_TOKEN2 }} 28 | with: 29 | name: "${{ github.event.repository.name }}" 30 | repo: "${{ github.server_url }}/${{ github.repository }}.git" 31 | ref: "${{ github.ref_name }}" 32 | 33 | - name: Push Changes to Voulage 34 | uses: stefanzweifel/git-auto-commit-action@v5 35 | if: ${{ steps.prepare.outputs.release-exists == 'false' }} 36 | env: 37 | GITHUB_TOKEN: ${{ secrets.ORG_BROADCAST_TOKEN2 }} 38 | with: 39 | repository: "${{ steps.prepare.outputs.voulage-path }}" 40 | branch: "main" 41 | file_pattern: "stage/testing/**" 42 | commit_message: "chore: bump ${{ github.event.repository.name }} testing to ${{ steps.prepare.outputs.release-version }}" 43 | commit_user_name: regolith-ci-bot 44 | commit_user_email: bot@regolith-desktop.com 45 | commit_author: "regolith-ci-bot " 46 | 47 | - name: Release Package 48 | uses: softprops/action-gh-release@v2 49 | if: ${{ steps.prepare.outputs.release-exists == 'false' }} 50 | with: 51 | name: ${{ steps.prepare.outputs.release-version }} 52 | tag_name: ${{ steps.prepare.outputs.release-version }} 53 | token: ${{ secrets.ORG_BROADCAST_TOKEN2 }} 54 | target_commitish: "${{ github.sha }}" 55 | generate_release_notes: true 56 | -------------------------------------------------------------------------------- /.github/workflows/publish-testing.yml: -------------------------------------------------------------------------------- 1 | name: Publish to Testing 2 | 3 | on: 4 | push: 5 | tags: 6 | - 'v*' 7 | 8 | concurrency: 9 | group: ${{ github.workflow }}-${{ github.ref }} 10 | cancel-in-progress: true 11 | 12 | jobs: 13 | matrix-builder: 14 | runs-on: ubuntu-24.04 15 | outputs: 16 | includes: ${{ steps.builder.outputs.includes }} 17 | runners: ${{ steps.builder.outputs.runners }} 18 | steps: 19 | - name: Build Matrix 20 | id: builder 21 | uses: regolith-linux/actions/build-matrix@main 22 | with: 23 | name: "${{ github.event.repository.name }}" 24 | ref: "${{ github.ref_name }}" 25 | arch: "amd64 arm64" 26 | stage: "testing" 27 | 28 | build: 29 | runs-on: ${{ fromJSON(needs.matrix-builder.outputs.runners)[matrix.arch] }} 30 | needs: matrix-builder 31 | container: "ghcr.io/regolith-linux/ci-${{ matrix.distro }}:${{ matrix.codename }}-${{ matrix.arch }}" 32 | strategy: 33 | fail-fast: false 34 | matrix: 35 | include: ${{ fromJSON(needs.matrix-builder.outputs.includes) }} 36 | env: 37 | server-address: "${{ secrets.KAMATERA_HOSTNAME2 }}" 38 | server-username: "${{ secrets.KAMATERA_USERNAME }}" 39 | steps: 40 | - name: Checkout 41 | uses: actions/checkout@v4 42 | 43 | - name: Import GPG Key 44 | uses: regolith-linux/actions/import-gpg@main 45 | with: 46 | gpg-key: "${{ secrets.PACKAGE_PRIVATE_KEY2 }}" 47 | 48 | - name: Build Package 49 | id: build 50 | uses: regolith-linux/actions/build-package@main 51 | with: 52 | name: "${{ github.event.repository.name }}" 53 | distro: "${{ matrix.distro }}" 54 | codename: "${{ matrix.codename }}" 55 | stage: "testing" 56 | suite: "testing" 57 | component: "main" 58 | arch: "${{ matrix.arch }}" 59 | 60 | - name: Setup SSH 61 | uses: regolith-linux/actions/setup-ssh@main 62 | with: 63 | ssh-host: "${{ env.server-address }}" 64 | ssh-key: "${{ secrets.KAMATERA_SSH_KEY }}" 65 | 66 | - name: Upload Package 67 | uses: regolith-linux/actions/upload-files@main 68 | with: 69 | upload-to-folder: "${{ github.event.repository.name }}" 70 | 71 | - name: Upload SourceLog 72 | uses: regolith-linux/actions/upload-files@main 73 | with: 74 | upload-from: "${{ steps.build.outputs.buildlog-path }}" 75 | upload-pattern: "SOURCELOG_*.txt" 76 | upload-to-base: "/opt/archives/workspace/" 77 | upload-to-folder: "${{ github.event.repository.name }}" 78 | 79 | sources: 80 | runs-on: ubuntu-24.04 81 | needs: build 82 | container: "ghcr.io/regolith-linux/ci-ubuntu:noble-amd64" 83 | if: ${{ !failure() && !cancelled() }} 84 | env: 85 | server-address: "${{ secrets.KAMATERA_HOSTNAME2 }}" 86 | server-username: "${{ secrets.KAMATERA_USERNAME }}" 87 | steps: 88 | - name: Import GPG Key 89 | uses: regolith-linux/actions/import-gpg@main 90 | with: 91 | gpg-key: "${{ secrets.PACKAGE_PRIVATE_KEY2 }}" 92 | 93 | - name: Setup SSH 94 | uses: regolith-linux/actions/setup-ssh@main 95 | with: 96 | ssh-host: "${{ env.server-address }}" 97 | ssh-key: "${{ secrets.KAMATERA_SSH_KEY }}" 98 | 99 | - name: Rebuild Sources 100 | uses: regolith-linux/actions/rebuild-sources@main 101 | with: 102 | workspace-subfolder: "${{ github.event.repository.name }}" 103 | only-component: "testing" 104 | only-package: "${{ github.event.repository.name }}" 105 | 106 | publish: 107 | runs-on: ubuntu-24.04 108 | needs: sources 109 | container: "ghcr.io/regolith-linux/ci-ubuntu:noble-amd64" 110 | if: ${{ !failure() && !cancelled() }} 111 | env: 112 | server-address: "${{ secrets.KAMATERA_HOSTNAME2 }}" 113 | server-username: "${{ secrets.KAMATERA_USERNAME }}" 114 | steps: 115 | - name: Setup SSH 116 | uses: regolith-linux/actions/setup-ssh@main 117 | with: 118 | ssh-host: "${{ env.server-address }}" 119 | ssh-key: "${{ secrets.KAMATERA_SSH_KEY }}" 120 | 121 | - name: Publish Repo 122 | uses: regolith-linux/actions/publish-repo@main 123 | with: 124 | packages-path-subfolder: "${{ github.event.repository.name }}" 125 | only-component: "testing" 126 | 127 | manifests: 128 | runs-on: ubuntu-24.04 129 | needs: [matrix-builder, publish] 130 | container: "ghcr.io/regolith-linux/ci-ubuntu:noble-amd64" 131 | if: ${{ !failure() && !cancelled() }} 132 | steps: 133 | - name: Update Manifests 134 | uses: regolith-linux/actions/update-manifest@main 135 | env: 136 | GITHUB_TOKEN: ${{ secrets.ORG_BROADCAST_TOKEN2 }} 137 | with: 138 | name: "${{ github.event.repository.name }}" 139 | repo: "${{ github.server_url }}/${{ github.repository }}.git" 140 | ref: "${{ github.ref_name }}" 141 | sha: "${{ github.sha }}" 142 | matrix: "${{ needs.matrix-builder.outputs.includes }}" 143 | suite: "testing" 144 | component: "main" 145 | -------------------------------------------------------------------------------- /.github/workflows/publish-unstable.yml: -------------------------------------------------------------------------------- 1 | name: Publish to Unstable 2 | 3 | on: 4 | workflow_dispatch: 5 | push: 6 | branches: 7 | - master 8 | 9 | concurrency: 10 | group: ${{ github.workflow }}-${{ github.ref }} 11 | cancel-in-progress: true 12 | 13 | jobs: 14 | matrix-builder: 15 | runs-on: ubuntu-24.04 16 | outputs: 17 | includes: ${{ steps.builder.outputs.includes }} 18 | runners: ${{ steps.builder.outputs.runners }} 19 | steps: 20 | - name: Build Matrix 21 | id: builder 22 | uses: regolith-linux/actions/build-matrix@main 23 | with: 24 | name: "${{ github.event.repository.name }}" 25 | ref: "${{ github.ref_name }}" 26 | arch: "amd64 arm64" 27 | stage: "unstable" 28 | 29 | build: 30 | runs-on: ${{ fromJSON(needs.matrix-builder.outputs.runners)[matrix.arch] }} 31 | needs: matrix-builder 32 | container: "ghcr.io/regolith-linux/ci-${{ matrix.distro }}:${{ matrix.codename }}-${{ matrix.arch }}" 33 | strategy: 34 | fail-fast: false 35 | matrix: 36 | include: ${{ fromJSON(needs.matrix-builder.outputs.includes) }} 37 | env: 38 | server-address: "${{ secrets.KAMATERA_HOSTNAME2 }}" 39 | server-username: "${{ secrets.KAMATERA_USERNAME }}" 40 | steps: 41 | - name: Checkout 42 | uses: actions/checkout@v4 43 | 44 | - name: Import GPG Key 45 | uses: regolith-linux/actions/import-gpg@main 46 | with: 47 | gpg-key: "${{ secrets.PACKAGE_PRIVATE_KEY2 }}" 48 | 49 | - name: Build Package 50 | id: build 51 | uses: regolith-linux/actions/build-package@main 52 | with: 53 | name: "${{ github.event.repository.name }}" 54 | distro: "${{ matrix.distro }}" 55 | codename: "${{ matrix.codename }}" 56 | stage: "unstable" 57 | suite: "unstable" 58 | component: "main" 59 | arch: "${{ matrix.arch }}" 60 | 61 | - name: Setup SSH 62 | uses: regolith-linux/actions/setup-ssh@main 63 | with: 64 | ssh-host: "${{ env.server-address }}" 65 | ssh-key: "${{ secrets.KAMATERA_SSH_KEY }}" 66 | 67 | - name: Upload Package 68 | uses: regolith-linux/actions/upload-files@main 69 | with: 70 | upload-to-folder: "${{ github.event.repository.name }}" 71 | 72 | - name: Upload SourceLog 73 | uses: regolith-linux/actions/upload-files@main 74 | with: 75 | upload-from: "${{ steps.build.outputs.buildlog-path }}" 76 | upload-pattern: "SOURCELOG_*.txt" 77 | upload-to-base: "/opt/archives/workspace/" 78 | upload-to-folder: "${{ github.event.repository.name }}" 79 | 80 | sources: 81 | runs-on: ubuntu-24.04 82 | needs: build 83 | container: "ghcr.io/regolith-linux/ci-ubuntu:noble-amd64" 84 | if: ${{ !failure() && !cancelled() }} 85 | env: 86 | server-address: "${{ secrets.KAMATERA_HOSTNAME2 }}" 87 | server-username: "${{ secrets.KAMATERA_USERNAME }}" 88 | steps: 89 | - name: Import GPG Key 90 | uses: regolith-linux/actions/import-gpg@main 91 | with: 92 | gpg-key: "${{ secrets.PACKAGE_PRIVATE_KEY2 }}" 93 | 94 | - name: Setup SSH 95 | uses: regolith-linux/actions/setup-ssh@main 96 | with: 97 | ssh-host: "${{ env.server-address }}" 98 | ssh-key: "${{ secrets.KAMATERA_SSH_KEY }}" 99 | 100 | - name: Rebuild Sources 101 | uses: regolith-linux/actions/rebuild-sources@main 102 | with: 103 | workspace-subfolder: "${{ github.event.repository.name }}" 104 | only-component: "unstable" 105 | only-package: "${{ github.event.repository.name }}" 106 | 107 | publish: 108 | runs-on: ubuntu-24.04 109 | needs: sources 110 | container: "ghcr.io/regolith-linux/ci-ubuntu:noble-amd64" 111 | if: ${{ !failure() && !cancelled() }} 112 | env: 113 | server-address: "${{ secrets.KAMATERA_HOSTNAME2 }}" 114 | server-username: "${{ secrets.KAMATERA_USERNAME }}" 115 | steps: 116 | - name: Setup SSH 117 | uses: regolith-linux/actions/setup-ssh@main 118 | with: 119 | ssh-host: "${{ env.server-address }}" 120 | ssh-key: "${{ secrets.KAMATERA_SSH_KEY }}" 121 | 122 | - name: Publish Repo 123 | uses: regolith-linux/actions/publish-repo@main 124 | with: 125 | packages-path-subfolder: "${{ github.event.repository.name }}" 126 | only-component: "unstable" 127 | 128 | manifests: 129 | runs-on: ubuntu-24.04 130 | needs: [matrix-builder, publish] 131 | container: "ghcr.io/regolith-linux/ci-ubuntu:noble-amd64" 132 | if: ${{ !failure() && !cancelled() }} 133 | steps: 134 | - name: Update Manifests 135 | uses: regolith-linux/actions/update-manifest@main 136 | env: 137 | GITHUB_TOKEN: ${{ secrets.ORG_BROADCAST_TOKEN2 }} 138 | with: 139 | name: "${{ github.event.repository.name }}" 140 | repo: "${{ github.server_url }}/${{ github.repository }}.git" 141 | ref: "${{ github.ref_name }}" 142 | sha: "${{ github.sha }}" 143 | matrix: "${{ needs.matrix-builder.outputs.includes }}" 144 | suite: "unstable" 145 | component: "main" 146 | -------------------------------------------------------------------------------- /.github/workflows/test-pr.yml: -------------------------------------------------------------------------------- 1 | name: Test Pull Request 2 | 3 | on: 4 | pull_request: 5 | 6 | concurrency: 7 | group: ${{ github.workflow }}-${{ github.ref }} 8 | cancel-in-progress: true 9 | 10 | jobs: 11 | matrix-builder: 12 | runs-on: ubuntu-24.04 13 | outputs: 14 | includes: ${{ steps.builder.outputs.includes }} 15 | runners: ${{ steps.builder.outputs.runners }} 16 | steps: 17 | - name: Build Matrix 18 | id: builder 19 | uses: regolith-linux/actions/build-matrix@main 20 | with: 21 | name: "${{ github.event.repository.name }}" 22 | ref: "${{ github.base_ref }}" # build for target branch of the pull request 23 | arch: "amd64" # only test on amd64 on pull requests 24 | stage: "unstable" 25 | 26 | build: 27 | runs-on: ${{ fromJSON(needs.matrix-builder.outputs.runners)[matrix.arch] }} 28 | needs: matrix-builder 29 | container: "ghcr.io/regolith-linux/ci-${{ matrix.distro }}:${{ matrix.codename }}-${{ matrix.arch }}" 30 | strategy: 31 | fail-fast: false 32 | matrix: 33 | include: ${{ fromJSON(needs.matrix-builder.outputs.includes) }} 34 | steps: 35 | - name: Checkout 36 | uses: actions/checkout@v4 37 | 38 | - name: Build Package 39 | uses: regolith-linux/actions/build-package@main 40 | with: 41 | only-build: "true" 42 | name: "${{ github.event.repository.name }}" 43 | distro: "${{ matrix.distro }}" 44 | codename: "${{ matrix.codename }}" 45 | stage: "unstable" 46 | suite: "unstable" 47 | component: "main" 48 | arch: "${{ matrix.arch }}" 49 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .buildconfig 2 | files 3 | build 4 | .vscode 5 | builddir 6 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | 676 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Remontoire 2 | 3 | ## Summary 4 | 5 |
6 |

Remontoire is a small (~71Kb) GTK app for presenting keybinding hints in a compact form suitable for tiling window environments. It is intended for use with the i3 window manager but it's also able to display keybindings from any suitably formatted config file.

7 | 8 |

The program functions by scanning and parsing comments in a specific format (described directly below), then displaying them in a one-layer categorized list view. The program stores the state of which sections are expanded, allowing for use on screens with limited resolution.

9 |
10 |
11 | 12 | ## Model 13 | 14 | Remontoire utilizes the concept of a `category` to group items, `action` to denote the human description, and `keybinding` to define the specific keys corresponding to the action. The format is designed to be both easily parsable by program but also readable in it's native form by people: 15 | 16 | ``` 17 | ## // // ## 18 | ``` 19 | 20 | Text within ``, ``, and `` must not contain the sequences `##`, `//`, or line feeds. 21 | 22 | Examples: 23 | 24 | ``` 25 | ... 26 | ## Navigate // Relative Window // ↑ ↓ ← → ## 27 | bindsym $mod+Left focus left 28 | ... 29 | ``` 30 | 31 | ``` 32 | ... 33 | ## Launch // Application // Space ## some extra notes that are ignored by Remontoire but maybe of interest to those reading the config file. 34 | bindsym $mod+space exec $i3-wm.program.launcher.app 35 | ``` 36 | 37 | Any line that doesn't contain the structure listed here will be ignored. 38 | 39 | ## Usage 40 | 41 | ``` 42 | Usage: 43 | remontoire [OPTION?] 44 | 45 | Help Options: 46 | -h, --help Show help options 47 | 48 | Application Options: 49 | -v, --version Display version number 50 | -s, --socket= Socket path for i3 51 | -c Config file 52 | -i Read from standard input 53 | -t CSS file 54 | -p Prefix of comment line 55 | 56 | ``` 57 | 58 | With `-s`, Remontoire communicates with i3 via domain sockets to retrieve the active i3 config file. To determine the socket path on a system running i3: 59 | ```bash 60 | $ i3 --get-socketpath 61 | ``` 62 | 63 | Or altogether: 64 | ```bash 65 | $ remontoire -s `i3 --get-socketpath` 66 | ``` 67 | 68 | Remontoire can also be passed a file path and will read from that instead of the i3 socket. In this mode, Remontoire can be used to display keybindings from any file that utilize the comment format. 69 | 70 | ```bash 71 | $ remontoire -c /etc/something/interesting.conf 72 | ``` 73 | 74 | As a third option to provide your config files, Remontoire can read from STDIN. Use this option 75 | if you want to pass in the contents of multiple config files. 76 | 77 | Once executed Remontoire will display a sticky floating window on the right-center of the primary monitor. Upon first launch, all categories are collapsed. User selections to open categories are persisted across instantiations of the program. 78 | 79 | ### Toggle 80 | 81 | It is suggested to use a small shell script to allow the dialog to be toggled on and off with a hotkey. Here is one such script from Regolith: 82 | 83 | ``` 84 | #!/bin/bash 85 | # If remontoire is running, kill it. Otherwise start it. 86 | 87 | remontoire_PID=$(pidof remontoire) 88 | 89 | if [ -z "$remontoire_PID" ]; then 90 | /usr/bin/remontoire -s $(printenv I3SOCK) & 91 | else 92 | kill $remontoire_PID 93 | fi 94 | ``` 95 | 96 | ## Configuration 97 | 98 | Remontoire utilizes GLib settings to store configuration using the namespace `org.regolith-linux.remontoire`. The following settings are available for user customization: 99 | 100 | ### Window Position 101 | ``` 102 | window-position 103 | ``` 104 | 105 | #### Example 106 | 107 | ```bash 108 | $ gsettings set org.regolith-linux.remontoire window-position "west" 109 | ``` 110 | 111 | ### Padding 112 | 113 | Vertical and horizontal padding can be specified independently, allowing for bars or other UI widgets to be accounted for when placing the window. The keys for padding are `window-padding-width` and `window-padding-height` and the value units are pixels. 114 | 115 | #### Example 116 | 117 | ```bash 118 | $ gsettings set org.regolith-linux.remontoire window-padding-width 10 119 | $ gsettings set org.regolith-linux.remontoire window-padding-height 20 120 | ``` 121 | 122 | ## Style 123 | 124 | You can specify a custom CSS file to change the look of the dialog. The built-in CSS as of version 1.3.0: 125 | 126 | ```css 127 | .window { 128 | margin: 4px; 129 | } 130 | 131 | *:selected { 132 | background-color: @theme_bg_color; 133 | color: @theme_text_color; 134 | } 135 | 136 | .category { 137 | padding-top: 2px; 138 | padding-bottom: 2px; 139 | font-weight: bold; 140 | font-size: .95em; 141 | color: @theme_unfocused_fg_color; 142 | } 143 | 144 | .action { 145 | padding-right: 10px; 146 | padding-left: 15px; 147 | font-weight: lighter; 148 | } 149 | 150 | .error { 151 | padding: 15px; 152 | font-size: 1.2em; 153 | font-weight: bold; 154 | } 155 | 156 | .metakey { 157 | font-family: monospace; 158 | font-weight: normal; 159 | background-color: @insensitive_bg_color; 160 | border: 1px solid; 161 | border-color: @insensitive_base_color; 162 | color: @theme_unfocused_fg_color; 163 | 164 | padding: 2px; 165 | margin: 2px; 166 | font-size: .9em; 167 | } 168 | 169 | .rangekey { 170 | font-family: monospace; 171 | font-weight: normal; 172 | background-color: @insensitive_bg_color; 173 | border: 1px solid; 174 | border-color: @insensitive_base_color; 175 | color: @theme_unfocused_fg_color; 176 | 177 | padding: 2px; 178 | margin: 2px; 179 | font-size: .9em; 180 | } 181 | 182 | .key { 183 | font-family: monospace; 184 | font-weight: normal; 185 | background-color: @insensitive_bg_color; 186 | border: 1px solid; 187 | border-color: @insensitive_base_color; 188 | color: @theme_unfocused_fg_color; 189 | 190 | padding: 2px; 191 | margin: 2px; 192 | font-size: .9em; 193 | } 194 | 195 | .detail { 196 | margin: 2px; 197 | } 198 | ``` 199 | 200 | ## Using Remontoire to view keybindings for arbitrary config files 201 | 202 | Since Remontoire parses comments and not actual keybindings, it can be used as a keybinding viewer for any app that stores keybindings in plain text and supports comments, like Sway or Vim. Use the `-c` or `-i` options documented above to supply the config files. If config doesn't use `#` as a comment prefix, you use the `-p` option to supply comment prefix to go immediately before '##'. Here's an example of parsing a comment using Vim's quote character as a prefix: 203 | 204 | echo '"## Category // Description // J ##' | remontoire -i -p '"' 205 | 206 | ## Install Package 207 | 208 | ### Ubuntu 209 | 210 | Remontoire is available from the Regolith Linux `stable` PPA: 211 | 212 | ``` 213 | $ sudo add-apt-repository ppa:regolith-linux/stable 214 | $ sudo apt install remontoire 215 | ``` 216 | 217 | ### openSUSE 218 | 219 | Remontoire is available from the X11:Utilities devel project: 220 | 221 | ``` 222 | $ sudo zypper ar -f obs://X11:Utilities X11Utilities 223 | $ sudo zypper ref 224 | $ sudo zypper in remontoire 225 | ``` 226 | 227 | ## Build from Source 228 | 229 | Meson, Vala and Gtk+ libraries are required to build. After downloading sources, from within the project root, execute the following: 230 | 231 | ```bash 232 | $ meson build 233 | $ cd build 234 | $ ninja 235 | $ src/remontoire -c 236 | ... or ... 237 | $ src/remontoire -s `i3 --get-socketpath` 238 | ``` 239 | -------------------------------------------------------------------------------- /build-aux/meson/postinstall.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | from os import environ, path 4 | from subprocess import call 5 | 6 | prefix = environ.get('MESON_INSTALL_PREFIX', '/usr/local') 7 | datadir = path.join(prefix, 'share') 8 | destdir = environ.get('DESTDIR', '') 9 | 10 | # Package managers set this so we don't need to run 11 | if not destdir: 12 | print('Updating icon cache...') 13 | call(['gtk-update-icon-cache', '-qtf', path.join(datadir, 'icons', 'hicolor')]) 14 | 15 | print('Updating desktop database...') 16 | call(['update-desktop-database', '-q', path.join(datadir, 'applications')]) 17 | 18 | print('Compiling GSettings schemas...') 19 | call(['glib-compile-schemas', path.join(datadir, 'glib-2.0', 'schemas')]) 20 | 21 | 22 | -------------------------------------------------------------------------------- /data/meson.build: -------------------------------------------------------------------------------- 1 | desktop_file = i18n.merge_file( 2 | input: 'org.regolith-linux.remontoire.desktop.in', 3 | output: 'org.regolith-linux.remontoire.desktop', 4 | type: 'desktop', 5 | po_dir: '../po', 6 | install: true, 7 | install_dir: join_paths(get_option('datadir'), 'applications') 8 | ) 9 | 10 | desktop_utils = find_program('desktop-file-validate', required: false) 11 | if desktop_utils.found() 12 | test('Validate desktop file', desktop_utils, 13 | args: [desktop_file] 14 | ) 15 | endif 16 | 17 | appstream_file = i18n.merge_file( 18 | input: 'org.regolith-linux.remontoire.appdata.xml.in', 19 | output: 'org.regolith-linux.remontoire.appdata.xml', 20 | po_dir: '../po', 21 | install: true, 22 | install_dir: join_paths(get_option('datadir'), 'appdata') 23 | ) 24 | 25 | appstream_util = find_program('appstream-util', required: false) 26 | if appstream_util.found() 27 | test('Validate appstream file', appstream_util, 28 | args: ['validate', appstream_file] 29 | ) 30 | endif 31 | 32 | install_data('org.regolith-linux.remontoire.gschema.xml', 33 | install_dir: join_paths(get_option('datadir'), 'glib-2.0/schemas') 34 | ) 35 | 36 | compile_schemas = find_program('glib-compile-schemas', required: false) 37 | if compile_schemas.found() 38 | test('Validate schema file', compile_schemas, 39 | args: ['--strict', '--dry-run', meson.current_source_dir()] 40 | ) 41 | endif 42 | -------------------------------------------------------------------------------- /data/org.regolith-linux.remontoire.appdata.xml.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.gnome.Remontoire.desktop 4 | CC0-1.0 5 | GPL-3.0-or-later 6 | Desktop xml's description 7 | 8 | -------------------------------------------------------------------------------- /data/org.regolith-linux.remontoire.desktop.in: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=Remontoire 3 | Exec=remontoire 4 | Terminal=false 5 | Type=Application 6 | Categories=GTK; 7 | StartupNotify=true 8 | Icon=dialog-information 9 | Keywords=shortcuts,keybindings -------------------------------------------------------------------------------- /data/org.regolith-linux.remontoire.gschema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | "" 6 | Categories that are collapsed. 7 | 8 | This value is used to store the layout of the shortcuts window across invocations. 9 | 10 | 11 | 12 | "" 13 | Categories that are expanded. 14 | 15 | This value is used to store the layout of the shortcuts window across invocations. 16 | 17 | 18 | 19 | "east" 20 | Window position 21 | 22 | The position to render the window on start. Possible values: north, south, east (default), west. 23 | 24 | 25 | 26 | 6 27 | Window padding width 28 | 29 | Number of horizontal pixels between the window and the screen's closest edge(s). 30 | 31 | 32 | 33 | 6 34 | Window padding height 35 | 36 | Number of vertical pixels between the window and the screen's closest edge(s). 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /data/style.css: -------------------------------------------------------------------------------- 1 | .window { 2 | margin: 4px; 3 | } 4 | 5 | *:selected { 6 | background-color: @theme_bg_color; 7 | color: @theme_text_color; 8 | } 9 | 10 | .category { 11 | padding-top: 2px; 12 | padding-bottom: 2px; 13 | font-weight: bold; 14 | font-size: .95em; 15 | color: @theme_unfocused_fg_color; 16 | } 17 | 18 | .action { 19 | padding-right: 10px; 20 | padding-left: 15px; 21 | font-weight: lighter; 22 | } 23 | 24 | .error { 25 | padding: 15px; 26 | font-size: 1.2em; 27 | font-weight: bold; 28 | } 29 | 30 | .metakey { 31 | font-family: FontAwesome, monospace; 32 | font-weight: normal; 33 | background-color: @insensitive_bg_color; 34 | border: 1px solid; 35 | border-color: @insensitive_base_color; 36 | color: @theme_unfocused_fg_color; 37 | 38 | padding: 2px; 39 | margin: 2px; 40 | font-size: .9em; 41 | } 42 | 43 | .rangekey { 44 | font-family: monospace; 45 | font-weight: normal; 46 | background-color: @insensitive_bg_color; 47 | border: 1px solid; 48 | border-color: @insensitive_base_color; 49 | color: @theme_unfocused_fg_color; 50 | 51 | padding: 2px; 52 | margin: 2px; 53 | font-size: .9em; 54 | } 55 | 56 | .key { 57 | font-family: monospace; 58 | font-weight: normal; 59 | background-color: @insensitive_bg_color; 60 | border: 1px solid; 61 | border-color: @insensitive_base_color; 62 | color: @theme_unfocused_fg_color; 63 | 64 | padding: 2px; 65 | margin: 2px; 66 | font-size: .9em; 67 | } 68 | 69 | .detail { 70 | margin: 2px; 71 | } 72 | 73 | /* Remove dotted lines from ScrolledWindow container on left and right */ 74 | scrolledwindow undershoot.right, 75 | scrolledwindow undershoot.left { background-image: none; } -------------------------------------------------------------------------------- /data/style.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | style.css 5 | 6 | -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | remontoire (1.4.4) focal; urgency=medium 2 | 3 | [ x3mboy ] 4 | * Fixing version on main.vala 5 | 6 | [ Eduard Lucena ] 7 | * Update main.vala 8 | 9 | [ Khosrow Moossavi ] 10 | * feat: use build-only to test pull request 11 | 12 | -- Regolith Linux Fri, 21 Feb 2025 12:10:47 -0500 13 | 14 | remontoire (1.4.3) focal; urgency=medium 15 | 16 | [ Ken Gilmer ] 17 | * Fix build automation 18 | 19 | [ Khosrow Moossavi ] 20 | * chore: remove obsolete package broadcast action 21 | * feat: enable github action to test pull requests 22 | * feat: enable github action to publish to unstable 23 | * feat: enable github action to publish to testing 24 | * feat: enable github action to prepare release 25 | * fix: create release tag from correct git sha 26 | 27 | -- Regolith Linux Tue, 04 Feb 2025 03:06:27 +0000 28 | 29 | remontoire (1.4.2) focal; urgency=medium 30 | 31 | [ Eduard Lucena ] 32 | * Adding content to Description tag (#18) 33 | 34 | [ Ken Gilmer ] 35 | * Add build automation 36 | * Don't draw scroll hints for horizontal scrolling 37 | * Add scrollable parent to flowbox to allow vertical scrolling of content when exceeds bounds of flowbox 38 | * Cleanup source formatting 39 | * Fix version returned by program to match package version 40 | 41 | -- Regolith Linux Sat, 18 Jun 2022 17:03:11 -0700 42 | 43 | remontoire (1.4.1-1) bionic; urgency=medium 44 | 45 | [ Mark Stosberg ] 46 | * Document `-i`, `-p`. (#11) 47 | 48 | [ Michael Vetter ] 49 | * Add openSUSE install instructions 50 | 51 | [ Ken Gilmer ] 52 | * Add fonts-font-awesome as soft dependency based on reference in CSS file and user feedback. Addresses https://github.com/regolith-linux/remontoire/issues/16. 53 | * Cleanup 54 | 55 | -- Regolith Linux Sat, 23 Jan 2021 11:39:37 -0800 56 | 57 | remontoire (1.4.0-1) bionic; urgency=medium 58 | 59 | [ Ken Gilmer ] 60 | * Specify font for windows glyph in stylesheet. 61 | * Increase buffer to 128Kb to handle larger i3 config files 62 | * Add feature to consume for stdin and specify arbitrary string prefix for more config file format support. 63 | * Fix window positioning in multi-monitor setups. 64 | 65 | -- Regolith Linux Wed, 14 Oct 2020 21:58:16 -0700 66 | 67 | remontoire (1.3.2-1) eoan; urgency=medium 68 | 69 | * Cleanup runtime dependencies. 70 | 71 | -- Regolith Linux Wed, 22 Apr 2020 07:26:48 -0700 72 | 73 | remontoire (1.3.1) eoan; urgency=medium 74 | 75 | * Fix segfault from option parser. 76 | 77 | -- Regolith Linux Fri, 27 Mar 2020 18:09:06 -0700 78 | 79 | remontoire (1.3.0) eoan; urgency=medium 80 | 81 | * Allow overriding style w/ custom css on command line. 82 | * Add feature to show error message if no 83 | keybindings parsed. Add style for error message. 84 | * Add feature to parse from file in addition to socket. 85 | Change cmd param signature to handle file and socket 86 | configs. 87 | * Change config line parse strategy to allow for user 88 | section of line following line delimiter sequence. 89 | 90 | -- Regolith Linux Wed, 25 Mar 2020 20:25:24 -0700 91 | 92 | remontoire (1.2.2) eoan; urgency=medium 93 | 94 | * Tweak CSS for better GTK theme compatibility. 95 | 96 | -- Regolith Linux Sun, 22 Mar 2020 19:32:29 -0700 97 | 98 | remontoire (1.2.1) eoan; urgency=medium 99 | 100 | * Add configuration for window padding. 101 | * Add configuratoin for window orientation. 102 | * Set sticky. 103 | * Fix intermittent layout issues. 104 | 105 | -- Regolith Linux Thu, 19 Mar 2020 01:42:34 -0700 106 | 107 | remontoire (1.2.0) eoan; urgency=medium 108 | 109 | * Style window via CSS 110 | * Parse keybindings to generate better UI 111 | * Save/Resource expanded state fixed. 112 | * Move from TreeView to Expandable container. 113 | * Sort categories by using TreeMap ADT. 114 | * Do not load window icon, avoid theme errors. 115 | 116 | -- Regolith Linux Mon, 16 Mar 2020 22:07:57 -0700 117 | 118 | remontoire (1.1.1-1ubuntu1~ppa1) eoan; urgency=medium 119 | 120 | * Fold grelier into package to avoid packaging complexity. 121 | 122 | -- Regolith Linux Tue, 25 Feb 2020 08:21:34 -0800 123 | 124 | remontoire (1.1.0-1ubuntu1~ppa3) eoan; urgency=medium 125 | 126 | * Dynamic keybindings from i3 over IPC. 127 | * UI Fixes 128 | * Layout/position Fixes. 129 | 130 | -- Regolith Linux Sun, 23 Feb 2020 20:48:53 -0800 131 | 132 | remontoire (1.0.3) eoan; urgency=medium 133 | 134 | * Update bindings based on R1.3 final i3 config. 135 | 136 | -- Regolith Linux Mon, 27 Jan 2020 20:58:34 -0800 137 | 138 | remontoire (1.0.2-1ubuntu1~ppa2) eoan; urgency=medium 139 | 140 | * Migrate to new PPA. 141 | 142 | -- Regolith Linux Tue, 14 Jan 2020 20:20:06 -0800 143 | 144 | remontoire (1.0.2-1ubuntu1~ppa1) eoan; urgency=medium 145 | 146 | * Add section for notifications. 147 | 148 | -- Ken Gilmer Wed, 01 Jan 2020 13:24:04 -0800 149 | 150 | remontoire (1.0.1-1ubuntu1~ppa1) eoan; urgency=medium 151 | 152 | * Initial release 153 | 154 | -- Ken Gilmer Tue, 24 Dec 2019 18:37:07 -0800 155 | -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 10 2 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: remontoire 2 | Section: x11 3 | Priority: optional 4 | Maintainer: Ken Gilmer 5 | Build-Depends: debhelper (>= 10), 6 | gettext, 7 | libgtk-3-dev (>= 3.22), 8 | meson, 9 | valac (>= 0.40.0), 10 | libgee-0.8-dev, 11 | libgee-0.8-2, 12 | gir1.2-gee-0.8, 13 | libjsonrpc-glib-1.0-dev 14 | Standards-Version: 4.1.2 15 | Homepage: https://github.com/regolith-linux/remontoire 16 | 17 | Package: remontoire 18 | Architecture: any 19 | Depends: 20 | ${shlibs:Depends}, 21 | ${misc:Depends}, 22 | libgee-0.8-2, 23 | libjsonrpc-glib-1.0-1 24 | Recommends: fonts-font-awesome 25 | Description: General purpose keybinding viewer 26 | Remontoire reads keybinding specifications via a specific 27 | string format and displays them in a one-level-deep tree 28 | structure suitable for tiling window managers such as i3. 29 | 30 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: remontoire 3 | Source: https://github.com/regolith-linux/remontoire 4 | 5 | Files: * 6 | Copyright: 2019 - 2021 Ken Gilmer 7 | License: GPL-3 8 | This program is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | . 13 | This package is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | . 18 | You should have received a copy of the GNU General Public License 19 | along with this program. If not, see . 20 | . 21 | On Debian systems, the complete text of the GNU General 22 | Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". 23 | 24 | Files: debian/* 25 | Copyright: 2019 Ken Gilmer 26 | License: GPL-2+ 27 | This package is free software; you can redistribute it and/or modify 28 | it under the terms of the GNU General Public License as published by 29 | the Free Software Foundation; either version 2 of the License, or 30 | (at your option) any later version. 31 | . 32 | This package is distributed in the hope that it will be useful, 33 | but WITHOUT ANY WARRANTY; without even the implied warranty of 34 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 35 | GNU General Public License for more details. 36 | . 37 | You should have received a copy of the GNU General Public License 38 | along with this program. If not, see 39 | . 40 | On Debian systems, the complete text of the GNU General 41 | Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". 42 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | 3 | %: 4 | dh $@ 5 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /meson.build: -------------------------------------------------------------------------------- 1 | project('remontoire', ['c', 'vala'], version: '0.1.0', 2 | meson_version: '>= 0.40.0', 3 | ) 4 | 5 | i18n = import('i18n') 6 | 7 | subdir('data') 8 | subdir('src') 9 | subdir('po') 10 | 11 | meson.add_install_script('build-aux/meson/postinstall.py') -------------------------------------------------------------------------------- /org.gnome.Remontoire.json: -------------------------------------------------------------------------------- 1 | { 2 | "app-id" : "org.gnome.Remontoire", 3 | "runtime" : "org.gnome.Platform", 4 | "runtime-version" : "3.28", 5 | "sdk" : "org.gnome.Sdk", 6 | "command" : "remontoire", 7 | "finish-args" : [ 8 | "--share=network", 9 | "--share=ipc", 10 | "--socket=x11", 11 | "--socket=wayland", 12 | "--filesystem=xdg-run/dconf", 13 | "--filesystem=~/.config/dconf:ro", 14 | "--talk-name=ca.desrt.dconf", 15 | "--env=DCONF_USER_CONFIG_DIR=.config/dconf" 16 | ], 17 | "build-options" : { 18 | "cflags" : "-O2 -g", 19 | "cxxflags" : "-O2 -g", 20 | "env" : { 21 | "V" : "1" 22 | } 23 | }, 24 | "cleanup" : [ 25 | "/include", 26 | "/lib/pkgconfig", 27 | "/man", 28 | "/share/doc", 29 | "/share/gtk-doc", 30 | "/share/man", 31 | "/share/pkgconfig", 32 | "/share/vala", 33 | "*.la", 34 | "*.a" 35 | ], 36 | "modules" : [ 37 | { 38 | "name" : "remontoire", 39 | "buildsystem" : "meson", 40 | "config-opts" : [ 41 | "--libdir=lib" 42 | ], 43 | "builddir" : true, 44 | "sources" : [ 45 | { 46 | "type" : "git", 47 | "url" : "file:///home/kgilmer/dev/repos/remontoire" 48 | } 49 | ] 50 | } 51 | ] 52 | } 53 | -------------------------------------------------------------------------------- /po/LINGUAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/regolith-linux/remontoire/edfddca1fda4d834dade26e792d356c498b5f0eb/po/LINGUAS -------------------------------------------------------------------------------- /po/POTFILES: -------------------------------------------------------------------------------- 1 | data/org.gnome.Remontoire.desktop.in 2 | data/org.gnome.Remontoire.appdata.xml.in 3 | data/org.gnome.Remontoire.gschema.xml 4 | src/window.uisrc/main.vala 5 | src/window.vala -------------------------------------------------------------------------------- /po/meson.build: -------------------------------------------------------------------------------- 1 | i18n.gettext('remontoire', preset: 'glib') 2 | -------------------------------------------------------------------------------- /src/arg_parser.vala: -------------------------------------------------------------------------------- 1 | /** 2 | * A lazy/minimal command-line arg parser because OptionContext segfaults. 3 | */ 4 | using Gee; 5 | 6 | errordomain ArgParser { 7 | PARSE_ERROR 8 | } 9 | 10 | /** 11 | * Convert ["-v", "-s", "asdf", "-f", "qwe"] => {("-v", null), ("-s", "adsf"), ("-f", "qwe")} 12 | * Populates key of "cmd" with first arg. 13 | * NOTE: Currently does not support quoted parameter values. 14 | */ 15 | Map parse_args (string[] args) throws ArgParser.PARSE_ERROR { 16 | var argMap = new HashMap(); 17 | 18 | if (args == null || args.length == 0) { 19 | return argMap; 20 | } 21 | 22 | string lastKey = null; 23 | foreach (string token in args) { 24 | if (!argMap.has_key ("cmd")) { 25 | argMap.set ("cmd", token); 26 | } else if (isKey (token)) { 27 | if (lastKey != null) { 28 | argMap.set (lastKey, null); 29 | } 30 | lastKey = token; 31 | } else if (lastKey != null) { 32 | argMap.set (lastKey, token); 33 | lastKey = null; 34 | } else { 35 | throw new ArgParser.PARSE_ERROR (@"Unexpected literal: $token\n"); 36 | } 37 | } 38 | 39 | if (lastKey != null) { // Trailing single param 40 | argMap.set (lastKey, null); 41 | } 42 | 43 | /* 44 | foreach (var entry in argMap.entries) { 45 | stdout.printf ("%s => %s\n", entry.key, entry.value); 46 | } 47 | */ 48 | 49 | return argMap; 50 | } 51 | 52 | bool isKey (string inval) { 53 | return inval.has_prefix ("-"); 54 | } -------------------------------------------------------------------------------- /src/config_parser.vala: -------------------------------------------------------------------------------- 1 | /** 2 | * This class retrieves the i3 config file over IPC and 3 | * produces a [Category] -> List data structure 4 | * indended to be presented to the user. 5 | */ 6 | using Gee; 7 | 8 | public class Keybinding { 9 | public string label { get; private set; } 10 | public string spec { get; private set; } 11 | 12 | public Keybinding(string label, string spec) { 13 | this.label = label; 14 | this.spec = spec; 15 | } 16 | } 17 | 18 | public errordomain PARSE_ERROR { 19 | BAD_PARAM_MATCH 20 | } 21 | 22 | public class ConfigParser { 23 | private const string REMONTOIRE_LINE_WRAPPER = "##"; 24 | private const string REMONTIORE_PARAM_DELIMITER = "//"; 25 | private const int PARAMETER_COUNT = 3; 26 | private const int MIN_LINE_LENGTH = 13; // "##x//y//z//##".length 27 | private string config; 28 | private string line_prefix; 29 | 30 | public ConfigParser(string config, string line_prefix) { 31 | this.config = config; 32 | this.line_prefix = line_prefix; 33 | } 34 | 35 | public Map> parse() throws PARSE_ERROR, GLib.Error, Grelier.I3_ERROR { 36 | string[] lines = config.split("\n"); 37 | 38 | if (lines == null || lines.length == 0) return Map.empty>();; 39 | 40 | var config_map = new TreeMap>(); 41 | var prefix = REMONTOIRE_LINE_WRAPPER; 42 | if (line_prefix != "") { 43 | prefix = line_prefix + REMONTOIRE_LINE_WRAPPER; 44 | } 45 | 46 | foreach (unowned string line in lines) { 47 | string trimmedLine = line.strip(); 48 | if (lineMatch(trimmedLine, prefix)) { 49 | if (line_prefix != "") { 50 | trimmedLine = trimmedLine.substring(line_prefix.length); 51 | } 52 | parseLine(trimmedLine, config_map); 53 | } 54 | } 55 | 56 | // debugConfigMap(config_map); 57 | 58 | return config_map; 59 | } 60 | 61 | private bool lineMatch(string line, string prefix) { 62 | 63 | return line.length > MIN_LINE_LENGTH && 64 | line.has_prefix(prefix) && 65 | line.substring(REMONTOIRE_LINE_WRAPPER.length + 1).contains(REMONTOIRE_LINE_WRAPPER) && 66 | line.contains(REMONTIORE_PARAM_DELIMITER); 67 | } 68 | 69 | /** 70 | * ## category // action // keybinding ## anything else 71 | */ 72 | private void parseLine(string line, Map> configMap) throws PARSE_ERROR.BAD_PARAM_MATCH { 73 | // Find end of machine-parsable section of line. 74 | int termSequenceIndex = line.index_of("##", 3); 75 | // Extract machine-parsable section of line. 76 | string valueList = line.substring(REMONTOIRE_LINE_WRAPPER.length, termSequenceIndex - REMONTOIRE_LINE_WRAPPER.length); 77 | // Tokenize parameters 78 | string[] values = valueList.split(REMONTIORE_PARAM_DELIMITER); 79 | 80 | if (values.length != PARAMETER_COUNT) { 81 | throw new PARSE_ERROR.BAD_PARAM_MATCH("Invalid line: " + line + "\n"); 82 | } 83 | 84 | string category = values[0].strip(); 85 | string label = values[1].strip(); 86 | string spec = values[2].strip(); 87 | 88 | if (!configMap.has_key(category)) configMap.set(category, new ArrayList()); 89 | 90 | configMap.get(category).add(new Keybinding(label, spec)); 91 | } 92 | 93 | /** 94 | * Ths method takes in a string and produces a list of strings. Ex: 95 | * "a b c" -> [, , a, b, c] 96 | */ 97 | public static GLib.List parse_keybinding(string raw_keybinding) { 98 | var tokens = new GLib.List(); 99 | var str_builder = new StringBuilder(); 100 | 101 | unichar c; 102 | for (int i = 0; raw_keybinding.get_next_char (ref i, out c);) { 103 | switch(c) { 104 | case '<': 105 | if (str_builder.len > 0) { 106 | string token = str_builder.str; 107 | tokens.append(token); 108 | str_builder.erase(0); 109 | } 110 | str_builder.append(c.to_string ()); 111 | break; 112 | case '>': 113 | str_builder.append(c.to_string ()); 114 | string token = str_builder.str; 115 | tokens.append(token); 116 | str_builder.erase(0); 117 | break; 118 | case ' ': 119 | if (str_builder.len > 0) { 120 | string token = str_builder.str; 121 | tokens.append(token); 122 | str_builder.erase(0); 123 | } 124 | break; 125 | default: 126 | str_builder.append(c.to_string ()); 127 | break; 128 | } 129 | } 130 | 131 | if (str_builder.len > 0) { 132 | string token = str_builder.str; 133 | tokens.append(token); 134 | str_builder.erase(0); 135 | } 136 | 137 | return tokens; 138 | } 139 | 140 | /* 141 | private void debugConfigMap(Map> configMap) { 142 | foreach (var entry in config_map.entries) { 143 | stdout.printf ("%s =>\n", entry.key); 144 | foreach (Keybinding k in entry.value) { 145 | stdout.printf (" %s %s\n", k.label, k.spec); 146 | } 147 | } 148 | } 149 | */ 150 | } 151 | -------------------------------------------------------------------------------- /src/grelier.vala: -------------------------------------------------------------------------------- 1 | /** 2 | * A client library for i3-wm that deserializes into idomatic Vala response objects. 3 | */ 4 | namespace Grelier { 5 | enum I3_COMMAND { 6 | RUN_COMMAND, 7 | GET_WORKSPACES, 8 | SUBSCRIBE, 9 | GET_OUTPUTS, 10 | GET_TREE, 11 | GET_MARKS, 12 | GET_BAR_CONFIG, 13 | GET_VERSION, 14 | GET_BINDING_MODES, 15 | GET_CONFIG, 16 | SEND_TICK, 17 | SYNC 18 | } 19 | 20 | public errordomain I3_ERROR { 21 | RPC_ERROR 22 | } 23 | 24 | // https://i3wm.org/docs/ipc.html#_version_reply 25 | public class VersionReply { 26 | public string human_readable { get; private set; } 27 | public string loaded_config_file_name { get; private set; } 28 | public string minor { get; private set; } 29 | public string patch { get; private set; } 30 | public string major { get; private set; } 31 | 32 | internal VersionReply (Json.Node responseJson) { 33 | human_readable = responseJson.get_object ().get_string_member ("human_readable"); 34 | loaded_config_file_name = responseJson.get_object ().get_string_member ("loaded_config_file_name"); 35 | minor = responseJson.get_object ().get_string_member ("minor"); 36 | patch = responseJson.get_object ().get_string_member ("patch"); 37 | major = responseJson.get_object ().get_string_member ("major"); 38 | } 39 | } 40 | 41 | // https://i3wm.org/docs/ipc.html#_config_reply 42 | public class ConfigReply { 43 | public string config { get; private set; } 44 | 45 | internal ConfigReply (Json.Node responseJson) { 46 | config = responseJson.get_object ().get_string_member ("config"); 47 | } 48 | } 49 | 50 | public class Client { 51 | private Socket socket; 52 | private uint8[] magic_number = "i3-ipc".data; 53 | private uint8[] terminator = { '\0' }; 54 | private int bytes_to_payload = 14; 55 | private int buffer_size = 1024 * 128; 56 | 57 | public Client (string i3Socket) throws GLib.Error { 58 | var socketAddress = new UnixSocketAddress (i3Socket); 59 | 60 | socket = new Socket (SocketFamily.UNIX, SocketType.STREAM, SocketProtocol.DEFAULT); 61 | assert (socket != null); 62 | 63 | socket.connect (socketAddress); 64 | socket.set_blocking (true); 65 | } 66 | 67 | ~Client () { 68 | if (socket != null) { 69 | socket.close (); 70 | } 71 | } 72 | 73 | private uint8[] int32_to_uint8_array (int32 input) { 74 | Variant val = new Variant.int32 (input); 75 | return val.get_data_as_bytes ().get_data (); 76 | } 77 | 78 | private string terminate_string (uint8[] rawString) { 79 | ByteArray b = new ByteArray (); 80 | b.append (rawString); 81 | b.append (terminator); 82 | 83 | return (string) b.data; 84 | } 85 | 86 | private uint8[] generate_request (I3_COMMAND cmd) { 87 | ByteArray np = new ByteArray (); 88 | 89 | np.append (magic_number); 90 | np.append (int32_to_uint8_array (0)); // payloadSize.get_data_as_bytes().get_data()); 91 | np.append (int32_to_uint8_array (cmd)); // command.get_data_as_bytes().get_data()); 92 | 93 | Bytes message = ByteArray.free_to_bytes (np); 94 | 95 | return message.get_data (); 96 | } 97 | 98 | private Json.Node ? i3_ipc (I3_COMMAND command) throws GLib.Error { 99 | ssize_t sent = socket.send (generate_request (command)); 100 | 101 | debug ("Sent " + sent.to_string () + " bytes to i3.\n"); 102 | uint8[] buffer = new uint8[buffer_size]; 103 | 104 | ssize_t len = socket.receive (buffer); 105 | 106 | debug ("Received " + len.to_string () + " bytes from i3.\n"); 107 | 108 | Bytes responseBytes = new Bytes.take (buffer[0 : len]); 109 | 110 | string payload = terminate_string (responseBytes.slice (bytes_to_payload, responseBytes.length).get_data ()); 111 | 112 | Json.Parser parser = new Json.Parser (); 113 | parser.load_from_data (payload); 114 | 115 | return parser.get_root (); 116 | } 117 | 118 | public VersionReply getVersion () throws I3_ERROR, GLib.Error { 119 | var response = i3_ipc (I3_COMMAND.GET_VERSION); 120 | 121 | if (response == null) { 122 | throw new I3_ERROR.RPC_ERROR ("No Response"); 123 | } 124 | 125 | return new VersionReply (response); 126 | } 127 | 128 | public ConfigReply getConfig () throws I3_ERROR, GLib.Error { 129 | var response = i3_ipc (I3_COMMAND.GET_CONFIG); 130 | 131 | if (response == null) { 132 | throw new I3_ERROR.RPC_ERROR ("No Response"); 133 | } 134 | 135 | return new ConfigReply (response); 136 | } 137 | } 138 | } 139 | -------------------------------------------------------------------------------- /src/helper.vala: -------------------------------------------------------------------------------- 1 | 2 | class Helper { 3 | 4 | /** 5 | * Return the screen dimentions in pixels that containes the passed-in window. 6 | */ 7 | public static Gdk.Rectangle getScreenSizeForWindow (Gtk.Window window) { 8 | var display = Gdk.Display.get_default (); 9 | var monitor = display.get_monitor_at_window (window.get_window ()); 10 | 11 | return monitor.get_geometry (); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main.vala: -------------------------------------------------------------------------------- 1 | using Gtk; 2 | using Gee; 3 | 4 | delegate string read_config (string config_descriptor) throws GLib.Error; 5 | 6 | int main (string[] args) { 7 | Map argMap; 8 | 9 | try { 10 | argMap = parse_args (args); 11 | } catch (Error e) { 12 | printerr ("error: %s\n", e.message); 13 | printerr ("Run '%s --help' to see a full list of available command line options.\n", args[0]); 14 | return 1; 15 | } 16 | 17 | if (argMap.has_key ("-v") || argMap.has_key ("--version")) { 18 | print ("remontoire 1.4.4 (C) 2022 Ken Gilmer\n"); 19 | return 0; 20 | } 21 | 22 | if (argMap.has_key ("-h") || argMap.has_key ("--help")) { 23 | print (""" 24 | Usage: 25 | remontoire (-c | -s | -h | -v) [-t ] 26 | 27 | Help Options: 28 | -h, --help Show help options 29 | 30 | Application Options: 31 | -v, --version Display version number 32 | -s Socket path for i3 33 | -c Config file 34 | -i Read from standard input 35 | -t CSS file 36 | -p Prefix of comment line 37 | """); 38 | print ("\n"); 39 | return 0; 40 | } 41 | 42 | read_config config_reader; 43 | string config_descriptor; 44 | if (argMap.has_key ("-s")) { 45 | config_reader = read_socket_config; 46 | config_descriptor = argMap.get ("-s"); 47 | } else if (argMap.has_key ("-c")) { 48 | config_reader = read_file_config; 49 | config_descriptor = argMap.get ("-c"); 50 | } else if (argMap.has_key ("-i")) { 51 | config_reader = read_stdin_config; 52 | config_descriptor = ""; 53 | } else { 54 | printerr ("Must specify -s , -c or -i .\n"); 55 | printerr ("Run '%s --help' to see a full list of available command line options.\n", args[0]); 56 | return 1; 57 | } 58 | 59 | string line_prefix = ""; 60 | if (argMap.has_key ("-p")) { 61 | line_prefix = argMap.get ("-p"); 62 | } 63 | 64 | var app = new Gtk.Application ("org.regolith.remontoire", ApplicationFlags.FLAGS_NONE); 65 | var settings = new GLib.Settings ("org.regolith-linux.remontoire"); 66 | 67 | app.activate.connect (() => { 68 | var window = app.active_window; 69 | if (window == null) { 70 | try { 71 | var configParser = new ConfigParser (config_reader (config_descriptor), line_prefix); 72 | window = new Remontoire.SliderWindow (app, configParser.parse (), settings); 73 | 74 | Gtk.CssProvider css_provider = new Gtk.CssProvider (); 75 | if (!argMap.has_key ("-t")) { 76 | css_provider.load_from_resource ("/application/style/style.css"); 77 | } else { 78 | var file = File.new_for_path (argMap.get ("-t")); 79 | 80 | if (!file.query_exists ()) { 81 | printerr ("File '%s' doesn't exist.\n", file.get_path ()); 82 | Process.exit (1); 83 | } 84 | css_provider.load_from_file (file); 85 | } 86 | 87 | Gtk.StyleContext.add_provider_for_screen (Gdk.Screen.get_default (), css_provider, Gtk.STYLE_PROVIDER_PRIORITY_USER); 88 | } catch (PARSE_ERROR ex) { 89 | error ("Failed to start: " + ex.message); 90 | } catch (GLib.Error ex) { 91 | error ("Failed to start: " + ex.message); 92 | } 93 | } 94 | 95 | var geometry = Helper.getScreenSizeForWindow (window); 96 | var position = settings.get_string ("window-position"); 97 | var x_padding = settings.get_int ("window-padding-width"); 98 | var y_padding = settings.get_int ("window-padding-height"); 99 | 100 | window.configure_event.connect (() => { 101 | int height, width; 102 | 103 | window.get_size (out width, out height); 104 | int x_position, y_position; 105 | 106 | switch (position) { 107 | case "north": 108 | x_position = geometry.x + ((geometry.width - width) / 2); 109 | y_position = geometry.y + y_padding; 110 | break; 111 | case "south": 112 | x_position = geometry.x + ((geometry.width - width) / 2); 113 | y_position = geometry.y + geometry.height - height - y_padding; 114 | break; 115 | case "west": 116 | x_position = geometry.x + x_padding; 117 | y_position = ((geometry.y + geometry.height - height) / 2); 118 | break; 119 | case "east": 120 | default: 121 | x_position = geometry.x + geometry.width - width - x_padding; 122 | y_position = ((geometry.y + geometry.height - height) / 2); 123 | break; 124 | } 125 | 126 | window.move (x_position, y_position); 127 | 128 | return false; 129 | }); 130 | 131 | window.show_all (); 132 | }); 133 | 134 | return app.run (new string[0]); 135 | } 136 | 137 | /** 138 | * Parse config from socket connection to i3. 139 | */ 140 | string read_socket_config (string socket_address) throws GLib.Error { 141 | var client = new Grelier.Client (socket_address); 142 | 143 | return client.getConfig ().config; 144 | } 145 | 146 | /** 147 | * Parse config from file path. 148 | */ 149 | string read_file_config (string file_path) throws GLib.Error { 150 | var file = File.new_for_path (file_path); 151 | 152 | if (!file.query_exists ()) { 153 | printerr ("File '%s' doesn't exist.\n", file.get_path ()); 154 | Process.exit (1); 155 | } 156 | 157 | var dis = new DataInputStream (file.read ()); 158 | string line; 159 | var str_builder = new StringBuilder (); 160 | 161 | while ((line = dis.read_line (null)) != null) { 162 | str_builder.append (line); 163 | str_builder.append ("\n"); 164 | } 165 | 166 | return str_builder.str; 167 | } 168 | 169 | string read_stdin_config (string unused) throws GLib.Error { 170 | var input = new StringBuilder (); 171 | var buffer = new char[1024]; 172 | while (!stdin.eof ()) { 173 | string read_chunk = stdin.gets (buffer); 174 | if (read_chunk != null) { 175 | input.append (read_chunk); 176 | } 177 | } 178 | return input.str; 179 | } 180 | -------------------------------------------------------------------------------- /src/meson.build: -------------------------------------------------------------------------------- 1 | 2 | add_project_arguments('--debug', language : 'vala') 3 | 4 | grelier_sources = [ 5 | 'grelier.vala' 6 | ] 7 | 8 | remontoire_sources = [ 9 | 'main.vala', 10 | 'slider_window.vala', 11 | 'helper.vala', 12 | 'config_parser.vala', 13 | 'arg_parser.vala' 14 | ] 15 | 16 | grelier_deps = [ 17 | dependency('glib-2.0'), 18 | dependency('gobject-2.0'), 19 | dependency('gio-unix-2.0', version: '>= 2.50'), 20 | dependency('json-glib-1.0') 21 | ] 22 | 23 | remontoire_deps = [ 24 | dependency('gio-2.0', version: '>= 2.50'), 25 | dependency('gtk+-3.0', version: '>= 3.22'), 26 | dependency('gdk-3.0', version: '>= 3.22'), 27 | dependency('gee-0.8') 28 | ] 29 | 30 | remontoire_sources += import( 'gnome' ).compile_resources( 31 | 'project-resources', 32 | '../data/style.xml', 33 | source_dir: '../data', 34 | ) 35 | 36 | gnome = import('gnome') 37 | 38 | executable('remontoire', [grelier_sources, remontoire_sources], 39 | vala_args: ['--target-glib=2.50'], dependencies: [grelier_deps, remontoire_deps], 40 | install: true, 41 | ) 42 | -------------------------------------------------------------------------------- /src/slider_window.vala: -------------------------------------------------------------------------------- 1 | using Gtk; 2 | using Gdk; 3 | using Gee; 4 | 5 | namespace Remontoire { 6 | 7 | /** 8 | * Primary window to dispay keybindings. 9 | */ 10 | public class SliderWindow : Gtk.Window { 11 | 12 | public SliderWindow (Gtk.Application app, Map > config, GLib.Settings settings) throws PARSE_ERROR, GLib.Error, Grelier.I3_ERROR { 13 | Object (application: app); 14 | 15 | style_window (this); 16 | 17 | if (config.size > 0) { 18 | var expandedCategories = parsePaths (settings.get_string ("expanded-category-path-ids")); 19 | 20 | var flowbox = new FlowBox (); 21 | flowbox.max_children_per_line = 1; 22 | flowbox.min_children_per_line = 1; 23 | flowbox.set_orientation (Orientation.HORIZONTAL); 24 | flowbox.get_style_context ().add_class ("window"); 25 | 26 | var scroll = new ScrolledWindow (null, null); 27 | scroll.set_policy (PolicyType.NEVER, PolicyType.AUTOMATIC); 28 | scroll.propagate_natural_height = true; 29 | scroll.propagate_natural_width = true; 30 | scroll.add (flowbox); 31 | 32 | this.add (scroll); 33 | 34 | build_widgets (flowbox, config, settings, expandedCategories); 35 | } else { 36 | var warning_label = new Gtk.Label ("No Keybindings"); 37 | warning_label.get_style_context ().add_class ("error"); 38 | this.add (warning_label); 39 | } 40 | 41 | this.destroy.connect (Gtk.main_quit); 42 | } 43 | 44 | private void build_widgets (Gtk.Container container, Map > keybindings, GLib.Settings settings, Set expandedCategories) { 45 | 46 | foreach (var categoryEntry in keybindings.entries) { 47 | Gtk.Expander expander; 48 | add_category (container, out expander, categoryEntry.key); 49 | 50 | expander.expanded = expandedCategories.contains (categoryEntry.key); 51 | expander.activate.connect ((expander) => { 52 | if (expander.expanded == false) { 53 | expandedCategories.add (expander.label); 54 | } else { 55 | expandedCategories.remove (expander.label); 56 | } 57 | savePaths (expandedCategories, settings); 58 | }); 59 | 60 | var keybinding_container = new Box (Gtk.Orientation.VERTICAL, 0); 61 | keybinding_container.set_spacing (0); 62 | expander.add (keybinding_container); 63 | 64 | foreach (var keybinding in categoryEntry.value) { 65 | add_item (keybinding_container, keybinding.label, keybinding.spec); 66 | } 67 | } 68 | } 69 | 70 | private static void add_category (Gtk.Container container, out Gtk.Expander expander, string label) { 71 | expander = new Gtk.Expander (label); 72 | expander.get_style_context ().add_class ("category"); 73 | container.add (expander); 74 | } 75 | 76 | private static void add_item (Gtk.Container container, string action, string keybinding) { 77 | var keybinding_root = new Box (Gtk.Orientation.HORIZONTAL, 0); 78 | keybinding_root.get_style_context ().add_class ("detail"); 79 | 80 | render_keybinding (keybinding_root, action, keybinding); 81 | container.add (keybinding_root); 82 | } 83 | 84 | /** 85 | * Generate the keybinding composite label. 86 | */ 87 | private static void render_keybinding (Gtk.Box parent, string action, string keybinding) { 88 | var action_label = new Gtk.Label (action); 89 | action_label.get_style_context ().add_class ("action"); 90 | action_label.halign = START; 91 | parent.pack_start (action_label); 92 | 93 | var keys = ConfigParser.parse_keybinding (keybinding); 94 | keys.reverse (); 95 | 96 | Gtk.Label keybinding_label; 97 | foreach (var key in keys) { 98 | if (key.has_prefix ("<") && key.has_suffix (">")) { 99 | keybinding_label = new Gtk.Label (key.substring (1, key.length - 2)); 100 | keybinding_label.get_style_context ().add_class ("metakey"); 101 | } else if (key.contains ("..")) { 102 | keybinding_label = new Gtk.Label (key); 103 | keybinding_label.get_style_context ().add_class ("rangekey"); 104 | } else { 105 | keybinding_label = new Gtk.Label (key); 106 | keybinding_label.get_style_context ().add_class ("key"); 107 | } 108 | keybinding_label.halign = END; 109 | parent.pack_end (keybinding_label, false, false, 0); 110 | } 111 | } 112 | 113 | private static void style_window (Gtk.Window window) { 114 | window.set_skip_taskbar_hint (true); 115 | window.set_skip_pager_hint (true); 116 | window.set_decorated (false); 117 | window.set_resizable (false); 118 | window.set_focus_on_map (false); 119 | window.set_deletable (false); 120 | window.set_accept_focus (false); 121 | window.set_type_hint (SPLASHSCREEN); 122 | window.stick (); 123 | } 124 | 125 | private Set parsePaths (string pathList) { 126 | var pathSet = new HashSet(); 127 | if (pathList.length == 0) return pathSet; 128 | 129 | pathSet.add_all_array (pathList.split (",")); 130 | 131 | return pathSet; 132 | } 133 | 134 | private void savePaths (Set pathSet, GLib.Settings settings) { 135 | string pathSetStr = ""; 136 | foreach (var pathstr in pathSet) { 137 | pathSetStr += pathstr; 138 | pathSetStr += ","; 139 | } 140 | settings.set_string ("expanded-category-path-ids", pathSetStr); 141 | } 142 | } 143 | } 144 | -------------------------------------------------------------------------------- /uncrustify.cfg: -------------------------------------------------------------------------------- 1 | # Uncrustify 0.60 2 | # Rules for vala 3 | # Version: 0.5 4 | # Refactored to match the style used on this project: https://github.com/GNOME/vala 5 | 6 | # 7 | # General options 8 | # 9 | 10 | # The type of line endings 11 | newlines = auto # auto/lf/crlf/cr 12 | 13 | # The original size of tabs in the input 14 | input_tab_size = 8 # number 15 | 16 | # The size of tabs in the output (only used if align_with_tabs=true) 17 | output_tab_size = 4 # number 18 | 19 | # The ASCII value of the string escape char, usually 92 (\) or 94 (^). (Pawn) 20 | string_escape_char = 92 # number 21 | 22 | # Alternate string escape char for Pawn. Only works right before the quote char. 23 | string_escape_char2 = 0 # number 24 | 25 | # Allow interpreting '>=' and '>>=' as part of a template in 'void f(list>=val);'. 26 | # If true (default), 'assert(x<0 && y>=3)' will be broken. 27 | # Improvements to template detection may make this option obsolete. 28 | tok_split_gte = false # false/true 29 | 30 | # Control what to do with the UTF-8 BOM (recommend 'remove') 31 | utf8_bom = ignore # ignore/add/remove/force 32 | 33 | # If the file contains bytes with values between 128 and 255, but is not UTF-8, then output as UTF-8 34 | utf8_byte = false # false/true 35 | 36 | # Force the output encoding to UTF-8 37 | utf8_force = false # false/true 38 | 39 | # 40 | # Indenting 41 | # 42 | 43 | # The number of columns to indent per level. 44 | # Usually 2, 3, 4, or 8. 45 | indent_columns = 4 # number 46 | 47 | # The continuation indent. If non-zero, this overrides the indent of '(' and '=' continuation indents. 48 | # For FreeBSD, this is set to 4. Negative value is absolute and not increased for each ( level 49 | indent_continue = 0 # number 50 | 51 | # How to use tabs when indenting code 52 | # 0=spaces only 53 | # 1=indent with tabs to brace level, align with spaces 54 | # 2=indent and align with tabs, using spaces when not on a tabstop 55 | indent_with_tabs = 0 # number 56 | 57 | # Comments that are not a brace level are indented with tabs on a tabstop. 58 | # Requires indent_with_tabs=2. If false, will use spaces. 59 | indent_cmt_with_tabs = false # false/true 60 | 61 | # Whether to indent strings broken by '\' so that they line up 62 | indent_align_string = false # false/true 63 | 64 | # The number of spaces to indent multi-line XML strings. 65 | # Requires indent_align_string=True 66 | indent_xml_string = 0 # number 67 | 68 | # Spaces to indent '{' from level 69 | indent_brace = 0 # number 70 | 71 | # Whether braces are indented to the body level 72 | indent_braces = false # false/true 73 | 74 | # Disabled indenting function braces if indent_braces is true 75 | indent_braces_no_func = false # false/true 76 | 77 | # Disabled indenting class braces if indent_braces is true 78 | indent_braces_no_class = false # false/true 79 | 80 | # Disabled indenting struct braces if indent_braces is true 81 | indent_braces_no_struct = false # false/true 82 | 83 | # Indent based on the size of the brace parent, i.e. 'if' => 3 spaces, 'for' => 4 spaces, etc. 84 | indent_brace_parent = false # false/true 85 | 86 | # Whether the 'namespace' body is indented 87 | indent_namespace = true # false/true 88 | 89 | # The number of spaces to indent a namespace block 90 | indent_namespace_level = 0 # number 91 | 92 | # If the body of the namespace is longer than this number, it won't be indented. 93 | # Requires indent_namespace=true. Default=0 (no limit) 94 | indent_namespace_limit = 0 # number 95 | 96 | # Whether the 'extern "C"' body is indented 97 | indent_extern = false # false/true 98 | 99 | # Whether the 'class' body is indented 100 | indent_class = true # false/true 101 | 102 | # Whether to indent the stuff after a leading class colon 103 | indent_class_colon = false # false/true 104 | # Whether to indent the stuff after a leading class initializer colon 105 | indent_constr_colon = false # false/true 106 | 107 | # Virtual indent from the ':' for member initializers. Default is 2 108 | indent_ctor_init_leading = 2 # number 109 | 110 | # Additional indenting for constructor initializer list 111 | indent_ctor_init = 0 # number 112 | 113 | # False=treat 'else\nif' as 'else if' for indenting purposes 114 | # True=indent the 'if' one level 115 | indent_else_if = false # false/true 116 | 117 | # Amount to indent variable declarations after a open brace. neg=relative, pos=absolute 118 | indent_var_def_blk = 0 # number 119 | 120 | # Indent continued variable declarations instead of aligning. 121 | indent_var_def_cont = false # false/true 122 | 123 | # True: force indentation of function definition to start in column 1 124 | # False: use the default behavior 125 | indent_func_def_force_col1 = false # false/true 126 | 127 | # True: indent continued function call parameters one indent level 128 | # False: align parameters under the open paren 129 | indent_func_call_param = false # false/true 130 | 131 | # Same as indent_func_call_param, but for function defs 132 | indent_func_def_param = false # false/true 133 | 134 | # Same as indent_func_call_param, but for function protos 135 | indent_func_proto_param = false # false/true 136 | 137 | # Same as indent_func_call_param, but for class declarations 138 | indent_func_class_param = false # false/true 139 | 140 | # Same as indent_func_call_param, but for class variable constructors 141 | indent_func_ctor_var_param = false # false/true 142 | 143 | # Same as indent_func_call_param, but for templates 144 | indent_template_param = false # false/true 145 | 146 | # Double the indent for indent_func_xxx_param options 147 | indent_func_param_double = false # false/true 148 | 149 | # Indentation column for standalone 'const' function decl/proto qualifier 150 | indent_func_const = 0 # number 151 | 152 | # Indentation column for standalone 'throw' function decl/proto qualifier 153 | indent_func_throw = 0 # number 154 | 155 | # The number of spaces to indent a continued '->' or '.' 156 | # Usually set to 0, 1, or indent_columns. 157 | indent_member = 1 # number 158 | 159 | # Spaces to indent single line ('//') comments on lines before code 160 | indent_sing_line_comments = 0 # number 161 | 162 | # If set, will indent trailing single line ('//') comments relative 163 | # to the code instead of trying to keep the same absolute column 164 | indent_relative_single_line_comments = false # false/true 165 | 166 | # Spaces to indent 'case' from 'switch' 167 | # Usually 0 or indent_columns. 168 | indent_switch_case = indent_columns # number 169 | 170 | # Spaces to shift the 'case' line, without affecting any other lines 171 | # Usually 0. 172 | indent_case_shift = 0 # number 173 | 174 | # Spaces to indent '{' from 'case'. 175 | # By default, the brace will appear under the 'c' in case. 176 | # Usually set to 0 or indent_columns. 177 | indent_case_brace = 0 # number 178 | 179 | # Whether to indent comments found in first column 180 | indent_col1_comment = false # false/true 181 | 182 | # How to indent goto labels 183 | # >0 : absolute column where 1 is the leftmost column 184 | # <=0 : subtract from brace indent 185 | indent_label = 1 # number 186 | 187 | # Same as indent_label, but for access specifiers that are followed by a colon 188 | indent_access_spec = 1 # number 189 | 190 | # Indent the code after an access specifier by one level. 191 | # If set, this option forces 'indent_access_spec=0' 192 | indent_access_spec_body = false # false/true 193 | 194 | # If an open paren is followed by a newline, indent the next line so that it lines up after the open paren (not recommended) 195 | indent_paren_nl = false # false/true 196 | 197 | # Controls the indent of a close paren after a newline. 198 | # 0: Indent to body level 199 | # 1: Align under the open paren 200 | # 2: Indent to the brace level 201 | indent_paren_close = 2 # number 202 | 203 | # Controls the indent of a comma when inside a paren.If TRUE, aligns under the open paren 204 | indent_comma_paren = false # false/true 205 | 206 | # Controls the indent of a BOOL operator when inside a paren.If TRUE, aligns under the open paren 207 | indent_bool_paren = false # false/true 208 | 209 | # If 'indent_bool_paren' is true, controls the indent of the first expression. If TRUE, aligns the first expression to the following ones 210 | indent_first_bool_expr = false # false/true 211 | 212 | # If an open square is followed by a newline, indent the next line so that it lines up after the open square (not recommended) 213 | indent_square_nl = false # false/true 214 | 215 | # Don't change the relative indent of ESQL/C 'EXEC SQL' bodies 216 | indent_preserve_sql = false # false/true 217 | 218 | # Align continued statements at the '='. Default=True 219 | # If FALSE or the '=' is followed by a newline, the next line is indent one tab. 220 | indent_align_assign = true # false/true 221 | 222 | # Indent OC blocks at brace level instead of usual rules. 223 | indent_oc_block = false # false/true 224 | 225 | # Indent OC blocks in a message relative to the parameter name. 226 | # 0=use indent_oc_block rules, 1+=spaces to indent 227 | indent_oc_block_msg = 0 # number 228 | 229 | # Minimum indent for subsequent parameters 230 | indent_oc_msg_colon = 0 # number 231 | 232 | # Objective C 233 | 234 | # If true, prioritize aligning with initial colon (and stripping spaces from lines, if necessary). 235 | # Default is true. 236 | indent_oc_msg_prioritize_first_colon = true 237 | 238 | # If indent_oc_block_msg and this option are on, blocks will be indented the way that Xcode does by default (from keyword if the parameter is on its own line; otherwise, from the previous indentation level). 239 | indent_oc_block_msg_xcode_style = true 240 | 241 | # If indent_oc_block_msg and this option are on, blocks will be indented from where the brace is relative to a msg keyword. 242 | indent_oc_block_msg_from_keyword = true 243 | 244 | # If indent_oc_block_msg and this option are on, blocks will be indented from where the brace is relative to a msg colon. 245 | indent_oc_block_msg_from_colon = true 246 | 247 | # If indent_oc_block_msg and this option are on, blocks will be indented from where the block caret is. 248 | indent_oc_block_msg_from_caret = true 249 | 250 | # If indent_oc_block_msg and this option are on, blocks will be indented from where the brace is. 251 | indent_oc_block_msg_from_brace = true 252 | 253 | # 254 | # Spacing options 255 | # 256 | 257 | # Add or remove space around arithmetic operator '+', '-', '/', '*', etc 258 | sp_arith = force # ignore/add/remove/force 259 | 260 | # Add or remove space around assignment operator '=', '+=', etc 261 | sp_assign = force # ignore/add/remove/force 262 | 263 | # Add or remove space around '=' in C++11 lambda capture specifications. Overrides sp_assign 264 | sp_cpp_lambda_assign = force # ignore/add/remove/force 265 | 266 | # Add or remove space after the capture specification in C++11 lambda. 267 | sp_cpp_lambda_paren = force # ignore/add/remove/force 268 | 269 | # Add or remove space around assignment operator '=' in a prototype 270 | sp_assign_default = force # ignore/add/remove/force 271 | 272 | # Add or remove space before assignment operator '=', '+=', etc. Overrides sp_assign. 273 | sp_before_assign = force # ignore/add/remove/force 274 | 275 | # Add or remove space after assignment operator '=', '+=', etc. Overrides sp_assign. 276 | sp_after_assign = force # ignore/add/remove/force 277 | 278 | # Add or remove space around assignment '=' in enum 279 | sp_enum_assign = force # ignore/add/remove/force 280 | 281 | # Add or remove space before assignment '=' in enum. Overrides sp_enum_assign. 282 | sp_enum_before_assign = ignore # ignore/add/remove/force 283 | 284 | # Add or remove space after assignment '=' in enum. Overrides sp_enum_assign. 285 | sp_enum_after_assign = force # ignore/add/remove/force 286 | 287 | # Add or remove space around preprocessor '##' concatenation operator. Default=Add 288 | sp_pp_concat = add # ignore/add/remove/force 289 | 290 | # Add or remove space after preprocessor '#' stringify operator. Also affects the '#@' charizing operator. 291 | sp_pp_stringify = ignore # ignore/add/remove/force 292 | 293 | # Add or remove space before preprocessor '#' stringify operator as in '#define x(y) L#y'. 294 | sp_before_pp_stringify = ignore # ignore/add/remove/force 295 | 296 | # Add or remove space around boolean operators '&&' and '||' 297 | sp_bool = force # ignore/add/remove/force 298 | 299 | # Add or remove space around compare operator '<', '>', '==', etc 300 | sp_compare = force # ignore/add/remove/force 301 | 302 | # Add or remove space inside '(' and ')' 303 | sp_inside_paren = remove # ignore/add/remove/force 304 | 305 | # Add or remove space between nested parens 306 | sp_paren_paren = remove # ignore/add/remove/force 307 | 308 | # Add or remove space between back-to-back parens: ')(' vs ') (' 309 | sp_cparen_oparen = remove # ignore/add/remove/force 310 | # Whether to balance spaces inside nested parens 311 | sp_balance_nested_parens = false # false/true 312 | 313 | # Add or remove space between ')' and '{' 314 | sp_paren_brace = force # ignore/add/remove/force 315 | 316 | # Add or remove space before pointer star '*' 317 | sp_before_ptr_star = force # ignore/add/remove/force 318 | 319 | # Add or remove space before pointer star '*' that isn't followed by a variable name 320 | # If set to 'ignore', sp_before_ptr_star is used instead. 321 | sp_before_unnamed_ptr_star = force # ignore/add/remove/force 322 | 323 | # Add or remove space between pointer stars '*' 324 | sp_between_ptr_star = force # ignore/add/remove/force 325 | 326 | # Add or remove space after pointer star '*', if followed by a word. 327 | sp_after_ptr_star = force # ignore/add/remove/force 328 | 329 | # Add or remove space after a pointer star '*', if followed by a func proto/def. 330 | sp_after_ptr_star_func = force # ignore/add/remove/force 331 | 332 | # Add or remove space after a pointer star '*', if followed by an open paren (function types). 333 | sp_ptr_star_paren = force # ignore/add/remove/force 334 | 335 | # Add or remove space before a pointer star '*', if followed by a func proto/def. 336 | sp_before_ptr_star_func = force # ignore/add/remove/force 337 | 338 | # Add or remove space before a reference sign '&' 339 | sp_before_byref = force # ignore/add/remove/force 340 | 341 | # Add or remove space before a reference sign '&' that isn't followed by a variable name 342 | # If set to 'ignore', sp_before_byref is used instead. 343 | sp_before_unnamed_byref = ignore # ignore/add/remove/force 344 | 345 | # Add or remove space after reference sign '&', if followed by a word. 346 | sp_after_byref = ignore # ignore/add/remove/force 347 | 348 | # Add or remove space after a reference sign '&', if followed by a func proto/def. 349 | sp_after_byref_func = remove # ignore/add/remove/force 350 | 351 | # Add or remove space before a reference sign '&', if followed by a func proto/def. 352 | sp_before_byref_func = force # ignore/add/remove/force 353 | 354 | # Add or remove space between type and word. Default=Force 355 | sp_after_type = force # ignore/add/remove/force 356 | 357 | # Add or remove space before the paren in the D constructs 'template Foo(' and 'class Foo('. 358 | sp_before_template_paren = ignore # ignore/add/remove/force 359 | 360 | # Add or remove space in 'template <' vs 'template<'. 361 | # If set to ignore, sp_before_angle is used. 362 | sp_template_angle = ignore # ignore/add/remove/force 363 | 364 | # Add or remove space before '<>' 365 | sp_before_angle = remove # ignore/add/remove/force 366 | 367 | # Add or remove space inside '<' and '>' 368 | sp_inside_angle = remove # ignore/add/remove/force 369 | 370 | # Add or remove space after '<>' 371 | sp_after_angle = remove # ignore/add/remove/force 372 | 373 | # Add or remove space between '<>' and '(' as found in 'new List();' 374 | sp_angle_paren = remove # ignore/add/remove/force 375 | 376 | # Add or remove space between '<>' and a word as in 'List m;' 377 | sp_angle_word = force # ignore/add/remove/force 378 | 379 | # Add or remove space between '>' and '>' in '>>' (template stuff C++/C# only). Default=Add 380 | sp_angle_shift = add # ignore/add/remove/force 381 | 382 | # Permit removal of the space between '>>' in 'foo >' (C++11 only). Default=False 383 | # sp_angle_shift cannot remove the space without this option. 384 | sp_permit_cpp11_shift = false # false/true 385 | 386 | # Add or remove space before '(' of 'if', 'for', 'switch', and 'while' 387 | sp_before_sparen = force # ignore/add/remove/force 388 | 389 | # Add or remove space inside if-condition '(' and ')' 390 | sp_inside_sparen = remove # ignore/add/remove/force 391 | 392 | # Add or remove space before if-condition ')'. Overrides sp_inside_sparen. 393 | sp_inside_sparen_close = ignore # ignore/add/remove/force 394 | 395 | # Add or remove space before if-condition '('. Overrides sp_inside_sparen. 396 | sp_inside_sparen_open = ignore # ignore/add/remove/force 397 | 398 | # Add or remove space after ')' of 'if', 'for', 'switch', and 'while' 399 | sp_after_sparen = remove # ignore/add/remove/force 400 | 401 | # Add or remove space between ')' and '{' of 'if', 'for', 'switch', and 'while' 402 | sp_sparen_brace = force # ignore/add/remove/force 403 | 404 | # Add or remove space between 'invariant' and '(' in the D language. 405 | sp_invariant_paren = ignore # ignore/add/remove/force 406 | 407 | # Add or remove space after the ')' in 'invariant (C) c' in the D language. 408 | sp_after_invariant_paren = ignore # ignore/add/remove/force 409 | 410 | # Add or remove space before empty statement ';' on 'if', 'for' and 'while' 411 | sp_special_semi = remove # ignore/add/remove/force 412 | 413 | # Add or remove space before ';'. Default=Remove 414 | sp_before_semi = remove # ignore/add/remove/force 415 | 416 | # Add or remove space before ';' in non-empty 'for' statements 417 | sp_before_semi_for = remove # ignore/add/remove/force 418 | 419 | # Add or remove space before a semicolon of an empty part of a for statement. 420 | sp_before_semi_for_empty = force # ignore/add/remove/force 421 | 422 | # Add or remove space after ';', except when followed by a comment. Default=Add 423 | sp_after_semi = add # ignore/add/remove/force 424 | 425 | # Add or remove space after ';' in non-empty 'for' statements. Default=Force 426 | sp_after_semi_for = force # ignore/add/remove/force 427 | 428 | # Add or remove space after the final semicolon of an empty part of a for statement: for ( ; ; ). 429 | sp_after_semi_for_empty = force # ignore/add/remove/force 430 | 431 | # Add or remove space before '[' (except '[]') 432 | sp_before_square = remove # ignore/add/remove/force 433 | 434 | # Add or remove space before '[]' 435 | sp_before_squares = remove # ignore/add/remove/force 436 | 437 | # Add or remove space inside a non-empty '[' and ']' 438 | sp_inside_square = remove # ignore/add/remove/force 439 | 440 | # Add or remove space after ',' 441 | sp_after_comma = force # ignore/add/remove/force 442 | 443 | # Add or remove space before ',' 444 | sp_before_comma = remove # ignore/add/remove/force 445 | 446 | # Add or remove space between an open paren and comma: '(,' vs '( ,' 447 | sp_paren_comma = force # ignore/add/remove/force 448 | 449 | # Add or remove space before the variadic '...' when preceded by a non-punctuator 450 | sp_before_ellipsis = remove # ignore/add/remove/force 451 | 452 | # Add or remove space after class ':' 453 | sp_after_class_colon = force # ignore/add/remove/force 454 | 455 | # Add or remove space before class ':' 456 | sp_before_class_colon = force # ignore/add/remove/force 457 | 458 | # Add or remove space after class constructor ':' 459 | sp_after_constr_colon = ignore # ignore/add/remove/force 460 | 461 | # Add or remove space before class constructor ':' 462 | sp_before_constr_colon = ignore # ignore/add/remove/force 463 | 464 | # Add or remove space before case ':'. Default=Remove 465 | sp_before_case_colon = remove # ignore/add/remove/force 466 | 467 | # Add or remove space between 'operator' and operator sign 468 | sp_after_operator = force # ignore/add/remove/force 469 | 470 | # Add or remove space between the operator symbol and the open paren, as in 'operator ++(' 471 | sp_after_operator_sym = ignore # ignore/add/remove/force 472 | 473 | # Add or remove space after C/D cast, i.e. 'cast(int)a' vs 'cast(int) a' or '(int)a' vs '(int) a' 474 | sp_after_cast = force # ignore/add/remove/force 475 | 476 | # Add or remove spaces inside cast parens 477 | sp_inside_paren_cast = remove # ignore/add/remove/force 478 | 479 | # Add or remove space between the type and open paren in a C++ cast, i.e. 'int(exp)' vs 'int (exp)' 480 | sp_cpp_cast_paren = ignore # ignore/add/remove/force 481 | 482 | # Add or remove space between 'sizeof' and '(' 483 | sp_sizeof_paren = force # ignore/add/remove/force 484 | 485 | # Add or remove space after the tag keyword (Pawn) 486 | sp_after_tag = ignore # ignore/add/remove/force 487 | 488 | # Add or remove space inside enum '{' and '}' 489 | sp_inside_braces_enum = force # ignore/add/remove/force 490 | 491 | # Add or remove space inside struct/union '{' force '}' 492 | sp_inside_braces_struct = force # ignore/add/remove/force 493 | 494 | # Add or remove space inside '{' and '}' 495 | sp_inside_braces = force # ignore/add/remove/force 496 | 497 | # Add or remove space inside '{}' 498 | sp_inside_braces_empty = remove # ignore/add/remove/force 499 | 500 | # Add or remove space between return type and function name 501 | # A minimum of 1 is forced except for pointer return types. 502 | sp_type_func = remove # ignore/add/remove/force 503 | 504 | # Add or remove space between function name and '(' on function declaration 505 | sp_func_proto_paren = force # ignore/add/remove/force 506 | 507 | # CARL duplicates ERROR ?? 508 | # Add or remove space between function name and '(' on function definition 509 | sp_func_def_paren = force # ignore/add/remove/force 510 | 511 | # Add or remove space inside empty function '()' 512 | sp_inside_fparens = remove # ignore/add/remove/force 513 | 514 | # Add or remove space inside function '(' and ')' 515 | sp_inside_fparen = remove # ignore/add/remove/force 516 | 517 | # Add or remove space inside the first parens in the function type: 'void (*x)(...)' 518 | sp_inside_tparen = remove # ignore/add/remove/force 519 | 520 | # Add or remove between the parens in the function type: 'void (*x)(...)' 521 | sp_after_tparen_close = remove # ignore/add/remove/force 522 | 523 | # Add or remove space between ']' and '(' when part of a function call. 524 | sp_square_fparen = force # ignore/add/remove/force 525 | 526 | # Add or remove space between ')' and '{' of function 527 | sp_fparen_brace = force # ignore/add/remove/force 528 | 529 | # Add or remove space between function name and '(' on function calls 530 | sp_func_call_paren = force # ignore/add/remove/force 531 | 532 | # Add or remove space between function name and '()' on function calls without parameters. 533 | # If set to 'ignore' (the default), sp_func_call_paren is used. 534 | sp_func_call_paren_empty = force # ignore/add/remove/force 535 | 536 | # Add or remove space between the user function name and '(' on function calls 537 | # You need to set a keyword to be a user function, like this: 'set func_call_user _' in the config file. 538 | sp_func_call_user_paren = ignore # ignore/add/remove/force 539 | set func_call_user _ 540 | 541 | # Add or remove space between a constructor/destructor and the open paren 542 | sp_func_class_paren = force # ignore/add/remove/force 543 | 544 | # Add or remove space between 'return' and '(' 545 | sp_return_paren = force # ignore/add/remove/force 546 | 547 | # Add or remove space between '__attribute__' and '(' 548 | sp_attribute_paren = force # ignore/add/remove/force 549 | 550 | # Add or remove space between 'defined' and '(' in '#if defined (FOO)' 551 | sp_defined_paren = force # ignore/add/remove/force 552 | 553 | # Add or remove space between 'throw' and '(' in 'throw (something)' 554 | sp_throw_paren = force # ignore/add/remove/force 555 | 556 | # Add or remove space between 'throw' and anything other than '(' as in '@throw [...];' 557 | sp_after_throw = force # ignore/add/remove/force 558 | 559 | # Add or remove space between 'catch' and '(' in 'catch (something) { }' 560 | # If set to ignore, sp_before_sparen is used. 561 | sp_catch_paren = force # ignore/add/remove/force 562 | 563 | # D 564 | # Add or remove space between 'version' and '(' in 'version (something) { }' (D language) 565 | # If set to ignore, sp_before_sparen is used. 566 | sp_version_paren = ignore # ignore/add/remove/force 567 | 568 | # D 569 | # Add or remove space between 'scope' and '(' in 'scope (something) { }' (D language) 570 | # If set to ignore, sp_before_sparen is used. 571 | sp_scope_paren = ignore # ignore/add/remove/force 572 | 573 | # Add or remove space between macro and value 574 | sp_macro = ignore # ignore/add/remove/force 575 | 576 | # MACRO 577 | # Add or remove space between macro function ')' and value 578 | sp_macro_func = ignore # ignore/add/remove/force 579 | 580 | # Add or remove space between 'else' and '{' if on the same line 581 | sp_else_brace = force # ignore/add/remove/force 582 | 583 | # Add or remove space between '}' and 'else' if on the same line 584 | sp_brace_else = force # ignore/add/remove/force 585 | 586 | # Add or remove space between '}' and the name of a typedef on the same line 587 | sp_brace_typedef = force # ignore/add/remove/force 588 | 589 | # Add or remove space between 'catch' and '{' if on the same line 590 | sp_catch_brace = force # ignore/add/remove/force 591 | 592 | # Add or remove space between '}' and 'catch' if on the same line 593 | sp_brace_catch = force # ignore/add/remove/force 594 | 595 | # Add or remove space between 'finally' and '{' if on the same line 596 | sp_finally_brace = force # ignore/add/remove/force 597 | 598 | # Add or remove space between '}' and 'finally' if on the same line 599 | sp_brace_finally = force # ignore/add/remove/force 600 | 601 | # Add or remove space between 'try' and '{' if on the same line 602 | sp_try_brace = force # ignore/add/remove/force 603 | 604 | # Add or remove space between get/set and '{' if on the same line 605 | sp_getset_brace = force # ignore/add/remove/force 606 | 607 | # CARL TODO 608 | 609 | # Add or remove space between a variable and '{' for C++ uniform initialization 610 | sp_word_brace = ignore 611 | 612 | # Add or remove space between a variable and '{' for a namespace 613 | sp_word_brace_ns = force 614 | 615 | # C++ 616 | # Add or remove space before the '::' operator 617 | sp_before_dc = remove # ignore/add/remove/force 618 | 619 | # C++ 620 | # Add or remove space after the '::' operator 621 | sp_after_dc = remove # ignore/add/remove/force 622 | 623 | # Add or remove around the D named array initializer ':' operator 624 | sp_d_array_colon = ignore # ignore/add/remove/force 625 | 626 | # Add or remove space after the '!' (not) operator. Default=Remove 627 | sp_not = remove # ignore/add/remove/force 628 | 629 | # Add or remove space after the '~' (invert) operator. Default=Remove 630 | sp_inv = remove # ignore/add/remove/force 631 | 632 | # Add or remove space after the '&' (address-of) operator. Default=Remove 633 | # This does not affect the spacing after a '&' that is part of a type. 634 | sp_addr = remove # ignore/add/remove/force 635 | 636 | # Add or remove space around the '.' or '->' operators. Default=Remove 637 | sp_member = remove # ignore/add/remove/force 638 | 639 | # Add or remove space after the '*' (dereference) operator. Default=Remove 640 | # This does not affect the spacing after a '*' that is part of a type. 641 | sp_deref = remove # ignore/add/remove/force 642 | 643 | # Add or remove space after '+' or '-', as in 'x = -5' or 'y = +7'. Default=Remove 644 | sp_sign = remove # ignore/add/remove/force 645 | 646 | # Add or remove space before or after '++' and '--', as in '(--x)' or 'y++;'. Default=Remove 647 | sp_incdec = remove # ignore/add/remove/force 648 | 649 | # Add or remove space before a backslash-newline at the end of a line. Default=Add 650 | sp_before_nl_cont = add # ignore/add/remove/force 651 | 652 | # Obj c 653 | # Add or remove space after the scope '+' or '-', as in '-(void) foo;' or '+(int) bar;' 654 | sp_after_oc_scope = ignore # ignore/add/remove/force 655 | 656 | # Obj c 657 | # Add or remove space after the colon in message specs 658 | # '-(int) f:(int) x;' vs '-(int) f: (int) x;' 659 | sp_after_oc_colon = ignore # ignore/add/remove/force 660 | 661 | # Obj c 662 | # Add or remove space before the colon in message specs 663 | # '-(int) f: (int) x;' vs '-(int) f : (int) x;' 664 | sp_before_oc_colon = ignore # ignore/add/remove/force 665 | 666 | # Obj c 667 | # Add or remove space after the colon in immutable dictionary expression 668 | # 'NSDictionary *test = @{@"foo" :@"bar"};' 669 | sp_after_oc_dict_colon = ignore # ignore/add/remove/force 670 | 671 | # Obj c 672 | # Add or remove space before the colon in immutable dictionary expression 673 | # 'NSDictionary *test = @{@"foo" :@"bar"};' 674 | sp_before_oc_dict_colon = ignore # ignore/add/remove/force 675 | 676 | # Obj c 677 | # Add or remove space after the colon in message specs 678 | # '[object setValue:1];' vs '[object setValue: 1];' 679 | sp_after_send_oc_colon = ignore # ignore/add/remove/force 680 | 681 | # Obj c 682 | # Add or remove space before the colon in message specs 683 | # '[object setValue:1];' vs '[object setValue :1];' 684 | sp_before_send_oc_colon = ignore # ignore/add/remove/force 685 | 686 | # Obj c 687 | # Add or remove space after the (type) in message specs 688 | # '-(int)f: (int) x;' vs '-(int)f: (int)x;' 689 | sp_after_oc_type = ignore # ignore/add/remove/force 690 | 691 | # Obj c 692 | # Add or remove space after the first (type) in message specs 693 | # '-(int) f:(int)x;' vs '-(int)f:(int)x;' 694 | sp_after_oc_return_type = ignore # ignore/add/remove/force 695 | 696 | # Obj c 697 | # Add or remove space between '@selector' and '(' 698 | # '@selector(msgName)' vs '@selector (msgName)' 699 | # Also applies to @protocol() constructs 700 | sp_after_oc_at_sel = ignore # ignore/add/remove/force 701 | 702 | # Obj c 703 | # Add or remove space between '@selector(x)' and the following word 704 | # '@selector(foo) a:' vs '@selector(foo)a:' 705 | sp_after_oc_at_sel_parens = ignore # ignore/add/remove/force 706 | 707 | # Obj c 708 | # Add or remove space inside '@selector' parens 709 | # '@selector(foo)' vs '@selector( foo )' 710 | # Also applies to @protocol() constructs 711 | sp_inside_oc_at_sel_parens = ignore # ignore/add/remove/force 712 | 713 | # Obj c 714 | # Add or remove space before a block pointer caret 715 | # '^int (int arg){...}' vs. ' ^int (int arg){...}' 716 | sp_before_oc_block_caret = ignore # ignore/add/remove/force 717 | 718 | # Obj c 719 | # Add or remove space after a block pointer caret 720 | # '^int (int arg){...}' vs. '^ int (int arg){...}' 721 | sp_after_oc_block_caret = ignore # ignore/add/remove/force 722 | 723 | # Obj c 724 | # Add or remove space between the receiver and selector in a message. 725 | # '[receiver selector ...]' 726 | sp_after_oc_msg_receiver = ignore # ignore/add/remove/force 727 | 728 | # Obj c 729 | # Add or remove space after @property. 730 | sp_after_oc_property = ignore # ignore/add/remove/force 731 | 732 | # Add or remove space around the ':' in 'b ? t : f' 733 | sp_cond_colon = force # ignore/add/remove/force 734 | # TODO 735 | 736 | # Add or remove space before the ':' in 'b ? t : f'. Overrides sp_cond_colon. 737 | sp_cond_colon_before = force 738 | # Add or remove space after the ':' in 'b ? t : f'. Overrides sp_cond_colon. 739 | sp_cond_colon_after = force 740 | # Add or remove space around the '?' in 'b ? t : f' 741 | sp_cond_question = force 742 | 743 | # Add or remove space before the '?' in 'b ? t : f'. Overrides sp_cond_question. 744 | sp_cond_question_before = force 745 | 746 | # Add or remove space after the '?' in 'b ? t : f'. Overrides sp_cond_question. 747 | sp_cond_question_after = force 748 | 749 | # In the abbreviated ternary form (a ?: b), add/remove space between ? and :.'. Overrides all other sp_cond_* options. 750 | sp_cond_ternary_short = force 751 | 752 | # Fix the spacing between 'case' and the label. Only 'ignore' and 'force' make sense here. 753 | sp_case_label = force # ignore/add/remove/force 754 | 755 | # Control the space around the D '..' operator. 756 | sp_range = ignore # ignore/add/remove/force 757 | 758 | # Control the spacing after ':' in 'for (TYPE VAR : EXPR)' (Java) 759 | sp_after_for_colon = ignore # ignore/add/remove/force 760 | 761 | # Control the spacing before ':' in 'for (TYPE VAR : EXPR)' (Java) 762 | sp_before_for_colon = ignore # ignore/add/remove/force 763 | 764 | # Control the spacing in 'extern (C)' (D) 765 | sp_extern_paren = ignore # ignore/add/remove/force 766 | 767 | # Control the space after the opening of a C++ comment '// A' vs '//A' 768 | sp_cmt_cpp_start = force # ignore/add/remove/force 769 | 770 | # Controls the spaces between #else or #endif and a trailing comment 771 | sp_endif_cmt = remove # ignore/add/remove/force 772 | 773 | # Controls the spaces after 'new', 'delete', and 'delete[]' 774 | sp_after_new = force # ignore/add/remove/force 775 | 776 | # Controls the spaces before a trailing or embedded comment 777 | sp_before_tr_emb_cmt = force # ignore/add/remove/force 778 | 779 | # Number of spaces before a trailing or embedded comment 780 | sp_num_before_tr_emb_cmt = 0 # number 781 | 782 | # Control space between a Java annotation and the open paren. 783 | sp_annotation_paren = ignore # ignore/add/remove/force 784 | 785 | # 786 | # Code alignment (not left column spaces/tabs) 787 | # 788 | 789 | # Whether to keep non-indenting tabs 790 | align_keep_tabs = false # false/true 791 | 792 | # Whether to use tabs for aligning 793 | align_with_tabs = false # false/true 794 | 795 | # Whether to bump out to the next tab when aligning 796 | align_on_tabstop = false # false/true 797 | 798 | # Whether to left-align numbers 799 | align_number_left = false # false/true 800 | 801 | # TODO DOC 802 | # Whether to keep whitespace not required for alignment. 803 | align_keep_extra_space = true 804 | 805 | # Align variable definitions in prototypes and functions 806 | align_func_params = false # false/true 807 | 808 | # Align parameters in single-line functions that have the same name. 809 | # The function names must already be aligned with each other. 810 | align_same_func_call_params = false # false/true 811 | 812 | # The span for aligning variable definitions (0=don't align) 813 | align_var_def_span = 0 # number 814 | 815 | # How to align the star in variable definitions. 816 | # 0=Part of the type 'void * foo;' 817 | # 1=Part of the variable 'void *foo;' 818 | # 2=Dangling 'void *foo;' 819 | align_var_def_star_style = 0 # number 820 | 821 | # How to align the '&' in variable definitions. 822 | # 0=Part of the type 823 | # 1=Part of the variable 824 | # 2=Dangling 825 | align_var_def_amp_style = 0 # number 826 | 827 | # The threshold for aligning variable definitions (0=no limit) 828 | align_var_def_thresh = 0 # number 829 | 830 | # The gap for aligning variable definitions 831 | align_var_def_gap = 0 # number 832 | 833 | # Whether to align the colon in struct bit fields 834 | align_var_def_colon = false # false/true 835 | 836 | # Whether to align any attribute after the variable name 837 | align_var_def_attribute = false # false/true 838 | 839 | # Whether to align inline struct/enum/union variable definitions 840 | align_var_def_inline = false # false/true 841 | 842 | # The span for aligning on '=' in assignments (0=don't align) 843 | align_assign_span = 0 # number 844 | 845 | # The threshold for aligning on '=' in assignments (0=no limit) 846 | align_assign_thresh = 0 # number 847 | 848 | # The span for aligning on '=' in enums (0=don't align) 849 | align_enum_equ_span = 0 # number 850 | 851 | # The threshold for aligning on '=' in enums (0=no limit) 852 | align_enum_equ_thresh = 0 # number 853 | 854 | # The span for aligning struct/union (0=don't align) 855 | align_var_struct_span = 0 # number 856 | 857 | # The threshold for aligning struct/union member definitions (0=no limit) 858 | align_var_struct_thresh = 0 # number 859 | 860 | # The gap for aligning struct/union member definitions 861 | align_var_struct_gap = 0 # number 862 | 863 | # The span for aligning struct initializer values (0=don't align) 864 | align_struct_init_span = 0 # number 865 | 866 | # The minimum space between the type and the synonym of a typedef 867 | align_typedef_gap = 0 # number 868 | 869 | # The span for aligning single-line typedefs (0=don't align) 870 | align_typedef_span = 0 # number 871 | 872 | # How to align typedef'd functions with other typedefs 873 | # 0: Don't mix them at all 874 | # 1: align the open paren with the types 875 | # 2: align the function type name with the other type names 876 | align_typedef_func = 0 # number 877 | 878 | # Controls the positioning of the '*' in typedefs. Just try it. 879 | # 0: Align on typedef type, ignore '*' 880 | # 1: The '*' is part of type name: typedef int *pint; 881 | # 2: The '*' is part of the type, but dangling: typedef int *pint; 882 | align_typedef_star_style = 0 # number 883 | 884 | # Controls the positioning of the '&' in typedefs. Just try it. 885 | # 0: Align on typedef type, ignore '&' 886 | # 1: The '&' is part of type name: typedef int &pint; 887 | # 2: The '&' is part of the type, but dangling: typedef int &pint; 888 | align_typedef_amp_style = 0 # number 889 | 890 | # The span for aligning comments that end lines (0=don't align) 891 | align_right_cmt_span = 0 # number 892 | 893 | # If aligning comments, mix with comments after '}' and #endif with less than 3 spaces before the comment 894 | align_right_cmt_mix = false # false/true 895 | 896 | # If a trailing comment is more than this number of columns away from the text it follows, 897 | # it will qualify for being aligned. This has to be > 0 to do anything. 898 | align_right_cmt_gap = 0 # number 899 | 900 | # Align trailing comment at or beyond column N; 'pulls in' comments as a bonus side effect (0=ignore) 901 | align_right_cmt_at_col = 0 # number 902 | 903 | # The span for aligning function prototypes (0=don't align) 904 | align_func_proto_span = 0 # number 905 | 906 | # Minimum gap between the return type and the function name. 907 | align_func_proto_gap = 0 # number 908 | 909 | # Align function protos on the 'operator' keyword instead of what follows 910 | align_on_operator = false # false/true 911 | 912 | # Whether to mix aligning prototype and variable declarations. 913 | # If true, align_var_def_XXX options are used instead of align_func_proto_XXX options. 914 | align_mix_var_proto = false # false/true 915 | 916 | # Align single-line functions with function prototypes, uses align_func_proto_span 917 | align_single_line_func = false # false/true 918 | 919 | # Aligning the open brace of single-line functions. 920 | # Requires align_single_line_func=true, uses align_func_proto_span 921 | align_single_line_brace = false # false/true 922 | 923 | # Gap for align_single_line_brace. 924 | align_single_line_brace_gap = 0 # number 925 | 926 | # The span for aligning ObjC msg spec (0=don't align) 927 | align_oc_msg_spec_span = 0 # number 928 | 929 | # Whether to align macros wrapped with a backslash and a newline. 930 | # This will not work right if the macro contains a multi-line comment. 931 | align_nl_cont = false # false/true 932 | 933 | # # Align macro functions and variables together 934 | align_pp_define_together = false # false/true 935 | 936 | # The minimum space between label and value of a preprocessor define 937 | align_pp_define_gap = 0 # number 938 | 939 | # The span for aligning on '#define' bodies (0=don't align) 940 | align_pp_define_span = 0 # number 941 | 942 | # Align lines that start with '<<' with previous '<<'. Default=true 943 | align_left_shift = true # false/true 944 | 945 | # Span for aligning parameters in an Obj-C message call on the ':' (0=don't align) 946 | align_oc_msg_colon_span = 0 # number 947 | 948 | # If true, always align with the first parameter, even if it is too short. 949 | align_oc_msg_colon_first = false # false/true 950 | 951 | # Aligning parameters in an Obj-C '+' or '-' declaration on the ':' 952 | align_oc_decl_colon = false # false/true 953 | 954 | # 955 | # Newline adding and removing options 956 | # 957 | 958 | # Whether to collapse empty blocks between '{' and '}' 959 | nl_collapse_empty_body = false # false/true 960 | 961 | # Don't split one-line braced assignments - 'foo_t f = { 1, 2 };' 962 | nl_assign_leave_one_liners = true # false/true 963 | 964 | # Don't split one-line braced statements inside a class xx { } body 965 | nl_class_leave_one_liners = false # false/true 966 | 967 | # Don't split one-line enums: 'enum foo { BAR = 15 };' 968 | nl_enum_leave_one_liners = false # false/true 969 | 970 | # Don't split one-line get or set functions 971 | nl_getset_leave_one_liners = false # false/true 972 | 973 | # Don't split one-line function definitions - 'int foo() { return 0; }' 974 | nl_func_leave_one_liners = false # false/true 975 | 976 | # Don't split one-line if/else statements - 'if(a) b++;' 977 | nl_if_leave_one_liners = false # false/true 978 | 979 | # Don't split one-line OC messages 980 | nl_oc_msg_leave_one_liner = false # false/true 981 | 982 | # Add or remove newlines at the start of the file 983 | nl_start_of_file = ignore # ignore/add/remove/force 984 | 985 | # The number of newlines at the start of the file (only used if nl_start_of_file is 'add' or 'force' 986 | nl_start_of_file_min = 0 # number 987 | 988 | # Add or remove newline at the end of the file 989 | nl_end_of_file = ignore # ignore/add/remove/force 990 | 991 | # The number of newlines at the end of the file (only used if nl_end_of_file is 'add' or 'force') 992 | nl_end_of_file_min = 0 # number 993 | 994 | # Add or remove newline between '=' and '{' 995 | nl_assign_brace = ignore # ignore/add/remove/force 996 | 997 | # Add or remove newline between '=' and '[' (D only) 998 | nl_assign_square = ignore # ignore/add/remove/force 999 | 1000 | # Add or remove newline after '= [' (D only). Will also affect the newline before the ']' 1001 | nl_after_square_assign = ignore # ignore/add/remove/force 1002 | 1003 | # The number of blank lines after a block of variable definitions at the top of a function body 1004 | # 0 = No change (default) 1005 | nl_func_var_def_blk = 0 # number 1006 | 1007 | # The number of newlines before a block of typedefs 1008 | # 0 = No change (default) 1009 | nl_typedef_blk_start = 0 # number 1010 | 1011 | # The number of newlines after a block of typedefs 1012 | # 0 = No change (default) 1013 | nl_typedef_blk_end = 0 # number 1014 | 1015 | # The maximum consecutive newlines within a block of typedefs 1016 | # 0 = No change (default) 1017 | nl_typedef_blk_in = 0 # number 1018 | 1019 | # The number of newlines before a block of variable definitions not at the top of a function body 1020 | # 0 = No change (default) 1021 | nl_var_def_blk_start = 0 # number 1022 | 1023 | # The number of newlines after a block of variable definitions not at the top of a function body 1024 | # 0 = No change (default) 1025 | nl_var_def_blk_end = 0 # number 1026 | 1027 | # The maximum consecutive newlines within a block of variable definitions 1028 | # 0 = No change (default) 1029 | nl_var_def_blk_in = 0 # number 1030 | 1031 | # Add or remove newline between a function call's ')' and '{', as in: 1032 | # list_for_each(item, &list) { } 1033 | nl_fcall_brace = ignore # ignore/add/remove/force 1034 | 1035 | # Add or remove newline between 'enum' and '{' 1036 | nl_enum_brace = remove # ignore/add/remove/force 1037 | 1038 | # Add or remove newline between 'struct and '{' 1039 | nl_struct_brace = remove # ignore/add/remove/force 1040 | 1041 | # Add or remove newline between 'union' and '{' 1042 | nl_union_brace = remove # ignore/add/remove/force 1043 | 1044 | # Add or remove newline between 'if' and '{' 1045 | nl_if_brace = remove # ignore/add/remove/force 1046 | 1047 | # Add or remove newline between '}' and 'else' 1048 | nl_brace_else = remove # ignore/add/remove/force 1049 | 1050 | # Add or remove newline between 'else if' and '{' 1051 | # If set to ignore, nl_if_brace is used instead 1052 | nl_elseif_brace = remove # ignore/add/remove/force 1053 | 1054 | # Add or remove newline between 'else' and '{' 1055 | nl_else_brace = remove # ignore/add/remove/force 1056 | 1057 | # Add or remove newline between 'else' and 'if' 1058 | nl_else_if = remove # ignore/add/remove/force 1059 | 1060 | # Add or remove newline between '}' and 'finally' 1061 | nl_brace_finally = remove # ignore/add/remove/force 1062 | 1063 | # Add or remove newline between 'finally' and '{' 1064 | nl_finally_brace = remove # ignore/add/remove/force 1065 | 1066 | # Add or remove newline between 'try' and '{' 1067 | nl_try_brace = remove # ignore/add/remove/force 1068 | 1069 | # Add or remove newline between get/set and '{' 1070 | nl_getset_brace = remove # ignore/add/remove/force 1071 | 1072 | # Add or remove newline between 'for' and '{' 1073 | nl_for_brace = remove # ignore/add/remove/force 1074 | 1075 | # Add or remove newline between 'catch' and '{' 1076 | nl_catch_brace = remove # ignore/add/remove/force 1077 | 1078 | # Add or remove newline between '}' and 'catch' 1079 | nl_brace_catch = remove # ignore/add/remove/force 1080 | 1081 | # Add or remove newline between '}' and ']' 1082 | nl_brace_square = remove # ignore/add/remove/force 1083 | 1084 | # Add or remove newline between '}' and ')' in a function invocation 1085 | nl_brace_fparen = remove # ignore/add/remove/force 1086 | # Add or remove newline between 'while' and '{' 1087 | nl_while_brace = remove # ignore/add/remove/force 1088 | 1089 | # Add or remove newline between 'scope (x)' and '{' (D) 1090 | nl_scope_brace = ignore # ignore/add/remove/force 1091 | 1092 | # Add or remove newline between 'unittest' and '{' (D) 1093 | nl_unittest_brace = ignore # ignore/add/remove/force 1094 | 1095 | # Add or remove newline between 'version (x)' and '{' (D) 1096 | nl_version_brace = ignore # ignore/add/remove/force 1097 | 1098 | # Add or remove newline between 'using' and '{' 1099 | nl_using_brace = remove # ignore/add/remove/force 1100 | 1101 | # Add or remove newline between two open or close braces. 1102 | # Due to general newline/brace handling, REMOVE may not work. 1103 | nl_brace_brace = ignore # ignore/add/remove/force 1104 | 1105 | # Add or remove newline between 'do' and '{' 1106 | nl_do_brace = remove # ignore/add/remove/force 1107 | 1108 | # Add or remove newline between '}' and 'while' of 'do' statement 1109 | nl_brace_while = remove # ignore/add/remove/force 1110 | 1111 | # Add or remove newline between 'switch' and '{' 1112 | nl_switch_brace = remove # ignore/add/remove/force 1113 | 1114 | # Add a newline between ')' and '{' if the ')' is on a different line than the if/for/etc. 1115 | # Overrides nl_for_brace, nl_if_brace, nl_switch_brace, nl_while_switch, and nl_catch_brace. 1116 | nl_multi_line_cond = false # false/true 1117 | 1118 | # Force a newline in a define after the macro name for multi-line defines. 1119 | nl_multi_line_define = false # false/true 1120 | 1121 | # Whether to put a newline before 'case' statement 1122 | nl_before_case = false # false/true 1123 | 1124 | # Add or remove newline between ')' and 'throw' 1125 | nl_before_throw = remove # ignore/add/remove/force 1126 | 1127 | # Whether to put a newline after 'case' statement 1128 | nl_after_case = false # false/true 1129 | 1130 | # Add or remove a newline between a case ':' and '{'. Overrides nl_after_case. 1131 | nl_case_colon_brace = ignore # ignore/add/remove/force 1132 | 1133 | # Newline between namespace and { 1134 | nl_namespace_brace = remove # ignore/add/remove/force 1135 | 1136 | # Add or remove newline between 'template<>' and whatever follows. 1137 | nl_template_class = ignore # ignore/add/remove/force 1138 | 1139 | # Add or remove newline between 'class' and '{' 1140 | nl_class_brace = remove # ignore/add/remove/force 1141 | 1142 | # Add or remove newline after each ',' in the class base list 1143 | nl_class_init_args = remove # ignore/add/remove/force 1144 | # Add or remove newline after each ',' in the constructor member initialization 1145 | nl_class_init_args = remove # ignore/add/remove/force 1146 | 1147 | # Add or remove newline between return type and function name in a function definition 1148 | nl_func_type_name = remove # ignore/add/remove/force 1149 | 1150 | # Add or remove newline between return type and function name inside a class {} 1151 | # Uses nl_func_type_name or nl_func_proto_type_name if set to ignore. 1152 | nl_func_type_name_class = remove # ignore/add/remove/force 1153 | 1154 | # Add or remove newline between function scope and name in a definition 1155 | # Controls the newline after '::' in 'void A::f() { }' 1156 | nl_func_scope_name = ignore # ignore/add/remove/force 1157 | 1158 | # Add or remove newline between return type and function name in a prototype 1159 | nl_func_proto_type_name = remove # ignore/add/remove/force 1160 | 1161 | # Add or remove newline between a function name and the opening '(' 1162 | nl_func_paren = remove # ignore/add/remove/force 1163 | 1164 | # Add or remove newline between a function name and the opening '(' in the definition 1165 | nl_func_def_paren = remove # ignore/add/remove/force 1166 | 1167 | # Add or remove newline after '(' in a function declaration 1168 | nl_func_decl_start = remove # ignore/add/remove/force 1169 | 1170 | # Add or remove newline after '(' in a function definition 1171 | nl_func_def_start = remove # ignore/add/remove/force 1172 | 1173 | # Overrides nl_func_decl_start when there is only one parameter. 1174 | nl_func_decl_start_single = ignore # ignore/add/remove/force 1175 | 1176 | # Overrides nl_func_def_start when there is only one parameter. 1177 | nl_func_def_start_single = ignore # ignore/add/remove/force 1178 | 1179 | # Add or remove newline after each ',' in a function declaration 1180 | nl_func_decl_args = ignore # ignore/add/remove/force 1181 | 1182 | # Add or remove newline after each ',' in a function definition 1183 | nl_func_def_args = ignore # ignore/add/remove/force 1184 | 1185 | # Add or remove newline before the ')' in a function declaration 1186 | nl_func_decl_end = remove # ignore/add/remove/force 1187 | 1188 | # Add or remove newline before the ')' in a function definition 1189 | nl_func_def_end = remove # ignore/add/remove/force 1190 | 1191 | # Overrides nl_func_decl_end when there is only one parameter. 1192 | nl_func_decl_end_single = ignore # ignore/add/remove/force 1193 | 1194 | # Overrides nl_func_def_end when there is only one parameter. 1195 | nl_func_def_end_single = ignore # ignore/add/remove/force 1196 | 1197 | # Add or remove newline between '()' in a function declaration. 1198 | nl_func_decl_empty = remove # ignore/add/remove/force 1199 | 1200 | # Add or remove newline between '()' in a function definition. 1201 | nl_func_def_empty = remove # ignore/add/remove/force 1202 | 1203 | # Whether to put each OC message parameter on a separate line 1204 | # See nl_oc_msg_leave_one_liner 1205 | nl_oc_msg_args = false # false/true 1206 | 1207 | # Add or remove newline between function signature and '{' 1208 | nl_fdef_brace = remove # ignore/add/remove/force 1209 | 1210 | # Add or remove newline between C++11 lambda signature and '{' 1211 | nl_cpp_ldef_brace = ignore # ignore/add/remove/force 1212 | 1213 | # Add or remove a newline between the return keyword and return expression. 1214 | nl_return_expr = remove # ignore/add/remove/force 1215 | 1216 | # Whether to put a newline after semicolons, except in 'for' statements 1217 | nl_after_semicolon = false # false/true 1218 | 1219 | # CARL ?? 1220 | # Whether to put a newline after brace open. 1221 | # This also adds a newline before the matching brace close. 1222 | nl_after_brace_open = false # false/true 1223 | 1224 | # If nl_after_brace_open and nl_after_brace_open_cmt are true, a newline is 1225 | # placed between the open brace and a trailing single-line comment. 1226 | nl_after_brace_open_cmt = false # false/true 1227 | 1228 | # Whether to put a newline after a virtual brace open with a non-empty body. 1229 | # These occur in un-braced if/while/do/for statement bodies. 1230 | nl_after_vbrace_open = false # false/true 1231 | 1232 | # Whether to put a newline after a virtual brace open with an empty body. 1233 | # These occur in un-braced if/while/do/for statement bodies. 1234 | nl_after_vbrace_open_empty = false # false/true 1235 | 1236 | # Whether to put a newline after a brace close. 1237 | # Does not apply if followed by a necessary ';'. 1238 | nl_after_brace_close = false # false/true 1239 | 1240 | # Whether to put a newline after a virtual brace close. 1241 | # Would add a newline before return in: 'if (foo) a++; return;' 1242 | nl_after_vbrace_close = false # false/true 1243 | 1244 | # Control the newline between the close brace and 'b' in: 'struct { int a; } b;' 1245 | # Affects enums, unions, and structures. If set to ignore, uses nl_after_brace_close 1246 | nl_brace_struct_var = ignore # ignore/add/remove/force 1247 | 1248 | # Whether to alter newlines in '#define' macros 1249 | nl_define_macro = false # false/true 1250 | 1251 | # Whether to not put blanks after '#ifxx', '#elxx', or before '#endif' 1252 | nl_squeeze_ifdef = false # false/true 1253 | 1254 | # Add or remove blank line before 'if' 1255 | nl_before_if = ignore # ignore/add/remove/force 1256 | 1257 | # Add or remove blank line after 'if' statement 1258 | nl_after_if = ignore # ignore/add/remove/force 1259 | 1260 | # Add or remove blank line before 'for' 1261 | nl_before_for = ignore # ignore/add/remove/force 1262 | 1263 | # Add or remove blank line after 'for' statement 1264 | nl_after_for = ignore # ignore/add/remove/force 1265 | 1266 | # Add or remove blank line before 'while' 1267 | nl_before_while = ignore # ignore/add/remove/force 1268 | 1269 | # Add or remove blank line after 'while' statement 1270 | nl_after_while = ignore # ignore/add/remove/force 1271 | 1272 | # Add or remove blank line before 'switch' 1273 | nl_before_switch = ignore # ignore/add/remove/force 1274 | 1275 | # Add or remove blank line after 'switch' statement 1276 | nl_after_switch = ignore # ignore/add/remove/force 1277 | 1278 | # Add or remove blank line before 'do' 1279 | nl_before_do = ignore # ignore/add/remove/force 1280 | 1281 | # Add or remove blank line after 'do/while' statement 1282 | nl_after_do = ignore # ignore/add/remove/force 1283 | 1284 | # Whether to double-space commented-entries in struct/enum 1285 | nl_ds_struct_enum_cmt = false # false/true 1286 | 1287 | # Whether to double-space before the close brace of a struct/union/enum 1288 | # (lower priority than 'eat_blanks_before_close_brace') 1289 | nl_ds_struct_enum_close_brace = false # false/true 1290 | 1291 | # Add or remove a newline around a class colon. 1292 | # Related to pos_class_colon, nl_class_init_args, and pos_comma. 1293 | nl_class_colon = ignore # ignore/add/remove/force 1294 | 1295 | # Add or remove a newline around a class constructor colon. 1296 | # Related to pos_constr_colon, nl_constr_init_args, and pos_constr_comma. 1297 | nl_constr_colon = ignore # ignore/add/remove/force 1298 | 1299 | 1300 | # Change simple unbraced if statements into a one-liner 1301 | # 'if(b)\n i++;' => 'if(b) i++;' 1302 | nl_create_if_one_liner = false # false/true 1303 | 1304 | # Change simple unbraced for statements into a one-liner 1305 | # 'for (i=0;i<5;i++)\n foo(i);' => 'for (i=0;i<5;i++) foo(i);' 1306 | nl_create_for_one_liner = false # false/true 1307 | 1308 | # Change simple unbraced while statements into a one-liner 1309 | # 'while (i<5)\n foo(i++);' => 'while (i<5) foo(i++);' 1310 | nl_create_while_one_liner = false # false/true 1311 | 1312 | # 1313 | # Positioning options 1314 | # 1315 | 1316 | # The position of arithmetic operators in wrapped expressions 1317 | pos_arith = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force 1318 | 1319 | # The position of assignment in wrapped expressions. 1320 | # Do not affect '=' followed by '{' 1321 | pos_assign = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force 1322 | 1323 | # The position of boolean operators in wrapped expressions 1324 | pos_bool = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force 1325 | 1326 | # The position of comparison operators in wrapped expressions 1327 | pos_compare = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force 1328 | 1329 | # The position of conditional (b ? t : f) operators in wrapped expressions 1330 | pos_conditional = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force 1331 | 1332 | # The position of the comma in wrapped expressions 1333 | pos_comma = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force 1334 | 1335 | # The position of the comma in the class base list 1336 | pos_class_comma = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force 1337 | 1338 | # The position of the comma in the constructor initialization list 1339 | pos_constr_comma = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force 1340 | 1341 | # The position of colons between class and base class list 1342 | pos_class_colon = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force 1343 | 1344 | # The position of colons between constructor and member initialization 1345 | pos_constr_colon = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force 1346 | 1347 | # 1348 | # Line Splitting options 1349 | # 1350 | 1351 | # Try to limit code width to N number of columns 1352 | code_width = 0 # number 1353 | 1354 | # Whether to fully split long 'for' statements at semi-colons 1355 | ls_for_split_full = false # false/true 1356 | 1357 | # Whether to fully split long function protos/calls at commas 1358 | ls_func_split_full = false # false/true 1359 | 1360 | # Whether to split lines as close to code_width as possible and ignore some groupings 1361 | ls_code_width = false # false/true 1362 | 1363 | # 1364 | # Blank line options 1365 | # 1366 | 1367 | # The maximum consecutive newlines 1368 | nl_max = 0 # number 1369 | 1370 | # The number of newlines after a function prototype, if followed by another function prototype 1371 | nl_after_func_proto = 0 # number 1372 | 1373 | # The number of newlines after a function prototype, if not followed by another function prototype 1374 | nl_after_func_proto_group = 2 # number 1375 | 1376 | # The number of newlines after '}' of a multi-line function body 1377 | nl_after_func_body = 2 # number 1378 | 1379 | # The number of newlines after '}' of a multi-line function body in a class declaration 1380 | nl_after_func_body_class = 2 # number 1381 | 1382 | # The number of newlines after '}' of a single line function body 1383 | nl_after_func_body_one_liner = 0 # number 1384 | 1385 | # The minimum number of newlines before a multi-line comment. 1386 | # Doesn't apply if after a brace open or another multi-line comment. 1387 | nl_before_block_comment = 0 # number 1388 | 1389 | # The minimum number of newlines before a single-line C comment. 1390 | # Doesn't apply if after a brace open or other single-line C comments. 1391 | nl_before_c_comment = 0 # number 1392 | 1393 | # The minimum number of newlines before a CPP comment. 1394 | # Doesn't apply if after a brace open or other CPP comments. 1395 | nl_before_cpp_comment = 0 # number 1396 | 1397 | # Whether to force a newline after a multi-line comment. 1398 | nl_after_multiline_comment = false # false/true 1399 | 1400 | # The number of newlines after '}' or ';' of a struct/enum/union definition 1401 | nl_after_struct = 0 # number 1402 | 1403 | # The number of newlines after '}' or ';' of a class definition 1404 | nl_after_class = 0 # number 1405 | 1406 | # The number of newlines before a 'private:', 'public:', 'protected:', 'signals:', or 'slots:' label. 1407 | # Will not change the newline count if after a brace open. 1408 | # 0 = No change. 1409 | nl_before_access_spec = 0 # number 1410 | 1411 | # The number of newlines after a 'private:', 'public:', 'protected:', 'signals:', or 'slots:' label. 1412 | # 0 = No change. 1413 | nl_after_access_spec = 0 # number 1414 | 1415 | # The number of newlines between a function def and the function comment. 1416 | # 0 = No change. 1417 | nl_comment_func_def = 0 # number 1418 | 1419 | # The number of newlines after a try-catch-finally block that isn't followed by a brace close. 1420 | # 0 = No change. 1421 | nl_after_try_catch_finally = 0 # number 1422 | 1423 | # The number of newlines before and after a property, indexer or event decl. 1424 | # 0 = No change. 1425 | nl_around_cs_property = 0 # number 1426 | 1427 | # The number of newlines between the get/set/add/remove handlers in C#. 1428 | # 0 = No change. 1429 | nl_between_get_set = 0 # number 1430 | 1431 | # Add or remove newline between C# property and the '{' 1432 | nl_property_brace = ignore # ignore/add/remove/force 1433 | 1434 | # Whether to remove blank lines after '{' 1435 | eat_blanks_after_open_brace = false # false/true 1436 | 1437 | # Whether to remove blank lines before '}' 1438 | eat_blanks_before_close_brace = true # false/true 1439 | 1440 | # How aggressively to remove extra newlines not in preproc. 1441 | # 0: No change 1442 | # 1: Remove most newlines not handled by other config 1443 | # 2: Remove all newlines and reformat completely by config 1444 | nl_remove_extra_newlines = 0 # number 1445 | 1446 | # Whether to put a blank line before 'return' statements, unless after an open brace. 1447 | nl_before_return = false # false/true 1448 | 1449 | # Whether to put a blank line after 'return' statements, unless followed by a close brace. 1450 | nl_after_return = false # false/true 1451 | 1452 | # Whether to put a newline after a Java annotation statement. 1453 | # Only affects annotations that are after a newline. 1454 | nl_after_annotation = ignore # ignore/add/remove/force 1455 | 1456 | # Controls the newline between two annotations. 1457 | nl_between_annotation = ignore # ignore/add/remove/force 1458 | 1459 | # 1460 | # Code modifying options (non-whitespace) 1461 | # 1462 | 1463 | # Add or remove braces on single-line 'do' statement 1464 | mod_full_brace_do = ignore # ignore/add/remove/force 1465 | 1466 | # Add or remove braces on single-line 'for' statement 1467 | mod_full_brace_for = ignore # ignore/add/remove/force 1468 | 1469 | # Add or remove braces on single-line function definitions. (Pawn) 1470 | mod_full_brace_function = ignore # ignore/add/remove/force 1471 | 1472 | # Add or remove braces on single-line 'if' statement. Will not remove the braces if they contain an 'else'. 1473 | mod_full_brace_if = ignore # ignore/add/remove/force 1474 | 1475 | # Make all if/elseif/else statements in a chain be braced or not. Overrides mod_full_brace_if. 1476 | # If any must be braced, they are all braced. If all can be unbraced, then the braces are removed. 1477 | mod_full_brace_if_chain = false # false/true 1478 | 1479 | # Don't remove braces around statements that span N newlines 1480 | mod_full_brace_nl = 0 # number 1481 | 1482 | # Add or remove braces on single-line 'while' statement 1483 | mod_full_brace_while = ignore # ignore/add/remove/force 1484 | 1485 | # Add or remove braces on single-line 'using ()' statement 1486 | mod_full_brace_using = ignore # ignore/add/remove/force 1487 | 1488 | # Add or remove unnecessary paren on 'return' statement 1489 | mod_paren_on_return = ignore # ignore/add/remove/force 1490 | 1491 | # Whether to change optional semicolons to real semicolons 1492 | mod_pawn_semicolon = false # false/true 1493 | 1494 | # Add parens on 'while' and 'if' statement around bools 1495 | mod_full_paren_if_bool = false # false/true 1496 | 1497 | # Whether to remove superfluous semicolons 1498 | mod_remove_extra_semicolon = false # false/true 1499 | 1500 | # If a function body exceeds the specified number of newlines and doesn't have a comment after 1501 | # the close brace, a comment will be added. 1502 | mod_add_long_function_closebrace_comment = 0 # number 1503 | 1504 | # If a namespace body exceeds the specified number of newlines and doesn't have a comment after 1505 | # the close brace, a comment will be added. 1506 | mod_add_long_namespace_closebrace_comment = 0 # number 1507 | # If a switch body exceeds the specified number of newlines and doesn't have a comment after 1508 | # the close brace, a comment will be added. 1509 | mod_add_long_switch_closebrace_comment = 0 # number 1510 | 1511 | # If an #ifdef body exceeds the specified number of newlines and doesn't have a comment after 1512 | # the #endif, a comment will be added. 1513 | mod_add_long_ifdef_endif_comment = 0 # number 1514 | 1515 | # If an #ifdef or #else body exceeds the specified number of newlines and doesn't have a comment after 1516 | # the #else, a comment will be added. 1517 | mod_add_long_ifdef_else_comment = 0 # number 1518 | 1519 | # If TRUE, will sort consecutive single-line 'import' statements [Java, D] 1520 | mod_sort_import = false # false/true 1521 | 1522 | # If TRUE, will sort consecutive single-line 'using' statements [C#] 1523 | mod_sort_using = false # false/true 1524 | 1525 | # If TRUE, will sort consecutive single-line '#include' statements [C/C++] and '#import' statements [Obj-C] 1526 | # This is generally a bad idea, as it may break your code. 1527 | mod_sort_include = false # false/true 1528 | 1529 | # If TRUE, it will move a 'break' that appears after a fully braced 'case' before the close brace. 1530 | mod_move_case_break = false # false/true 1531 | 1532 | # Will add or remove the braces around a fully braced case statement. 1533 | # Will only remove the braces if there are no variable declarations in the block. 1534 | mod_case_brace = ignore # ignore/add/remove/force 1535 | 1536 | # If TRUE, it will remove a void 'return;' that appears as the last statement in a function. 1537 | mod_remove_empty_return = false # false/true 1538 | 1539 | # 1540 | # Comment modifications 1541 | # 1542 | 1543 | # Try to wrap comments at cmt_width columns 1544 | cmt_width = 0 # number 1545 | 1546 | # Set the comment reflow mode (default: 0) 1547 | # 0: no reflowing (apart from the line wrapping due to cmt_width) 1548 | # 1: no touching at all 1549 | # 2: full reflow 1550 | cmt_reflow_mode = 0 # number 1551 | 1552 | # If false, disable all multi-line comment changes, including cmt_width. keyword substitution, and leading chars. 1553 | # Default is true. 1554 | cmt_indent_multi = true # false/true 1555 | 1556 | # Whether to group c-comments that look like they are in a block 1557 | cmt_c_group = false # false/true 1558 | 1559 | # Whether to put an empty '/*' on the first line of the combined c-comment 1560 | cmt_c_nl_start = false # false/true 1561 | 1562 | # Whether to put a newline before the closing '*/' of the combined c-comment 1563 | cmt_c_nl_end = false # false/true 1564 | 1565 | # Whether to group cpp-comments that look like they are in a block 1566 | cmt_cpp_group = false # false/true 1567 | 1568 | # Whether to put an empty '/*' on the first line of the combined cpp-comment 1569 | cmt_cpp_nl_start = false # false/true 1570 | 1571 | # Whether to put a newline before the closing '*/' of the combined cpp-comment 1572 | cmt_cpp_nl_end = false # false/true 1573 | 1574 | # Whether to change cpp-comments into c-comments 1575 | cmt_cpp_to_c = false # false/true 1576 | 1577 | # Whether to put a star on subsequent comment lines 1578 | cmt_star_cont = false # false/true 1579 | 1580 | # The number of spaces to insert at the start of subsequent comment lines 1581 | cmt_sp_before_star_cont = 0 # number 1582 | 1583 | # The number of spaces to insert after the star on subsequent comment lines 1584 | cmt_sp_after_star_cont = 0 # number 1585 | 1586 | # For multi-line comments with a '*' lead, remove leading spaces if the first and last lines of 1587 | # the comment are the same length. Default=True 1588 | cmt_multi_check_last = true # false/true 1589 | 1590 | # The filename that contains text to insert at the head of a file if the file doesn't start with a C/C++ comment. 1591 | # Will substitute $(filename) with the current file's name. 1592 | cmt_insert_file_header = "" # string 1593 | 1594 | # The filename that contains text to insert at the end of a file if the file doesn't end with a C/C++ comment. 1595 | # Will substitute $(filename) with the current file's name. 1596 | cmt_insert_file_footer = "" # string 1597 | 1598 | # The filename that contains text to insert before a function implementation if the function isn't preceded with a C/C++ comment. 1599 | # Will substitute $(function) with the function name and $(javaparam) with the javadoc @param and @return stuff. 1600 | # Will also substitute $(fclass) with the class name: void CFoo::Bar() { ... } 1601 | cmt_insert_func_header = "" # string 1602 | 1603 | # The filename that contains text to insert before a class if the class isn't preceded with a C/C++ comment. 1604 | # Will substitute $(class) with the class name. 1605 | cmt_insert_class_header = "" # string 1606 | 1607 | # The filename that contains text to insert before a Obj-C message specification if the method isn't preceeded with a C/C++ comment. 1608 | # Will substitute $(message) with the function name and $(javaparam) with the javadoc @param and @return stuff. 1609 | cmt_insert_oc_msg_header = "" # string 1610 | 1611 | # If a preprocessor is encountered when stepping backwards from a function name, then 1612 | # this option decides whether the comment should be inserted. 1613 | # Affects cmt_insert_oc_msg_header, cmt_insert_func_header and cmt_insert_class_header. 1614 | cmt_insert_before_preproc = false # false/true 1615 | 1616 | # 1617 | # Preprocessor options 1618 | # 1619 | 1620 | # Control indent of preprocessors inside #if blocks at brace level 0 1621 | pp_indent = ignore # ignore/add/remove/force 1622 | 1623 | # Whether to indent #if/#else/#endif at the brace level (true) or from column 1 (false) 1624 | pp_indent_at_level = false # false/true 1625 | 1626 | # If pp_indent_at_level=false, specifies the number of columns to indent per level. Default=1. 1627 | pp_indent_count = 1 # number 1628 | 1629 | # Add or remove space after # based on pp_level of #if blocks 1630 | pp_space = ignore # ignore/add/remove/force 1631 | 1632 | # Sets the number of spaces added with pp_space 1633 | pp_space_count = 0 # number 1634 | 1635 | # The indent for #region and #endregion in C# and '#pragma region' in C/C++ 1636 | pp_indent_region = 0 # number 1637 | 1638 | # Whether to indent the code between #region and #endregion 1639 | pp_region_indent_code = false # false/true 1640 | 1641 | # If pp_indent_at_level=true, sets the indent for #if, #else, and #endif when not at file-level 1642 | pp_indent_if = 0 # number 1643 | 1644 | # Control whether to indent the code between #if, #else and #endif when not at file-level 1645 | pp_if_indent_code = false # false/true 1646 | 1647 | # Whether to indent '#define' at the brace level (true) or from column 1 (false) 1648 | pp_define_at_level = false # false/true 1649 | 1650 | --------------------------------------------------------------------------------