├── .codespellignore ├── .editorconfig ├── .github ├── CODEOWNERS ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── PULL_REQUEST_TEMPLATE.md ├── bors.toml ├── dependabot.yml ├── mergify.yml └── workflows │ ├── cd.yml │ └── ci.yml ├── .gitignore ├── CHANGELOG.md ├── CNAME ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Cargo.lock ├── Cargo.toml ├── LICENSE-APACHE ├── LICENSE-MIT ├── README.md ├── RELEASE.md ├── SECURITY.md ├── assets ├── runst-demo.gif ├── runst-demo2.gif └── runst-logo.png ├── build.rs ├── cliff.toml ├── committed.toml ├── config └── runst.toml ├── dbus └── introspection.xml ├── deny.toml ├── release.sh └── src ├── config.rs ├── dbus.rs ├── error.rs ├── lib.rs ├── main.rs ├── notification.rs └── x11.rs /.codespellignore: -------------------------------------------------------------------------------- 1 | crate 2 | ser 3 | nd 4 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # https://editorconfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | [*.rs] 7 | indent_style = space 8 | indent_size = 4 9 | 10 | [*.yml] 11 | indent_style = space 12 | indent_size = 2 13 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/about-codeowners/ 2 | # for more info about CODEOWNERS file 3 | 4 | # It uses the same pattern rule for gitignore file 5 | # https://git-scm.com/docs/gitignore#_pattern_format 6 | 7 | # Core 8 | * @orhun 9 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: orhun 2 | patreon: orhunp 3 | buy_me_a_coffee: orhun 4 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Report a bug to help us improve 4 | title: "" 5 | labels: "bug" 6 | assignees: "orhun" 7 | --- 8 | 9 | **Describe the bug** 10 | 11 | 12 | 13 | **To reproduce** 14 | 15 | 21 | 22 | **Expected behavior** 23 | 24 | 25 | 26 | **Screenshots / Logs** 27 | 28 | 29 | 30 | **Software information** 31 | 32 | 33 | 34 | - Operating system: 35 | - Rust version: 36 | - Project version: 37 | 38 | **Additional context** 39 | 40 | 41 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Make a suggestion for the project 4 | title: "" 5 | labels: "enhancement" 6 | assignees: "orhun" 7 | --- 8 | 9 | **Is your feature request related to a problem? Please describe.** 10 | 11 | 12 | 13 | **Describe the solution you'd like** 14 | 15 | 16 | 17 | **Describe alternatives you've considered** 18 | 19 | 20 | 21 | **Additional context** 22 | 23 | 24 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Description 2 | 3 | 4 | 5 | ## Motivation and Context 6 | 7 | 8 | 9 | 10 | ## How Has This Been Tested? 11 | 12 | 13 | 14 | 15 | 16 | ## Screenshots / Logs (if applicable) 17 | 18 | ## Types of Changes 19 | 20 | 21 | 22 | - [ ] Bug fix (non-breaking change which fixes an issue) 23 | - [ ] New feature (non-breaking change which adds functionality) 24 | - [ ] Breaking change (fix or feature that would cause existing functionality to change) 25 | - [ ] Documentation (no code change) 26 | - [ ] Refactor (refactoring production code) 27 | - [ ] Other 28 | 29 | ## Checklist: 30 | 31 | 32 | 33 | - [ ] My code follows the code style of this project. 34 | - [ ] I have updated the documentation accordingly. 35 | - [ ] I have formatted the code with [rustfmt](https://github.com/rust-lang/rustfmt). 36 | - [ ] I checked the lints with [clippy](https://github.com/rust-lang/rust-clippy). 37 | - [ ] I have added tests to cover my changes. 38 | - [ ] All new and existing tests passed. 39 | -------------------------------------------------------------------------------- /.github/bors.toml: -------------------------------------------------------------------------------- 1 | status = [ 2 | "Build", 3 | "Lint", 4 | ] 5 | required_approvals = 1 6 | up_to_date_approvals = true 7 | delete_merged_branches = true 8 | update_base_for_deletes = true 9 | use_codeowners = true 10 | cut_body_after = "
" 11 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | # Maintain dependencies for Cargo 4 | - package-ecosystem: cargo 5 | directory: "/" 6 | schedule: 7 | interval: daily 8 | open-pull-requests-limit: 10 9 | 10 | # Maintain dependencies for GitHub Actions 11 | - package-ecosystem: github-actions 12 | directory: "/" 13 | schedule: 14 | interval: daily 15 | open-pull-requests-limit: 10 16 | -------------------------------------------------------------------------------- /.github/mergify.yml: -------------------------------------------------------------------------------- 1 | pull_request_rules: 2 | - name: Automatic merge for Dependabot pull requests 3 | conditions: 4 | - author=dependabot[bot] 5 | actions: 6 | merge: 7 | method: squash 8 | 9 | - name: Automatic update to the main branch for pull requests 10 | conditions: 11 | - -conflict # skip PRs with conflicts 12 | - -draft # skip GH draft PRs 13 | - -author=dependabot[bot] # skip dependabot PRs 14 | actions: 15 | update: 16 | -------------------------------------------------------------------------------- /.github/workflows/cd.yml: -------------------------------------------------------------------------------- 1 | name: Continuous Deployment 2 | 3 | on: 4 | push: 5 | tags: 6 | - "v*.*.*" 7 | 8 | jobs: 9 | changelog: 10 | name: Generate changelog 11 | runs-on: ubuntu-latest 12 | outputs: 13 | release_body: ${{ steps.git-cliff.outputs.content }} 14 | steps: 15 | - name: Checkout 16 | uses: actions/checkout@v4 17 | with: 18 | fetch-depth: 0 19 | 20 | - name: Generate a changelog 21 | uses: orhun/git-cliff-action@v4 22 | id: git-cliff 23 | with: 24 | config: cliff.toml 25 | args: --latest --strip header 26 | 27 | publish-github: 28 | name: Publish on GitHub 29 | needs: changelog 30 | runs-on: ubuntu-20.04 31 | strategy: 32 | fail-fast: false 33 | matrix: 34 | TARGET: [x86_64-unknown-linux-gnu] 35 | steps: 36 | - name: Checkout the repository 37 | uses: actions/checkout@v4 38 | 39 | - name: Set the release version 40 | run: echo "RELEASE_VERSION=${GITHUB_REF:11}" >> $GITHUB_ENV 41 | 42 | - name: Install dependencies 43 | run: | 44 | sudo apt-get update 45 | sudo apt-get install -y \ 46 | --no-install-recommends \ 47 | --allow-unauthenticated \ 48 | libdbus-1-dev \ 49 | libglib2.0-dev \ 50 | libpango1.0-dev \ 51 | pkg-config 52 | 53 | - name: Install Rust toolchain 54 | uses: actions-rs/toolchain@v1 55 | with: 56 | toolchain: stable 57 | target: ${{matrix.TARGET}} 58 | override: true 59 | 60 | - name: Build 61 | run: cargo build --release --locked --target ${{matrix.TARGET}} 62 | 63 | - name: Prepare release assets 64 | run: | 65 | mkdir release/ 66 | cp {LICENSE-*,README.md,CHANGELOG.md} release/ 67 | cp target/${{matrix.TARGET}}/release/runst release/ 68 | mv release/ runst-${{env.RELEASE_VERSION}}/ 69 | 70 | - name: Create release artifacts 71 | run: | 72 | tar -czvf runst-${{env.RELEASE_VERSION}}-${{matrix.TARGET}}.tar.gz \ 73 | runst-${{env.RELEASE_VERSION}}/ 74 | sha512sum runst-${{env.RELEASE_VERSION}}-${{matrix.TARGET}}.tar.gz \ 75 | > runst-${{env.RELEASE_VERSION}}-${{matrix.TARGET}}.tar.gz.sha512 76 | 77 | - name: Sign the release 78 | run: | 79 | echo "${{secrets.GPG_RELEASE_KEY}}" | base64 --decode > private.key 80 | echo "${{secrets.GPG_PASSPHRASE}}" | gpg --pinentry-mode=loopback \ 81 | --passphrase-fd 0 --import private.key 82 | echo "${{secrets.GPG_PASSPHRASE}}" | gpg --pinentry-mode=loopback \ 83 | --passphrase-fd 0 --detach-sign \ 84 | runst-${{env.RELEASE_VERSION}}-${{matrix.TARGET}}.tar.gz 85 | 86 | - name: Upload the binary releases 87 | uses: svenstaro/upload-release-action@v2 88 | with: 89 | file: runst-${{env.RELEASE_VERSION}}-${{matrix.TARGET}}* 90 | file_glob: true 91 | overwrite: true 92 | tag: ${{ github.ref }} 93 | body: ${{ needs.changelog.outputs.release_body }} 94 | repo_token: ${{ secrets.GITHUB_TOKEN }} 95 | 96 | publish-crates-io: 97 | name: Publish on crates.io 98 | runs-on: ubuntu-20.04 99 | steps: 100 | - name: Checkout the repository 101 | uses: actions/checkout@v4 102 | 103 | - name: Install dependencies 104 | run: | 105 | sudo apt-get update 106 | sudo apt-get install -y \ 107 | --no-install-recommends \ 108 | --allow-unauthenticated \ 109 | libdbus-1-dev \ 110 | libglib2.0-dev \ 111 | libpango1.0-dev \ 112 | pkg-config 113 | 114 | - name: Install Rust toolchain 115 | uses: actions-rs/toolchain@v1 116 | with: 117 | toolchain: stable 118 | target: x86_64-unknown-linux-gnu 119 | override: true 120 | 121 | - name: Publish 122 | run: cargo publish --locked --token ${{ secrets.CARGO_TOKEN }} 123 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: Continuous Integration 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | - staging # for bors 8 | - trying # for bors 9 | pull_request: 10 | branches: 11 | - main 12 | schedule: 13 | - cron: "0 0 * * 0" 14 | 15 | jobs: 16 | build: 17 | name: Build 18 | runs-on: ubuntu-20.04 19 | steps: 20 | - name: Checkout the repository 21 | uses: actions/checkout@v4 22 | 23 | - name: Install dependencies 24 | run: | 25 | sudo apt-get update 26 | sudo apt-get install -y \ 27 | --no-install-recommends \ 28 | --allow-unauthenticated \ 29 | libdbus-1-dev \ 30 | libglib2.0-dev \ 31 | libpango1.0-dev \ 32 | pkg-config 33 | 34 | - name: Install Rust toolchain 35 | uses: actions-rs/toolchain@v1 36 | with: 37 | profile: minimal 38 | toolchain: stable 39 | override: true 40 | 41 | - name: Cache Cargo dependencies 42 | uses: Swatinem/rust-cache@v2 43 | 44 | - name: Build the project 45 | uses: actions-rs/cargo@v1 46 | with: 47 | command: check 48 | args: --locked --verbose 49 | 50 | lint: 51 | name: Lint 52 | runs-on: ubuntu-latest 53 | steps: 54 | - name: Checkout the repository 55 | uses: actions/checkout@v4 56 | 57 | - name: Install dependencies 58 | run: | 59 | sudo apt-get update 60 | sudo apt-get install -y \ 61 | --no-install-recommends \ 62 | --allow-unauthenticated \ 63 | libdbus-1-dev \ 64 | libglib2.0-dev \ 65 | libpango1.0-dev \ 66 | pkg-config 67 | 68 | - name: Install Rust 69 | uses: actions-rs/toolchain@v1 70 | with: 71 | profile: minimal 72 | toolchain: stable 73 | override: true 74 | components: rustfmt, clippy 75 | 76 | - name: Check formatting 77 | uses: actions-rs/cargo@v1 78 | with: 79 | command: fmt 80 | args: --all -- --check 81 | 82 | - name: Run clippy 83 | uses: actions-rs/cargo@v1 84 | with: 85 | command: clippy 86 | args: -- -D warnings 87 | 88 | - name: Run cargo-deny 89 | uses: EmbarkStudios/cargo-deny-action@v2 90 | with: 91 | command: check licenses sources 92 | 93 | - name: Run cargo-audit 94 | uses: actions-rs/audit-check@v1 95 | with: 96 | token: ${{ secrets.GITHUB_TOKEN }} 97 | 98 | - name: Run committed 99 | uses: crate-ci/committed@master 100 | with: 101 | args: "-vv" 102 | commits: "HEAD" 103 | 104 | - name: Run lychee 105 | uses: lycheeverse/lychee-action@v2 106 | with: 107 | args: -v *.md 108 | env: 109 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 110 | 111 | - name: Run codespell 112 | uses: codespell-project/actions-codespell@master 113 | with: 114 | check_filenames: true 115 | check_hidden: true 116 | ignore_words_file: .codespellignore 117 | skip: target,.git 118 | 119 | - name: Run cargo-msrv 120 | shell: bash 121 | run: | 122 | curl -s 'https://api.github.com/repos/foresterre/cargo-msrv/releases' | \ 123 | jq -r "[.[] | select(.prerelease == false)][0].assets[] | \ 124 | select(.name | ascii_downcase | test(\"linux.*x86_64|x86_64.*linux\")).browser_download_url" | \ 125 | wget -qi - 126 | tar -xvf cargo-msrv*.tar* -C ~/.cargo/bin/ cargo-msrv 127 | printf "%s" "Checking MSRV for $package..." 128 | cargo msrv --output-format json verify | tail -n 1 | jq --exit-status '.success' 129 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled files and executables 2 | /target/ 3 | 4 | # Backup files generated by rustfmt 5 | **/*.rs.bk 6 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. 4 | 5 | ## [0.1.7] - 2024-03-26 6 | 7 | ### ⚙️ Miscellaneous Tasks 8 | 9 | - *(github)* Update funding options 10 | - *(project)* Update license copyright years 11 | 12 | ## [0.1.6] - 2024-03-26 13 | 14 | ### ⚙️ Miscellaneous Tasks 15 | 16 | - *(mergify)* Add mergify config for automatic merges 17 | 18 | ## [0.1.5] - 2023-08-09 19 | 20 | ### 🐛 Bug Fixes 21 | 22 | - *(dbus)* Fail if cannot be primary notification server ([#107](https://github.com/orhun/runst/issues/107)) 23 | 24 | ### 📚 Documentation 25 | 26 | - *(readme)* Add instructions for installing on Alpine Linux 27 | - *(readme)* Update broken Arch Linux link 28 | 29 | ### 🎨 Styling 30 | 31 | - *(format)* Apply formatting to the project manifest 32 | 33 | ### ⚙️ Miscellaneous Tasks 34 | 35 | - *(changelog)* Skip the dependency bump entries 36 | - *(ci)* Integrate more tools for linting 37 | - *(crate)* Bump MSRV to 1.70.0 38 | - *(lint)* Apply workaround for codespell warnings 39 | 40 | ## [0.1.4] - 2023-06-10 41 | 42 | ### 📚 Documentation 43 | 44 | - *(readme)* Update installation instructions for Arch Linux 45 | 46 | ### ⚙️ Miscellaneous Tasks 47 | 48 | - *(deps)* Downgrade tracing crate 49 | - *(github)* Check dependabot updates daily 50 | 51 | ## [0.1.3] - 2023-03-13 52 | 53 | ### 🐛 Bug Fixes 54 | 55 | - *(typo)* Fix typo in security policy 56 | 57 | ### 🚜 Refactor 58 | 59 | - *(cd)* Remove GitHub release requirement from crates.io step 60 | - *(readme)* Use HTML badges 61 | 62 | ### 📚 Documentation 63 | 64 | - *(readme)* Add badges 65 | 66 | ### ⚙️ Miscellaneous Tasks 67 | 68 | - *(github)* Add custom domain for GitHub pages 69 | 70 | ## [0.1.1] - 2023-03-05 71 | 72 | ### 📚 Documentation 73 | 74 | - *(github)* Add Code Of Conduct 75 | - *(github)* Add pull request template 76 | - *(github)* Add issue templates 77 | - *(github)* Add contribution guidelines 78 | - *(github)* Add security policy 79 | - *(readme)* Add AUR instructions 80 | 81 | ### ⚙️ Miscellaneous Tasks 82 | 83 | - *(github)* Enable sponsorships 84 | 85 | ## [0.1.0] - 2023-03-05 86 | 87 | ### 🚀 Features 88 | 89 | - *(x11)* Add `wrap_content` option 90 | 91 | ### 📚 Documentation 92 | 93 | - *(project)* Update emojis in the description 94 | - *(readme)* Add ctl usage example 95 | - *(readme)* Update logo link 96 | 97 | ### 🎨 Styling 98 | 99 | - *(assets)* Update demo recordings 100 | - *(assets)* Update project logo 101 | - *(notification)* Update the startup message 102 | - *(readme)* Use HTML for the project header 103 | - *(readme)* Update the emoji in README.md 104 | 105 | ### ⚙️ Miscellaneous Tasks 106 | 107 | - *(assets)* Remove unnecessary asset 108 | - *(config)* Update default config 109 | - *(github)* Add Jekyll theme 110 | - *(github)* Remove Jekyll theme 111 | 112 | ## [0.1.0-rc.2] - 2023-03-02 113 | 114 | ### 📚 Documentation 115 | 116 | - *(readme)* Update minimum supported Rust version to 1.64.0 117 | 118 | ### ⚙️ Miscellaneous Tasks 119 | 120 | - *(release)* Update git-cliff config 121 | - *(release)* Remove empty lines from the tag message 122 | 123 | 124 | -------------------------------------------------------------------------------- /CNAME: -------------------------------------------------------------------------------- 1 | runst.cli.rs 2 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in our 6 | community a harassment-free experience for everyone, regardless of age, body 7 | size, visible or invisible disability, ethnicity, sex characteristics, gender 8 | identity and expression, level of experience, education, socioeconomic status, 9 | nationality, personal appearance, race, religion, or sexual identity 10 | and orientation. 11 | 12 | We pledge to act and interact in ways that contribute to an open, welcoming, 13 | diverse, inclusive, and healthy community. 14 | 15 | ## Our Standards 16 | 17 | Examples of behavior that contributes to a positive environment for our 18 | community include: 19 | 20 | - Demonstrating empathy and kindness toward other people 21 | - Being respectful of differing opinions, viewpoints, and experiences 22 | - Giving and gracefully accepting constructive feedback 23 | - Accepting responsibility and apologizing to those affected by our mistakes, 24 | and learning from the experience 25 | - Focusing on what is best not just for us as individuals, but for the 26 | overall community 27 | 28 | Examples of unacceptable behavior include: 29 | 30 | - The use of sexualized language or imagery, and sexual attention or 31 | advances of any kind 32 | - Trolling, insulting or derogatory comments, and personal or political attacks 33 | - Public or private harassment 34 | - Publishing others' private information, such as a physical or email 35 | address, without their explicit permission 36 | - Other conduct which could reasonably be considered inappropriate in a 37 | professional setting 38 | 39 | ## Enforcement Responsibilities 40 | 41 | Community leaders are responsible for clarifying and enforcing our standards of 42 | acceptable behavior and will take appropriate and fair corrective action in 43 | response to any behavior that they deem inappropriate, threatening, offensive, 44 | or harmful. 45 | 46 | Community leaders have the right and responsibility to remove, edit, or reject 47 | comments, commits, code, wiki edits, issues, and other contributions that are 48 | not aligned to this Code of Conduct, and will communicate reasons for moderation 49 | decisions when appropriate. 50 | 51 | ## Scope 52 | 53 | This Code of Conduct applies within all community spaces, and also applies when 54 | an individual is officially representing the community in public spaces. 55 | Examples of representing our community include using an official e-mail address, 56 | posting via an official social media account, or acting as an appointed 57 | representative at an online or offline event. 58 | 59 | ## Enforcement 60 | 61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 | reported to the community leaders responsible for enforcement at 63 | runstify@proton.me 64 | All complaints will be reviewed and investigated promptly and fairly. 65 | 66 | All community leaders are obligated to respect the privacy and security of the 67 | reporter of any incident. 68 | 69 | ## Enforcement Guidelines 70 | 71 | Community leaders will follow these Community Impact Guidelines in determining 72 | the consequences for any action they deem in violation of this Code of Conduct: 73 | 74 | ### 1. Correction 75 | 76 | **Community Impact**: Use of inappropriate language or other behavior deemed 77 | unprofessional or unwelcome in the community. 78 | 79 | **Consequence**: A private, written warning from community leaders, providing 80 | clarity around the nature of the violation and an explanation of why the 81 | behavior was inappropriate. A public apology may be requested. 82 | 83 | ### 2. Warning 84 | 85 | **Community Impact**: A violation through a single incident or series 86 | of actions. 87 | 88 | **Consequence**: A warning with consequences for continued behavior. No 89 | interaction with the people involved, including unsolicited interaction with 90 | those enforcing the Code of Conduct, for a specified period of time. This 91 | includes avoiding interactions in community spaces as well as external channels 92 | like social media. Violating these terms may lead to a temporary or 93 | permanent ban. 94 | 95 | ### 3. Temporary Ban 96 | 97 | **Community Impact**: A serious violation of community standards, including 98 | sustained inappropriate behavior. 99 | 100 | **Consequence**: A temporary ban from any sort of interaction or public 101 | communication with the community for a specified period of time. No public or 102 | private interaction with the people involved, including unsolicited interaction 103 | with those enforcing the Code of Conduct, is allowed during this period. 104 | Violating these terms may lead to a permanent ban. 105 | 106 | ### 4. Permanent Ban 107 | 108 | **Community Impact**: Demonstrating a pattern of violation of community 109 | standards, including sustained inappropriate behavior, harassment of an 110 | individual, or aggression toward or disparagement of classes of individuals. 111 | 112 | **Consequence**: A permanent ban from any sort of public interaction within 113 | the community. 114 | 115 | ## Attribution 116 | 117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 118 | version 2.0, available at 119 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 120 | 121 | Community Impact Guidelines were inspired by [Mozilla's code of conduct 122 | enforcement ladder](https://github.com/mozilla/diversity). 123 | 124 | [homepage]: https://www.contributor-covenant.org 125 | 126 | For answers to common questions about this code of conduct, see the FAQ at 127 | https://www.contributor-covenant.org/faq. Translations are available at 128 | https://www.contributor-covenant.org/translations. 129 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # Contributing 4 | 5 | A big welcome and thank you for considering contributing to **runst**! 🦡 It is people like you that make it a reality for users in the open source community. 6 | 7 | Reading and following these guidelines will help us make the contribution process easy and effective for everyone involved. It also communicates that you agree to respect the time of the developers managing and developing this project. In return, we will reciprocate that respect by addressing your issue, assessing changes, and helping you finalize your pull requests. 8 | 9 | ## Quicklinks 10 | 11 | - [Code of Conduct](#code-of-conduct) 12 | - [Getting Started](#getting-started) 13 | - [Issues](#issues) 14 | - [Pull Requests](#pull-requests) 15 | - [License](#license) 16 | 17 | ## Code of Conduct 18 | 19 | We take our open source community seriously and hold ourselves and other contributors to high standards of communication. By participating and contributing to this project, you agree to uphold our [Code of Conduct](./CODE_OF_CONDUCT.md). 20 | 21 | ## Getting Started 22 | 23 | Contributions are made to this repo via Issues and Pull Requests (PRs). A few general guidelines that cover both: 24 | 25 | - First, discuss the change you wish to make via creating an [issue](https://github.com/orhun/runst/issues/new/choose), [email](mailto:orhunparmaksiz@gmail.com), or any other method with the owners of this repository before making a change. 26 | - Search for existing issues and PRs before creating your own. 27 | - We work hard to make sure issues are handled in a timely manner but, depending on the impact, it could take a while to investigate the root cause. A friendly ping in the comment thread to the submitter or a contributor can help draw attention if your issue is blocking. 28 | 29 | ### Issues 30 | 31 | Issues should be used to report problems with the project, request a new feature, or discuss potential changes before a PR is created. When you create a new issue, a template will be loaded that will guide you through collecting and providing the information we need to investigate. 32 | 33 | If you find an issue that addresses the problem you're having, please add your own reproduction information to the existing issue rather than creating a new one. Adding a [reaction](https://github.blog/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) can also help be indicating to our maintainers that a particular problem is affecting more than just the reporter. 34 | 35 | ### Pull Requests 36 | 37 | PRs are always welcome and can be a quick way to get your fix or improvement slated for the next release. In general, PRs should: 38 | 39 | - Only fix/add the functionality in question **or** address wide-spread whitespace/style issues, not both. 40 | - Add unit or integration tests for fixed or changed functionality (if a test suite already exists). 41 | - Address a single concern in the least number of changed lines as possible. 42 | - Include documentation. 43 | - Be accompanied by a complete Pull Request template (loaded automatically when a PR is created). 44 | 45 | For changes that address core functionality or would require breaking changes (e.g. a major release), it's best to open an issue to discuss your proposal first. This is not required but can save time creating and reviewing changes. 46 | 47 | In general, we follow the "[fork-and-pull](https://github.com/susam/gitpr)" Git workflow: 48 | 49 | 1. Fork the repository to your own GitHub account. 50 | 51 | 2. Clone the project to your local environment. 52 | 53 | ```sh 54 | git clone https://github.com//runst && cd runst/ 55 | ``` 56 | 57 | 3. Create a branch locally with a succinct but descriptive name. 58 | 59 | ```sh 60 | git checkout -b 61 | ``` 62 | 63 | 4. Make sure you have everything installed in the [prerequisites](./README.md#prerequisites) section. If so, build the project. 64 | 65 | ```sh 66 | cargo build 67 | ``` 68 | 69 | 5. Start committing changes to the branch. 70 | 71 | 6. Add your tests or update the existing tests according to the changes and check if the tests are passed. 72 | 73 | ```sh 74 | cargo test 75 | ``` 76 | 77 | 7. Make sure [rustfmt](https://github.com/rust-lang/rustfmt) and [clippy](https://github.com/rust-lang/rust-clippy) don't show any errors/warnings. 78 | 79 | ```sh 80 | cargo fmt --all -- --check --verbose 81 | ``` 82 | 83 | ```sh 84 | cargo clippy --verbose -- -D warnings 85 | ``` 86 | 87 | 8. Push changes to your fork. 88 | 89 | 9. Open a PR in our repository and follow the [PR template](./.github/PULL_REQUEST_TEMPLATE.md) so that we can efficiently review the changes. 90 | 91 | 10. Wait for approval from the repository owners. Discuss the possible changes and update your PR if necessary. 92 | 93 | 11. The PR will be merged once you have the sign-off of the repository owners. 94 | 95 | ## License 96 | 97 | By contributing, you agree that your contributions will be licensed under [The MIT License](./LICENSE-MIT) or [Apache License 2.0](./LICENSE-APACHE). 98 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "adler32" 7 | version = "1.2.0" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" 10 | 11 | [[package]] 12 | name = "ahash" 13 | version = "0.8.11" 14 | source = "registry+https://github.com/rust-lang/crates.io-index" 15 | checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" 16 | dependencies = [ 17 | "cfg-if", 18 | "once_cell", 19 | "version_check", 20 | "zerocopy", 21 | ] 22 | 23 | [[package]] 24 | name = "aho-corasick" 25 | version = "1.1.3" 26 | source = "registry+https://github.com/rust-lang/crates.io-index" 27 | checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" 28 | dependencies = [ 29 | "memchr", 30 | ] 31 | 32 | [[package]] 33 | name = "allocator-api2" 34 | version = "0.2.18" 35 | source = "registry+https://github.com/rust-lang/crates.io-index" 36 | checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" 37 | 38 | [[package]] 39 | name = "android-tzdata" 40 | version = "0.1.1" 41 | source = "registry+https://github.com/rust-lang/crates.io-index" 42 | checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" 43 | 44 | [[package]] 45 | name = "android_system_properties" 46 | version = "0.1.5" 47 | source = "registry+https://github.com/rust-lang/crates.io-index" 48 | checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" 49 | dependencies = [ 50 | "libc", 51 | ] 52 | 53 | [[package]] 54 | name = "anstream" 55 | version = "0.6.14" 56 | source = "registry+https://github.com/rust-lang/crates.io-index" 57 | checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" 58 | dependencies = [ 59 | "anstyle", 60 | "anstyle-parse", 61 | "anstyle-query", 62 | "anstyle-wincon", 63 | "colorchoice", 64 | "is_terminal_polyfill", 65 | "utf8parse", 66 | ] 67 | 68 | [[package]] 69 | name = "anstyle" 70 | version = "1.0.7" 71 | source = "registry+https://github.com/rust-lang/crates.io-index" 72 | checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" 73 | 74 | [[package]] 75 | name = "anstyle-parse" 76 | version = "0.2.4" 77 | source = "registry+https://github.com/rust-lang/crates.io-index" 78 | checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" 79 | dependencies = [ 80 | "utf8parse", 81 | ] 82 | 83 | [[package]] 84 | name = "anstyle-query" 85 | version = "1.0.3" 86 | source = "registry+https://github.com/rust-lang/crates.io-index" 87 | checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" 88 | dependencies = [ 89 | "windows-sys 0.52.0", 90 | ] 91 | 92 | [[package]] 93 | name = "anstyle-wincon" 94 | version = "3.0.3" 95 | source = "registry+https://github.com/rust-lang/crates.io-index" 96 | checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" 97 | dependencies = [ 98 | "anstyle", 99 | "windows-sys 0.52.0", 100 | ] 101 | 102 | [[package]] 103 | name = "as-raw-xcb-connection" 104 | version = "1.0.1" 105 | source = "registry+https://github.com/rust-lang/crates.io-index" 106 | checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b" 107 | 108 | [[package]] 109 | name = "autocfg" 110 | version = "1.2.0" 111 | source = "registry+https://github.com/rust-lang/crates.io-index" 112 | checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" 113 | 114 | [[package]] 115 | name = "bitflags" 116 | version = "1.3.2" 117 | source = "registry+https://github.com/rust-lang/crates.io-index" 118 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 119 | 120 | [[package]] 121 | name = "bitflags" 122 | version = "2.6.0" 123 | source = "registry+https://github.com/rust-lang/crates.io-index" 124 | checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" 125 | 126 | [[package]] 127 | name = "block-buffer" 128 | version = "0.10.4" 129 | source = "registry+https://github.com/rust-lang/crates.io-index" 130 | checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" 131 | dependencies = [ 132 | "generic-array", 133 | ] 134 | 135 | [[package]] 136 | name = "bstr" 137 | version = "1.9.1" 138 | source = "registry+https://github.com/rust-lang/crates.io-index" 139 | checksum = "05efc5cfd9110c8416e471df0e96702d58690178e206e61b7173706673c93706" 140 | dependencies = [ 141 | "memchr", 142 | "serde", 143 | ] 144 | 145 | [[package]] 146 | name = "bumpalo" 147 | version = "3.15.4" 148 | source = "registry+https://github.com/rust-lang/crates.io-index" 149 | checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" 150 | 151 | [[package]] 152 | name = "cairo-rs" 153 | version = "0.20.10" 154 | source = "registry+https://github.com/rust-lang/crates.io-index" 155 | checksum = "b58e62a27cd02fb3f63f82bb31fdda7e6c43141497cbe97e8816d7c914043f55" 156 | dependencies = [ 157 | "bitflags 2.6.0", 158 | "cairo-sys-rs", 159 | "glib", 160 | "libc", 161 | ] 162 | 163 | [[package]] 164 | name = "cairo-sys-rs" 165 | version = "0.20.0" 166 | source = "registry+https://github.com/rust-lang/crates.io-index" 167 | checksum = "428290f914b9b86089f60f5d8a9f6e440508e1bcff23b25afd51502b0a2da88f" 168 | dependencies = [ 169 | "glib-sys", 170 | "libc", 171 | "system-deps", 172 | ] 173 | 174 | [[package]] 175 | name = "cc" 176 | version = "1.0.90" 177 | source = "registry+https://github.com/rust-lang/crates.io-index" 178 | checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" 179 | 180 | [[package]] 181 | name = "cfg-expr" 182 | version = "0.15.7" 183 | source = "registry+https://github.com/rust-lang/crates.io-index" 184 | checksum = "fa50868b64a9a6fda9d593ce778849ea8715cd2a3d2cc17ffdb4a2f2f2f1961d" 185 | dependencies = [ 186 | "smallvec", 187 | "target-lexicon", 188 | ] 189 | 190 | [[package]] 191 | name = "cfg-if" 192 | version = "1.0.0" 193 | source = "registry+https://github.com/rust-lang/crates.io-index" 194 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 195 | 196 | [[package]] 197 | name = "chrono" 198 | version = "0.4.35" 199 | source = "registry+https://github.com/rust-lang/crates.io-index" 200 | checksum = "8eaf5903dcbc0a39312feb77df2ff4c76387d591b9fc7b04a238dcf8bb62639a" 201 | dependencies = [ 202 | "android-tzdata", 203 | "iana-time-zone", 204 | "num-traits", 205 | "windows-targets 0.52.4", 206 | ] 207 | 208 | [[package]] 209 | name = "chrono-tz" 210 | version = "0.9.0" 211 | source = "registry+https://github.com/rust-lang/crates.io-index" 212 | checksum = "93698b29de5e97ad0ae26447b344c482a7284c737d9ddc5f9e52b74a336671bb" 213 | dependencies = [ 214 | "chrono", 215 | "chrono-tz-build", 216 | "phf", 217 | ] 218 | 219 | [[package]] 220 | name = "chrono-tz-build" 221 | version = "0.3.0" 222 | source = "registry+https://github.com/rust-lang/crates.io-index" 223 | checksum = "0c088aee841df9c3041febbb73934cfc39708749bf96dc827e3359cd39ef11b1" 224 | dependencies = [ 225 | "parse-zoneinfo", 226 | "phf", 227 | "phf_codegen", 228 | ] 229 | 230 | [[package]] 231 | name = "clap" 232 | version = "4.5.4" 233 | source = "registry+https://github.com/rust-lang/crates.io-index" 234 | checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" 235 | dependencies = [ 236 | "clap_builder", 237 | ] 238 | 239 | [[package]] 240 | name = "clap_builder" 241 | version = "4.5.2" 242 | source = "registry+https://github.com/rust-lang/crates.io-index" 243 | checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" 244 | dependencies = [ 245 | "anstream", 246 | "anstyle", 247 | "clap_lex", 248 | "strsim", 249 | ] 250 | 251 | [[package]] 252 | name = "clap_lex" 253 | version = "0.7.0" 254 | source = "registry+https://github.com/rust-lang/crates.io-index" 255 | checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" 256 | 257 | [[package]] 258 | name = "colorchoice" 259 | version = "1.0.1" 260 | source = "registry+https://github.com/rust-lang/crates.io-index" 261 | checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" 262 | 263 | [[package]] 264 | name = "colorsys" 265 | version = "0.6.7" 266 | source = "registry+https://github.com/rust-lang/crates.io-index" 267 | checksum = "54261aba646433cb567ec89844be4c4825ca92a4f8afba52fc4dd88436e31bbd" 268 | 269 | [[package]] 270 | name = "const_format" 271 | version = "0.2.31" 272 | source = "registry+https://github.com/rust-lang/crates.io-index" 273 | checksum = "c990efc7a285731f9a4378d81aff2f0e85a2c8781a05ef0f8baa8dac54d0ff48" 274 | dependencies = [ 275 | "const_format_proc_macros", 276 | ] 277 | 278 | [[package]] 279 | name = "const_format_proc_macros" 280 | version = "0.2.31" 281 | source = "registry+https://github.com/rust-lang/crates.io-index" 282 | checksum = "e026b6ce194a874cb9cf32cd5772d1ef9767cc8fcb5765948d74f37a9d8b2bf6" 283 | dependencies = [ 284 | "proc-macro2", 285 | "quote", 286 | "unicode-xid", 287 | ] 288 | 289 | [[package]] 290 | name = "convert_case" 291 | version = "0.6.0" 292 | source = "registry+https://github.com/rust-lang/crates.io-index" 293 | checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" 294 | dependencies = [ 295 | "unicode-segmentation", 296 | ] 297 | 298 | [[package]] 299 | name = "core-foundation-sys" 300 | version = "0.8.6" 301 | source = "registry+https://github.com/rust-lang/crates.io-index" 302 | checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" 303 | 304 | [[package]] 305 | name = "core2" 306 | version = "0.4.0" 307 | source = "registry+https://github.com/rust-lang/crates.io-index" 308 | checksum = "b49ba7ef1ad6107f8824dbe97de947cbaac53c44e7f9756a1fba0d37c1eec505" 309 | dependencies = [ 310 | "memchr", 311 | ] 312 | 313 | [[package]] 314 | name = "cpufeatures" 315 | version = "0.2.12" 316 | source = "registry+https://github.com/rust-lang/crates.io-index" 317 | checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" 318 | dependencies = [ 319 | "libc", 320 | ] 321 | 322 | [[package]] 323 | name = "crc32fast" 324 | version = "1.4.0" 325 | source = "registry+https://github.com/rust-lang/crates.io-index" 326 | checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" 327 | dependencies = [ 328 | "cfg-if", 329 | ] 330 | 331 | [[package]] 332 | name = "crossbeam-deque" 333 | version = "0.8.5" 334 | source = "registry+https://github.com/rust-lang/crates.io-index" 335 | checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" 336 | dependencies = [ 337 | "crossbeam-epoch", 338 | "crossbeam-utils", 339 | ] 340 | 341 | [[package]] 342 | name = "crossbeam-epoch" 343 | version = "0.9.18" 344 | source = "registry+https://github.com/rust-lang/crates.io-index" 345 | checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" 346 | dependencies = [ 347 | "crossbeam-utils", 348 | ] 349 | 350 | [[package]] 351 | name = "crossbeam-utils" 352 | version = "0.8.19" 353 | source = "registry+https://github.com/rust-lang/crates.io-index" 354 | checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" 355 | 356 | [[package]] 357 | name = "crypto-common" 358 | version = "0.1.6" 359 | source = "registry+https://github.com/rust-lang/crates.io-index" 360 | checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" 361 | dependencies = [ 362 | "generic-array", 363 | "typenum", 364 | ] 365 | 366 | [[package]] 367 | name = "dary_heap" 368 | version = "0.3.6" 369 | source = "registry+https://github.com/rust-lang/crates.io-index" 370 | checksum = "7762d17f1241643615821a8455a0b2c3e803784b058693d990b11f2dce25a0ca" 371 | 372 | [[package]] 373 | name = "dbus" 374 | version = "0.9.7" 375 | source = "registry+https://github.com/rust-lang/crates.io-index" 376 | checksum = "1bb21987b9fb1613058ba3843121dd18b163b254d8a6e797e144cbac14d96d1b" 377 | dependencies = [ 378 | "libc", 379 | "libdbus-sys", 380 | "winapi", 381 | ] 382 | 383 | [[package]] 384 | name = "dbus-codegen" 385 | version = "0.12.0" 386 | source = "registry+https://github.com/rust-lang/crates.io-index" 387 | checksum = "cf7b8c78e020d2eb0bb7ad986a86c5e5477d66d3cb13ea23a0faf896dd72a1db" 388 | dependencies = [ 389 | "clap", 390 | "dbus", 391 | "xml-rs", 392 | ] 393 | 394 | [[package]] 395 | name = "dbus-crossroads" 396 | version = "0.5.2" 397 | source = "registry+https://github.com/rust-lang/crates.io-index" 398 | checksum = "3a4c83437187544ba5142427746835061b330446ca8902eabd70e4afb8f76de0" 399 | dependencies = [ 400 | "dbus", 401 | ] 402 | 403 | [[package]] 404 | name = "deunicode" 405 | version = "1.4.3" 406 | source = "registry+https://github.com/rust-lang/crates.io-index" 407 | checksum = "b6e854126756c496b8c81dec88f9a706b15b875c5849d4097a3854476b9fdf94" 408 | 409 | [[package]] 410 | name = "digest" 411 | version = "0.10.7" 412 | source = "registry+https://github.com/rust-lang/crates.io-index" 413 | checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" 414 | dependencies = [ 415 | "block-buffer", 416 | "crypto-common", 417 | ] 418 | 419 | [[package]] 420 | name = "dirs" 421 | version = "5.0.1" 422 | source = "registry+https://github.com/rust-lang/crates.io-index" 423 | checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" 424 | dependencies = [ 425 | "dirs-sys", 426 | ] 427 | 428 | [[package]] 429 | name = "dirs-sys" 430 | version = "0.4.1" 431 | source = "registry+https://github.com/rust-lang/crates.io-index" 432 | checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" 433 | dependencies = [ 434 | "libc", 435 | "option-ext", 436 | "redox_users", 437 | "windows-sys 0.48.0", 438 | ] 439 | 440 | [[package]] 441 | name = "equivalent" 442 | version = "1.0.1" 443 | source = "registry+https://github.com/rust-lang/crates.io-index" 444 | checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" 445 | 446 | [[package]] 447 | name = "errno" 448 | version = "0.3.8" 449 | source = "registry+https://github.com/rust-lang/crates.io-index" 450 | checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" 451 | dependencies = [ 452 | "libc", 453 | "windows-sys 0.52.0", 454 | ] 455 | 456 | [[package]] 457 | name = "estimated_read_time" 458 | version = "1.0.0" 459 | source = "registry+https://github.com/rust-lang/crates.io-index" 460 | checksum = "649cfd341410b1f8906e8ca1b39e5534be9312fda9182edd770cec34dfbce8d7" 461 | 462 | [[package]] 463 | name = "futures-channel" 464 | version = "0.3.30" 465 | source = "registry+https://github.com/rust-lang/crates.io-index" 466 | checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" 467 | dependencies = [ 468 | "futures-core", 469 | ] 470 | 471 | [[package]] 472 | name = "futures-core" 473 | version = "0.3.30" 474 | source = "registry+https://github.com/rust-lang/crates.io-index" 475 | checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" 476 | 477 | [[package]] 478 | name = "futures-executor" 479 | version = "0.3.30" 480 | source = "registry+https://github.com/rust-lang/crates.io-index" 481 | checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" 482 | dependencies = [ 483 | "futures-core", 484 | "futures-task", 485 | "futures-util", 486 | ] 487 | 488 | [[package]] 489 | name = "futures-io" 490 | version = "0.3.30" 491 | source = "registry+https://github.com/rust-lang/crates.io-index" 492 | checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" 493 | 494 | [[package]] 495 | name = "futures-macro" 496 | version = "0.3.30" 497 | source = "registry+https://github.com/rust-lang/crates.io-index" 498 | checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" 499 | dependencies = [ 500 | "proc-macro2", 501 | "quote", 502 | "syn", 503 | ] 504 | 505 | [[package]] 506 | name = "futures-task" 507 | version = "0.3.30" 508 | source = "registry+https://github.com/rust-lang/crates.io-index" 509 | checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" 510 | 511 | [[package]] 512 | name = "futures-util" 513 | version = "0.3.30" 514 | source = "registry+https://github.com/rust-lang/crates.io-index" 515 | checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" 516 | dependencies = [ 517 | "futures-core", 518 | "futures-macro", 519 | "futures-task", 520 | "pin-project-lite", 521 | "pin-utils", 522 | "slab", 523 | ] 524 | 525 | [[package]] 526 | name = "generic-array" 527 | version = "0.14.7" 528 | source = "registry+https://github.com/rust-lang/crates.io-index" 529 | checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" 530 | dependencies = [ 531 | "typenum", 532 | "version_check", 533 | ] 534 | 535 | [[package]] 536 | name = "gethostname" 537 | version = "0.4.3" 538 | source = "registry+https://github.com/rust-lang/crates.io-index" 539 | checksum = "0176e0459c2e4a1fe232f984bca6890e681076abb9934f6cea7c326f3fc47818" 540 | dependencies = [ 541 | "libc", 542 | "windows-targets 0.48.5", 543 | ] 544 | 545 | [[package]] 546 | name = "getrandom" 547 | version = "0.2.12" 548 | source = "registry+https://github.com/rust-lang/crates.io-index" 549 | checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" 550 | dependencies = [ 551 | "cfg-if", 552 | "libc", 553 | "wasi", 554 | ] 555 | 556 | [[package]] 557 | name = "gio" 558 | version = "0.20.0" 559 | source = "registry+https://github.com/rust-lang/crates.io-index" 560 | checksum = "398e3da68749fdc32783cbf7521ec3f65c9cf946db8c7774f8460af49e52c6e2" 561 | dependencies = [ 562 | "futures-channel", 563 | "futures-core", 564 | "futures-io", 565 | "futures-util", 566 | "gio-sys", 567 | "glib", 568 | "libc", 569 | "pin-project-lite", 570 | "smallvec", 571 | "thiserror 1.0.68", 572 | ] 573 | 574 | [[package]] 575 | name = "gio-sys" 576 | version = "0.20.5" 577 | source = "registry+https://github.com/rust-lang/crates.io-index" 578 | checksum = "217f464cad5946ae4369c355155e2d16b488c08920601083cb4891e352ae777b" 579 | dependencies = [ 580 | "glib-sys", 581 | "gobject-sys", 582 | "libc", 583 | "system-deps", 584 | "windows-sys 0.52.0", 585 | ] 586 | 587 | [[package]] 588 | name = "glib" 589 | version = "0.20.5" 590 | source = "registry+https://github.com/rust-lang/crates.io-index" 591 | checksum = "358431b0e0eb15b9d02db52e1f19c805b953c5c168099deb3de88beab761768c" 592 | dependencies = [ 593 | "bitflags 2.6.0", 594 | "futures-channel", 595 | "futures-core", 596 | "futures-executor", 597 | "futures-task", 598 | "futures-util", 599 | "gio-sys", 600 | "glib-macros", 601 | "glib-sys", 602 | "gobject-sys", 603 | "libc", 604 | "memchr", 605 | "smallvec", 606 | ] 607 | 608 | [[package]] 609 | name = "glib-macros" 610 | version = "0.20.5" 611 | source = "registry+https://github.com/rust-lang/crates.io-index" 612 | checksum = "e7d21ca27acfc3e91da70456edde144b4ac7c36f78ee77b10189b3eb4901c156" 613 | dependencies = [ 614 | "heck", 615 | "proc-macro-crate", 616 | "proc-macro2", 617 | "quote", 618 | "syn", 619 | ] 620 | 621 | [[package]] 622 | name = "glib-sys" 623 | version = "0.20.5" 624 | source = "registry+https://github.com/rust-lang/crates.io-index" 625 | checksum = "8a5911863ab7ecd4a6f8d5976f12eeba076b23669c49b066d877e742544aa389" 626 | dependencies = [ 627 | "libc", 628 | "system-deps", 629 | ] 630 | 631 | [[package]] 632 | name = "globset" 633 | version = "0.4.14" 634 | source = "registry+https://github.com/rust-lang/crates.io-index" 635 | checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1" 636 | dependencies = [ 637 | "aho-corasick", 638 | "bstr", 639 | "log", 640 | "regex-automata 0.4.8", 641 | "regex-syntax 0.8.5", 642 | ] 643 | 644 | [[package]] 645 | name = "globwalk" 646 | version = "0.9.1" 647 | source = "registry+https://github.com/rust-lang/crates.io-index" 648 | checksum = "0bf760ebf69878d9fd8f110c89703d90ce35095324d1f1edcb595c63945ee757" 649 | dependencies = [ 650 | "bitflags 2.6.0", 651 | "ignore", 652 | "walkdir", 653 | ] 654 | 655 | [[package]] 656 | name = "gobject-sys" 657 | version = "0.20.0" 658 | source = "registry+https://github.com/rust-lang/crates.io-index" 659 | checksum = "c6908864f5ffff15b56df7e90346863904f49b949337ed0456b9287af61903b8" 660 | dependencies = [ 661 | "glib-sys", 662 | "libc", 663 | "system-deps", 664 | ] 665 | 666 | [[package]] 667 | name = "hashbrown" 668 | version = "0.14.3" 669 | source = "registry+https://github.com/rust-lang/crates.io-index" 670 | checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" 671 | dependencies = [ 672 | "ahash", 673 | "allocator-api2", 674 | ] 675 | 676 | [[package]] 677 | name = "hashbrown" 678 | version = "0.15.2" 679 | source = "registry+https://github.com/rust-lang/crates.io-index" 680 | checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" 681 | 682 | [[package]] 683 | name = "heck" 684 | version = "0.5.0" 685 | source = "registry+https://github.com/rust-lang/crates.io-index" 686 | checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" 687 | 688 | [[package]] 689 | name = "humansize" 690 | version = "2.1.3" 691 | source = "registry+https://github.com/rust-lang/crates.io-index" 692 | checksum = "6cb51c9a029ddc91b07a787f1d86b53ccfa49b0e86688c946ebe8d3555685dd7" 693 | dependencies = [ 694 | "libm", 695 | ] 696 | 697 | [[package]] 698 | name = "humantime" 699 | version = "2.2.0" 700 | source = "registry+https://github.com/rust-lang/crates.io-index" 701 | checksum = "9b112acc8b3adf4b107a8ec20977da0273a8c386765a3ec0229bd500a1443f9f" 702 | 703 | [[package]] 704 | name = "iana-time-zone" 705 | version = "0.1.60" 706 | source = "registry+https://github.com/rust-lang/crates.io-index" 707 | checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" 708 | dependencies = [ 709 | "android_system_properties", 710 | "core-foundation-sys", 711 | "iana-time-zone-haiku", 712 | "js-sys", 713 | "wasm-bindgen", 714 | "windows-core", 715 | ] 716 | 717 | [[package]] 718 | name = "iana-time-zone-haiku" 719 | version = "0.1.2" 720 | source = "registry+https://github.com/rust-lang/crates.io-index" 721 | checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" 722 | dependencies = [ 723 | "cc", 724 | ] 725 | 726 | [[package]] 727 | name = "ignore" 728 | version = "0.4.22" 729 | source = "registry+https://github.com/rust-lang/crates.io-index" 730 | checksum = "b46810df39e66e925525d6e38ce1e7f6e1d208f72dc39757880fcb66e2c58af1" 731 | dependencies = [ 732 | "crossbeam-deque", 733 | "globset", 734 | "log", 735 | "memchr", 736 | "regex-automata 0.4.8", 737 | "same-file", 738 | "walkdir", 739 | "winapi-util", 740 | ] 741 | 742 | [[package]] 743 | name = "include-flate" 744 | version = "0.3.0" 745 | source = "registry+https://github.com/rust-lang/crates.io-index" 746 | checksum = "df49c16750695486c1f34de05da5b7438096156466e7f76c38fcdf285cf0113e" 747 | dependencies = [ 748 | "include-flate-codegen", 749 | "lazy_static", 750 | "libflate", 751 | ] 752 | 753 | [[package]] 754 | name = "include-flate-codegen" 755 | version = "0.2.0" 756 | source = "registry+https://github.com/rust-lang/crates.io-index" 757 | checksum = "8c5b246c6261be723b85c61ecf87804e8ea4a35cb68be0ff282ed84b95ffe7d7" 758 | dependencies = [ 759 | "libflate", 760 | "proc-macro2", 761 | "quote", 762 | "syn", 763 | ] 764 | 765 | [[package]] 766 | name = "indexmap" 767 | version = "2.7.1" 768 | source = "registry+https://github.com/rust-lang/crates.io-index" 769 | checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" 770 | dependencies = [ 771 | "equivalent", 772 | "hashbrown 0.15.2", 773 | ] 774 | 775 | [[package]] 776 | name = "is_terminal_polyfill" 777 | version = "1.70.0" 778 | source = "registry+https://github.com/rust-lang/crates.io-index" 779 | checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" 780 | 781 | [[package]] 782 | name = "itoa" 783 | version = "1.0.11" 784 | source = "registry+https://github.com/rust-lang/crates.io-index" 785 | checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" 786 | 787 | [[package]] 788 | name = "js-sys" 789 | version = "0.3.69" 790 | source = "registry+https://github.com/rust-lang/crates.io-index" 791 | checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" 792 | dependencies = [ 793 | "wasm-bindgen", 794 | ] 795 | 796 | [[package]] 797 | name = "lazy_static" 798 | version = "1.4.0" 799 | source = "registry+https://github.com/rust-lang/crates.io-index" 800 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 801 | 802 | [[package]] 803 | name = "libc" 804 | version = "0.2.153" 805 | source = "registry+https://github.com/rust-lang/crates.io-index" 806 | checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" 807 | 808 | [[package]] 809 | name = "libdbus-sys" 810 | version = "0.2.5" 811 | source = "registry+https://github.com/rust-lang/crates.io-index" 812 | checksum = "06085512b750d640299b79be4bad3d2fa90a9c00b1fd9e1b46364f66f0485c72" 813 | dependencies = [ 814 | "pkg-config", 815 | ] 816 | 817 | [[package]] 818 | name = "libflate" 819 | version = "2.1.0" 820 | source = "registry+https://github.com/rust-lang/crates.io-index" 821 | checksum = "45d9dfdc14ea4ef0900c1cddbc8dcd553fbaacd8a4a282cf4018ae9dd04fb21e" 822 | dependencies = [ 823 | "adler32", 824 | "core2", 825 | "crc32fast", 826 | "dary_heap", 827 | "libflate_lz77", 828 | ] 829 | 830 | [[package]] 831 | name = "libflate_lz77" 832 | version = "2.1.0" 833 | source = "registry+https://github.com/rust-lang/crates.io-index" 834 | checksum = "e6e0d73b369f386f1c44abd9c570d5318f55ccde816ff4b562fa452e5182863d" 835 | dependencies = [ 836 | "core2", 837 | "hashbrown 0.14.3", 838 | "rle-decode-fast", 839 | ] 840 | 841 | [[package]] 842 | name = "libm" 843 | version = "0.2.8" 844 | source = "registry+https://github.com/rust-lang/crates.io-index" 845 | checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" 846 | 847 | [[package]] 848 | name = "libredox" 849 | version = "0.0.1" 850 | source = "registry+https://github.com/rust-lang/crates.io-index" 851 | checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" 852 | dependencies = [ 853 | "bitflags 2.6.0", 854 | "libc", 855 | "redox_syscall", 856 | ] 857 | 858 | [[package]] 859 | name = "linux-raw-sys" 860 | version = "0.4.13" 861 | source = "registry+https://github.com/rust-lang/crates.io-index" 862 | checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" 863 | 864 | [[package]] 865 | name = "log" 866 | version = "0.4.21" 867 | source = "registry+https://github.com/rust-lang/crates.io-index" 868 | checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" 869 | 870 | [[package]] 871 | name = "matchers" 872 | version = "0.1.0" 873 | source = "registry+https://github.com/rust-lang/crates.io-index" 874 | checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" 875 | dependencies = [ 876 | "regex-automata 0.1.10", 877 | ] 878 | 879 | [[package]] 880 | name = "memchr" 881 | version = "2.7.4" 882 | source = "registry+https://github.com/rust-lang/crates.io-index" 883 | checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" 884 | 885 | [[package]] 886 | name = "nu-ansi-term" 887 | version = "0.46.0" 888 | source = "registry+https://github.com/rust-lang/crates.io-index" 889 | checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" 890 | dependencies = [ 891 | "overload", 892 | "winapi", 893 | ] 894 | 895 | [[package]] 896 | name = "num-traits" 897 | version = "0.2.18" 898 | source = "registry+https://github.com/rust-lang/crates.io-index" 899 | checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" 900 | dependencies = [ 901 | "autocfg", 902 | ] 903 | 904 | [[package]] 905 | name = "once_cell" 906 | version = "1.19.0" 907 | source = "registry+https://github.com/rust-lang/crates.io-index" 908 | checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" 909 | 910 | [[package]] 911 | name = "option-ext" 912 | version = "0.2.0" 913 | source = "registry+https://github.com/rust-lang/crates.io-index" 914 | checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" 915 | 916 | [[package]] 917 | name = "overload" 918 | version = "0.1.1" 919 | source = "registry+https://github.com/rust-lang/crates.io-index" 920 | checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" 921 | 922 | [[package]] 923 | name = "pango" 924 | version = "0.20.10" 925 | source = "registry+https://github.com/rust-lang/crates.io-index" 926 | checksum = "d88d37c161f2848f0d9382597f0168484c9335ac800995f3956641abb7002938" 927 | dependencies = [ 928 | "gio", 929 | "glib", 930 | "libc", 931 | "pango-sys", 932 | ] 933 | 934 | [[package]] 935 | name = "pango-sys" 936 | version = "0.20.0" 937 | source = "registry+https://github.com/rust-lang/crates.io-index" 938 | checksum = "b07cc57d10cee4ec661f718a6902cee18c2f4cfae08e87e5a390525946913390" 939 | dependencies = [ 940 | "glib-sys", 941 | "gobject-sys", 942 | "libc", 943 | "system-deps", 944 | ] 945 | 946 | [[package]] 947 | name = "pangocairo" 948 | version = "0.20.10" 949 | source = "registry+https://github.com/rust-lang/crates.io-index" 950 | checksum = "58890dc451db9964ac2d8874f903a4370a4b3932aa5281ff0c8d9810937ad84f" 951 | dependencies = [ 952 | "cairo-rs", 953 | "glib", 954 | "libc", 955 | "pango", 956 | "pangocairo-sys", 957 | ] 958 | 959 | [[package]] 960 | name = "pangocairo-sys" 961 | version = "0.20.0" 962 | source = "registry+https://github.com/rust-lang/crates.io-index" 963 | checksum = "bc23a5ea756e709ab1598f8446a64c799b10c99ec59aa2310965218bc1915853" 964 | dependencies = [ 965 | "cairo-sys-rs", 966 | "glib-sys", 967 | "libc", 968 | "pango-sys", 969 | "system-deps", 970 | ] 971 | 972 | [[package]] 973 | name = "parse-zoneinfo" 974 | version = "0.3.0" 975 | source = "registry+https://github.com/rust-lang/crates.io-index" 976 | checksum = "c705f256449c60da65e11ff6626e0c16a0a0b96aaa348de61376b249bc340f41" 977 | dependencies = [ 978 | "regex", 979 | ] 980 | 981 | [[package]] 982 | name = "percent-encoding" 983 | version = "2.3.1" 984 | source = "registry+https://github.com/rust-lang/crates.io-index" 985 | checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" 986 | 987 | [[package]] 988 | name = "pest" 989 | version = "2.7.8" 990 | source = "registry+https://github.com/rust-lang/crates.io-index" 991 | checksum = "56f8023d0fb78c8e03784ea1c7f3fa36e68a723138990b8d5a47d916b651e7a8" 992 | dependencies = [ 993 | "memchr", 994 | "thiserror 1.0.68", 995 | "ucd-trie", 996 | ] 997 | 998 | [[package]] 999 | name = "pest_derive" 1000 | version = "2.7.8" 1001 | source = "registry+https://github.com/rust-lang/crates.io-index" 1002 | checksum = "b0d24f72393fd16ab6ac5738bc33cdb6a9aa73f8b902e8fe29cf4e67d7dd1026" 1003 | dependencies = [ 1004 | "pest", 1005 | "pest_generator", 1006 | ] 1007 | 1008 | [[package]] 1009 | name = "pest_generator" 1010 | version = "2.7.8" 1011 | source = "registry+https://github.com/rust-lang/crates.io-index" 1012 | checksum = "fdc17e2a6c7d0a492f0158d7a4bd66cc17280308bbaff78d5bef566dca35ab80" 1013 | dependencies = [ 1014 | "pest", 1015 | "pest_meta", 1016 | "proc-macro2", 1017 | "quote", 1018 | "syn", 1019 | ] 1020 | 1021 | [[package]] 1022 | name = "pest_meta" 1023 | version = "2.7.8" 1024 | source = "registry+https://github.com/rust-lang/crates.io-index" 1025 | checksum = "934cd7631c050f4674352a6e835d5f6711ffbfb9345c2fc0107155ac495ae293" 1026 | dependencies = [ 1027 | "once_cell", 1028 | "pest", 1029 | "sha2", 1030 | ] 1031 | 1032 | [[package]] 1033 | name = "phf" 1034 | version = "0.11.2" 1035 | source = "registry+https://github.com/rust-lang/crates.io-index" 1036 | checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" 1037 | dependencies = [ 1038 | "phf_shared", 1039 | ] 1040 | 1041 | [[package]] 1042 | name = "phf_codegen" 1043 | version = "0.11.2" 1044 | source = "registry+https://github.com/rust-lang/crates.io-index" 1045 | checksum = "e8d39688d359e6b34654d328e262234662d16cc0f60ec8dcbe5e718709342a5a" 1046 | dependencies = [ 1047 | "phf_generator", 1048 | "phf_shared", 1049 | ] 1050 | 1051 | [[package]] 1052 | name = "phf_generator" 1053 | version = "0.11.2" 1054 | source = "registry+https://github.com/rust-lang/crates.io-index" 1055 | checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" 1056 | dependencies = [ 1057 | "phf_shared", 1058 | "rand", 1059 | ] 1060 | 1061 | [[package]] 1062 | name = "phf_shared" 1063 | version = "0.11.2" 1064 | source = "registry+https://github.com/rust-lang/crates.io-index" 1065 | checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" 1066 | dependencies = [ 1067 | "siphasher", 1068 | ] 1069 | 1070 | [[package]] 1071 | name = "pin-project-lite" 1072 | version = "0.2.13" 1073 | source = "registry+https://github.com/rust-lang/crates.io-index" 1074 | checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" 1075 | 1076 | [[package]] 1077 | name = "pin-utils" 1078 | version = "0.1.0" 1079 | source = "registry+https://github.com/rust-lang/crates.io-index" 1080 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 1081 | 1082 | [[package]] 1083 | name = "pkg-config" 1084 | version = "0.3.30" 1085 | source = "registry+https://github.com/rust-lang/crates.io-index" 1086 | checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" 1087 | 1088 | [[package]] 1089 | name = "ppv-lite86" 1090 | version = "0.2.17" 1091 | source = "registry+https://github.com/rust-lang/crates.io-index" 1092 | checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" 1093 | 1094 | [[package]] 1095 | name = "proc-macro-crate" 1096 | version = "3.1.0" 1097 | source = "registry+https://github.com/rust-lang/crates.io-index" 1098 | checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" 1099 | dependencies = [ 1100 | "toml_edit 0.21.1", 1101 | ] 1102 | 1103 | [[package]] 1104 | name = "proc-macro2" 1105 | version = "1.0.86" 1106 | source = "registry+https://github.com/rust-lang/crates.io-index" 1107 | checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" 1108 | dependencies = [ 1109 | "unicode-ident", 1110 | ] 1111 | 1112 | [[package]] 1113 | name = "quote" 1114 | version = "1.0.35" 1115 | source = "registry+https://github.com/rust-lang/crates.io-index" 1116 | checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" 1117 | dependencies = [ 1118 | "proc-macro2", 1119 | ] 1120 | 1121 | [[package]] 1122 | name = "rand" 1123 | version = "0.8.5" 1124 | source = "registry+https://github.com/rust-lang/crates.io-index" 1125 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 1126 | dependencies = [ 1127 | "libc", 1128 | "rand_chacha", 1129 | "rand_core", 1130 | ] 1131 | 1132 | [[package]] 1133 | name = "rand_chacha" 1134 | version = "0.3.1" 1135 | source = "registry+https://github.com/rust-lang/crates.io-index" 1136 | checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 1137 | dependencies = [ 1138 | "ppv-lite86", 1139 | "rand_core", 1140 | ] 1141 | 1142 | [[package]] 1143 | name = "rand_core" 1144 | version = "0.6.4" 1145 | source = "registry+https://github.com/rust-lang/crates.io-index" 1146 | checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 1147 | dependencies = [ 1148 | "getrandom", 1149 | ] 1150 | 1151 | [[package]] 1152 | name = "redox_syscall" 1153 | version = "0.4.1" 1154 | source = "registry+https://github.com/rust-lang/crates.io-index" 1155 | checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" 1156 | dependencies = [ 1157 | "bitflags 1.3.2", 1158 | ] 1159 | 1160 | [[package]] 1161 | name = "redox_users" 1162 | version = "0.4.4" 1163 | source = "registry+https://github.com/rust-lang/crates.io-index" 1164 | checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" 1165 | dependencies = [ 1166 | "getrandom", 1167 | "libredox", 1168 | "thiserror 1.0.68", 1169 | ] 1170 | 1171 | [[package]] 1172 | name = "regex" 1173 | version = "1.11.1" 1174 | source = "registry+https://github.com/rust-lang/crates.io-index" 1175 | checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" 1176 | dependencies = [ 1177 | "aho-corasick", 1178 | "memchr", 1179 | "regex-automata 0.4.8", 1180 | "regex-syntax 0.8.5", 1181 | ] 1182 | 1183 | [[package]] 1184 | name = "regex-automata" 1185 | version = "0.1.10" 1186 | source = "registry+https://github.com/rust-lang/crates.io-index" 1187 | checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" 1188 | dependencies = [ 1189 | "regex-syntax 0.6.29", 1190 | ] 1191 | 1192 | [[package]] 1193 | name = "regex-automata" 1194 | version = "0.4.8" 1195 | source = "registry+https://github.com/rust-lang/crates.io-index" 1196 | checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" 1197 | dependencies = [ 1198 | "aho-corasick", 1199 | "memchr", 1200 | "regex-syntax 0.8.5", 1201 | ] 1202 | 1203 | [[package]] 1204 | name = "regex-syntax" 1205 | version = "0.6.29" 1206 | source = "registry+https://github.com/rust-lang/crates.io-index" 1207 | checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" 1208 | 1209 | [[package]] 1210 | name = "regex-syntax" 1211 | version = "0.8.5" 1212 | source = "registry+https://github.com/rust-lang/crates.io-index" 1213 | checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" 1214 | 1215 | [[package]] 1216 | name = "rle-decode-fast" 1217 | version = "1.0.3" 1218 | source = "registry+https://github.com/rust-lang/crates.io-index" 1219 | checksum = "3582f63211428f83597b51b2ddb88e2a91a9d52d12831f9d08f5e624e8977422" 1220 | 1221 | [[package]] 1222 | name = "runst" 1223 | version = "0.1.7" 1224 | dependencies = [ 1225 | "cairo-rs", 1226 | "colorsys", 1227 | "dbus", 1228 | "dbus-codegen", 1229 | "dbus-crossroads", 1230 | "dirs", 1231 | "estimated_read_time", 1232 | "humantime", 1233 | "pango", 1234 | "pangocairo", 1235 | "regex", 1236 | "rust-embed", 1237 | "serde", 1238 | "serde_json", 1239 | "serde_regex", 1240 | "sscanf", 1241 | "tera", 1242 | "thiserror 2.0.12", 1243 | "toml", 1244 | "tracing", 1245 | "tracing-subscriber", 1246 | "x11rb", 1247 | ] 1248 | 1249 | [[package]] 1250 | name = "rust-embed" 1251 | version = "8.7.2" 1252 | source = "registry+https://github.com/rust-lang/crates.io-index" 1253 | checksum = "025908b8682a26ba8d12f6f2d66b987584a4a87bc024abc5bbc12553a8cd178a" 1254 | dependencies = [ 1255 | "include-flate", 1256 | "rust-embed-impl", 1257 | "rust-embed-utils", 1258 | "walkdir", 1259 | ] 1260 | 1261 | [[package]] 1262 | name = "rust-embed-impl" 1263 | version = "8.7.2" 1264 | source = "registry+https://github.com/rust-lang/crates.io-index" 1265 | checksum = "6065f1a4392b71819ec1ea1df1120673418bf386f50de1d6f54204d836d4349c" 1266 | dependencies = [ 1267 | "proc-macro2", 1268 | "quote", 1269 | "rust-embed-utils", 1270 | "syn", 1271 | "walkdir", 1272 | ] 1273 | 1274 | [[package]] 1275 | name = "rust-embed-utils" 1276 | version = "8.7.2" 1277 | source = "registry+https://github.com/rust-lang/crates.io-index" 1278 | checksum = "f6cc0c81648b20b70c491ff8cce00c1c3b223bb8ed2b5d41f0e54c6c4c0a3594" 1279 | dependencies = [ 1280 | "sha2", 1281 | "walkdir", 1282 | ] 1283 | 1284 | [[package]] 1285 | name = "rustix" 1286 | version = "0.38.32" 1287 | source = "registry+https://github.com/rust-lang/crates.io-index" 1288 | checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" 1289 | dependencies = [ 1290 | "bitflags 2.6.0", 1291 | "errno", 1292 | "libc", 1293 | "linux-raw-sys", 1294 | "windows-sys 0.52.0", 1295 | ] 1296 | 1297 | [[package]] 1298 | name = "ryu" 1299 | version = "1.0.17" 1300 | source = "registry+https://github.com/rust-lang/crates.io-index" 1301 | checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" 1302 | 1303 | [[package]] 1304 | name = "same-file" 1305 | version = "1.0.6" 1306 | source = "registry+https://github.com/rust-lang/crates.io-index" 1307 | checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" 1308 | dependencies = [ 1309 | "winapi-util", 1310 | ] 1311 | 1312 | [[package]] 1313 | name = "serde" 1314 | version = "1.0.219" 1315 | source = "registry+https://github.com/rust-lang/crates.io-index" 1316 | checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" 1317 | dependencies = [ 1318 | "serde_derive", 1319 | ] 1320 | 1321 | [[package]] 1322 | name = "serde_derive" 1323 | version = "1.0.219" 1324 | source = "registry+https://github.com/rust-lang/crates.io-index" 1325 | checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" 1326 | dependencies = [ 1327 | "proc-macro2", 1328 | "quote", 1329 | "syn", 1330 | ] 1331 | 1332 | [[package]] 1333 | name = "serde_json" 1334 | version = "1.0.140" 1335 | source = "registry+https://github.com/rust-lang/crates.io-index" 1336 | checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" 1337 | dependencies = [ 1338 | "itoa", 1339 | "memchr", 1340 | "ryu", 1341 | "serde", 1342 | ] 1343 | 1344 | [[package]] 1345 | name = "serde_regex" 1346 | version = "1.1.0" 1347 | source = "registry+https://github.com/rust-lang/crates.io-index" 1348 | checksum = "a8136f1a4ea815d7eac4101cfd0b16dc0cb5e1fe1b8609dfd728058656b7badf" 1349 | dependencies = [ 1350 | "regex", 1351 | "serde", 1352 | ] 1353 | 1354 | [[package]] 1355 | name = "serde_spanned" 1356 | version = "0.6.8" 1357 | source = "registry+https://github.com/rust-lang/crates.io-index" 1358 | checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" 1359 | dependencies = [ 1360 | "serde", 1361 | ] 1362 | 1363 | [[package]] 1364 | name = "sha2" 1365 | version = "0.10.8" 1366 | source = "registry+https://github.com/rust-lang/crates.io-index" 1367 | checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" 1368 | dependencies = [ 1369 | "cfg-if", 1370 | "cpufeatures", 1371 | "digest", 1372 | ] 1373 | 1374 | [[package]] 1375 | name = "sharded-slab" 1376 | version = "0.1.7" 1377 | source = "registry+https://github.com/rust-lang/crates.io-index" 1378 | checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" 1379 | dependencies = [ 1380 | "lazy_static", 1381 | ] 1382 | 1383 | [[package]] 1384 | name = "siphasher" 1385 | version = "0.3.11" 1386 | source = "registry+https://github.com/rust-lang/crates.io-index" 1387 | checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" 1388 | 1389 | [[package]] 1390 | name = "slab" 1391 | version = "0.4.9" 1392 | source = "registry+https://github.com/rust-lang/crates.io-index" 1393 | checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" 1394 | dependencies = [ 1395 | "autocfg", 1396 | ] 1397 | 1398 | [[package]] 1399 | name = "slug" 1400 | version = "0.1.5" 1401 | source = "registry+https://github.com/rust-lang/crates.io-index" 1402 | checksum = "3bd94acec9c8da640005f8e135a39fc0372e74535e6b368b7a04b875f784c8c4" 1403 | dependencies = [ 1404 | "deunicode", 1405 | "wasm-bindgen", 1406 | ] 1407 | 1408 | [[package]] 1409 | name = "smallvec" 1410 | version = "1.13.2" 1411 | source = "registry+https://github.com/rust-lang/crates.io-index" 1412 | checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" 1413 | 1414 | [[package]] 1415 | name = "sscanf" 1416 | version = "0.4.3" 1417 | source = "registry+https://github.com/rust-lang/crates.io-index" 1418 | checksum = "cbd1009b536a04035c8ffcf967496c7726c6b4971c9939b20ad085ac9377d4f0" 1419 | dependencies = [ 1420 | "const_format", 1421 | "lazy_static", 1422 | "regex", 1423 | "sscanf_macro", 1424 | ] 1425 | 1426 | [[package]] 1427 | name = "sscanf_macro" 1428 | version = "0.4.3" 1429 | source = "registry+https://github.com/rust-lang/crates.io-index" 1430 | checksum = "cffce0630a574bbcda2476cf733363c7e077001c386b0dea87b77eb397ca1a37" 1431 | dependencies = [ 1432 | "convert_case", 1433 | "proc-macro2", 1434 | "quote", 1435 | "regex-syntax 0.6.29", 1436 | "strsim", 1437 | "syn", 1438 | "unicode-width", 1439 | ] 1440 | 1441 | [[package]] 1442 | name = "strsim" 1443 | version = "0.11.1" 1444 | source = "registry+https://github.com/rust-lang/crates.io-index" 1445 | checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" 1446 | 1447 | [[package]] 1448 | name = "syn" 1449 | version = "2.0.87" 1450 | source = "registry+https://github.com/rust-lang/crates.io-index" 1451 | checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" 1452 | dependencies = [ 1453 | "proc-macro2", 1454 | "quote", 1455 | "unicode-ident", 1456 | ] 1457 | 1458 | [[package]] 1459 | name = "system-deps" 1460 | version = "7.0.1" 1461 | source = "registry+https://github.com/rust-lang/crates.io-index" 1462 | checksum = "6c81f13d9a334a6c242465140bd262fae382b752ff2011c4f7419919a9c97922" 1463 | dependencies = [ 1464 | "cfg-expr", 1465 | "heck", 1466 | "pkg-config", 1467 | "toml", 1468 | "version-compare", 1469 | ] 1470 | 1471 | [[package]] 1472 | name = "target-lexicon" 1473 | version = "0.12.14" 1474 | source = "registry+https://github.com/rust-lang/crates.io-index" 1475 | checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" 1476 | 1477 | [[package]] 1478 | name = "tera" 1479 | version = "1.20.0" 1480 | source = "registry+https://github.com/rust-lang/crates.io-index" 1481 | checksum = "ab9d851b45e865f178319da0abdbfe6acbc4328759ff18dafc3a41c16b4cd2ee" 1482 | dependencies = [ 1483 | "chrono", 1484 | "chrono-tz", 1485 | "globwalk", 1486 | "humansize", 1487 | "lazy_static", 1488 | "percent-encoding", 1489 | "pest", 1490 | "pest_derive", 1491 | "rand", 1492 | "regex", 1493 | "serde", 1494 | "serde_json", 1495 | "slug", 1496 | "unic-segment", 1497 | ] 1498 | 1499 | [[package]] 1500 | name = "thiserror" 1501 | version = "1.0.68" 1502 | source = "registry+https://github.com/rust-lang/crates.io-index" 1503 | checksum = "02dd99dc800bbb97186339685293e1cc5d9df1f8fae2d0aecd9ff1c77efea892" 1504 | dependencies = [ 1505 | "thiserror-impl 1.0.68", 1506 | ] 1507 | 1508 | [[package]] 1509 | name = "thiserror" 1510 | version = "2.0.12" 1511 | source = "registry+https://github.com/rust-lang/crates.io-index" 1512 | checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" 1513 | dependencies = [ 1514 | "thiserror-impl 2.0.12", 1515 | ] 1516 | 1517 | [[package]] 1518 | name = "thiserror-impl" 1519 | version = "1.0.68" 1520 | source = "registry+https://github.com/rust-lang/crates.io-index" 1521 | checksum = "a7c61ec9a6f64d2793d8a45faba21efbe3ced62a886d44c36a009b2b519b4c7e" 1522 | dependencies = [ 1523 | "proc-macro2", 1524 | "quote", 1525 | "syn", 1526 | ] 1527 | 1528 | [[package]] 1529 | name = "thiserror-impl" 1530 | version = "2.0.12" 1531 | source = "registry+https://github.com/rust-lang/crates.io-index" 1532 | checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" 1533 | dependencies = [ 1534 | "proc-macro2", 1535 | "quote", 1536 | "syn", 1537 | ] 1538 | 1539 | [[package]] 1540 | name = "thread_local" 1541 | version = "1.1.8" 1542 | source = "registry+https://github.com/rust-lang/crates.io-index" 1543 | checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" 1544 | dependencies = [ 1545 | "cfg-if", 1546 | "once_cell", 1547 | ] 1548 | 1549 | [[package]] 1550 | name = "toml" 1551 | version = "0.8.22" 1552 | source = "registry+https://github.com/rust-lang/crates.io-index" 1553 | checksum = "05ae329d1f08c4d17a59bed7ff5b5a769d062e64a62d34a3261b219e62cd5aae" 1554 | dependencies = [ 1555 | "serde", 1556 | "serde_spanned", 1557 | "toml_datetime", 1558 | "toml_edit 0.22.26", 1559 | ] 1560 | 1561 | [[package]] 1562 | name = "toml_datetime" 1563 | version = "0.6.9" 1564 | source = "registry+https://github.com/rust-lang/crates.io-index" 1565 | checksum = "3da5db5a963e24bc68be8b17b6fa82814bb22ee8660f192bb182771d498f09a3" 1566 | dependencies = [ 1567 | "serde", 1568 | ] 1569 | 1570 | [[package]] 1571 | name = "toml_edit" 1572 | version = "0.21.1" 1573 | source = "registry+https://github.com/rust-lang/crates.io-index" 1574 | checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" 1575 | dependencies = [ 1576 | "indexmap", 1577 | "toml_datetime", 1578 | "winnow 0.5.40", 1579 | ] 1580 | 1581 | [[package]] 1582 | name = "toml_edit" 1583 | version = "0.22.26" 1584 | source = "registry+https://github.com/rust-lang/crates.io-index" 1585 | checksum = "310068873db2c5b3e7659d2cc35d21855dbafa50d1ce336397c666e3cb08137e" 1586 | dependencies = [ 1587 | "indexmap", 1588 | "serde", 1589 | "serde_spanned", 1590 | "toml_datetime", 1591 | "toml_write", 1592 | "winnow 0.7.7", 1593 | ] 1594 | 1595 | [[package]] 1596 | name = "toml_write" 1597 | version = "0.1.1" 1598 | source = "registry+https://github.com/rust-lang/crates.io-index" 1599 | checksum = "bfb942dfe1d8e29a7ee7fcbde5bd2b9a25fb89aa70caea2eba3bee836ff41076" 1600 | 1601 | [[package]] 1602 | name = "tracing" 1603 | version = "0.1.41" 1604 | source = "registry+https://github.com/rust-lang/crates.io-index" 1605 | checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" 1606 | dependencies = [ 1607 | "pin-project-lite", 1608 | "tracing-attributes", 1609 | "tracing-core", 1610 | ] 1611 | 1612 | [[package]] 1613 | name = "tracing-attributes" 1614 | version = "0.1.28" 1615 | source = "registry+https://github.com/rust-lang/crates.io-index" 1616 | checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" 1617 | dependencies = [ 1618 | "proc-macro2", 1619 | "quote", 1620 | "syn", 1621 | ] 1622 | 1623 | [[package]] 1624 | name = "tracing-core" 1625 | version = "0.1.33" 1626 | source = "registry+https://github.com/rust-lang/crates.io-index" 1627 | checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" 1628 | dependencies = [ 1629 | "once_cell", 1630 | "valuable", 1631 | ] 1632 | 1633 | [[package]] 1634 | name = "tracing-log" 1635 | version = "0.2.0" 1636 | source = "registry+https://github.com/rust-lang/crates.io-index" 1637 | checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" 1638 | dependencies = [ 1639 | "log", 1640 | "once_cell", 1641 | "tracing-core", 1642 | ] 1643 | 1644 | [[package]] 1645 | name = "tracing-subscriber" 1646 | version = "0.3.19" 1647 | source = "registry+https://github.com/rust-lang/crates.io-index" 1648 | checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" 1649 | dependencies = [ 1650 | "matchers", 1651 | "nu-ansi-term", 1652 | "once_cell", 1653 | "regex", 1654 | "sharded-slab", 1655 | "smallvec", 1656 | "thread_local", 1657 | "tracing", 1658 | "tracing-core", 1659 | "tracing-log", 1660 | ] 1661 | 1662 | [[package]] 1663 | name = "typenum" 1664 | version = "1.17.0" 1665 | source = "registry+https://github.com/rust-lang/crates.io-index" 1666 | checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" 1667 | 1668 | [[package]] 1669 | name = "ucd-trie" 1670 | version = "0.1.6" 1671 | source = "registry+https://github.com/rust-lang/crates.io-index" 1672 | checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" 1673 | 1674 | [[package]] 1675 | name = "unic-char-property" 1676 | version = "0.9.0" 1677 | source = "registry+https://github.com/rust-lang/crates.io-index" 1678 | checksum = "a8c57a407d9b6fa02b4795eb81c5b6652060a15a7903ea981f3d723e6c0be221" 1679 | dependencies = [ 1680 | "unic-char-range", 1681 | ] 1682 | 1683 | [[package]] 1684 | name = "unic-char-range" 1685 | version = "0.9.0" 1686 | source = "registry+https://github.com/rust-lang/crates.io-index" 1687 | checksum = "0398022d5f700414f6b899e10b8348231abf9173fa93144cbc1a43b9793c1fbc" 1688 | 1689 | [[package]] 1690 | name = "unic-common" 1691 | version = "0.9.0" 1692 | source = "registry+https://github.com/rust-lang/crates.io-index" 1693 | checksum = "80d7ff825a6a654ee85a63e80f92f054f904f21e7d12da4e22f9834a4aaa35bc" 1694 | 1695 | [[package]] 1696 | name = "unic-segment" 1697 | version = "0.9.0" 1698 | source = "registry+https://github.com/rust-lang/crates.io-index" 1699 | checksum = "e4ed5d26be57f84f176157270c112ef57b86debac9cd21daaabbe56db0f88f23" 1700 | dependencies = [ 1701 | "unic-ucd-segment", 1702 | ] 1703 | 1704 | [[package]] 1705 | name = "unic-ucd-segment" 1706 | version = "0.9.0" 1707 | source = "registry+https://github.com/rust-lang/crates.io-index" 1708 | checksum = "2079c122a62205b421f499da10f3ee0f7697f012f55b675e002483c73ea34700" 1709 | dependencies = [ 1710 | "unic-char-property", 1711 | "unic-char-range", 1712 | "unic-ucd-version", 1713 | ] 1714 | 1715 | [[package]] 1716 | name = "unic-ucd-version" 1717 | version = "0.9.0" 1718 | source = "registry+https://github.com/rust-lang/crates.io-index" 1719 | checksum = "96bd2f2237fe450fcd0a1d2f5f4e91711124f7857ba2e964247776ebeeb7b0c4" 1720 | dependencies = [ 1721 | "unic-common", 1722 | ] 1723 | 1724 | [[package]] 1725 | name = "unicode-ident" 1726 | version = "1.0.12" 1727 | source = "registry+https://github.com/rust-lang/crates.io-index" 1728 | checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" 1729 | 1730 | [[package]] 1731 | name = "unicode-segmentation" 1732 | version = "1.11.0" 1733 | source = "registry+https://github.com/rust-lang/crates.io-index" 1734 | checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" 1735 | 1736 | [[package]] 1737 | name = "unicode-width" 1738 | version = "0.1.11" 1739 | source = "registry+https://github.com/rust-lang/crates.io-index" 1740 | checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" 1741 | 1742 | [[package]] 1743 | name = "unicode-xid" 1744 | version = "0.2.4" 1745 | source = "registry+https://github.com/rust-lang/crates.io-index" 1746 | checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" 1747 | 1748 | [[package]] 1749 | name = "utf8parse" 1750 | version = "0.2.1" 1751 | source = "registry+https://github.com/rust-lang/crates.io-index" 1752 | checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" 1753 | 1754 | [[package]] 1755 | name = "valuable" 1756 | version = "0.1.0" 1757 | source = "registry+https://github.com/rust-lang/crates.io-index" 1758 | checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" 1759 | 1760 | [[package]] 1761 | name = "version-compare" 1762 | version = "0.2.0" 1763 | source = "registry+https://github.com/rust-lang/crates.io-index" 1764 | checksum = "852e951cb7832cb45cb1169900d19760cfa39b82bc0ea9c0e5a14ae88411c98b" 1765 | 1766 | [[package]] 1767 | name = "version_check" 1768 | version = "0.9.4" 1769 | source = "registry+https://github.com/rust-lang/crates.io-index" 1770 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 1771 | 1772 | [[package]] 1773 | name = "walkdir" 1774 | version = "2.5.0" 1775 | source = "registry+https://github.com/rust-lang/crates.io-index" 1776 | checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" 1777 | dependencies = [ 1778 | "same-file", 1779 | "winapi-util", 1780 | ] 1781 | 1782 | [[package]] 1783 | name = "wasi" 1784 | version = "0.11.0+wasi-snapshot-preview1" 1785 | source = "registry+https://github.com/rust-lang/crates.io-index" 1786 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 1787 | 1788 | [[package]] 1789 | name = "wasm-bindgen" 1790 | version = "0.2.92" 1791 | source = "registry+https://github.com/rust-lang/crates.io-index" 1792 | checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" 1793 | dependencies = [ 1794 | "cfg-if", 1795 | "wasm-bindgen-macro", 1796 | ] 1797 | 1798 | [[package]] 1799 | name = "wasm-bindgen-backend" 1800 | version = "0.2.92" 1801 | source = "registry+https://github.com/rust-lang/crates.io-index" 1802 | checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" 1803 | dependencies = [ 1804 | "bumpalo", 1805 | "log", 1806 | "once_cell", 1807 | "proc-macro2", 1808 | "quote", 1809 | "syn", 1810 | "wasm-bindgen-shared", 1811 | ] 1812 | 1813 | [[package]] 1814 | name = "wasm-bindgen-macro" 1815 | version = "0.2.92" 1816 | source = "registry+https://github.com/rust-lang/crates.io-index" 1817 | checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" 1818 | dependencies = [ 1819 | "quote", 1820 | "wasm-bindgen-macro-support", 1821 | ] 1822 | 1823 | [[package]] 1824 | name = "wasm-bindgen-macro-support" 1825 | version = "0.2.92" 1826 | source = "registry+https://github.com/rust-lang/crates.io-index" 1827 | checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" 1828 | dependencies = [ 1829 | "proc-macro2", 1830 | "quote", 1831 | "syn", 1832 | "wasm-bindgen-backend", 1833 | "wasm-bindgen-shared", 1834 | ] 1835 | 1836 | [[package]] 1837 | name = "wasm-bindgen-shared" 1838 | version = "0.2.92" 1839 | source = "registry+https://github.com/rust-lang/crates.io-index" 1840 | checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" 1841 | 1842 | [[package]] 1843 | name = "winapi" 1844 | version = "0.3.9" 1845 | source = "registry+https://github.com/rust-lang/crates.io-index" 1846 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1847 | dependencies = [ 1848 | "winapi-i686-pc-windows-gnu", 1849 | "winapi-x86_64-pc-windows-gnu", 1850 | ] 1851 | 1852 | [[package]] 1853 | name = "winapi-i686-pc-windows-gnu" 1854 | version = "0.4.0" 1855 | source = "registry+https://github.com/rust-lang/crates.io-index" 1856 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1857 | 1858 | [[package]] 1859 | name = "winapi-util" 1860 | version = "0.1.6" 1861 | source = "registry+https://github.com/rust-lang/crates.io-index" 1862 | checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" 1863 | dependencies = [ 1864 | "winapi", 1865 | ] 1866 | 1867 | [[package]] 1868 | name = "winapi-x86_64-pc-windows-gnu" 1869 | version = "0.4.0" 1870 | source = "registry+https://github.com/rust-lang/crates.io-index" 1871 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1872 | 1873 | [[package]] 1874 | name = "windows-core" 1875 | version = "0.52.0" 1876 | source = "registry+https://github.com/rust-lang/crates.io-index" 1877 | checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" 1878 | dependencies = [ 1879 | "windows-targets 0.52.4", 1880 | ] 1881 | 1882 | [[package]] 1883 | name = "windows-sys" 1884 | version = "0.48.0" 1885 | source = "registry+https://github.com/rust-lang/crates.io-index" 1886 | checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" 1887 | dependencies = [ 1888 | "windows-targets 0.48.5", 1889 | ] 1890 | 1891 | [[package]] 1892 | name = "windows-sys" 1893 | version = "0.52.0" 1894 | source = "registry+https://github.com/rust-lang/crates.io-index" 1895 | checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" 1896 | dependencies = [ 1897 | "windows-targets 0.52.4", 1898 | ] 1899 | 1900 | [[package]] 1901 | name = "windows-targets" 1902 | version = "0.48.5" 1903 | source = "registry+https://github.com/rust-lang/crates.io-index" 1904 | checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" 1905 | dependencies = [ 1906 | "windows_aarch64_gnullvm 0.48.5", 1907 | "windows_aarch64_msvc 0.48.5", 1908 | "windows_i686_gnu 0.48.5", 1909 | "windows_i686_msvc 0.48.5", 1910 | "windows_x86_64_gnu 0.48.5", 1911 | "windows_x86_64_gnullvm 0.48.5", 1912 | "windows_x86_64_msvc 0.48.5", 1913 | ] 1914 | 1915 | [[package]] 1916 | name = "windows-targets" 1917 | version = "0.52.4" 1918 | source = "registry+https://github.com/rust-lang/crates.io-index" 1919 | checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" 1920 | dependencies = [ 1921 | "windows_aarch64_gnullvm 0.52.4", 1922 | "windows_aarch64_msvc 0.52.4", 1923 | "windows_i686_gnu 0.52.4", 1924 | "windows_i686_msvc 0.52.4", 1925 | "windows_x86_64_gnu 0.52.4", 1926 | "windows_x86_64_gnullvm 0.52.4", 1927 | "windows_x86_64_msvc 0.52.4", 1928 | ] 1929 | 1930 | [[package]] 1931 | name = "windows_aarch64_gnullvm" 1932 | version = "0.48.5" 1933 | source = "registry+https://github.com/rust-lang/crates.io-index" 1934 | checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" 1935 | 1936 | [[package]] 1937 | name = "windows_aarch64_gnullvm" 1938 | version = "0.52.4" 1939 | source = "registry+https://github.com/rust-lang/crates.io-index" 1940 | checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" 1941 | 1942 | [[package]] 1943 | name = "windows_aarch64_msvc" 1944 | version = "0.48.5" 1945 | source = "registry+https://github.com/rust-lang/crates.io-index" 1946 | checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" 1947 | 1948 | [[package]] 1949 | name = "windows_aarch64_msvc" 1950 | version = "0.52.4" 1951 | source = "registry+https://github.com/rust-lang/crates.io-index" 1952 | checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" 1953 | 1954 | [[package]] 1955 | name = "windows_i686_gnu" 1956 | version = "0.48.5" 1957 | source = "registry+https://github.com/rust-lang/crates.io-index" 1958 | checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" 1959 | 1960 | [[package]] 1961 | name = "windows_i686_gnu" 1962 | version = "0.52.4" 1963 | source = "registry+https://github.com/rust-lang/crates.io-index" 1964 | checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" 1965 | 1966 | [[package]] 1967 | name = "windows_i686_msvc" 1968 | version = "0.48.5" 1969 | source = "registry+https://github.com/rust-lang/crates.io-index" 1970 | checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" 1971 | 1972 | [[package]] 1973 | name = "windows_i686_msvc" 1974 | version = "0.52.4" 1975 | source = "registry+https://github.com/rust-lang/crates.io-index" 1976 | checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" 1977 | 1978 | [[package]] 1979 | name = "windows_x86_64_gnu" 1980 | version = "0.48.5" 1981 | source = "registry+https://github.com/rust-lang/crates.io-index" 1982 | checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" 1983 | 1984 | [[package]] 1985 | name = "windows_x86_64_gnu" 1986 | version = "0.52.4" 1987 | source = "registry+https://github.com/rust-lang/crates.io-index" 1988 | checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" 1989 | 1990 | [[package]] 1991 | name = "windows_x86_64_gnullvm" 1992 | version = "0.48.5" 1993 | source = "registry+https://github.com/rust-lang/crates.io-index" 1994 | checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" 1995 | 1996 | [[package]] 1997 | name = "windows_x86_64_gnullvm" 1998 | version = "0.52.4" 1999 | source = "registry+https://github.com/rust-lang/crates.io-index" 2000 | checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" 2001 | 2002 | [[package]] 2003 | name = "windows_x86_64_msvc" 2004 | version = "0.48.5" 2005 | source = "registry+https://github.com/rust-lang/crates.io-index" 2006 | checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" 2007 | 2008 | [[package]] 2009 | name = "windows_x86_64_msvc" 2010 | version = "0.52.4" 2011 | source = "registry+https://github.com/rust-lang/crates.io-index" 2012 | checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" 2013 | 2014 | [[package]] 2015 | name = "winnow" 2016 | version = "0.5.40" 2017 | source = "registry+https://github.com/rust-lang/crates.io-index" 2018 | checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" 2019 | dependencies = [ 2020 | "memchr", 2021 | ] 2022 | 2023 | [[package]] 2024 | name = "winnow" 2025 | version = "0.7.7" 2026 | source = "registry+https://github.com/rust-lang/crates.io-index" 2027 | checksum = "6cb8234a863ea0e8cd7284fcdd4f145233eb00fee02bbdd9861aec44e6477bc5" 2028 | dependencies = [ 2029 | "memchr", 2030 | ] 2031 | 2032 | [[package]] 2033 | name = "x11rb" 2034 | version = "0.13.1" 2035 | source = "registry+https://github.com/rust-lang/crates.io-index" 2036 | checksum = "5d91ffca73ee7f68ce055750bf9f6eca0780b8c85eff9bc046a3b0da41755e12" 2037 | dependencies = [ 2038 | "as-raw-xcb-connection", 2039 | "gethostname", 2040 | "libc", 2041 | "rustix", 2042 | "x11rb-protocol", 2043 | ] 2044 | 2045 | [[package]] 2046 | name = "x11rb-protocol" 2047 | version = "0.13.1" 2048 | source = "registry+https://github.com/rust-lang/crates.io-index" 2049 | checksum = "ec107c4503ea0b4a98ef47356329af139c0a4f7750e621cf2973cd3385ebcb3d" 2050 | 2051 | [[package]] 2052 | name = "xml-rs" 2053 | version = "0.8.19" 2054 | source = "registry+https://github.com/rust-lang/crates.io-index" 2055 | checksum = "0fcb9cbac069e033553e8bb871be2fbdffcab578eb25bd0f7c508cedc6dcd75a" 2056 | 2057 | [[package]] 2058 | name = "zerocopy" 2059 | version = "0.7.35" 2060 | source = "registry+https://github.com/rust-lang/crates.io-index" 2061 | checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" 2062 | dependencies = [ 2063 | "zerocopy-derive", 2064 | ] 2065 | 2066 | [[package]] 2067 | name = "zerocopy-derive" 2068 | version = "0.7.35" 2069 | source = "registry+https://github.com/rust-lang/crates.io-index" 2070 | checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" 2071 | dependencies = [ 2072 | "proc-macro2", 2073 | "quote", 2074 | "syn", 2075 | ] 2076 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "runst" 3 | version = "0.1.7" # bumped by release.sh 4 | description = "A dead simple notification daemon 🦡" 5 | authors = ["Orhun Parmaksız "] 6 | license = "MIT OR Apache-2.0" 7 | readme = "README.md" 8 | homepage = "https://github.com/orhun/runst" 9 | repository = "https://github.com/orhun/runst" 10 | keywords = ["notification", "daemon", "dbus", "notify", "x11"] 11 | categories = ["command-line-utilities"] 12 | include = [ 13 | "src/**/*", 14 | "dbus/*", 15 | "config/*", 16 | "build.rs", 17 | "Cargo.*", 18 | "LICENSE-*", 19 | "*.md", 20 | ] 21 | edition = "2021" 22 | rust-version = "1.70.0" 23 | 24 | [dependencies] 25 | dbus = "0.9.7" 26 | dbus-crossroads = "0.5.2" 27 | x11rb = { version = "0.13.1", default-features = false, features = [ 28 | "allow-unsafe-code", 29 | ] } 30 | cairo-rs = { version = "0.20.10", default-features = false, features = [ 31 | "use_glib", 32 | "xcb", 33 | ] } 34 | pangocairo = "0.20.10" 35 | pango = "0.20.10" 36 | thiserror = "2.0.12" 37 | serde = { version = "1.0.219", features = ["derive"] } 38 | toml = "0.8.22" 39 | sscanf = "0.4.3" 40 | colorsys = "0.6.7" 41 | dirs = "5.0.1" 42 | rust-embed = { version = "8.7.2", features = ["compression"] } 43 | tera = "1.20.0" 44 | estimated_read_time = "1.0.0" 45 | regex = "1.11.1" 46 | serde_regex = "1.1.0" 47 | serde_json = "1.0.140" 48 | tracing = "=0.1.41" 49 | tracing-subscriber = { version = "0.3.19", features = ["env-filter"] } 50 | humantime = "2.2.0" 51 | 52 | [build-dependencies] 53 | dbus-codegen = "0.12.0" 54 | 55 | [profile.dev] 56 | opt-level = 0 57 | debug = true 58 | panic = "abort" 59 | 60 | [profile.test] 61 | opt-level = 0 62 | debug = true 63 | 64 | [profile.release] 65 | opt-level = 3 66 | debug = false 67 | panic = "unwind" 68 | lto = true 69 | codegen-units = 1 70 | 71 | [profile.bench] 72 | opt-level = 3 73 | debug = false 74 | -------------------------------------------------------------------------------- /LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright (c) 2020-2021 The Fish Fight Game Developers 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Copyright (c) 2022-2024 Orhun Parmaksız 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a 4 | copy of this software and associated documentation files (the "Software"), 5 | to deal in the Software without restriction, including without limitation 6 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | and/or sell copies of the Software, and to permit persons to whom the 8 | Software is furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 16 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19 | DEALINGS IN THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 | 7 |

runst — A dead simple notification daemon 🦡

8 | 9 | GitHub Release 10 | Crate Release 11 | Continuous Integration 12 | Continuous Deployment 13 | Documentation 14 | 15 |
16 | 17 | [Desktop notifications](https://wiki.archlinux.org/title/Desktop_notifications) are small, passive popup dialogs that notify the user of particular events in an asynchronous manner. These passive popups can automatically disappear after a short period of time. 18 | 19 | `runst` is the server implementation of [freedesktop.org](https://www.freedesktop.org/wiki) - [Desktop Notifications Specification](https://specifications.freedesktop.org/notification-spec/notification-spec-latest.html) and it can be used to receive notifications from applications via [D-Bus](https://www.freedesktop.org/wiki/Software/dbus/). As of now, only [X11](https://en.wikipedia.org/wiki/X_Window_System) is supported. 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | ## Features 30 | 31 | - Fully customizable notification window (size, location, text, colors). 32 | - Template-powered ([Jinja2](http://jinja.pocoo.org/)/[Django](https://docs.djangoproject.com/en/3.1/topics/templates/)) notification text. 33 | - Auto-clear notifications based on a fixed time or estimated read time. 34 | - Run custom OS commands based on the matched notifications. 35 | 36 | ## Roadmap 37 | 38 | `runst` is initially designed to show a simple notification window. On top of that, it combines customization-oriented and semi-innovative features. In the future, I'm aiming to shape `runst` functionality based on new ideas and feedback. 39 | 40 | Feel free to [submit an issue](https://github.com/orhun/runst/issues/new) if you have something in mind or having a problem! 41 | 42 | ## Installation 43 | 44 | ### From crates.io 45 | 46 | `runst` can be installed from [crates.io](https://crates.io/crates/runst): 47 | 48 | ```sh 49 | $ cargo install runst 50 | ``` 51 | 52 | The minimum supported Rust version is `1.70.0`. 53 | 54 | ### Arch Linux 55 | 56 | `runst` can be installed from the [extra repository](https://archlinux.org/packages/extra/x86_64/runst/) using [pacman](https://wiki.archlinux.org/title/Pacman): 57 | 58 | ```sh 59 | $ pacman -S runst 60 | ``` 61 | 62 | Or you can install the available [AUR packages](https://aur.archlinux.org/packages?O=0&SeB=nd&K=runst&outdated=&SB=p&SO=d&PP=50&submit=Go) with using an [AUR helper](https://wiki.archlinux.org/title/AUR_helpers). For example: 63 | 64 | ```sh 65 | $ paru -S runst-git 66 | ``` 67 | 68 | ### Alpine Linux 69 | 70 | `runst` is available for [Alpine Edge](https://pkgs.alpinelinux.org/packages?name=runst&branch=edge). It can be installed via [apk](https://wiki.alpinelinux.org/wiki/Alpine_Package_Keeper) after enabling the [testing repository](https://wiki.alpinelinux.org/wiki/Repositories). 71 | 72 | ```sh 73 | apk add runst 74 | ``` 75 | 76 | ### Binary releases 77 | 78 | See the available binaries for different operating systems/architectures from the [releases page](https://github.com/orhun/runst/releases). 79 | 80 | Release tarballs are signed with the following PGP key: [AEF8C7261F4CEB41A448CBC41B250A9F78535D1A](https://keyserver.ubuntu.com/pks/lookup?search=0x1B250A9F78535D1A&op=vindex) 81 | 82 | ### Build from source 83 | 84 | #### Prerequisites 85 | 86 | - [D-Bus](https://www.freedesktop.org/wiki/Software/dbus) 87 | - [GLib](https://wiki.gnome.org/Projects/GLib) 88 | - [Pango](https://pango.gnome.org) 89 | 90 | #### Instructions 91 | 92 | 1. Clone the repository. 93 | 94 | ```sh 95 | $ git clone https://github.com/orhun/runst && cd runst/ 96 | ``` 97 | 98 | 2. Build. 99 | 100 | ```sh 101 | $ CARGO_TARGET_DIR=target cargo build --release 102 | ``` 103 | 104 | Binary will be located at `target/release/runst`. 105 | 106 | ## Usage 107 | 108 | ### On Xorg startup 109 | 110 | You can use [xinitrc](#xinitrc) or [xprofile](#xprofile) for autostarting `runst`. 111 | 112 | #### xinitrc 113 | 114 | If you are starting Xorg manually with [xinit](https://www.x.org/archive/X11R6.8.0/doc/xinit.1.html), you can `runst` on X server startup via [xinitrc](https://wiki.archlinux.org/title/Xinit#xinitrc): 115 | 116 | `$HOME/.xinitrc`: 117 | 118 | ```sh 119 | runst & 120 | ``` 121 | 122 | Long-running programs such as notification daemons should be started before the window manager, so they should either fork themself or be run in the background via appending `&` sign. Otherwise, the script would halt and wait for each program to exit before executing the window manager or desktop environment. 123 | 124 | In the case of `runst` not being available since it's started at a faster manner than the window manager, you can add a delay as shown in the example below: 125 | 126 | ```sh 127 | { sleep 2; runst; } & 128 | ``` 129 | 130 | #### xprofile 131 | 132 | If you are using a [display manager](https://wiki.archlinux.org/title/Display_manager), you can utilize an [xprofile](https://wiki.archlinux.org/title/Xprofile) file which allows you to execute commands at the beginning of the X user session. 133 | 134 | The xprofile file, which is `~/.xprofile` or `/etc/xprofile`, can be styled similarly to [xinitrc](#xinitrc). 135 | 136 | ### As a D-Bus service 137 | 138 | You can create a D-Bus service to launch `runst` automatically on the first notification action. For example, you can create the following service configuration: 139 | 140 | `/usr/share/dbus-1/services/org.orhun.runst.service`: 141 | 142 | ```ini 143 | [D-BUS Service] 144 | Name=org.freedesktop.Notifications 145 | Exec=/usr/bin/runst 146 | ``` 147 | 148 | Whenever an application sends a notification by sending a signal to `org.freedesktop.Notifications`, D-Bus activates `runst`. 149 | 150 | Also, see [**#1**](https://github.com/orhun/runst/issues/1) for systemd integration. 151 | 152 | ## Commands 153 | 154 | `runst` can be controlled with sending commands to D-Bus via [`dbus-send(1)`](https://man.archlinux.org/man/dbus-send.1.en). 155 | 156 | ```sh 157 | dbus-send --print-reply --dest=org.freedesktop.Notifications /org/freedesktop/Notifications/ctl "org.freedesktop.Notifications.${command}" 158 | ``` 159 | 160 | Available commands are: 161 | 162 | - `History`: show the last notification. 163 | - `Close`: close the notification. 164 | - `CloseAll`: close all the notifications. 165 | 166 | For example: 167 | 168 | ```sh 169 | # show the last notification 170 | dbus-send --print-reply \ 171 | --dest=org.freedesktop.Notifications \ 172 | /org/freedesktop/Notifications/ctl \ 173 | org.freedesktop.Notifications.History 174 | ``` 175 | 176 | An example usage for [i3](https://i3wm.org/): 177 | 178 | ```sh 179 | # Notification history 180 | bindsym $mod+grave exec dbus-send --print-reply \ 181 | --dest=org.freedesktop.Notifications /org/freedesktop/Notifications/ctl org.freedesktop.Notifications.History 182 | 183 | # Close notification 184 | bindsym $mod+shift+grave exec dbus-send --print-reply \ 185 | --dest=org.freedesktop.Notifications /org/freedesktop/Notifications/ctl org.freedesktop.Notifications.Close 186 | ``` 187 | 188 | Additionally, to view the server version: 189 | 190 | ```sh 191 | dbus-send --print-reply --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.GetServerInformation 192 | ``` 193 | 194 | ## Configuration 195 | 196 | `runst` configuration file supports [TOML](https://github.com/toml-lang/toml) format and the default configuration values can be found [here](./config/runst.toml). 197 | 198 | If exists, configuration file is read from the following default locations: 199 | 200 | - `$HOME/.config/runst/runst.toml` 201 | - `$HOME/.runst/runst.toml` 202 | 203 | You can also specify a path via `RUNST_CONFIG` environment variable. 204 | 205 | ### Global configuration 206 | 207 | #### `log_verbosity` 208 | 209 | Sets the [logging verbosity](https://docs.rs/log/latest/log/enum.Level.html). Possible values are `error`, `warn`, `info`, `debug` and `trace`. 210 | 211 | #### `startup_notification` 212 | 213 | Shows a notification at startup if set to `true`. 214 | 215 | #### `geometry` 216 | 217 | Sets the window geometry. The value format is `x++`. 218 | 219 | For setting this value, I recommend using a tool like [slop](https://github.com/naelstrof/slop) which helps with querying for a selection and printing the region to stdout. 220 | 221 | #### `wrap_content` 222 | 223 | If set to `true`, the window is resized to match the contents. 224 | 225 | If the content is larger than the window size, `geometry` option is used for maximum width and height. 226 | 227 | #### `font` 228 | 229 | Sets the font to use for the window. 230 | 231 | #### `template` 232 | 233 | Sets the template for the notification message. The syntax is based on [Jinja2](http://jinja.pocoo.org/) and [Django](https://docs.djangoproject.com/en/3.1/topics/templates/) templates. 234 | 235 | Simply, there are 3 kinds of delimiters: 236 | 237 | 238 | 239 | - `{{` and `}}` for expressions 240 | - `{%` or `{%-` and `%}` or `-%}` for statements 241 | - `{#` and `#}` for comments 242 | 243 | 244 | 245 | See [Tera documentation](https://tera.netlify.app/docs/#templates) for more information about [control structures](https://tera.netlify.app/docs/#control-structures), [built-in filters](https://tera.netlify.app/docs/#built-ins), etc. 246 | 247 | ##### Context 248 | 249 | Context is the model that holds the required data for template rendering. The [JSON](https://en.wikipedia.org/wiki/JSON) format is used in the following example for the representation of a context. 250 | 251 | ```json 252 | { 253 | "app_name": "runst", 254 | "summary": "example", 255 | "body": "this is a notification 🦡", 256 | "urgency": "normal", 257 | "unread_count": 1, 258 | "timestamp": 1672426610 259 | } 260 | ``` 261 | 262 | ##### Styling 263 | 264 | [Pango](https://pango.gnome.org/) is used for text rendering. The markup documentation can be found [here](https://docs.gtk.org/Pango/pango_markup.html). 265 | 266 | A few examples would be: 267 | 268 | - `bold text`: **bold text** 269 | - `blue text`: blue text 270 | - `monospace text`: monospace text 271 | 272 | ### Urgency configuration 273 | 274 | There are 3 levels of urgency defined in the [Freedesktop](https://specifications.freedesktop.org/notification-spec/notification-spec-latest.html) specification and they define the importance of the notification. 275 | 276 | 1. `low`: e.g. "joe signed on" 277 | 2. `normal`: e.g. "you got mail" 278 | 3. `critical`: e.g. "your computer is on fire!" 279 | 280 | You can configure `runst` to act differently based on these urgency levels. For this, there need to be 3 different sections defined in the configuration file. Each of these sections has the following fields: 281 | 282 | ```toml 283 | [urgency_{level}] # urgency_low, urgency_normal or urgency_critical 284 | background = "#000000" # background color 285 | foreground = "#ffffff" # foreground color 286 | timeout = 10 287 | auto_clear = true 288 | text = "normal" 289 | custom_commands = [] 290 | ``` 291 | 292 | #### `timeout` 293 | 294 | This is the default timeout value (in seconds) if the notification has no timeout specified by the sender. If the timeout is 0, the notification is not automatically closed (i.e. it never expires). 295 | 296 | #### `auto_clear` 297 | 298 | If set to `true`, the **estimated read time** of the notification is calculated and it is used as the timeout. This is useful if you want the notifications to disappear as you finish reading them. 299 | 300 | #### `text` 301 | 302 | This is the custom text for the urgency level and can be used in [template context](#context) as `urgency`. If it is not set, the corresponding urgency level is used (e.g. "low", "normal" or "critical"). 303 | 304 | #### `custom_commands` 305 | 306 | With using this option, you can run custom OS commands based on urgency levels and the notification contents. The basic usage is the following: 307 | 308 | ```toml 309 | custom_commands = [ 310 | { command = 'echo "{{app_name}} {{summary}} {{body}}"' } # echoes the notification to stdout 311 | ] 312 | ``` 313 | 314 | As shown in the example above, you can specify an arbitrary command via `command` which is also processed through the template engine. This means that you can use the same [template context](#context). 315 | 316 | The filtering is done by matching the fields in JSON via using `filter` along with the `command`. For example, if you want to play a custom notification sound for a certain application: 317 | 318 | ```toml 319 | custom_commands = [ 320 | { filter = '{ "app_name":"notify-send" }', command = 'aplay notification.wav' }, 321 | { filter = '{ "app_name":"weechat" }', command = 'aplay irc.wav' } 322 | ] 323 | ``` 324 | 325 | The JSON filter can have the following fields: 326 | 327 | - `app_name`: Name of the application that sends the notification. 328 | - `summary`: Summary of the notification. 329 | - `body`: Body of the notification. 330 | 331 | Each of these fields is matched using regex and you can combine them as follows: 332 | 333 | ```toml 334 | custom_commands = [ 335 | { filter = '{ "app_name":"telegram|discord|.*chat$","body":"^hello.*" }', command = 'gotify push -t "{{app_name}}" "someone said hi!"' } 336 | ] 337 | ``` 338 | 339 | In this hypothetical example, we are sending a [Gotify](https://gotify.net/) notification when someone says hi to us in any chatting application matched by the regex. 340 | 341 | ## Why this exists? 342 | 343 | I have been a user of [dunst](https://github.com/dunst-project/dunst) for a long time. However, they made some [uncool breaking changes](https://github.com/dunst-project/dunst/issues/940) in [v1.7.0](https://github.com/dunst-project/dunst/releases/tag/v1.7.0) and it completely broke my configuration. That day, I refused to update `dunst` (I was too lazy to re-configure) and decided to write my own notification server using Rust. 344 | 345 | I wanted to keep `runst` simple since the way I use `dunst` was really simple. I was only showing an overlay window on top of [i3status](https://github.com/i3/i3status) as shown below: 346 | 347 | ![runst use case](assets/runst-demo2.gif) 348 | 349 | And that's how `runst` is born. 350 | 351 | ## Similar projects 352 | 353 | - [wired-notify](https://github.com/Toqozz/wired-notify) 354 | 355 | ## License 356 | 357 | Licensed under either of [Apache License Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) or [The MIT License](http://opensource.org/licenses/MIT) at your option. 358 | 359 | ## Copyright 360 | 361 | Copyright © 2022-2024, [Orhun Parmaksız](mailto:orhunparmaksiz@gmail.com) 362 | -------------------------------------------------------------------------------- /RELEASE.md: -------------------------------------------------------------------------------- 1 | # Creating a Release 2 | 3 | [GitHub](https://github.com/orhun/runst/releases) and [crates.io](https://crates.io/crates/runst) releases are automated via [GitHub actions](.github/workflows/cd.yml) and triggered by pushing a tag. 4 | 5 | 1. Run the [release script](./release.sh): `./release.sh v[X.Y.Z]` (requires [git-cliff](https://github.com/orhun/git-cliff) for changelog generation) 6 | 2. Push the changes: `git push` 7 | 3. Check if [Continuous Integration](https://github.com/orhun/runst/actions) workflow is completed successfully. 8 | 4. Push the tags: `git push --tags` 9 | 5. Wait for [Continuous Deployment](https://github.com/orhun/runst/actions) workflow to finish. 10 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | The following versions are supported with security updates: 6 | 7 | | Version | Supported | 8 | | ------- | ------------------ | 9 | | 0.1.x | :white_check_mark: | 10 | 11 | ## Reporting a Vulnerability 12 | 13 | Please use the [GitHub Security Advisories](https://github.com/orhun/runst/security/advisories/new) feature to report vulnerabilities. 14 | -------------------------------------------------------------------------------- /assets/runst-demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orhun/runst/2dcc4895b2543d55619b33d7afea527a60ca9e8c/assets/runst-demo.gif -------------------------------------------------------------------------------- /assets/runst-demo2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orhun/runst/2dcc4895b2543d55619b33d7afea527a60ca9e8c/assets/runst-demo2.gif -------------------------------------------------------------------------------- /assets/runst-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orhun/runst/2dcc4895b2543d55619b33d7afea527a60ca9e8c/assets/runst-logo.png -------------------------------------------------------------------------------- /build.rs: -------------------------------------------------------------------------------- 1 | use dbus_codegen::{ConnectionType, GenOpts, ServerAccess}; 2 | use std::env; 3 | use std::error::Error; 4 | use std::fs; 5 | use std::path::Path; 6 | 7 | const INTROSPECTION_PATH: &str = "dbus/introspection.xml"; 8 | 9 | fn main() -> Result<(), Box> { 10 | let introspection = fs::read_to_string(INTROSPECTION_PATH)?; 11 | let out_dir = env::var_os("OUT_DIR").ok_or("OUT_DIR is not set")?; 12 | 13 | let gen_path = Path::new(&out_dir).join("introspection.rs"); 14 | let gen_opts = GenOpts { 15 | methodtype: None, 16 | crossroads: true, 17 | skipprefix: None, 18 | serveraccess: ServerAccess::RefClosure, 19 | genericvariant: false, 20 | connectiontype: ConnectionType::Blocking, 21 | propnewtype: false, 22 | interfaces: None, 23 | ..Default::default() 24 | }; 25 | 26 | let code = dbus_codegen::generate(&introspection, &gen_opts)?; 27 | fs::write(&gen_path, code)?; 28 | 29 | println!("D-Bus code generated at {gen_path:?}"); 30 | println!("cargo:rerun-if-changed={INTROSPECTION_PATH}"); 31 | println!("cargo:rerun-if-changed=build.rs"); 32 | Ok(()) 33 | } 34 | -------------------------------------------------------------------------------- /cliff.toml: -------------------------------------------------------------------------------- 1 | # configuration file for git-cliff 2 | # https://github.com/orhun/git-cliff 3 | 4 | [changelog] 5 | # changelog header 6 | header = """ 7 | # Changelog\n 8 | All notable changes to this project will be documented in this file.\n 9 | """ 10 | # template for the changelog body 11 | # https://tera.netlify.app/docs/#introduction 12 | body = """ 13 | {% if version %}\ 14 | ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} 15 | {% else %}\ 16 | ## [unreleased] 17 | {% endif %}\ 18 | {% for group, commits in commits | group_by(attribute="group") %} 19 | ### {{ group | striptags | trim | upper_first }} 20 | {% for commit in commits 21 | | filter(attribute="scope") 22 | | sort(attribute="scope") %} 23 | - *({{commit.scope}})* {{ commit.message | upper_first }} 24 | {%- if commit.breaking %} 25 | {% raw %} {% endraw %}- **BREAKING**: {{commit.breaking_description}} 26 | {%- endif -%} 27 | {%- endfor -%} 28 | {%- for commit in commits %} 29 | {%- if commit.scope -%} 30 | {% else -%} 31 | - *(no category)* {{ commit.message | upper_first }} 32 | {% if commit.breaking -%} 33 | {% raw %} {% endraw %}- **BREAKING**: {{commit.breaking_description}} 34 | {% endif -%} 35 | {% endif -%} 36 | {% endfor -%} 37 | {% raw %}\n{% endraw %}\ 38 | {% endfor %}\n 39 | """ 40 | # remove the leading and trailing whitespace from the template 41 | trim = true 42 | # changelog footer 43 | footer = """ 44 | 45 | """ 46 | 47 | [git] 48 | # parse the commits based on https://www.conventionalcommits.org 49 | conventional_commits = true 50 | # filter out the commits that are not conventional 51 | filter_unconventional = true 52 | # process each line of a commit as an individual commit 53 | split_commits = false 54 | # regex for preprocessing the commit messages 55 | commit_preprocessors = [ 56 | { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/orhun/runst/issues/${2}))" }, 57 | ] 58 | # regex for parsing and grouping commits 59 | commit_parsers = [ 60 | { message = "^feat", group = "🚀 Features" }, 61 | { message = "^fix", group = "🐛 Bug Fixes" }, 62 | { message = "^doc", group = "📚 Documentation" }, 63 | { message = "^perf", group = "⚡ Performance" }, 64 | { message = "^refactor", group = "🚜 Refactor" }, 65 | { message = "^style", group = "🎨 Styling" }, 66 | { message = "^test", group = "🧪 Testing" }, 67 | { message = "^chore\\(release\\): prepare for", skip = true }, 68 | { message = "^chore\\(deps\\): bump*", skip = true }, 69 | { message = "^chore", group = "⚙️ Miscellaneous Tasks" }, 70 | { body = ".*security", group = "🛡️ Security" }, 71 | ] 72 | # protect breaking changes from being skipped due to matching a skipping commit_parser 73 | protect_breaking_commits = false 74 | # filter out the commits that are not matched by commit parsers 75 | filter_commits = false 76 | # glob pattern for matching git tags 77 | tag_pattern = "v[0-9]*" 78 | # regex for skipping tags 79 | skip_tags = "v0.1.0-rc.1" 80 | # regex for ignoring tags 81 | ignore_tags = "" 82 | # sort the tags topologically 83 | topo_order = false 84 | # sort the commits inside sections by oldest/newest order 85 | sort_commits = "oldest" 86 | -------------------------------------------------------------------------------- /committed.toml: -------------------------------------------------------------------------------- 1 | # configuration file for committed 2 | # https://github.com/crate-ci/committed 3 | 4 | # https://www.conventionalcommits.org 5 | style = "conventional" 6 | # disallow merge commits 7 | merge_commit = false 8 | # subject is not required to be capitalized 9 | subject_capitalized = false 10 | # subject should start with an imperative verb 11 | imperative_subject = true 12 | # subject should not end with a punctuation 13 | subject_not_punctuated = true 14 | # disable line length 15 | line_length = 0 16 | # disable subject length 17 | subject_length = 0 18 | # default allowed_types [ "chore", "docs", "feat", "fix", "perf", "refactor", "style", "test" ] 19 | allowed_types = [ 20 | "chore", 21 | "docs", 22 | "feat", 23 | "fix", 24 | "perf", 25 | "refactor", 26 | "revert", 27 | "style", 28 | "test", 29 | ] 30 | -------------------------------------------------------------------------------- /config/runst.toml: -------------------------------------------------------------------------------- 1 | [global] 2 | log_verbosity = "info" 3 | startup_notification = true 4 | geometry = "340x25+0+0" 5 | wrap_content = true 6 | font = "Monospace 10" 7 | template = """ 8 | [{{app_name}}] {{summary}}\ 9 | {% if body %} {{body}}{% endif %} \ 10 | {% if now(timestamp=true) - timestamp > 60 %} \ 11 | ({{ (now(timestamp=true) - timestamp) | humantime }} ago)\ 12 | {% endif %}\ 13 | {% if unread_count > 1 %} ({{unread_count}}){% endif %} 14 | """ 15 | 16 | [urgency_low] 17 | background = "#000000" 18 | foreground = "#505050" 19 | timeout = 2 20 | text = "low" 21 | 22 | [urgency_normal] 23 | background = "#bcbcb2" 24 | foreground = "#3f3c35" 25 | timeout = 10 26 | auto_clear = true 27 | text = "normal" 28 | 29 | [urgency_critical] 30 | background = "#3f3c35" 31 | foreground = "#bcbcb2" 32 | timeout = 0 33 | text = "critical" 34 | -------------------------------------------------------------------------------- /dbus/introspection.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /deny.toml: -------------------------------------------------------------------------------- 1 | # configuration file for cargo-deny 2 | # https://github.com/EmbarkStudios/cargo-deny 3 | 4 | [licenses] 5 | default = "deny" 6 | unlicensed = "deny" 7 | copyleft = "deny" 8 | confidence-threshold = 0.8 9 | allow = [ 10 | "MIT", 11 | "Apache-2.0", 12 | "Apache-2.0 WITH LLVM-exception", 13 | "Unicode-DFS-2016", 14 | "MPL-2.0", 15 | "BSD-3-Clause", 16 | "Zlib", 17 | ] 18 | 19 | [sources] 20 | unknown-registry = "deny" 21 | unknown-git = "warn" 22 | allow-registry = ["https://github.com/rust-lang/crates.io-index"] 23 | -------------------------------------------------------------------------------- /release.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | if [ -z "$1" ]; then 6 | echo "Please provide a tag." 7 | echo "Usage: ./release.sh v[X.Y.Z]" 8 | exit 9 | fi 10 | 11 | echo "Preparing $1..." 12 | # update the version 13 | msg="# bumped by release.sh" 14 | sed -E -i "s/^version = .* $msg$/version = \"${1#v}\" $msg/" Cargo.toml 15 | cargo build 16 | # update the changelog 17 | git cliff --tag "$1" >CHANGELOG.md 18 | git add -A 19 | git commit -m "chore(release): prepare for $1" 20 | git show 21 | # generate a changelog for the tag message 22 | changelog=$(git cliff --tag "$1" --unreleased --strip all | sed -e '/^#/d' -e '/^$/d') 23 | # create a signed tag 24 | # https://keyserver.ubuntu.com/pks/lookup?search=0x1B250A9F78535D1A&op=vindex 25 | git -c user.name="runst" \ 26 | -c user.email="runstify@proton.me" \ 27 | -c user.signingkey="AEF8C7261F4CEB41A448CBC41B250A9F78535D1A" \ 28 | tag -f -s -a "$1" -m "Release $1" -m "$changelog" 29 | git tag -v "$1" 30 | echo "Done!" 31 | echo "Now push the commit (git push) and the tag (git push --tags)." 32 | -------------------------------------------------------------------------------- /src/config.rs: -------------------------------------------------------------------------------- 1 | use crate::error::{Error, Result}; 2 | use crate::notification::{Notification, NotificationFilter, Urgency}; 3 | use colorsys::Rgb; 4 | use rust_embed::RustEmbed; 5 | use serde::de::{Deserializer, Error as SerdeError}; 6 | use serde::ser::Serializer; 7 | use serde::{Deserialize, Serialize}; 8 | use sscanf::scanf; 9 | use std::env; 10 | use std::fs; 11 | use std::path::PathBuf; 12 | use std::process::Command; 13 | use std::result::Result as StdResult; 14 | use std::str::{self, FromStr}; 15 | use std::time::{SystemTime, UNIX_EPOCH}; 16 | use tera::Tera; 17 | use tracing::Level; 18 | 19 | /// Environment variable for the configuration file. 20 | const CONFIG_ENV: &str = "RUNST_CONFIG"; 21 | 22 | /// Name of the default configuration file. 23 | const DEFAULT_CONFIG: &str = concat!(env!("CARGO_PKG_NAME"), ".toml"); 24 | 25 | /// Embedded (default) configuration. 26 | #[derive(Debug, RustEmbed)] 27 | #[folder = "config/"] 28 | struct EmbeddedConfig; 29 | 30 | /// Configuration. 31 | #[derive(Debug, Deserialize, Serialize)] 32 | pub struct Config { 33 | /// Global configuration. 34 | pub global: GlobalConfig, 35 | /// Configuration for low urgency. 36 | pub urgency_low: UrgencyConfig, 37 | /// Configuration for normal urgency. 38 | pub urgency_normal: UrgencyConfig, 39 | /// Configuration for critical urgency. 40 | pub urgency_critical: UrgencyConfig, 41 | } 42 | 43 | impl Config { 44 | /// Parses the configuration file. 45 | pub fn parse() -> Result { 46 | for config_path in [ 47 | env::var(CONFIG_ENV).ok().map(PathBuf::from), 48 | dirs::config_dir().map(|p| p.join(env!("CARGO_PKG_NAME")).join(DEFAULT_CONFIG)), 49 | dirs::home_dir().map(|p| { 50 | p.join(concat!(".", env!("CARGO_PKG_NAME"))) 51 | .join(DEFAULT_CONFIG) 52 | }), 53 | ] 54 | .iter() 55 | .flatten() 56 | { 57 | if config_path.exists() { 58 | let contents = fs::read_to_string(config_path)?; 59 | let config = toml::from_str(&contents)?; 60 | return Ok(config); 61 | } 62 | } 63 | if let Some(embedded_config) = EmbeddedConfig::get(DEFAULT_CONFIG) 64 | .and_then(|v| String::from_utf8(v.data.as_ref().to_vec()).ok()) 65 | { 66 | let config = toml::from_str(&embedded_config)?; 67 | Ok(config) 68 | } else { 69 | Err(Error::Config(String::from("configuration file not found"))) 70 | } 71 | } 72 | 73 | /// Returns the appropriate urgency configuration. 74 | pub fn get_urgency_config(&self, urgency: &Urgency) -> UrgencyConfig { 75 | match urgency { 76 | Urgency::Low => self.urgency_low.clone(), 77 | Urgency::Normal => self.urgency_normal.clone(), 78 | Urgency::Critical => self.urgency_critical.clone(), 79 | } 80 | } 81 | } 82 | 83 | /// Global configuration. 84 | #[derive(Debug, Deserialize, Serialize)] 85 | pub struct GlobalConfig { 86 | /// Log verbosity. 87 | #[serde(deserialize_with = "deserialize_level_from_string", skip_serializing)] 88 | pub log_verbosity: Level, 89 | /// Whether if a startup notification should be shown. 90 | pub startup_notification: bool, 91 | /// Geometry of the notification window. 92 | #[serde(deserialize_with = "deserialize_geometry_from_string")] 93 | pub geometry: Geometry, 94 | /// Whether if the window will be resized to wrap the content. 95 | pub wrap_content: bool, 96 | /// Text font. 97 | pub font: String, 98 | /// Template for the notification message. 99 | pub template: String, 100 | } 101 | 102 | /// Custom deserializer implementation for converting `String` to [`Level`] 103 | fn deserialize_level_from_string<'de, D>(deserializer: D) -> StdResult 104 | where 105 | D: Deserializer<'de>, 106 | { 107 | let value: String = Deserialize::deserialize(deserializer)?; 108 | Level::from_str(&value).map_err(SerdeError::custom) 109 | } 110 | 111 | /// Custom deserializer implementation for converting `String` to [`Geometry`] 112 | fn deserialize_geometry_from_string<'de, D>(deserializer: D) -> StdResult 113 | where 114 | D: Deserializer<'de>, 115 | { 116 | let value: String = Deserialize::deserialize(deserializer)?; 117 | Geometry::from_str(&value).map_err(SerdeError::custom) 118 | } 119 | 120 | /// Window geometry. 121 | #[derive(Debug, Deserialize, Serialize)] 122 | pub struct Geometry { 123 | /// Width of the window. 124 | pub width: u32, 125 | /// Height of the window. 126 | pub height: u32, 127 | /// X coordinate. 128 | pub x: u32, 129 | /// Y coordinate. 130 | pub y: u32, 131 | } 132 | 133 | impl FromStr for Geometry { 134 | type Err = Error; 135 | fn from_str(s: &str) -> StdResult { 136 | let (width, height, x, y) = 137 | scanf!(s, "{u32}x{u32}+{u32}+{u32}").map_err(|e| Error::Scanf(e.to_string()))?; 138 | Ok(Self { 139 | width, 140 | height, 141 | x, 142 | y, 143 | }) 144 | } 145 | } 146 | 147 | /// Urgency configuration. 148 | #[derive(Clone, Debug, Deserialize, Serialize)] 149 | pub struct UrgencyConfig { 150 | /// Background color. 151 | #[serde( 152 | deserialize_with = "deserialize_rgb_from_string", 153 | serialize_with = "serialize_rgb_to_string" 154 | )] 155 | pub background: Rgb, 156 | /// Foreground color. 157 | #[serde( 158 | deserialize_with = "deserialize_rgb_from_string", 159 | serialize_with = "serialize_rgb_to_string" 160 | )] 161 | pub foreground: Rgb, 162 | /// Timeout value. 163 | pub timeout: u32, 164 | /// Whether if auto timeout is enabled. 165 | pub auto_clear: Option, 166 | /// Text. 167 | pub text: Option, 168 | /// Custom OS commands to run. 169 | pub custom_commands: Option>, 170 | } 171 | 172 | /// Custom deserializer implementation for converting `String` to [`Rgb`] 173 | fn deserialize_rgb_from_string<'de, D>(deserializer: D) -> StdResult 174 | where 175 | D: Deserializer<'de>, 176 | { 177 | let value: String = Deserialize::deserialize(deserializer)?; 178 | Rgb::from_hex_str(&value).map_err(SerdeError::custom) 179 | } 180 | 181 | /// Custom serializer implementation for converting [`Rgb`] to `String` 182 | fn serialize_rgb_to_string(value: &Rgb, s: S) -> StdResult 183 | where 184 | S: Serializer, 185 | { 186 | s.serialize_str(&value.to_hex_string()) 187 | } 188 | 189 | impl UrgencyConfig { 190 | /// Runs the custom OS commands that are determined by configuration. 191 | pub fn run_commands(&self, notification: &Notification) -> Result<()> { 192 | if let Some(commands) = &self.custom_commands { 193 | for command in commands { 194 | if let Some(filter) = &command.filter { 195 | if !notification.matches_filter(filter) { 196 | continue; 197 | } 198 | } 199 | if (notification.timestamp 200 | + notification.expire_timeout.unwrap_or_default().as_secs()) 201 | < SystemTime::now().duration_since(UNIX_EPOCH)?.as_secs() 202 | { 203 | continue; 204 | } 205 | tracing::trace!("running command: {:#?}", command); 206 | let command = Tera::one_off( 207 | &command.command, 208 | ¬ification.into_context( 209 | self.text 210 | .clone() 211 | .unwrap_or_else(|| notification.urgency.to_string()), 212 | 0, 213 | )?, 214 | true, 215 | )?; 216 | Command::new("sh").args(["-c", &command]).spawn()?; 217 | } 218 | } 219 | Ok(()) 220 | } 221 | } 222 | 223 | /// Custom OS commands along with notification filters. 224 | #[derive(Clone, Debug, Deserialize, Serialize)] 225 | pub struct CustomCommand { 226 | /// Notification message filter. 227 | #[serde(deserialize_with = "deserialize_filter_from_string", default)] 228 | filter: Option, 229 | /// Command. 230 | command: String, 231 | } 232 | 233 | /// Custom deserializer implementation for converting `String` to [`NotificationFilter`] 234 | fn deserialize_filter_from_string<'de, D>( 235 | deserializer: D, 236 | ) -> StdResult, D::Error> 237 | where 238 | D: Deserializer<'de>, 239 | { 240 | let value: Option = Deserialize::deserialize(deserializer)?; 241 | match value { 242 | Some(v) => serde_json::from_str(&v).map_err(SerdeError::custom), 243 | None => Ok(None), 244 | } 245 | } 246 | -------------------------------------------------------------------------------- /src/dbus.rs: -------------------------------------------------------------------------------- 1 | use crate::error::{self, Error}; 2 | use crate::notification::{Action, Notification}; 3 | use dbus::arg::{RefArg, Variant}; 4 | use dbus::blocking::stdintf::org_freedesktop_dbus::RequestNameReply; 5 | use dbus::blocking::{Connection, Proxy}; 6 | use dbus::channel::MatchingReceiver; 7 | use dbus::message::MatchRule; 8 | use dbus::MethodErr; 9 | use dbus_crossroads::Crossroads; 10 | use std::collections::HashMap; 11 | use std::sync::atomic::{AtomicU32, Ordering}; 12 | use std::sync::mpsc::Sender; 13 | use std::time::{Duration, SystemTime, UNIX_EPOCH}; 14 | 15 | /// D-Bus server information. 16 | /// 17 | /// Specifically, the server name, vendor, version, and spec version. 18 | const SERVER_INFO: [&str; 4] = [ 19 | env!("CARGO_PKG_NAME"), 20 | env!("CARGO_PKG_AUTHORS"), 21 | env!("CARGO_PKG_VERSION"), 22 | "1.2", 23 | ]; 24 | 25 | /// D-Bus server capabilities. 26 | /// 27 | /// - `actions`: The server will provide the specified actions to the user. 28 | /// - `body`: Supports body text. 29 | const SERVER_CAPABILITIES: [&str; 2] = ["actions", "body"]; 30 | 31 | mod dbus_server { 32 | #![allow(clippy::too_many_arguments)] 33 | include!(concat!(env!("OUT_DIR"), "/introspection.rs")); 34 | } 35 | 36 | /// ID counter for the notification. 37 | static ID_COUNT: AtomicU32 = AtomicU32::new(1); 38 | 39 | /// D-Bus interface for desktop notifications. 40 | const NOTIFICATION_INTERFACE: &str = "org.freedesktop.Notifications"; 41 | 42 | /// D-Bus path for desktop notifications. 43 | const NOTIFICATION_PATH: &str = "/org/freedesktop/Notifications"; 44 | 45 | /// D-Bus notification implementation. 46 | /// 47 | /// 48 | pub struct DbusNotification { 49 | sender: Sender, 50 | } 51 | 52 | impl dbus_server::OrgFreedesktopNotifications for DbusNotification { 53 | fn get_capabilities(&mut self) -> Result, dbus::MethodErr> { 54 | Ok(SERVER_CAPABILITIES.into_iter().map(String::from).collect()) 55 | } 56 | 57 | fn notify( 58 | &mut self, 59 | app_name: String, 60 | replaces_id: u32, 61 | _app_icon: String, 62 | summary: String, 63 | body: String, 64 | _actions: Vec, 65 | hints: dbus::arg::PropMap, 66 | expire_timeout: i32, 67 | ) -> Result { 68 | let id = if replaces_id == 0 { 69 | ID_COUNT.fetch_add(1, Ordering::Relaxed) 70 | } else { 71 | replaces_id 72 | }; 73 | let notification = Notification { 74 | id, 75 | app_name, 76 | summary, 77 | body, 78 | expire_timeout: if expire_timeout != -1 { 79 | match expire_timeout.try_into() { 80 | Ok(v) => Some(Duration::from_millis(v)), 81 | Err(_) => None, 82 | } 83 | } else { 84 | None 85 | }, 86 | urgency: hints 87 | .get("urgency") 88 | .and_then(|v| v.as_u64()) 89 | .map(|v| v.into()) 90 | .unwrap_or_default(), 91 | is_read: false, 92 | timestamp: SystemTime::now() 93 | .duration_since(UNIX_EPOCH) 94 | .map_err(|e| dbus::MethodErr::failed(&e))? 95 | .as_secs(), 96 | }; 97 | tracing::trace!("{:#?}", notification); 98 | match self.sender.send(Action::Show(notification)) { 99 | Ok(_) => Ok(id), 100 | Err(e) => Err(dbus::MethodErr::failed(&e)), 101 | } 102 | } 103 | 104 | fn close_notification(&mut self, id: u32) -> Result<(), dbus::MethodErr> { 105 | tracing::trace!("received close signal for notification: {}", id); 106 | match self.sender.send(Action::Close(Some(id))) { 107 | Ok(_) => Ok(()), 108 | Err(e) => Err(dbus::MethodErr::failed(&e)), 109 | } 110 | } 111 | 112 | fn get_server_information( 113 | &mut self, 114 | ) -> Result<(String, String, String, String), dbus::MethodErr> { 115 | Ok(( 116 | SERVER_INFO[0].to_string(), 117 | SERVER_INFO[1].to_string(), 118 | SERVER_INFO[2].to_string(), 119 | SERVER_INFO[3].to_string(), 120 | )) 121 | } 122 | } 123 | 124 | /// Wrapper for a [`D-Bus connection`] and [`server`] handler. 125 | /// 126 | /// [`D-Bus connection`]: Connection 127 | /// [`server`]: Crossroads 128 | pub struct DbusServer { 129 | /// Connection to D-Bus. 130 | connection: Connection, 131 | /// Server handler. 132 | crossroads: Crossroads, 133 | } 134 | 135 | impl DbusServer { 136 | /// Initializes the D-Bus controller. 137 | pub fn init() -> error::Result { 138 | tracing::trace!("D-Bus server information: {:#?}", SERVER_INFO); 139 | tracing::trace!("D-Bus server capabilities: {:?}", SERVER_CAPABILITIES); 140 | let connection = Connection::new_session()?; 141 | let crossroads = Crossroads::new(); 142 | Ok(Self { 143 | connection, 144 | crossroads, 145 | }) 146 | } 147 | 148 | /// Registers a handler for handling D-Bus notifications. 149 | /// 150 | /// Handles the incoming messages in a blocking manner. 151 | pub fn register_notification_handler( 152 | mut self, 153 | sender: Sender, 154 | timeout: Duration, 155 | ) -> error::Result<()> { 156 | let reply = self 157 | .connection 158 | .request_name(NOTIFICATION_INTERFACE, false, true, false)?; 159 | if reply != RequestNameReply::PrimaryOwner { 160 | return Err(Error::Init( 161 | "Not primary D-Bus notification server, is another running?".to_string(), 162 | )); 163 | } 164 | let token = dbus_server::register_org_freedesktop_notifications(&mut self.crossroads); 165 | self.crossroads.insert( 166 | NOTIFICATION_PATH, 167 | &[token], 168 | DbusNotification { 169 | sender: sender.clone(), 170 | }, 171 | ); 172 | let token = self.crossroads.register(NOTIFICATION_INTERFACE, |builder| { 173 | let sender_cloned = sender.clone(); 174 | builder.method("History", (), ("reply",), move |_, _, ()| { 175 | sender_cloned 176 | .send(Action::ShowLast) 177 | .map_err(|e| MethodErr::failed(&e))?; 178 | Ok((String::from("history signal sent"),)) 179 | }); 180 | let sender_cloned = sender.clone(); 181 | builder.method("Close", (), ("reply",), move |_, _, (): ()| { 182 | sender_cloned 183 | .send(Action::Close(None)) 184 | .map_err(|e| MethodErr::failed(&e))?; 185 | Ok((String::from("close signal sent"),)) 186 | }); 187 | builder.method("CloseAll", (), ("reply",), move |_, _, ()| { 188 | sender 189 | .send(Action::CloseAll) 190 | .map_err(|e| MethodErr::failed(&e))?; 191 | Ok((String::from("close all signal sent"),)) 192 | }); 193 | }); 194 | self.crossroads 195 | .insert(format!("{NOTIFICATION_PATH}/ctl"), &[token], ()); 196 | self.connection.start_receive( 197 | MatchRule::new_method_call(), 198 | Box::new(move |message, connection| { 199 | self.crossroads 200 | .handle_message(message, connection) 201 | .expect("failed to handle message"); 202 | true 203 | }), 204 | ); 205 | loop { 206 | self.connection.process(timeout)?; 207 | } 208 | } 209 | } 210 | 211 | /// Wrapper for a [`D-Bus connection`] without the server part. 212 | /// 213 | /// [`D-Bus connection`]: Connection 214 | pub struct DbusClient { 215 | /// Connection to D-Bus. 216 | connection: Connection, 217 | } 218 | 219 | unsafe impl Send for DbusClient {} 220 | unsafe impl Sync for DbusClient {} 221 | 222 | impl DbusClient { 223 | /// Initializes the D-Bus controller. 224 | pub fn init() -> error::Result { 225 | let connection = Connection::new_session()?; 226 | Ok(Self { connection }) 227 | } 228 | 229 | /// Sends a notification. 230 | /// 231 | /// See `org.freedesktop.Notifications.Notify` 232 | pub fn notify>( 233 | &self, 234 | app_name: S, 235 | summary: S, 236 | body: S, 237 | expire_timeout: i32, 238 | ) -> error::Result<()> { 239 | let proxy = Proxy::new( 240 | NOTIFICATION_INTERFACE, 241 | NOTIFICATION_PATH, 242 | Duration::from_millis(1000), 243 | &self.connection, 244 | ); 245 | proxy.method_call( 246 | NOTIFICATION_INTERFACE, 247 | "Notify", 248 | ( 249 | app_name.into(), 250 | 0_u32, 251 | String::new(), 252 | summary.into(), 253 | body.into(), 254 | Vec::::new(), 255 | { 256 | let mut hints = HashMap::>>::new(); 257 | hints.insert(String::from("urgency"), Variant(Box::new(0_u8))); 258 | hints 259 | }, 260 | expire_timeout, 261 | ), 262 | )?; 263 | Ok(()) 264 | } 265 | 266 | /// Closes the notification. 267 | /// 268 | /// See `org.freedesktop.Notifications.CloseNotification` 269 | pub fn close_notification(&self, id: u32, timeout: Duration) -> error::Result<()> { 270 | tracing::trace!( 271 | "sending close signal for notification: {} (timeout: {}ms)", 272 | id, 273 | timeout.as_millis() 274 | ); 275 | let proxy = Proxy::new( 276 | NOTIFICATION_INTERFACE, 277 | NOTIFICATION_PATH, 278 | timeout, 279 | &self.connection, 280 | ); 281 | proxy.method_call(NOTIFICATION_INTERFACE, "CloseNotification", (id,))?; 282 | Ok(()) 283 | } 284 | } 285 | -------------------------------------------------------------------------------- /src/error.rs: -------------------------------------------------------------------------------- 1 | #![allow(missing_docs)] 2 | 3 | use thiserror::Error as ThisError; 4 | 5 | #[derive(Debug, ThisError)] 6 | pub enum Error { 7 | #[error("IO error: `{0}`")] 8 | Io(#[from] std::io::Error), 9 | #[error("D-Bus error: `{0}`")] 10 | Dbus(#[from] dbus::Error), 11 | #[error("D-Bus string error: `{0}`")] 12 | DbusString(String), 13 | #[error("D-Bus argument error: `{0}`")] 14 | DbusArgument(String), 15 | #[error("X11 connect error: `{0}`")] 16 | X11Connect(#[from] x11rb::errors::ConnectError), 17 | #[error("X11 connection error: `{0}`")] 18 | X11Connection(#[from] x11rb::errors::ConnectionError), 19 | #[error("X11 ID error: `{0}`")] 20 | X11Id(#[from] x11rb::errors::ReplyOrIdError), 21 | #[error("X11 error: `{0}`")] 22 | X11Other(String), 23 | #[error("Cairo error: `{0}`")] 24 | Cairo(#[from] cairo::Error), 25 | #[error("Receiver error: `{0}`")] 26 | Receiver(#[from] std::sync::mpsc::RecvError), 27 | #[error("TOML parsing error: `{0}`")] 28 | Toml(#[from] toml::de::Error), 29 | #[error("Scan error: `{0}`")] 30 | Scanf(String), 31 | #[error("Integer conversion error: `{0}`")] 32 | IntegerConversion(#[from] std::num::TryFromIntError), 33 | #[error("Template error: `{0}`")] 34 | Template(#[from] tera::Error), 35 | #[error("Template parse error:\n{0}")] 36 | TemplateParse(String), 37 | #[error("Template render error:\n{0}")] 38 | TemplateRender(String), 39 | #[error("System time error: `{0}`")] 40 | SystemTime(#[from] std::time::SystemTimeError), 41 | #[error("Config error: `{0}`")] 42 | Config(String), 43 | #[error("Init error: `{0}")] 44 | Init(String), 45 | } 46 | 47 | /// Type alias for the standard [`Result`] type. 48 | pub type Result = std::result::Result; 49 | -------------------------------------------------------------------------------- /src/lib.rs: -------------------------------------------------------------------------------- 1 | //! A dead simple notification daemon. 2 | 3 | #![warn(missing_docs, clippy::unwrap_used)] 4 | 5 | /// Error handler. 6 | pub mod error; 7 | 8 | /// D-Bus handler. 9 | pub mod dbus; 10 | 11 | /// X11 handler. 12 | pub mod x11; 13 | 14 | /// Configuration. 15 | pub mod config; 16 | 17 | /// Notification manager. 18 | pub mod notification; 19 | 20 | use crate::config::Config; 21 | use crate::dbus::{DbusClient, DbusServer}; 22 | use crate::error::Result; 23 | use crate::notification::Action; 24 | use crate::x11::X11; 25 | use estimated_read_time::Options; 26 | use notification::Manager; 27 | use std::sync::mpsc; 28 | use std::sync::Arc; 29 | use std::thread; 30 | use std::time::Duration; 31 | use tracing_subscriber::EnvFilter; 32 | 33 | /// Runs `runst`. 34 | pub fn run() -> Result<()> { 35 | let config = Arc::new(Config::parse()?); 36 | 37 | tracing_subscriber::fmt() 38 | .with_env_filter( 39 | EnvFilter::builder() 40 | .with_default_directive(config.global.log_verbosity.into()) 41 | .from_env_lossy(), 42 | ) 43 | .init(); 44 | tracing::trace!("{:#?}", config); 45 | tracing::info!("starting"); 46 | 47 | let mut x11 = X11::init(None)?; 48 | let window = x11.create_window(&config.global)?; 49 | let dbus_server = DbusServer::init()?; 50 | let dbus_client = Arc::new(DbusClient::init()?); 51 | let timeout = Duration::from_millis(1000); 52 | 53 | let x11 = Arc::new(x11); 54 | let window = Arc::new(window); 55 | let notifications = Manager::init(); 56 | 57 | let x11_cloned = Arc::clone(&x11); 58 | let window_cloned = Arc::clone(&window); 59 | let dbus_client_cloned = Arc::clone(&dbus_client); 60 | let config_cloned = Arc::clone(&config); 61 | let notifications_cloned = notifications.clone(); 62 | 63 | thread::spawn(move || { 64 | if let Err(e) = x11_cloned.handle_events( 65 | window_cloned, 66 | notifications_cloned, 67 | config_cloned, 68 | |notification| { 69 | tracing::debug!("user input detected"); 70 | dbus_client_cloned 71 | .close_notification(notification.id, timeout) 72 | .expect("failed to close notification"); 73 | }, 74 | ) { 75 | eprintln!("Failed to handle X11 events: {e}") 76 | } 77 | }); 78 | 79 | let (sender, receiver) = mpsc::channel(); 80 | 81 | thread::spawn(move || { 82 | tracing::debug!("registering D-Bus handler"); 83 | dbus_server 84 | .register_notification_handler(sender, timeout) 85 | .expect("failed to register D-Bus notification handler"); 86 | }); 87 | 88 | if config.global.startup_notification { 89 | dbus_client.notify( 90 | env!("CARGO_PKG_NAME"), 91 | "startup", 92 | concat!(env!("CARGO_PKG_NAME"), " is up and running 🦡"), 93 | -1, 94 | )?; 95 | } 96 | 97 | let x11_cloned = Arc::clone(&x11); 98 | loop { 99 | match receiver.recv()? { 100 | Action::Show(notification) => { 101 | tracing::debug!("received notification: {}", notification.id); 102 | let timeout = notification.expire_timeout.unwrap_or_else(|| { 103 | let urgency_config = config.get_urgency_config(¬ification.urgency); 104 | Duration::from_secs(if urgency_config.auto_clear.unwrap_or(false) { 105 | notification 106 | .render_message(&window.template, urgency_config.text, 0) 107 | .map(|v| estimated_read_time::text(&v, &Options::default()).seconds()) 108 | .unwrap_or_default() 109 | } else { 110 | urgency_config.timeout.into() 111 | }) 112 | }); 113 | if !timeout.is_zero() { 114 | tracing::debug!("notification timeout: {}ms", timeout.as_millis()); 115 | let dbus_client_cloned = Arc::clone(&dbus_client); 116 | let notifications_cloned = notifications.clone(); 117 | thread::spawn(move || { 118 | thread::sleep(timeout); 119 | if notifications_cloned.is_unread(notification.id) { 120 | dbus_client_cloned 121 | .close_notification(notification.id, timeout) 122 | .expect("failed to close notification"); 123 | } 124 | }); 125 | } 126 | notifications.add(notification); 127 | x11_cloned.hide_window(&window)?; 128 | x11_cloned.show_window(&window)?; 129 | } 130 | Action::ShowLast => { 131 | tracing::debug!("showing the last notification"); 132 | if notifications.count() == 0 { 133 | continue; 134 | } else if notifications.mark_next_as_unread() { 135 | x11_cloned.hide_window(&window)?; 136 | x11_cloned.show_window(&window)?; 137 | } else { 138 | x11_cloned.hide_window(&window)?; 139 | } 140 | } 141 | Action::Close(id) => { 142 | if let Some(id) = id { 143 | tracing::debug!("closing notification: {}", id); 144 | notifications.mark_as_read(id); 145 | } else { 146 | tracing::debug!("closing the last notification"); 147 | notifications.mark_last_as_read(); 148 | } 149 | x11_cloned.hide_window(&window)?; 150 | if notifications.get_unread_count() >= 1 { 151 | x11_cloned.show_window(&window)?; 152 | } 153 | } 154 | Action::CloseAll => { 155 | tracing::debug!("closing all notifications"); 156 | notifications.mark_all_as_read(); 157 | x11_cloned.hide_window(&window)?; 158 | } 159 | } 160 | } 161 | } 162 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | use std::process; 2 | 3 | fn main() { 4 | match runst::run() { 5 | Ok(_) => process::exit(0), 6 | Err(e) => { 7 | eprintln!("{e}"); 8 | process::exit(1) 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/notification.rs: -------------------------------------------------------------------------------- 1 | use crate::error::{Error, Result}; 2 | use regex::Regex; 3 | use serde::{Deserialize, Serialize}; 4 | use std::error::Error as StdError; 5 | use std::fmt::Display; 6 | use std::sync::{Arc, RwLock}; 7 | use std::time::Duration; 8 | use tera::{Context as TeraContext, Tera}; 9 | 10 | /// Name of the template for rendering the notification message. 11 | pub const NOTIFICATION_MESSAGE_TEMPLATE: &str = "notification_message_template"; 12 | 13 | /// Possible urgency levels for the notification. 14 | #[derive(Clone, Debug, Serialize)] 15 | pub enum Urgency { 16 | /// Low urgency. 17 | Low, 18 | /// Normal urgency (default). 19 | Normal, 20 | /// Critical urgency. 21 | Critical, 22 | } 23 | 24 | impl Display for Urgency { 25 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 26 | write!(f, "{}", format!("{self:?}").to_lowercase()) 27 | } 28 | } 29 | 30 | impl From for Urgency { 31 | fn from(value: u64) -> Self { 32 | match value { 33 | 0 => Self::Low, 34 | 1 => Self::Normal, 35 | 2 => Self::Critical, 36 | _ => Self::default(), 37 | } 38 | } 39 | } 40 | 41 | impl Default for Urgency { 42 | fn default() -> Self { 43 | Self::Normal 44 | } 45 | } 46 | 47 | /// Representation of a notification. 48 | /// 49 | /// See [D-Bus Notify Parameters](https://specifications.freedesktop.org/notification-spec/latest/ar01s09.html) 50 | #[derive(Clone, Debug, Default)] 51 | pub struct Notification { 52 | /// The optional notification ID. 53 | pub id: u32, 54 | /// Name of the application that sends the notification. 55 | pub app_name: String, 56 | /// Summary text. 57 | pub summary: String, 58 | /// Body. 59 | pub body: String, 60 | /// The timeout time in milliseconds. 61 | pub expire_timeout: Option, 62 | /// Urgency. 63 | pub urgency: Urgency, 64 | /// Whether if the notification is read. 65 | pub is_read: bool, 66 | /// Timestamp that the notification is created. 67 | pub timestamp: u64, 68 | } 69 | 70 | impl Notification { 71 | /// Converts [`Notification`] into [`TeraContext`]. 72 | pub fn into_context(&self, urgency_text: String, unread_count: usize) -> Result { 73 | Ok(TeraContext::from_serialize(Context { 74 | app_name: &self.app_name, 75 | summary: &self.summary, 76 | body: &self.body, 77 | urgency_text, 78 | unread_count, 79 | timestamp: self.timestamp, 80 | })?) 81 | } 82 | 83 | /// Renders the notification message using the given template. 84 | pub fn render_message( 85 | &self, 86 | template: &Tera, 87 | urgency_text: Option, 88 | unread_count: usize, 89 | ) -> Result { 90 | match template.render( 91 | NOTIFICATION_MESSAGE_TEMPLATE, 92 | &self.into_context( 93 | urgency_text.unwrap_or_else(|| self.urgency.to_string()), 94 | unread_count, 95 | )?, 96 | ) { 97 | Ok(v) => Ok::(v), 98 | Err(e) => { 99 | if let Some(error_source) = e.source() { 100 | Err(Error::TemplateRender(error_source.to_string())) 101 | } else { 102 | Err(Error::Template(e)) 103 | } 104 | } 105 | } 106 | } 107 | 108 | /// Returns true if the given filter matches the notification message. 109 | pub fn matches_filter(&self, filter: &NotificationFilter) -> bool { 110 | macro_rules! check_filter { 111 | ($field: ident) => { 112 | if let Some($field) = &filter.$field { 113 | if !$field.is_match(&self.$field) { 114 | return false; 115 | } 116 | } 117 | }; 118 | } 119 | check_filter!(app_name); 120 | check_filter!(summary); 121 | check_filter!(body); 122 | true 123 | } 124 | } 125 | 126 | /// Notification message filter. 127 | #[derive(Clone, Debug, Deserialize, Serialize)] 128 | pub struct NotificationFilter { 129 | /// Name of the application. 130 | #[serde(with = "serde_regex", default)] 131 | pub app_name: Option, 132 | /// Summary text. 133 | #[serde(with = "serde_regex", default)] 134 | pub summary: Option, 135 | /// Body. 136 | #[serde(with = "serde_regex", default)] 137 | pub body: Option, 138 | } 139 | 140 | /// Template context for the notification. 141 | #[derive(Clone, Debug, Default, Serialize)] 142 | struct Context<'a> { 143 | /// Name of the application that sends the notification. 144 | pub app_name: &'a str, 145 | /// Summary text. 146 | pub summary: &'a str, 147 | /// Body. 148 | pub body: &'a str, 149 | /// Urgency. 150 | #[serde(rename = "urgency")] 151 | pub urgency_text: String, 152 | /// Count of unread notifications. 153 | pub unread_count: usize, 154 | /// Timestamp of the notification. 155 | pub timestamp: u64, 156 | } 157 | 158 | /// Possible actions for a notification. 159 | #[derive(Debug)] 160 | pub enum Action { 161 | /// Show a notification. 162 | Show(Notification), 163 | /// Show the last notification. 164 | ShowLast, 165 | /// Close a notification. 166 | Close(Option), 167 | /// Close all the notifications. 168 | CloseAll, 169 | } 170 | 171 | /// Notification manager. 172 | #[derive(Debug)] 173 | pub struct Manager { 174 | /// Inner type that holds the notifications in thread-safe way. 175 | inner: Arc>>, 176 | } 177 | 178 | impl Clone for Manager { 179 | fn clone(&self) -> Self { 180 | Self { 181 | inner: Arc::clone(&self.inner), 182 | } 183 | } 184 | } 185 | 186 | impl Manager { 187 | /// Initializes the notification manager. 188 | pub fn init() -> Self { 189 | Self { 190 | inner: Arc::new(RwLock::new(Vec::new())), 191 | } 192 | } 193 | 194 | /// Returns the number of notifications. 195 | pub fn count(&self) -> usize { 196 | self.inner 197 | .read() 198 | .expect("failed to retrieve notifications") 199 | .len() 200 | } 201 | 202 | /// Adds a new notifications to manage. 203 | pub fn add(&self, notification: Notification) { 204 | self.inner 205 | .write() 206 | .expect("failed to retrieve notifications") 207 | .push(notification); 208 | } 209 | 210 | /// Returns the last unread notification. 211 | pub fn get_last_unread(&self) -> Notification { 212 | let notifications = self.inner.read().expect("failed to retrieve notifications"); 213 | let notifications = notifications 214 | .iter() 215 | .filter(|v| !v.is_read) 216 | .collect::>(); 217 | notifications[notifications.len() - 1].clone() 218 | } 219 | 220 | /// Marks the last notification as read. 221 | pub fn mark_last_as_read(&self) { 222 | let mut notifications = self 223 | .inner 224 | .write() 225 | .expect("failed to retrieve notifications"); 226 | if let Some(notification) = notifications.iter_mut().filter(|v| !v.is_read).last() { 227 | notification.is_read = true; 228 | } 229 | } 230 | 231 | /// Marks the next notification as unread starting from the first one. 232 | /// 233 | /// Returns true if there is an unread notification remaining. 234 | pub fn mark_next_as_unread(&self) -> bool { 235 | let mut notifications = self 236 | .inner 237 | .write() 238 | .expect("failed to retrieve notifications"); 239 | let last_unread_index = notifications.iter_mut().position(|v| !v.is_read); 240 | if last_unread_index.is_none() { 241 | let len = notifications.len(); 242 | notifications[len - 1].is_read = false; 243 | } 244 | if let Some(index) = last_unread_index { 245 | notifications[index].is_read = true; 246 | if index > 0 { 247 | notifications[index - 1].is_read = false; 248 | } else { 249 | return false; 250 | } 251 | } 252 | true 253 | } 254 | 255 | /// Marks the given notification as read. 256 | pub fn mark_as_read(&self, id: u32) { 257 | let mut notifications = self 258 | .inner 259 | .write() 260 | .expect("failed to retrieve notifications"); 261 | if let Some(notification) = notifications 262 | .iter_mut() 263 | .find(|notification| notification.id == id) 264 | { 265 | notification.is_read = true; 266 | } 267 | } 268 | 269 | /// Marks all the notifications as read. 270 | pub fn mark_all_as_read(&self) { 271 | let mut notifications = self 272 | .inner 273 | .write() 274 | .expect("failed to retrieve notifications"); 275 | notifications.iter_mut().for_each(|v| v.is_read = true); 276 | } 277 | 278 | /// Returns the number of unread notifications. 279 | pub fn get_unread_count(&self) -> usize { 280 | let notifications = self.inner.read().expect("failed to retrieve notifications"); 281 | notifications.iter().filter(|v| !v.is_read).count() 282 | } 283 | 284 | /// Returns true if the notification is unread. 285 | pub fn is_unread(&self, id: u32) -> bool { 286 | let notifications = self.inner.read().expect("failed to retrieve notifications"); 287 | notifications 288 | .iter() 289 | .find(|notification| notification.id == id) 290 | .map(|v| !v.is_read) 291 | .unwrap_or_default() 292 | } 293 | } 294 | #[cfg(test)] 295 | mod tests { 296 | use super::*; 297 | #[test] 298 | fn test_notification_filter() { 299 | let notification = Notification { 300 | app_name: String::from("app"), 301 | summary: String::from("test"), 302 | body: String::from("this is a test notification"), 303 | ..Default::default() 304 | }; 305 | assert!(notification.matches_filter(&NotificationFilter { 306 | app_name: Regex::new("app").ok(), 307 | summary: None, 308 | body: None, 309 | })); 310 | assert!(notification.matches_filter(&NotificationFilter { 311 | app_name: None, 312 | summary: Regex::new("tes*").ok(), 313 | body: None, 314 | })); 315 | assert!(notification.matches_filter(&NotificationFilter { 316 | app_name: None, 317 | summary: None, 318 | body: Regex::new("notification").ok(), 319 | })); 320 | assert!(notification.matches_filter(&NotificationFilter { 321 | app_name: Regex::new("app").ok(), 322 | summary: Regex::new("test").ok(), 323 | body: Regex::new("notification").ok(), 324 | })); 325 | assert!(notification.matches_filter(&NotificationFilter { 326 | app_name: None, 327 | summary: None, 328 | body: None, 329 | })); 330 | assert!(!notification.matches_filter(&NotificationFilter { 331 | app_name: Regex::new("xxx").ok(), 332 | summary: None, 333 | body: Regex::new("yyy").ok(), 334 | })); 335 | assert!(!notification.matches_filter(&NotificationFilter { 336 | app_name: Regex::new("xxx").ok(), 337 | summary: Regex::new("aaa").ok(), 338 | body: Regex::new("yyy").ok(), 339 | })); 340 | assert!(!notification.matches_filter(&NotificationFilter { 341 | app_name: Regex::new("app").ok(), 342 | summary: Regex::new("invalid").ok(), 343 | body: Regex::new("regex").ok(), 344 | })); 345 | } 346 | } 347 | -------------------------------------------------------------------------------- /src/x11.rs: -------------------------------------------------------------------------------- 1 | use crate::config::{Config, GlobalConfig}; 2 | use crate::error::{Error, Result}; 3 | use crate::notification::{Manager, Notification, NOTIFICATION_MESSAGE_TEMPLATE}; 4 | use cairo::{ 5 | Context as CairoContext, XCBConnection as CairoXCBConnection, XCBDrawable, XCBSurface, 6 | XCBVisualType, 7 | }; 8 | use colorsys::ColorAlpha; 9 | use pango::{Context as PangoContext, FontDescription, Layout as PangoLayout}; 10 | use pangocairo::functions as pango_functions; 11 | use std::collections::HashMap; 12 | use std::error::Error as StdError; 13 | use std::sync::Arc; 14 | use std::time::Duration; 15 | use tera::{Result as TeraResult, Tera, Value}; 16 | use x11rb::connection::Connection; 17 | use x11rb::protocol::{xproto::*, Event}; 18 | use x11rb::xcb_ffi::XCBConnection; 19 | use x11rb::COPY_DEPTH_FROM_PARENT; 20 | 21 | /// Rust version of XCB's [`xcb_visualtype_t`] struct. 22 | /// 23 | /// [`xcb_visualtype_t`]: https://xcb.freedesktop.org/manual/structxcb__visualtype__t.html 24 | #[derive(Debug, Clone, Copy)] 25 | #[repr(C)] 26 | pub struct xcb_visualtype_t { 27 | visual_id: u32, 28 | class: u8, 29 | bits_per_rgb_value: u8, 30 | colormap_entries: u16, 31 | red_mask: u32, 32 | green_mask: u32, 33 | blue_mask: u32, 34 | pad0: [u8; 4], 35 | } 36 | 37 | impl From for xcb_visualtype_t { 38 | fn from(value: Visualtype) -> xcb_visualtype_t { 39 | xcb_visualtype_t { 40 | visual_id: value.visual_id, 41 | class: value.class.into(), 42 | bits_per_rgb_value: value.bits_per_rgb_value, 43 | colormap_entries: value.colormap_entries, 44 | red_mask: value.red_mask, 45 | green_mask: value.green_mask, 46 | blue_mask: value.blue_mask, 47 | pad0: [0; 4], 48 | } 49 | } 50 | } 51 | 52 | /// Wrapper for X11 [`connection`] and [`screen`]. 53 | /// 54 | /// [`connection`]: XCBConnection 55 | /// [`screen`]: x11rb::protocol::xproto::Screen 56 | pub struct X11 { 57 | connection: XCBConnection, 58 | cairo: CairoXCBConnection, 59 | screen: Screen, 60 | } 61 | 62 | unsafe impl Send for X11 {} 63 | unsafe impl Sync for X11 {} 64 | 65 | impl X11 { 66 | /// Initializes the X11 connection. 67 | pub fn init(screen_num: Option) -> Result { 68 | let (connection, default_screen_num) = XCBConnection::connect(None)?; 69 | tracing::trace!("Default screen num: {:?}", default_screen_num); 70 | let setup_info = connection.setup(); 71 | tracing::trace!("Setup info status: {:?}", setup_info.status); 72 | let screen = setup_info.roots[screen_num.unwrap_or(default_screen_num)].clone(); 73 | tracing::trace!("Screen root: {:?}", screen.root); 74 | let cairo = 75 | unsafe { CairoXCBConnection::from_raw_none(connection.get_raw_xcb_connection() as _) }; 76 | Ok(Self { 77 | connection, 78 | screen, 79 | cairo, 80 | }) 81 | } 82 | 83 | /// Creates a window. 84 | pub fn create_window(&mut self, config: &GlobalConfig) -> Result { 85 | let visual_id = self.screen.root_visual; 86 | let mut visual_type = self 87 | .find_xcb_visualtype(visual_id) 88 | .ok_or_else(|| Error::X11Other(String::from("cannot find a XCB visual type")))?; 89 | let visual = unsafe { XCBVisualType::from_raw_none(&mut visual_type as *mut _ as _) }; 90 | let window_id = self.connection.generate_id()?; 91 | tracing::trace!("Window ID: {:?}", window_id); 92 | self.connection.create_window( 93 | COPY_DEPTH_FROM_PARENT, 94 | window_id, 95 | self.screen.root, 96 | config.geometry.x.try_into()?, 97 | config.geometry.y.try_into()?, 98 | config.geometry.width.try_into()?, 99 | config.geometry.height.try_into()?, 100 | 0, 101 | WindowClass::INPUT_OUTPUT, 102 | visual_id, 103 | &CreateWindowAux::new() 104 | .border_pixel(self.screen.white_pixel) 105 | .override_redirect(1) 106 | .event_mask(EventMask::EXPOSURE | EventMask::BUTTON_PRESS), 107 | )?; 108 | let surface = XCBSurface::create( 109 | &self.cairo, 110 | &XCBDrawable(window_id), 111 | &visual, 112 | config.geometry.width.try_into()?, 113 | config.geometry.height.try_into()?, 114 | )?; 115 | let context = CairoContext::new(&surface)?; 116 | X11Window::new( 117 | window_id, 118 | context, 119 | &config.font, 120 | Box::leak(config.template.to_string().into_boxed_str()), 121 | ) 122 | } 123 | 124 | /// Find a `xcb_visualtype_t` based on its ID number 125 | fn find_xcb_visualtype(&self, visual_id: u32) -> Option { 126 | for root in &self.connection.setup().roots { 127 | for depth in &root.allowed_depths { 128 | for visual in &depth.visuals { 129 | if visual.visual_id == visual_id { 130 | return Some((*visual).into()); 131 | } 132 | } 133 | } 134 | } 135 | None 136 | } 137 | 138 | /// Shows the given X11 window. 139 | pub fn show_window(&self, window: &X11Window) -> Result<()> { 140 | window.show(&self.connection)?; 141 | self.connection.flush()?; 142 | Ok(()) 143 | } 144 | 145 | /// Hides the given X11 window. 146 | pub fn hide_window(&self, window: &X11Window) -> Result<()> { 147 | window.hide(&self.connection)?; 148 | self.connection.flush()?; 149 | Ok(()) 150 | } 151 | 152 | /// Handles the events. 153 | pub fn handle_events( 154 | &self, 155 | window: Arc, 156 | manager: Manager, 157 | config: Arc, 158 | on_press: F, 159 | ) -> Result<()> 160 | where 161 | F: Fn(&Notification), 162 | { 163 | loop { 164 | self.connection.flush()?; 165 | let event = self.connection.wait_for_event()?; 166 | let mut event_opt = Some(event); 167 | while let Some(event) = event_opt { 168 | tracing::trace!("New event: {:?}", event); 169 | match event { 170 | Event::Expose(_) => { 171 | let notification = manager.get_last_unread(); 172 | let unread_count = manager.get_unread_count(); 173 | window.draw(&self.connection, notification, unread_count, &config)?; 174 | } 175 | Event::ButtonPress(_) => { 176 | let notification = manager.get_last_unread(); 177 | manager.mark_last_as_read(); 178 | on_press(¬ification); 179 | } 180 | _ => {} 181 | } 182 | event_opt = self.connection.poll_for_event()?; 183 | } 184 | } 185 | } 186 | } 187 | 188 | /// Representation of a X11 window. 189 | pub struct X11Window { 190 | /// Window ID. 191 | pub id: u32, 192 | /// Graphics renderer context. 193 | pub cairo_context: CairoContext, 194 | /// Text renderer context. 195 | pub pango_context: PangoContext, 196 | /// Window layout. 197 | pub layout: PangoLayout, 198 | /// Text format. 199 | pub template: Tera, 200 | } 201 | 202 | unsafe impl Send for X11Window {} 203 | unsafe impl Sync for X11Window {} 204 | 205 | impl X11Window { 206 | /// Creates a new instance of window. 207 | pub fn new( 208 | id: u32, 209 | cairo_context: CairoContext, 210 | font: &str, 211 | raw_template: &'static str, 212 | ) -> Result { 213 | let pango_context = pango_functions::create_context(&cairo_context); 214 | let layout = PangoLayout::new(&pango_context); 215 | let font_description = FontDescription::from_string(font); 216 | pango_context.set_font_description(Some(&font_description)); 217 | let mut template = Tera::default(); 218 | if let Err(e) = 219 | template.add_raw_template(NOTIFICATION_MESSAGE_TEMPLATE, raw_template.trim()) 220 | { 221 | return if let Some(error_source) = e.source() { 222 | Err(Error::TemplateParse(error_source.to_string())) 223 | } else { 224 | Err(Error::Template(e)) 225 | }; 226 | } 227 | template.register_filter( 228 | "humantime", 229 | |value: &Value, _: &HashMap| -> TeraResult { 230 | let value = tera::try_get_value!("humantime_filter", "value", u64, value); 231 | let value = humantime::format_duration(Duration::new(value, 0)).to_string(); 232 | Ok(tera::to_value(value)?) 233 | }, 234 | ); 235 | Ok(Self { 236 | id, 237 | cairo_context, 238 | pango_context, 239 | layout, 240 | template, 241 | }) 242 | } 243 | 244 | /// Shows the window. 245 | fn show(&self, connection: &impl Connection) -> Result<()> { 246 | connection.map_window(self.id)?; 247 | Ok(()) 248 | } 249 | 250 | /// Hides the window. 251 | fn hide(&self, connection: &impl Connection) -> Result<()> { 252 | connection.unmap_window(self.id)?; 253 | Ok(()) 254 | } 255 | 256 | /// Draws the window content. 257 | fn draw( 258 | &self, 259 | connection: &XCBConnection, 260 | notification: Notification, 261 | unread_count: usize, 262 | config: &Config, 263 | ) -> Result<()> { 264 | let urgency_config = config.get_urgency_config(¬ification.urgency); 265 | urgency_config.run_commands(¬ification)?; 266 | let message = 267 | notification.render_message(&self.template, urgency_config.text, unread_count)?; 268 | let background_color = urgency_config.background; 269 | self.cairo_context.set_source_rgba( 270 | background_color.red() / 255.0, 271 | background_color.green() / 255.0, 272 | background_color.blue() / 255.0, 273 | background_color.alpha(), 274 | ); 275 | self.cairo_context.fill()?; 276 | self.cairo_context.paint()?; 277 | let foreground_color = urgency_config.foreground; 278 | self.cairo_context.set_source_rgba( 279 | foreground_color.red() / 255.0, 280 | foreground_color.green() / 255.0, 281 | foreground_color.blue() / 255.0, 282 | foreground_color.alpha(), 283 | ); 284 | self.cairo_context.move_to(0., 0.); 285 | self.layout.set_markup(&message); 286 | if config.global.wrap_content { 287 | let (width, height) = self.layout.pixel_size(); 288 | let values = ConfigureWindowAux::default() 289 | .width(width.try_into().ok()) 290 | .height(height.try_into().ok()); 291 | connection.configure_window(self.id, &values)?; 292 | } 293 | pango_functions::show_layout(&self.cairo_context, &self.layout); 294 | Ok(()) 295 | } 296 | } 297 | --------------------------------------------------------------------------------