Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:dspinella
wpaperd-git
wpaperd-1.0.1~git66.62af439.obscpio
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File wpaperd-1.0.1~git66.62af439.obscpio of Package wpaperd-git
07070100000000000041ED00000000000000000000000266D6DD8C00000000000000000000000000000000000000000000002400000000wpaperd-1.0.1~git66.62af439/.github07070100000001000041ED00000000000000000000000266D6DD8C00000000000000000000000000000000000000000000002E00000000wpaperd-1.0.1~git66.62af439/.github/workflows07070100000002000081A400000000000000000000000166D6DD8C00000A9E000000000000000000000000000000000000003800000000wpaperd-1.0.1~git66.62af439/.github/workflows/cargo.ymlon: [push, pull_request] name: Continuous integration jobs: check: name: Check runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Install dependencies run: sudo apt-get install --yes libwayland-dev libegl1-mesa-dev - uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: stable override: true - uses: actions-rs/cargo@v1 with: command: check test: name: Test Suite runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Install dependencies run: sudo apt-get install --yes libwayland-dev libegl1-mesa-dev - uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: stable override: true - uses: actions-rs/cargo@v1 with: command: test fmt: name: Rustfmt runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: stable override: true - run: rustup component add rustfmt - uses: actions-rs/cargo@v1 with: command: fmt args: --all -- --check clippy: name: Clippy runs-on: ubuntu-latest permissions: contents: read security-events: write steps: - name: Checkout code uses: actions/checkout@v2 - name: Install Rust toolchain uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: stable components: clippy override: true - name: Install required cargo run: cargo install clippy-sarif sarif-fmt - name: Run rust-clippy run: cargo clippy --all-features --message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt continue-on-error: true - name: Upload analysis results to GitHub uses: github/codeql-action/upload-sarif@v1 with: sarif_file: rust-clippy-results.sarif wait-for-processing: true audit: name: Audit runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: stable override: true - name: Install cargo-audit binary crate uses: actions-rs/install@v0.1 with: crate: cargo-audit version: latest use-tool-cache: true - name: Security audit uses: actions-rs/audit-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }} 07070100000003000081A400000000000000000000000166D6DD8C00000320000000000000000000000000000000000000003A00000000wpaperd-1.0.1~git66.62af439/.github/workflows/devskim.yml# This workflow uses actions that are not certified by GitHub. # They are provided by a third-party and are governed by # separate terms of service, privacy policy, and support # documentation. name: DevSkim on: push: branches: [ main ] pull_request: branches: [ main ] schedule: - cron: '44 0 * * 0' jobs: lint: name: DevSkim runs-on: ubuntu-20.04 permissions: actions: read contents: read security-events: write steps: - name: Checkout code uses: actions/checkout@v3 - name: Run DevSkim scanner uses: microsoft/DevSkim-Action@v1 - name: Upload DevSkim scan results to GitHub Security tab uses: github/codeql-action/upload-sarif@v2 with: sarif_file: devskim-results.sarif 07070100000004000081A400000000000000000000000166D6DD8C00000637000000000000000000000000000000000000003A00000000wpaperd-1.0.1~git66.62af439/.github/workflows/release.yml#on: # push: # tags: # - '*.*.*' name: Release jobs: release: name: Release Packaging runs-on: ubuntu-latest strategy: matrix: target: [x86_64-unknown-linux-gnu] steps: - uses: actions/checkout@v2 - name: Install dependencies run: sudo apt-get install --yes libwayland-dev libegl1-mesa-dev - uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: stable override: true target: ${{ matrix.target }} - name: Release Build uses: actions-rs/cargo@v1 with: command: build args: --release --target ${{ matrix.target }} - name: Generate man pages run: | sudo apt-get install --yes scdoc scdoc < man/wpaperd-output.5.scd > man/wpaperd-output.5 - name: Strip binary run: | strip target/${{ matrix.target }}/release/wpaperd strip target/${{ matrix.target }}/release/wpaperctl - name: Create tarball run: | cp target/${{ matrix.target }}/release/wpaperd wpaperd cp target/${{ matrix.target }}/release/wpaperctl wpaperctl tar -cvf wpaperd-${{ matrix.target }}.tar.zst \ wpaperd \ wpaperctl \ man/wpaperd-output.5 \ README.md \ LICENSE.md \ install.yml - name: Upload release tarball uses: softprops/action-gh-release@v1 with: files: wpaperd-${{ matrix.target }}.tar.zst 07070100000005000081A400000000000000000000000166D6DD8C0000002F000000000000000000000000000000000000002700000000wpaperd-1.0.1~git66.62af439/.gitignore/target /man/*.[1-8] /completions #nix /result07070100000006000081A400000000000000000000000166D6DD8C00000B22000000000000000000000000000000000000002900000000wpaperd-1.0.1~git66.62af439/CHANGELOG.md# 1.1 ## Breaking changes - Rename `transition_time` and `queue_size` to kebab case (`transition-time and `queue-size`). ## New features - Add `avif` feature to load `avif` images (requires `dav1d` library) - Add `offset` configuration to move the wallpaper from its center - Add `fit-border-color` background mode - Add `initial-transition` configuration to disable the startup transition if needed - Add `group` configuration to share the same wallpaper between multiple displays # 1.0.1 - Fix drawing at start time # 1.0.0 wpaperd is polished enough to call it 1.0.0 ## Breaking Changes - Version 0.3.0 had 2 different configuration files, one for wpaperd and one for the wallpapers. Remove the former and move the latter (`wallpaper.toml`) to `config.toml` - wpaperd `--no-daemon` behavior is now the default, `--daemon`/`-d` option have been added to fork and live in the background ## Other Changes - Use openGL ES to render the wallpaper instead of a Wayland memory buffer - Add transitions when switching to a wallpaper or to the other * Add `transition-time` to control the duratoin of the transition - Add `wpaperctl` command line program to control wpaperd * Let wpaperd switch the next and previous wallpaper * Get the current wallpaper for each displays * Reload the current wallpaper - Add `--notify` flag to wpaperd for readiness - Add `sorting` option to allow wpaperd to pick wallpaper in an ordered manner - Improve error checking and messages - Improve config parsing and checking - Remove --use-scaled-window option - Implement a filelist cache to avoid reading from disk every time - Add a `mode` to choose how to display the wallpaper (`center`, `fit`, `stretch` or `tile`) - Add a `any` section to configuration file to allow for more flexible configurations - Update MSRV to 1.61.0 - Use a black pixel as starting image # 0.3.0 - Replace timer library with calloop::sources::Timer (fixes #13) - Refactor wpaperd to use wayland-rs 0.30 and latest smithay-client-toolkit (fixes #14) - Do not crash when a new display is added or removed - The wallpaper duration setting is now more reliable - Fix panic when a directory is empty (fixes #27) - Remove `output-config` from config - Remove `--config` argument from cli - Rename wpaperd.conf to wpaperd.toml and output.conf to wallpaper.toml (fixes #25) - Cleanup code # 0.2.0 - Use rust implementation of wayland-client library - Draw to native resolution by default, add --use-scaled-window to match old behavior. Previously the wallpaper was drawn to the scaled resolution for the output selected and the compositor was doing the scaling. - Add apply-shadow option # 0.1.1 - Add wpaperd.1 manpage and completions - Log output to a file - Don't redraw when the dimensions are the same - Add wrap_help feature to clap # 0.1.0 Initial release! 07070100000007000081A400000000000000000000000166D6DD8C0000F1DA000000000000000000000000000000000000002700000000wpaperd-1.0.1~git66.62af439/Cargo.lock# This file is automatically @generated by Cargo. # It is not intended for manual editing. version = 3 [[package]] name = "addr2line" version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ "gimli", ] [[package]] name = "adler" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", "once_cell", "version_check", "zerocopy", ] [[package]] name = "aligned-vec" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4aa90d7ce82d4be67b64039a3d588d38dbcc6736577de4a847025ce5b0c468d1" [[package]] name = "android-tzdata" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" [[package]] name = "android_system_properties" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" dependencies = [ "libc", ] [[package]] name = "anstream" version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" [[package]] name = "anstyle-parse" version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" dependencies = [ "anstyle", "windows-sys 0.52.0", ] [[package]] name = "anyhow" version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "arbitrary" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" [[package]] name = "arg_enum_proc_macro" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea" dependencies = [ "proc-macro2", "quote", "syn 2.0.68", ] [[package]] name = "arrayvec" version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "autocfg" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "av-data" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d75b98a3525d00f920df9a2d44cc99b9cc5b7dc70d7fbb612cd755270dbe6552" dependencies = [ "byte-slice-cast", "bytes", "num-derive", "num-rational", "num-traits", "thiserror", ] [[package]] name = "av1-grain" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6678909d8c5d46a42abcf571271e15fdbc0a225e3646cf23762cd415046c78bf" dependencies = [ "anyhow", "arrayvec", "log", "nom", "num-rational", "v_frame", ] [[package]] name = "avif-serialize" version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "876c75a42f6364451a033496a14c44bffe41f5f4a8236f697391f11024e596d2" dependencies = [ "arrayvec", ] [[package]] name = "backtrace" version = "0.3.71" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" dependencies = [ "addr2line", "cc", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", ] [[package]] name = "bit_field" version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61" [[package]] name = "bitflags" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "bitreader" version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bdd859c9d97f7c468252795b35aeccc412bdbb1e90ee6969c4fa6328272eaeff" dependencies = [ "cfg-if", ] [[package]] name = "bitstream-io" version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415f8399438eb5e4b2f73ed3152a3448b98149dda642a957ee704e1daa5cf1d8" [[package]] name = "built" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6a6c0b39c38fd754ac338b00a88066436389c0f029da5d37d1e01091d9b7c17" [[package]] name = "bumpalo" version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byte-slice-cast" version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" [[package]] name = "bytemuck" version = "1.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b236fc92302c97ed75b38da1f4917b5cdda4984745740f153a5d3059e48d725e" [[package]] name = "byteorder" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "byteorder-lite" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" [[package]] name = "bytes" version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] name = "calloop" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b99da2f8558ca23c71f4fd15dc57c906239752dd27ff3c00a1d56b685b7cbfec" dependencies = [ "bitflags 2.6.0", "log", "polling", "rustix", "slab", "thiserror", ] [[package]] name = "calloop-wayland-source" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95a66a987056935f7efce4ab5668920b5d0dac4a7c99991a67395f13702ddd20" dependencies = [ "calloop", "rustix", "wayland-backend", "wayland-client", ] [[package]] name = "cc" version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac367972e516d45567c7eafc73d24e1c193dcf200a8d94e9db7b3d38b349572d" dependencies = [ "jobserver", "libc", "once_cell", ] [[package]] name = "cfg-expr" version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" dependencies = [ "smallvec", "target-lexicon", ] [[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "cfg_aliases" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "chrono" version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", "windows-targets 0.52.5", ] [[package]] name = "clap" version = "4.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5db83dced34638ad474f39f250d7fea9598bdd239eaced1bdf45d597da0f433f" dependencies = [ "clap_builder", "clap_derive", ] [[package]] name = "clap_builder" version = "4.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7e204572485eb3fbf28f871612191521df159bc3e15a9f5064c66dba3a8c05f" dependencies = [ "anstream", "anstyle", "clap_lex", "strsim", "terminal_size", ] [[package]] name = "clap_complete" version = "4.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbca90c87c2a04da41e95d1856e8bcd22f159bdbfa147314d2ce5218057b0e58" dependencies = [ "clap", ] [[package]] name = "clap_derive" version = "4.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c780290ccf4fb26629baa7a1081e68ced113f1d3ec302fa5948f1c381ebf06c6" dependencies = [ "heck", "proc-macro2", "quote", "syn 2.0.68", ] [[package]] name = "clap_lex" version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" [[package]] name = "clap_mangen" version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74b70fc13e60c0e1d490dc50eb73a749be6d81f4ef03783df1d9b7b0c62bc937" dependencies = [ "clap", "roff", ] [[package]] name = "color-eyre" version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55146f5e46f237f7423d74111267d4597b59b0dad0ffaf7303bce9945d843ad5" dependencies = [ "backtrace", "eyre", "indenter", "once_cell", "owo-colors", ] [[package]] name = "color_quant" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" [[package]] name = "colorchoice" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" [[package]] name = "concurrent-queue" version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" dependencies = [ "crossbeam-utils", ] [[package]] name = "core-foundation-sys" version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "crc32fast" version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] [[package]] name = "crossbeam-channel" version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-deque" version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-utils" version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crunchy" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "cursor-icon" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96a6ac251f4a2aca6b3f91340350eab87ae57c3f127ffeb585e92bd336717991" [[package]] name = "dav1d" version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d4b54a40baf633a71c6f0fb49494a7e4ee7bc26f3e727212b6cb915aa1ea1e1" dependencies = [ "av-data", "bitflags 2.6.0", "dav1d-sys", "static_assertions", ] [[package]] name = "dav1d-sys" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ecb1c5e8f4dc438eedc1b534a54672fb0e0a56035dae6b50162787bd2c50e95" dependencies = [ "libc", "system-deps", ] [[package]] name = "dcv-color-primitives" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07ad62edfed069700a5b33af6babd29c498d7e33eb01d96ffa8841ee1841634c" dependencies = [ "paste", "wasm-bindgen", ] [[package]] name = "dirs" version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" dependencies = [ "dirs-sys", ] [[package]] name = "dirs-sys" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" dependencies = [ "libc", "option-ext", "redox_users", "windows-sys 0.48.0", ] [[package]] name = "dlib" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" dependencies = [ "libloading", ] [[package]] name = "downcast-rs" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" [[package]] name = "either" version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "equivalent" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", ] [[package]] name = "exr" version = "1.72.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "887d93f60543e9a9362ef8a21beedd0a833c5d9610e18c67abe15a5963dcb1a4" dependencies = [ "bit_field", "flume", "half", "lebe", "miniz_oxide", "rayon-core", "smallvec", "zune-inflate", ] [[package]] name = "eyre" version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" dependencies = [ "indenter", "once_cell", ] [[package]] name = "fallible_collections" version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a88c69768c0a15262df21899142bc6df9b9b823546d4b4b9a7bc2d6c448ec6fd" dependencies = [ "hashbrown 0.13.2", ] [[package]] name = "fdeflate" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4f9bfee30e4dedf0ab8b422f03af778d9612b63f502710fc500a334ebe2de645" dependencies = [ "simd-adler32", ] [[package]] name = "file-id" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e13be71e6ca82e91bc0cb862bebaac0b2d1924a5a1d970c822b2f98b63fda8c3" dependencies = [ "winapi-util", ] [[package]] name = "filetime" version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" dependencies = [ "cfg-if", "libc", "redox_syscall 0.4.1", "windows-sys 0.52.0", ] [[package]] name = "flate2" version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" dependencies = [ "crc32fast", "miniz_oxide", ] [[package]] name = "flexi_logger" version = "0.28.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cca927478b3747ba47f98af6ba0ac0daea4f12d12f55e9104071b3dc00276310" dependencies = [ "chrono", "glob", "log", "nu-ansi-term", "thiserror", ] [[package]] name = "flume" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" dependencies = [ "spin", ] [[package]] name = "format-bytes" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48942366ef93975da38e175ac9e10068c6fc08ca9e85930d4f098f4d5b14c2fd" dependencies = [ "format-bytes-macros", ] [[package]] name = "format-bytes-macros" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "203aadebefcc73d12038296c228eabf830f99cba991b0032adf20e9fa6ce7e4f" dependencies = [ "proc-macro2", "quote", "syn 1.0.109", ] [[package]] name = "fsevent-sys" version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76ee7a02da4d231650c7cea31349b889be2f45ddb3ef3032d2ec8185f6313fd2" dependencies = [ "libc", ] [[package]] name = "getrandom" version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", "wasi", ] [[package]] name = "gif" version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fb2d69b19215e18bb912fa30f7ce15846e301408695e44e0ef719f1da9e19f2" dependencies = [ "color_quant", "weezl", ] [[package]] name = "gimli" version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "gl_generator" version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d" dependencies = [ "khronos_api", "log", "xml-rs", ] [[package]] name = "glob" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "half" version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" dependencies = [ "cfg-if", "crunchy", ] [[package]] name = "hashbrown" version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ "ahash", ] [[package]] name = "hashbrown" version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" [[package]] name = "heck" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" [[package]] name = "hotwatch" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9140219159163c92eb58c37955a0cc57c5814c3c44521955aae376064c668756" dependencies = [ "log", "notify", "notify-debouncer-full", ] [[package]] name = "humantime" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "humantime-serde" version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57a3db5ea5923d99402c94e9feb261dc5ee9b4efa158b0315f788cf549cc200c" dependencies = [ "humantime", "serde", ] [[package]] name = "iana-time-zone" version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", "windows-core", ] [[package]] name = "iana-time-zone-haiku" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" dependencies = [ "cc", ] [[package]] name = "image" version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd54d660e773627692c524beaad361aca785a4f9f5730ce91f42aabe5bce3d11" dependencies = [ "bytemuck", "byteorder", "color_quant", "dav1d", "dcv-color-primitives", "exr", "gif", "image-webp", "mp4parse", "num-traits", "png", "qoi", "ravif", "rayon", "rgb", "tiff", "zune-core", "zune-jpeg", ] [[package]] name = "image-webp" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d730b085583c4d789dfd07fdcf185be59501666a90c97c40162b37e4fdad272d" dependencies = [ "byteorder-lite", "thiserror", ] [[package]] name = "imgref" version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44feda355f4159a7c757171a77de25daf6411e217b4cabd03bd6650690468126" [[package]] name = "indenter" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" [[package]] name = "indexmap" version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", "hashbrown 0.14.5", ] [[package]] name = "inotify" version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8069d3ec154eb856955c1c0fbffefbf5f3c40a104ec912d4797314c1801abff" dependencies = [ "bitflags 1.3.2", "inotify-sys", "libc", ] [[package]] name = "inotify-sys" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" dependencies = [ "libc", ] [[package]] name = "interpolate_name" version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60" dependencies = [ "proc-macro2", "quote", "syn 2.0.68", ] [[package]] name = "is_terminal_polyfill" version = "1.70.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" [[package]] name = "itertools" version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" dependencies = [ "either", ] [[package]] name = "itoa" version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jobserver" version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" dependencies = [ "libc", ] [[package]] name = "jpeg-decoder" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" [[package]] name = "js-sys" version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] [[package]] name = "khronos-egl" version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6aae1df220ece3c0ada96b8153459b67eebe9ae9212258bb0134ae60416fdf76" dependencies = [ "libc", "pkg-config", ] [[package]] name = "khronos_api" version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" [[package]] name = "kqueue" version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7447f1ca1b7b563588a205fe93dea8df60fd981423a768bc1c0ded35ed147d0c" dependencies = [ "kqueue-sys", "libc", ] [[package]] name = "kqueue-sys" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed9625ffda8729b85e45cf04090035ac368927b8cebc34898e7c120f52e4838b" dependencies = [ "bitflags 1.3.2", "libc", ] [[package]] name = "lebe" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" [[package]] name = "libc" version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libfuzzer-sys" version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a96cfd5557eb82f2b83fed4955246c988d331975a002961b07c81584d107e7f7" dependencies = [ "arbitrary", "cc", "once_cell", ] [[package]] name = "libloading" version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" dependencies = [ "cfg-if", "windows-targets 0.52.5", ] [[package]] name = "libredox" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ "bitflags 2.6.0", "libc", ] [[package]] name = "linux-raw-sys" version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lock_api" version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", ] [[package]] name = "log" version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "loop9" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fae87c125b03c1d2c0150c90365d7d6bcc53fb73a9acaef207d2d065860f062" dependencies = [ "imgref", ] [[package]] name = "maybe-rayon" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ea1f30cedd69f0a2954655f7188c6a834246d2bcf1e315e2ac40c4b24dc9519" dependencies = [ "cfg-if", "rayon", ] [[package]] name = "memchr" version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memmap2" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322" dependencies = [ "libc", ] [[package]] name = "mime" version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "minimal-lexical" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", "simd-adler32", ] [[package]] name = "mio" version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "log", "wasi", "windows-sys 0.48.0", ] [[package]] name = "mp4parse" version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "63a35203d3c6ce92d5251c77520acb2e57108c88728695aa883f70023624c570" dependencies = [ "bitreader", "byteorder", "fallible_collections", "log", "num-traits", "static_assertions", ] [[package]] name = "new_debug_unreachable" version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" [[package]] name = "new_mime_guess" version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2d684d1b59e0dc07b37e2203ef576987473288f530082512aff850585c61b1f" dependencies = [ "mime", "unicase", ] [[package]] name = "nix" version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" dependencies = [ "bitflags 2.6.0", "cfg-if", "cfg_aliases", "libc", ] [[package]] name = "nom" version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" dependencies = [ "memchr", "minimal-lexical", ] [[package]] name = "noop_proc_macro" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8" [[package]] name = "notify" version = "6.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d" dependencies = [ "bitflags 2.6.0", "crossbeam-channel", "filetime", "fsevent-sys", "inotify", "kqueue", "libc", "log", "mio", "walkdir", "windows-sys 0.48.0", ] [[package]] name = "notify-debouncer-full" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4812c1eb49be776fb8df4961623bdc01ec9dfdc1abe8211ceb09150a2e64219" dependencies = [ "crossbeam-channel", "file-id", "notify", "parking_lot", "walkdir", ] [[package]] name = "nu-ansi-term" version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd2800e1520bdc966782168a627aa5d1ad92e33b984bf7c7615d31280c83ff14" dependencies = [ "windows-sys 0.48.0", ] [[package]] name = "num-bigint" version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ "num-integer", "num-traits", ] [[package]] name = "num-derive" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", "syn 2.0.68", ] [[package]] name = "num-integer" version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ "num-traits", ] [[package]] name = "num-rational" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" dependencies = [ "num-bigint", "num-integer", "num-traits", ] [[package]] name = "num-traits" version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] [[package]] name = "object" version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "memchr", ] [[package]] name = "once_cell" version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "option-ext" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "owo-colors" version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" [[package]] name = "parking_lot" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", ] [[package]] name = "parking_lot_core" version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", "redox_syscall 0.5.2", "smallvec", "windows-targets 0.52.5", ] [[package]] name = "paste" version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pin-project-lite" version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pkg-config" version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "png" version = "0.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06e4b0d3d1312775e782c86c91a111aa1f910cbb65e1337f9975b5f9a554b5e1" dependencies = [ "bitflags 1.3.2", "crc32fast", "fdeflate", "flate2", "miniz_oxide", ] [[package]] name = "polling" version = "3.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3ed00ed3fbf728b5816498ecd316d1716eecaced9c0c8d2c5a6740ca214985b" dependencies = [ "cfg-if", "concurrent-queue", "hermit-abi", "pin-project-lite", "rustix", "tracing", "windows-sys 0.52.0", ] [[package]] name = "ppv-lite86" version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] [[package]] name = "profiling" version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43d84d1d7a6ac92673717f9f6d1518374ef257669c24ebc5ac25d5033828be58" dependencies = [ "profiling-procmacros", ] [[package]] name = "profiling-procmacros" version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8021cf59c8ec9c432cfc2526ac6b8aa508ecaf29cd415f271b8406c1b851c3fd" dependencies = [ "quote", "syn 2.0.68", ] [[package]] name = "qoi" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f6d64c71eb498fe9eae14ce4ec935c555749aef511cca85b5568910d6e48001" dependencies = [ "bytemuck", ] [[package]] name = "quick-error" version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" [[package]] name = "quick-xml" version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33" dependencies = [ "memchr", ] [[package]] name = "quote" version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] [[package]] name = "rand" version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha", "rand_core", ] [[package]] name = "rand_chacha" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", "rand_core", ] [[package]] name = "rand_core" version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ "getrandom", ] [[package]] name = "rav1e" version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd87ce80a7665b1cce111f8a16c1f3929f6547ce91ade6addf4ec86a8dda5ce9" dependencies = [ "arbitrary", "arg_enum_proc_macro", "arrayvec", "av1-grain", "bitstream-io", "built", "cfg-if", "interpolate_name", "itertools", "libc", "libfuzzer-sys", "log", "maybe-rayon", "new_debug_unreachable", "noop_proc_macro", "num-derive", "num-traits", "once_cell", "paste", "profiling", "rand", "rand_chacha", "simd_helpers", "system-deps", "thiserror", "v_frame", "wasm-bindgen", ] [[package]] name = "ravif" version = "0.11.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67376f469e7e7840d0040bbf4b9b3334005bb167f814621326e4c7ab8cd6e944" dependencies = [ "avif-serialize", "imgref", "loop9", "quick-error", "rav1e", "rayon", "rgb", ] [[package]] name = "rayon" version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ "either", "rayon-core", ] [[package]] name = "rayon-core" version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ "crossbeam-deque", "crossbeam-utils", ] [[package]] name = "redox_syscall" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ "bitflags 1.3.2", ] [[package]] name = "redox_syscall" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" dependencies = [ "bitflags 2.6.0", ] [[package]] name = "redox_users" version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" dependencies = [ "getrandom", "libredox", "thiserror", ] [[package]] name = "rgb" version = "0.8.37" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05aaa8004b64fd573fc9d002f4e632d51ad4f026c2b5ba95fcb6c2f32c2c47d8" dependencies = [ "bytemuck", ] [[package]] name = "roff" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b833d8d034ea094b1ea68aa6d5c740e0d04bad9d16568d08ba6f76823a114316" [[package]] name = "rustc-demangle" version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustix" version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", "windows-sys 0.52.0", ] [[package]] name = "ryu" version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "same-file" version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" dependencies = [ "winapi-util", ] [[package]] name = "scoped-tls" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" [[package]] name = "scopeguard" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", "syn 2.0.68", ] [[package]] name = "serde_json" version = "1.0.118" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d947f6b3163d8857ea16c4fa0dd4840d52f3041039a85decd46867eb1abef2e4" dependencies = [ "itoa", "ryu", "serde", ] [[package]] name = "serde_spanned" version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" dependencies = [ "serde", ] [[package]] name = "simd-adler32" version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" [[package]] name = "simd_helpers" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95890f873bec569a0362c235787f3aca6e1e887302ba4840839bcc6459c42da6" dependencies = [ "quote", ] [[package]] name = "slab" version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] [[package]] name = "smallvec" version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "smithay-client-toolkit" version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "837d3067369e24aeda699a5d9fc5aa14ca14a84dd70aeed7156bfa04a5605b32" dependencies = [ "bitflags 2.6.0", "calloop", "calloop-wayland-source", "cursor-icon", "libc", "log", "memmap2", "rustix", "thiserror", "wayland-backend", "wayland-client", "wayland-csd-frame", "wayland-cursor", "wayland-protocols", "wayland-protocols-wlr", "wayland-scanner", "xkeysym", ] [[package]] name = "spin" version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" dependencies = [ "lock_api", ] [[package]] name = "static_assertions" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "strsim" version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "syn" version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] [[package]] name = "syn" version = "2.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] [[package]] name = "system-deps" version = "6.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" dependencies = [ "cfg-expr", "heck", "pkg-config", "toml", "version-compare", ] [[package]] name = "target-lexicon" version = "0.12.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" [[package]] name = "terminal_size" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" dependencies = [ "rustix", "windows-sys 0.48.0", ] [[package]] name = "thiserror" version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", "syn 2.0.68", ] [[package]] name = "tiff" version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba1310fcea54c6a9a4fd1aad794ecc02c31682f6bfbecdf460bf19533eed1e3e" dependencies = [ "flate2", "jpeg-decoder", "weezl", ] [[package]] name = "tikv-jemalloc-sys" version = "0.6.0+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd3c60906412afa9c2b5b5a48ca6a5abe5736aec9eb48ad05037a677e52e4e2d" dependencies = [ "cc", "libc", ] [[package]] name = "tikv-jemallocator" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cec5ff18518d81584f477e9bfdf957f5bb0979b0bac3af4ca30b5b3ae2d2865" dependencies = [ "libc", "tikv-jemalloc-sys", ] [[package]] name = "toml" version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335" dependencies = [ "serde", "serde_spanned", "toml_datetime", "toml_edit", ] [[package]] name = "toml_datetime" version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" dependencies = [ "serde", ] [[package]] name = "toml_edit" version = "0.22.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f21c7aaf97f1bd9ca9d4f9e73b0a6c74bd5afef56f2bc931943a6e1c37e04e38" dependencies = [ "indexmap", "serde", "serde_spanned", "toml_datetime", "winnow", ] [[package]] name = "tracing" version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ "pin-project-lite", "tracing-core", ] [[package]] name = "tracing-core" version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" [[package]] name = "unicase" version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" dependencies = [ "version_check", ] [[package]] name = "unicode-ident" version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "utf8parse" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "v_frame" version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6f32aaa24bacd11e488aa9ba66369c7cd514885742c9fe08cfe85884db3e92b" dependencies = [ "aligned-vec", "num-traits", "wasm-bindgen", ] [[package]] name = "version-compare" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "852e951cb7832cb45cb1169900d19760cfa39b82bc0ea9c0e5a14ae88411c98b" [[package]] name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "walkdir" version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", ] [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", "syn 2.0.68", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", ] [[package]] name = "wasm-bindgen-macro-support" version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", "syn 2.0.68", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wayland-backend" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34e9e6b6d4a2bb4e7e69433e0b35c7923b95d4dc8503a84d25ec917a4bbfdf07" dependencies = [ "cc", "downcast-rs", "rustix", "scoped-tls", "smallvec", "wayland-sys", ] [[package]] name = "wayland-client" version = "0.31.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e63801c85358a431f986cffa74ba9599ff571fc5774ac113ed3b490c19a1133" dependencies = [ "bitflags 2.6.0", "rustix", "wayland-backend", "wayland-scanner", ] [[package]] name = "wayland-csd-frame" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e" dependencies = [ "bitflags 2.6.0", "cursor-icon", "wayland-backend", ] [[package]] name = "wayland-cursor" version = "0.31.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a206e8b2b53b1d3fcb9428fec72bc278ce539e2fa81fe2bfc1ab27703d5187b9" dependencies = [ "rustix", "wayland-client", "xcursor", ] [[package]] name = "wayland-egl" version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "18cede1c33845ccd8fcebf7f107595170abf0ad0a28d47c50b444e06019b16e8" dependencies = [ "wayland-backend", "wayland-sys", ] [[package]] name = "wayland-protocols" version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83d0f1056570486e26a3773ec633885124d79ae03827de05ba6c85f79904026c" dependencies = [ "bitflags 2.6.0", "wayland-backend", "wayland-client", "wayland-scanner", ] [[package]] name = "wayland-protocols-wlr" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7dab47671043d9f5397035975fe1cac639e5bca5cc0b3c32d09f01612e34d24" dependencies = [ "bitflags 2.6.0", "wayland-backend", "wayland-client", "wayland-protocols", "wayland-scanner", ] [[package]] name = "wayland-scanner" version = "0.31.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67da50b9f80159dec0ea4c11c13e24ef9e7574bd6ce24b01860a175010cea565" dependencies = [ "proc-macro2", "quick-xml", "quote", ] [[package]] name = "wayland-sys" version = "0.31.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "105b1842da6554f91526c14a2a2172897b7f745a805d62af4ce698706be79c12" dependencies = [ "dlib", "log", "pkg-config", ] [[package]] name = "weezl" version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" [[package]] name = "winapi-util" version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "windows-core" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ "windows-targets 0.52.5", ] [[package]] name = "windows-sys" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ "windows-targets 0.48.5", ] [[package]] name = "windows-sys" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ "windows-targets 0.52.5", ] [[package]] name = "windows-targets" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ "windows_aarch64_gnullvm 0.48.5", "windows_aarch64_msvc 0.48.5", "windows_i686_gnu 0.48.5", "windows_i686_msvc 0.48.5", "windows_x86_64_gnu 0.48.5", "windows_x86_64_gnullvm 0.48.5", "windows_x86_64_msvc 0.48.5", ] [[package]] name = "windows-targets" version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ "windows_aarch64_gnullvm 0.52.5", "windows_aarch64_msvc 0.52.5", "windows_i686_gnu 0.52.5", "windows_i686_gnullvm", "windows_i686_msvc 0.52.5", "windows_x86_64_gnu 0.52.5", "windows_x86_64_gnullvm 0.52.5", "windows_x86_64_msvc 0.52.5", ] [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" [[package]] name = "windows_i686_gnullvm" version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winnow" version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1" dependencies = [ "memchr", ] [[package]] name = "wpaperctl" version = "1.0.1" dependencies = [ "clap", "clap_complete", "clap_mangen", "serde", "serde_json", "wpaperd-ipc", ] [[package]] name = "wpaperd" version = "1.0.1" dependencies = [ "clap", "clap_complete", "clap_mangen", "color-eyre", "dirs", "flexi_logger", "format-bytes", "gl_generator", "hotwatch", "humantime-serde", "image", "khronos-egl", "log", "new_mime_guess", "nix", "rand", "serde", "serde_json", "smithay-client-toolkit", "tikv-jemallocator", "toml", "walkdir", "wayland-egl", "wpaperd-ipc", "xdg", ] [[package]] name = "wpaperd-ipc" version = "1.0.1" dependencies = [ "serde", "xdg", ] [[package]] name = "xcursor" version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a0ccd7b4a5345edfcd0c3535718a4e9ff7798ffc536bb5b5a0e26ff84732911" [[package]] name = "xdg" version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "213b7324336b53d2414b2db8537e56544d981803139155afa84f76eeebb7a546" [[package]] name = "xkeysym" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9cc00251562a284751c9973bace760d86c0276c471b4be569fe6b068ee97a56" [[package]] name = "xml-rs" version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "791978798f0597cfc70478424c2b4fdc2b7a8024aaff78497ef00f24ef674193" [[package]] name = "zerocopy" version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", "syn 2.0.68", ] [[package]] name = "zune-core" version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f423a2c17029964870cfaabb1f13dfab7d092a62a29a89264f4d36990ca414a" [[package]] name = "zune-inflate" version = "0.2.54" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02" dependencies = [ "simd-adler32", ] [[package]] name = "zune-jpeg" version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec866b44a2a1fd6133d363f073ca1b179f438f99e7e5bfb1e33f7181facfe448" dependencies = [ "zune-core", ] 07070100000008000081A400000000000000000000000166D6DD8C0000004F000000000000000000000000000000000000002700000000wpaperd-1.0.1~git66.62af439/Cargo.toml[workspace] members = [ "cli", "daemon", "ipc", ] resolver = "2" 07070100000009000081A400000000000000000000000166D6DD8C00008864000000000000000000000000000000000000002700000000wpaperd-1.0.1~git66.62af439/LICENSE.md### GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. ### Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. ### TERMS AND CONDITIONS #### 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. #### 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. #### 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. #### 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. #### 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. #### 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: - a) The work must carry prominent notices stating that you modified it, and giving a relevant date. - b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". - c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. - d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. #### 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: - a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. - b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. - c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. - d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. - e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. #### 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: - a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or - b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or - c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or - d) Limiting the use for publicity purposes of names of licensors or authors of the material; or - e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or - f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. #### 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. #### 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. #### 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. #### 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. #### 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. #### 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. #### 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. #### 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. #### 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. #### 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS ### How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: <program> Copyright (C) <year> <name of author> This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands \`show w' and \`show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <https://www.gnu.org/licenses/>. The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <https://www.gnu.org/licenses/why-not-lgpl.html>. 0707010000000A000081A400000000000000000000000166D6DD8C00001BBB000000000000000000000000000000000000002600000000wpaperd-1.0.1~git66.62af439/README.md# wpaperd ![GitHub's release (latest by date)](https://img.shields.io/github/v/release/danyspin97/wpaperd?logo=github&style=flat-square) [![GitHub license](https://img.shields.io/github/license/danyspin97/wpaperd?logo=github&style=flat-square)](https://github.com/danyspin97/wpaperd/blob/main/LICENSE.md) ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/danyspin97/wpaperd/cargo.yml?branch=main&logo=github&style=flat-square) **wpaperd** is the modern wallpaper daemon for Wayland. It dynamically changes the current wallpaper, either after a certain amount of time or via a command-line interface. It uses OpenGL ES to render the images and have beautiful hardware-accelerated transitions, while being easy on resources. *Notice*: wpaperd uses [wlr_layer_shell](https://wayland.app/protocols/wlr-layer-shell-unstable-v1) wayland protocol, which is available on all wlroots based compositors (sway, hyprland, ...) and on KDE. **Therefore it won't work on GNOME.** ## Features - Different wallpaper for each display - Pick a wallpaper from a directory - Change the wallpaper after a set time - Multiple sorting methods (random or ordered) - Flexible TOML configuration file - Hot config reloading for all settings - Easy to use command line interface - Hardware-accelerated configurable transitions - Multiple background modes (center, fit, fill) - Easy on resources (low CPU and memory usage) ## Getting started ### Dependencies *wpaperd* is written in Rust and requires a working Cargo installation. It also depends on: - `mesa` - `wayland-client` - `wayland-egl` - `rinstall` (optional, for installing `wpaperd`) - `libdav1d` (optional, for loading `avif` images) ### Build To install `wpaperd`, clone the repository and build the project: ```bash $ git clone https://github.com/danyspin97/wpaperd $ cd wpaperd $ cargo build --release ``` Generate the man pages by running `scdoc`: ```bash $ scdoc < man/wpaperd-output.5.scd > man/wpaperd-output.5 ``` ### Install You can install both the daemon (`wpaperd`) and cli (`wpaperctl`) using **rinstall**: ```bash $ rinstall --yes ``` To run _wpaperd_, run the **daemon**: ```bash $ wpaperd ``` If you want to automatically run it at startup, add this line to your sway configuration (located in `$HOME/.config/sway/config`): ``` # Assuming it has been installed in ~/.local/bin/wpaperd exec ~/.local/bin/wpaperd -d ``` Or in Hyprland: ``` exec-once=~/.local/bin/wpaperd -d ``` ## Image formats support wpaperd uses the [image] create to load and display images. Have a look on its [documentation](https://github.com/image-rs/image/blob/main/README.md#supported-image-formats) for the supported formats. *Note*: To enable `avif` format, build wpaperd with `avif` feature (requires `libdav1d` to be installed. ## Cycling images When `path` is set to a directory, you can cycle the images by running the commands `next` and `previous` using _wpaperctl_: ```bash $ wpaperctl next $ wpaperctl previous ``` When `sorting` is set to `ascending` and `descending`, _wpaperd_ will use the wallpaper name to calculate the next wallpaper accordingly. When `sorting` is set to `random`, it will store all the wallpapers shown in a queue, so that the commands `next` and `previous` can work as intended. The cycling of images can also be paused/resumed by running the `pause` and `resume` commands, or just `toggle-pause`, using _wpaperctl_: ```bash $ wpaperctl pause $ wpaperctl resume $ wpaperctl toggle-pause ``` ## Wallpaper Configuration The configuration file for *wpaperd* is located in `XDG_CONFIG_HOME/wpaperd/config.toml` (which defaults to `~/.config/wpaperd/config.toml`). Each section represents a different display and can contain the following keys: - `path`, path to the image to use as wallpaper or to a directory to pick the wallpaper from - `duration`, how much time the image should be displayed until it is changed with a new one. It supports a human format for declaring the duration (e.g. `30s` or `10m`), described [here](https://docs.rs/humantime/latest/humantime/fn.parse_duration.html). This is only valid when path points to a directory. (_Optional_) - `sorting`, choose the sorting order. Valid options are `ascending`, `descending`, and `random`, with the default being `random`. This is only valid when path points to a directory. (_Optional_) - `group`, assign multiple displays to same group to share the same wallpaper when using `random` sorting; group must be a number. (_Optional_) - `mode`, choose how to display the wallpaper when the size is different than the display resolution: - `fit` shows the entire image with black corners covering the empty space left - `fit-border-color` works like `fit`, but fill the empty space with the color of the border of the image; suggested for images that have a solid color in their border - `center` centers the image on the screen, leaving out the corners of the image that couldn't fit - `stretch` shows the entire image stretching it to fit the entire screen without leaving any black corner, changing the aspect ratio - `tile` shows the image multiple times horizontally and vertically to fill the screen - `transition-time`, how many milliseconds should the transition run. (_Optional_, `300` by default). - `offset`, offset the image on the screen, with a value from `0.0` to `1.0`. (_Optional_, `0.0` by default for `tile` mode and `0.5` for all the other modes) - `queue-size`, decide how big the queue should be when `path` is set a directory and `sorting` is set to `random`. (_Optional_, `10` by default) - `initial-transition`, enable the initial transition at wpaperd startup. (_Optional_, true by default) The section `default` will be used as base for the all the display configuration; the section `any` will be used for all the displays that are not explictly listed. This allows to have a flexible configuration without repeating any settings. _wpaperd_ will check the configuration at startup and each time it changes and provide help when it is incorrect. This is the simplest configuration: ```toml [DP-3] path = "/home/danyspin97/github_octupus.png" [DP-4] path = "/home/danyspin97/Wallpapers" duration = "30m" ``` This is a more complex configuration: ```toml [default] duration = "30m" mode = "center" sorting = "ascending" [any] path = "/home/danyspin97/default_wallpaper.png" [DP-3] path = "/home/danyspin97/Wallpapers" ``` If you're running sway, you can look for the available outputs and their ID by running: ```bash $ swaymsg -t get_outputs ``` On Hyprland you can run: ```bash $ hyprctl monitors ``` ## FAQ - The wallpapers are **slow to load**: wpaperd uses the `image` crate to load and decode the image. However, when built in `debug` mode the loading and decoding time takes from half a second to a couple, even on modern hardware. Try building wpaperd in release mode: ```bash $ cargo build --release ``` ## License **wpaperd** is licensed under the [GPL-3.0+](/LICENSE.md) license. [swaybg]: https://github.com/swaywm/swaybg 0707010000000B000041ED00000000000000000000000266D6DD8C00000000000000000000000000000000000000000000002000000000wpaperd-1.0.1~git66.62af439/cli0707010000000C000081A400000000000000000000000166D6DD8C00000345000000000000000000000000000000000000002B00000000wpaperd-1.0.1~git66.62af439/cli/Cargo.toml[package] name = "wpaperctl" version = "1.0.1" edition = "2021" authors = ["Danilo Spinella <danilo.spinella@suse.com>"] description = "CLI for wallpaper manager wpaperd" homepage = "https://github.com/danyspin97/wpaperd" repository = "https://github.com/danyspin97/wpaperd" license = "GPL-3.0+" keywords = ["wallpaper", "wayland", "wlroots"] categories = ["command-line-utilities", "multimedia"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] wpaperd-ipc = { path = "../ipc", version = "1.0.0" } clap = { version = "4.5.7", features = ["derive", "wrap_help"] } serde = { version = "1.0.203", features = ["derive"] } serde_json = "1.0.118" [build-dependencies] clap = { version = "4.5.7", features = ["derive", "cargo"] } clap_complete = "4.5.6" clap_mangen = "0.2.21" 0707010000000D000081A400000000000000000000000166D6DD8C000004BB000000000000000000000000000000000000002900000000wpaperd-1.0.1~git66.62af439/cli/build.rsuse std::env; use std::fs::File; use std::io::Error; use std::path::Path; use clap::{CommandFactory, ValueEnum}; use clap_complete::{generate_to, Shell}; use clap_mangen::Man; include!("src/opts.rs"); fn build_shell_completion(outdir: &Path) -> Result<(), Error> { let mut app = Opts::command(); let shells = Shell::value_variants(); for shell in shells { generate_to(*shell, &mut app, "wpaperctl", outdir)?; } Ok(()) } fn build_manpages(outdir: &Path) -> Result<(), Error> { let app = Opts::command(); let file = Path::new(&outdir).join("wpaperctl.1"); let mut file = File::create(file)?; Man::new(app).render(&mut file)?; Ok(()) } fn main() -> Result<(), Box<dyn std::error::Error>> { println!("cargo:rerun-if-changed=build.rs"); println!("cargo:rerun-if-changed=src/opts.rs"); let outdir = env::var("OUT_DIR").unwrap(); let dest = Path::new(&outdir).ancestors().nth(3).unwrap(); let comp_path = dest.join("completions"); let man_path = dest.join("man"); std::fs::create_dir_all(&comp_path)?; std::fs::create_dir_all(&man_path)?; build_shell_completion(&comp_path)?; build_manpages(&man_path)?; Ok(()) } 0707010000000E000041ED00000000000000000000000266D6DD8C00000000000000000000000000000000000000000000002400000000wpaperd-1.0.1~git66.62af439/cli/src0707010000000F000081A400000000000000000000000166D6DD8C00000E12000000000000000000000000000000000000002C00000000wpaperd-1.0.1~git66.62af439/cli/src/main.rsmod opts; use std::{ io::{Read, Write}, os::unix::net::UnixStream, path::PathBuf, }; use clap::Parser; use serde::Serialize; use serde_json::to_string; use wpaperd_ipc::{socket_path, IpcError, IpcMessage, IpcResponse}; use crate::opts::{Opts, SubCmd}; fn unquote(s: String) -> String { if s.starts_with('"') && s.ends_with('"') { s.trim_start_matches('"').trim_end_matches('"').to_string() } else { s } } fn main() { let args = Opts::parse(); let mut json_resp = false; let mut conn = UnixStream::connect(socket_path().unwrap()).unwrap(); let msg = match args.subcmd { SubCmd::GetWallpaper { monitor } => IpcMessage::CurrentWallpaper { monitor: unquote(monitor), }, SubCmd::AllWallpapers { json } => { json_resp = json; IpcMessage::AllWallpapers } SubCmd::NextWallpaper { monitors } => IpcMessage::NextWallpaper { monitors: monitors.into_iter().map(unquote).collect(), }, SubCmd::PreviousWallpaper { monitors } => IpcMessage::PreviousWallpaper { monitors: monitors.into_iter().map(unquote).collect(), }, SubCmd::ReloadWallpaper { monitors } => IpcMessage::ReloadWallpaper { monitors: monitors.into_iter().map(unquote).collect(), }, SubCmd::PauseWallpaper { monitors } => IpcMessage::PauseWallpaper { monitors: monitors.into_iter().map(unquote).collect(), }, SubCmd::ResumeWallpaper { monitors } => IpcMessage::ResumeWallpaper { monitors: monitors.into_iter().map(unquote).collect(), }, SubCmd::TogglePauseWallpaper { monitors } => IpcMessage::TogglePauseWallpaper { monitors: monitors.into_iter().map(unquote).collect(), }, }; conn.write_all(&serde_json::to_vec(&msg).unwrap()).unwrap(); let mut buf = String::new(); conn.read_to_string(&mut buf).unwrap(); let res: Result<IpcResponse, IpcError> = serde_json::from_str(&buf).expect("wpaperd to return a valid json"); match res { Ok(resp) => match resp { IpcResponse::CurrentWallpaper { path } => println!("{}", path.to_string_lossy()), IpcResponse::AllWallpapers { entries: paths } => { if json_resp { #[derive(Serialize)] struct Item { display: String, path: PathBuf, } let val = paths .into_iter() .map(|(name, path)| Item { display: name, path, }) .collect::<Vec<_>>(); println!( "{}", serde_json::to_string(&val).expect("json encoding to work") ); } else { for (monitor, path) in paths { println!("{monitor}: {}", path.to_string_lossy()); } } } IpcResponse::Ok => (), }, Err(err) => match err { IpcError::MonitorNotFound { monitor } => { eprintln!("monitor {monitor} could not be found") } IpcError::DrawErrors(errors) => { for (monitor, err) in errors { eprintln!("Wallpaper could not be drawn for monitor {monitor}: {err}") } } }, } } 07070100000010000081A400000000000000000000000166D6DD8C00000393000000000000000000000000000000000000002C00000000wpaperd-1.0.1~git66.62af439/cli/src/opts.rsuse clap::Parser; #[derive(Parser)] #[command(author, version, about, long_about = None)] pub struct Opts { #[clap(subcommand)] pub subcmd: SubCmd, } #[derive(clap::Subcommand)] pub enum SubCmd { #[clap(visible_alias = "get")] GetWallpaper { monitor: String }, #[clap(visible_alias = "get-all")] AllWallpapers { #[clap(short, long)] json: bool, }, #[clap(visible_alias = "next")] NextWallpaper { monitors: Vec<String> }, #[clap(visible_alias = "previous")] PreviousWallpaper { monitors: Vec<String> }, #[clap(visible_alias = "reload")] ReloadWallpaper { monitors: Vec<String> }, #[clap(visible_alias = "pause")] PauseWallpaper { monitors: Vec<String> }, #[clap(visible_alias = "resume")] ResumeWallpaper { monitors: Vec<String> }, #[clap(visible_alias = "toggle-pause")] TogglePauseWallpaper { monitors: Vec<String> }, } 07070100000011000041ED00000000000000000000000266D6DD8C00000000000000000000000000000000000000000000002300000000wpaperd-1.0.1~git66.62af439/daemon07070100000012000081A400000000000000000000000166D6DD8C0000061E000000000000000000000000000000000000002E00000000wpaperd-1.0.1~git66.62af439/daemon/Cargo.toml[package] name = "wpaperd" version = "1.0.1" edition = "2021" authors = ["Danilo Spinella <danilo.spinella@suse.com>"] description = "Wallpaper daemon for Wayland" readme = "../README.md" homepage = "https://github.com/danyspin97/wpaperd" repository = "https://github.com/danyspin97/wpaperd" license = "GPL-3.0+" keywords = ["wallpaper", "wayland", "wlroots"] categories = ["command-line-utilities", "multimedia"] rust-version = "1.63.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] wpaperd-ipc = { path = "../ipc", version = "1.0.0" } clap = { version = "4.5.7", features = ["derive", "wrap_help"] } color-eyre = { version = "0.6.3", default-features = false } flexi_logger = { version = "0.28.5", default-features = false, features = ["colors"] } image = "0.25.1" hotwatch = "0.5.0" humantime-serde = "1.1.1" log = "0.4.22" new_mime_guess = "4.0.1" nix = { version = "0.29.0", features = ["process"] } rand = "0.8.5" serde = { version = "1.0.203", features = ["derive", "rc"] } smithay-client-toolkit = { version = "0.19.1", default-features = false, features = [ "calloop" ] } toml = "0.8.14" xdg = "2.5.2" walkdir = "2.5.0" dirs = "5.0.1" serde_json = "1.0.118" wayland-egl = "0.32.1" khronos-egl = { version = "6.0.0", features = [ "static" ] } format-bytes = "0.3.0" tikv-jemallocator = "0.6.0" [build-dependencies] clap = { version = "4.5.7", features = ["derive", "cargo"] } clap_complete = "4.5.6" clap_mangen = "0.2.21" gl_generator = "0.14.0" [features] avif = ["image/avif-native"] 07070100000013000081A400000000000000000000000166D6DD8C00000646000000000000000000000000000000000000002C00000000wpaperd-1.0.1~git66.62af439/daemon/build.rsextern crate gl_generator; use gl_generator::{Api, Fallbacks, Profile, Registry, StructGenerator}; use std::env; use std::fs::File; use std::io::Error; use std::path::Path; use clap::{CommandFactory, ValueEnum}; use clap_complete::{generate_to, Shell}; use clap_mangen::Man; include!("src/opts.rs"); fn build_shell_completion(outdir: &Path) -> Result<(), Error> { let mut app = Opts::command(); let shells = Shell::value_variants(); for shell in shells { generate_to(*shell, &mut app, "wpaperd", outdir)?; } Ok(()) } fn build_manpages(outdir: &Path) -> Result<(), Error> { let app = Opts::command(); let file = Path::new(&outdir).join("wpaperd.1"); let mut file = File::create(file)?; Man::new(app).render(&mut file)?; Ok(()) } fn main() -> Result<(), Box<dyn std::error::Error>> { println!("cargo:rerun-if-changed=build.rs"); println!("cargo:rerun-if-changed=src/opts.rs"); let outdir = env::var("OUT_DIR").unwrap(); let dest = Path::new(&outdir).ancestors().nth(3).unwrap(); let comp_path = dest.join("completions"); let man_path = dest.join("man"); std::fs::create_dir_all(&comp_path)?; std::fs::create_dir_all(&man_path)?; build_shell_completion(&comp_path)?; build_manpages(&man_path)?; let mut file = File::create(Path::new(&outdir).join("gl_bindings.rs")).unwrap(); Registry::new( Api::Gles2, (2, 0), Profile::Core, Fallbacks::All, ["GL_EXT_texture_border_clamp"], ) .write_bindings(StructGenerator, &mut file) .unwrap(); Ok(()) } 07070100000014000041ED00000000000000000000000266D6DD8C00000000000000000000000000000000000000000000002700000000wpaperd-1.0.1~git66.62af439/daemon/src07070100000015000081A400000000000000000000000166D6DD8C00002BAC000000000000000000000000000000000000003100000000wpaperd-1.0.1~git66.62af439/daemon/src/config.rsuse std::{ collections::HashMap, fs, path::{Path, PathBuf}, sync::{ atomic::{AtomicBool, Ordering}, Arc, }, time::Duration, }; use color_eyre::{ eyre::{anyhow, ensure, Context}, owo_colors::OwoColorize, Result, Section, }; use dirs::home_dir; use hotwatch::{Event, Hotwatch}; use log::{error, warn}; use serde::Deserialize; use smithay_client_toolkit::reexports::calloop::ping::Ping; use crate::{ image_picker::ImagePicker, render::Transition, wallpaper_info::{BackgroundMode, Sorting, WallpaperInfo}, }; #[derive(Default, Deserialize, PartialEq, Debug, Clone)] #[serde(deny_unknown_fields)] pub struct SerializedWallpaperInfo { #[serde(default, deserialize_with = "tilde_expansion_deserialize")] pub path: Option<PathBuf>, #[serde(default, with = "humantime_serde")] pub duration: Option<Duration>, #[serde(rename = "apply-shadow")] pub apply_shadow: Option<bool>, pub sorting: Option<Sorting>, pub mode: Option<BackgroundMode>, #[serde(rename = "queue-size")] pub queue_size: Option<usize>, #[serde(rename = "transition-time")] pub transition_time: Option<u32>, /// Determines if we should show the transition between black and first /// wallpaper. `Some(false)` means we instantly cut to the first wallpaper, /// `Some(true)` means we fade from black to the first wallpaper. /// /// See [crate::wallpaper_info::WallpaperInfo] #[serde(rename = "initial-transition")] pub initial_transition: Option<bool>, pub transition: Option<Transition>, /// Determine the offset for the wallpaper to be drawn into the screen /// Must be from 0.0 to 1.0, by default is 0.0 in tile mode and 0.5 in all the others /// /// See [crate::wallpaper_info::WallpaperInfo] pub offset: Option<f32>, } impl SerializedWallpaperInfo { pub fn apply_and_validate(&self, default: &Self) -> Result<WallpaperInfo> { let mut path_inherited = false; let path = match (&self.path, &default.path) { (Some(path), None) | (Some(path), Some(_))=> path, (None, Some(path)) => { path_inherited = true; path } (None, None) => { return Err(anyhow!( "attribute {} is not set", "path".bold().italic().blue(), )) .with_suggestion(|| { format!( "add attribute {} in the display section of the configuration:\npath = \"</path/to/image>\"", "path".bold().italic().blue(), ) }); } } .to_path_buf(); // Ensure that a path exists if !path.exists() { return Err(anyhow!( "path {} for attribute {}{} does not exist", path.to_string_lossy().italic().yellow(), "path".bold().italic().blue(), if path_inherited { format!( " (inherited from {} configuration)", "default".magenta().bold() ) } else { "".to_string() } )) .with_suggestion(|| { format!( "set attribute {} to an existing file or directory", "path".bold().italic().blue(), ) }); } let duration = match (&self.duration, &default.duration) { // duration is inherited from default, but this section set path to a file, ignore // duration (None, Some(_)) if path.is_file() && !path_inherited => None, (Some(duration), _) | (None, Some(duration)) => Some(*duration), (None, None) => None, }; // duration can only be set when path is a directory if duration.is_some() && !path.is_dir() { // Do no use bail! to add suggestion return Err(anyhow!( "Attribute {} is set to a file and attribute {} is also set.", "path".bold().italic().blue(), "duration".bold().italic().blue() ) .with_suggestion(|| { format!( "Either remove {} or set {} to a directory", "path".bold().italic().blue(), "duration".bold().italic().blue() ) })); } let sorting = match (&self.sorting, &default.sorting) { (None, Some(_)) if path.is_file() && !path_inherited => None, (Some(sorting), _) | (None, Some(sorting)) => Some(*sorting), (None, None) => None, }; // sorting can only be set when path is a directory if sorting.is_some() && !path.is_dir() { // Do no use bail! to add suggestion return Err(anyhow!( "Attribute {} is set to a file and attribute {} is also set.", "path".bold().italic().blue(), "sorting".bold().italic().blue() ) .with_suggestion(|| { format!( "Either remove {} or set {} to a directory", "path".bold().italic().blue(), "sorting".bold().italic().blue() ) })); } let mode = match (&self.mode, &default.mode) { (Some(mode), _) | (None, Some(mode)) => *mode, (None, None) => BackgroundMode::default(), }; let drawn_images_queue_size = match (&self.queue_size, &default.queue_size) { (Some(size), _) | (None, Some(size)) => *size, (None, None) => ImagePicker::DEFAULT_DRAWN_IMAGES_QUEUE_SIZE, }; let initial_transition = match (&self.initial_transition, &default.initial_transition) { (Some(initial_transition), _) | (None, Some(initial_transition)) => *initial_transition, (None, None) => true, }; let transition = match (&self.transition, &default.transition) { (Some(transition), _) | (None, Some(transition)) => transition.clone(), (None, None) => Transition::Fade {}, }; let transition_time = match (&self.transition_time, &default.transition_time) { (Some(transition_time), _) | (None, Some(transition_time)) => *transition_time, (None, None) => transition.default_transition_time(), }; let offset = match (&self.offset, &default.offset) { (Some(offset), _) | (None, Some(offset)) => Some(*offset), (None, None) => None, }; Ok(WallpaperInfo { path, duration, apply_shadow: false, sorting, mode, drawn_images_queue_size, transition_time, initial_transition, transition, offset, }) } } #[derive(Deserialize, Default)] pub struct Config { #[serde(flatten)] data: HashMap<String, SerializedWallpaperInfo>, #[serde(skip)] default: SerializedWallpaperInfo, #[serde(skip)] any: SerializedWallpaperInfo, #[serde(skip)] pub path: PathBuf, #[serde(skip)] pub reloaded: Option<Arc<AtomicBool>>, } impl Config { pub fn new_from_path(path: &Path) -> Result<Self> { ensure!(path.exists(), "File {path:?} does not exists"); let mut config: Self = toml::from_str(&fs::read_to_string(path)?)?; config .data .get("default") .unwrap_or(&SerializedWallpaperInfo::default()) .clone_into(&mut config.default); config .data .get("any") .unwrap_or(&SerializedWallpaperInfo::default()) .clone_into(&mut config.any); config.data.retain(|name, info| { // The default configuration does not follow these rules // We still need the default configuration here because the path needs to be cached if info == &config.default { true } else { match info .apply_and_validate(&config.default) .with_context(|| format!("while validating display {}", name.bold().magenta())) { Ok(_) => true, Err(err) => { // We do not want to exit when error occurs, print it and go forward warn!("{err:?}"); false } } } }); config.path = path.to_path_buf(); Ok(config) } pub fn get_output_by_name(&self, name: &str) -> Result<WallpaperInfo> { self.data .get(name) .unwrap_or(&self.any) .apply_and_validate(&self.default) } pub fn listen_to_changes(&self, hotwatch: &mut Hotwatch, ping: Ping) -> Result<()> { let reloaded = self.reloaded.as_ref().unwrap().clone(); hotwatch .watch(&self.path, move |event: Event| { if let hotwatch::EventKind::Modify(_) = event.kind { reloaded.store(true, Ordering::Relaxed); ping.ping(); } }) .with_context(|| format!("watching file {:?}", &self.path))?; Ok(()) } pub fn paths(&self) -> Vec<PathBuf> { let mut paths: Vec<_> = self .data .values() .filter_map(|info| info.path.as_ref().map(|p| p.to_path_buf())) .collect(); paths.sort_unstable(); paths.dedup(); paths } /// Return true if the struct changed pub fn update(&mut self) -> bool { // When the config file has been written into let new_config = Config::new_from_path(&self.path).with_context(|| { format!( "updating configuration from file {}", self.path.to_string_lossy() ) }); match new_config { Ok(new_config) if new_config != *self => { let reloaded = self.reloaded.as_ref().unwrap().clone(); *self = new_config; self.reloaded = Some(reloaded); true } Ok(_) => { // Do nothing, the new config is the same as the loaded one false } Err(err) => { error!("{err:?}"); false } } } } impl PartialEq for Config { fn eq(&self, other: &Self) -> bool { self.data == other.data } } pub fn tilde_expansion_deserialize<'de, D>(deserializer: D) -> Result<Option<PathBuf>, D::Error> where D: serde::Deserializer<'de>, { let path = String::deserialize(deserializer)?; let path = Path::new(&path); Ok(Some( path.strip_prefix("~") .map_or(path.to_path_buf(), |p| home_dir().unwrap().join(p)), )) } 07070100000016000081A400000000000000000000000166D6DD8C00000A2E000000000000000000000000000000000000003700000000wpaperd-1.0.1~git66.62af439/daemon/src/display_info.rsuse smithay_client_toolkit::{ output::OutputInfo, reexports::client::protocol::wl_output::Transform, shell::wlr_layer::LayerSurfaceConfigure, }; #[derive(Debug)] pub struct DisplayInfo { pub name: String, pub width: i32, pub height: i32, pub scale: i32, pub transform: Transform, } impl DisplayInfo { pub fn new(info: OutputInfo) -> Self { Self { name: info.name.unwrap_or_default(), width: 0, height: 0, scale: info.scale_factor, transform: info.transform, } } #[inline] pub fn adjusted_width(&self) -> i32 { match self.transform { Transform::Normal | Transform::_180 | Transform::Flipped | Transform::Flipped180 => { self.width * self.scale } Transform::_90 | Transform::_270 | Transform::Flipped90 | Transform::Flipped270 => { self.height * self.scale } _ => unreachable!(), } } #[inline] pub fn adjusted_height(&self) -> i32 { match self.transform { Transform::Normal | Transform::_180 | Transform::Flipped | Transform::Flipped180 => { self.height * self.scale } Transform::_90 | Transform::_270 | Transform::Flipped90 | Transform::Flipped270 => { self.width * self.scale } _ => unreachable!(), } } #[inline] pub fn scaled_width(&self) -> i32 { self.width * self.scale } #[inline] pub fn scaled_height(&self) -> i32 { self.height * self.scale } #[inline] pub fn ratio(&self) -> f32 { self.adjusted_width() as f32 / self.adjusted_height() as f32 } pub fn change_size(&mut self, configure: LayerSurfaceConfigure) -> bool { let new_width = configure.new_size.0 as i32; let new_height = configure.new_size.1 as i32; if (self.width, self.height) != (new_width, new_height) { self.width = new_width; self.height = new_height; true } else { false } } pub fn change_transform(&mut self, transform: Transform) -> bool { if self.transform != transform { self.transform = transform; true } else { false } } pub fn change_scale_factor(&mut self, scale_factor: i32) -> bool { if self.scale != scale_factor { self.scale = scale_factor; true } else { false } } } 07070100000017000081A400000000000000000000000166D6DD8C0000144C000000000000000000000000000000000000003900000000wpaperd-1.0.1~git66.62af439/daemon/src/filelist_cache.rsuse std::{ path::{Path, PathBuf}, sync::{ atomic::{AtomicBool, Ordering}, Arc, }, }; use color_eyre::eyre::{anyhow, Context, Result}; use hotwatch::Hotwatch; use log::error; use smithay_client_toolkit::reexports::calloop::{self, ping::Ping, LoopHandle}; use walkdir::WalkDir; use crate::wpaperd::Wpaperd; #[derive(Debug)] struct Filelist { path: PathBuf, filelist: Arc<Vec<PathBuf>>, outdated: Arc<AtomicBool>, } impl Filelist { fn new(path: &Path) -> Self { let mut res = Self { path: path.to_path_buf(), filelist: Arc::new(Vec::new()), outdated: Arc::new(AtomicBool::new(true)), }; res.populate(); res } fn populate(&mut self) { self.filelist = Arc::new( WalkDir::new(&self.path) .follow_links(true) .sort_by_file_name() .into_iter() .filter_map(|e| e.ok()) .filter(|e| { if let Some(guess) = new_mime_guess::from_path(e.path()).first() { guess.type_() == "image" } else { false } }) .map(|e| e.path().to_path_buf()) .collect(), ); self.outdated.store(false, Ordering::Relaxed); } } pub struct FilelistCache { cache: Vec<Filelist>, } impl FilelistCache { pub fn new( paths: Vec<PathBuf>, hotwatch: &mut Hotwatch, event_loop_handle: LoopHandle<Wpaperd>, ) -> Result<(Ping, Self)> { let (ping, ping_source) = calloop::ping::make_ping().context("Unable to create a calloop::ping::Ping")?; let mut filelist_cache = Self { cache: Vec::new() }; filelist_cache.update_paths(paths, hotwatch, ping.clone()); event_loop_handle .insert_source(ping_source, move |_, _, wpaperd| { wpaperd.filelist_cache.borrow_mut().update_cache(); }) .map_err(|e| anyhow!("inserting the filelist event listener in the event loop: {e}"))?; Ok((ping, filelist_cache)) } pub fn get(&self, path: &Path) -> Arc<Vec<PathBuf>> { debug_assert!(path.is_dir()); self.cache .iter() .find(|filelist| filelist.path == path) .expect("path passed to Filelist::get has been cached") .filelist .clone() } /// paths must be sorted pub fn update_paths( &mut self, paths: Vec<PathBuf>, hotwatch: &mut Hotwatch, event_loop_ping: Ping, ) { self.cache.retain(|filelist| { let path_exists = filelist.path.exists(); if paths.contains(&filelist.path) && path_exists { true } else { // Stop watching paths that have been removed // Check that it exists before if path_exists { if let Err(err) = hotwatch.unwatch(&filelist.path).with_context(|| { format!("hotwatch unwatch error on path {:?}", &filelist.path) }) { error!("{err:?}"); } } // and remove them from the vec false } }); for path in paths { if !self.cache.iter().any(|filelist| filelist.path == path) { // Skip paths that don't exists and files if !path.exists() || !path.is_dir() { continue; } let filelist = Filelist::new(&path); let outdated = filelist.outdated.clone(); self.cache.push(filelist); let ping_clone = event_loop_ping.clone(); if let Err(err) = hotwatch .watch(&path, move |event| match event.kind { hotwatch::EventKind::Create(_) | hotwatch::EventKind::Remove(_) | hotwatch::EventKind::Modify(_) => { // We could manually update the list of files with the information // we get here, but the inotify on linux is not reliable, // so we prefer to always trigger an update and just reload // the entire list // See: https://github.com/notify-rs/notify/issues/412 outdated.store(true, Ordering::Release); ping_clone.ping(); } _ => {} }) .with_context(|| format!("hotwatch watch error on path {:?}", &path)) { error!("{err:?}"); } } } self.update_cache(); } pub fn update_cache(&mut self) { for filelist in &mut self.cache { if filelist.outdated.load(std::sync::atomic::Ordering::Relaxed) { filelist.populate(); } } } } 07070100000018000081A400000000000000000000000166D6DD8C00000E79000000000000000000000000000000000000003700000000wpaperd-1.0.1~git66.62af439/daemon/src/image_loader.rsuse std::{collections::HashMap, path::PathBuf, thread::JoinHandle}; use image::{open, RgbaImage}; use log::warn; struct Image { data: Option<RgbaImage>, thread_handle: Option<JoinHandle<Option<RgbaImage>>>, requesters: Vec<String>, } pub enum ImageLoaderStatus { Loaded(RgbaImage), Waiting, Error, } pub struct ImageLoader { images: HashMap<PathBuf, Image>, } impl ImageLoader { pub fn new() -> Self { Self { images: HashMap::new(), } } pub fn background_load(&mut self, path: PathBuf, requester_name: String) -> ImageLoaderStatus { if let Some(image) = self.images.get_mut(&path) { if let Some(handle) = image.thread_handle.take() { if handle.is_finished() { match handle.join() { Ok(thread_result) => match thread_result { Some(image_data) => { image.data = Some(image_data); } None => { self.images.remove(&path); return ImageLoaderStatus::Error; } }, Err(err) => { warn!("{err:?}"); self.images.remove(&path); return ImageLoaderStatus::Error; } } } else { // the thread is still running // reassign the handle image.thread_handle = Some(handle); return ImageLoaderStatus::Waiting; } } if let Some(data) = &image.data { // If the requesters is only one and it's the same as the current if image.requesters.len() == 1 && image.requesters.first().unwrap() == &requester_name { // Just send it up and remove it from the map let image = self.images.remove(&path); ImageLoaderStatus::Loaded(image.unwrap().data.unwrap()) } else { // otherwise this image has been requested by multiple surfaces let requesters = &mut image.requesters; if let Some(index) = requesters.iter().position(|name| name == &requester_name) { requesters.remove(index); } ImageLoaderStatus::Loaded(data.clone()) } } else { // The decoded image is not ready yet ImageLoaderStatus::Waiting } } else { // Start loading a new image let path_clone = path.clone(); let handle = std::thread::spawn(|| match open(path_clone) { Ok(image) => Some(image.into_rgba8()), Err(err) => { warn!("{err:?}"); None } }); let image = Image { requesters: vec![requester_name], thread_handle: Some(handle), data: None, }; self.images.insert(path, image); ImageLoaderStatus::Waiting } } /// Check that there are no threads waiting on zero requesters #[cfg(debug_assertions)] pub fn check_lingering_threads(&mut self) { debug_assert!(!self .images .iter() .any(|(_, image)| { image.requesters.is_empty() })); } } 07070100000019000081A400000000000000000000000166D6DD8C000059EF000000000000000000000000000000000000003700000000wpaperd-1.0.1~git66.62af439/daemon/src/image_picker.rsuse std::{ cell::RefCell, collections::VecDeque, path::{Path, PathBuf}, rc::Rc, time::Instant, }; use log::warn; use smithay_client_toolkit::reexports::client::{protocol::wl_surface::WlSurface, QueueHandle}; use crate::{ filelist_cache::FilelistCache, wallpaper_groups::{WallpaperGroup, WallpaperGroups}, wallpaper_info::{Sorting, WallpaperInfo}, wpaperd::Wpaperd, }; #[derive(Debug)] pub struct Queue { buffer: VecDeque<PathBuf>, current: usize, tail: usize, size: usize, } impl Queue { pub fn with_capacity(size: usize) -> Self { Self { buffer: VecDeque::with_capacity(size), current: 0, tail: size - 1, size, } } #[cfg(test)] fn current(&self) -> &Path { &self.buffer[self.current] } fn next(&mut self) -> Option<(&Path, usize)> { let next_index = (self.current + 1) % self.size; if !self.is_full() { if next_index < self.buffer.len() { self.current = next_index; Some((&self.buffer[next_index], next_index)) } else { None } } else if self.current != self.tail { self.current = next_index; Some((&self.buffer[next_index], next_index)) } else { None } } fn previous(&mut self) -> Option<(&Path, usize)> { let prev_index = (self.current + self.size - 1) % self.size; if prev_index != self.tail { self.current = prev_index; Some((&self.buffer[prev_index], prev_index)) } else { None } } fn is_full(&self) -> bool { self.buffer.len() == self.size } fn contains(&self, p: &PathBuf) -> bool { self.buffer.contains(p) } fn set_current_to(&mut self, p: &Path) { if let Some(index) = self.buffer.iter().position(|path| p == path) { self.current = index; } } fn push(&mut self, p: PathBuf) { // Avoid duplicates if self.buffer.contains(&p) { return; }; if self.is_full() { self.buffer.pop_front(); self.buffer.push_back(p); } else { self.buffer.push_back(p); self.current = self.buffer.len() - 1; } } fn has_reached_end(&self) -> bool { self.current == self.tail } fn resize(&mut self, new_size: usize) { if !self.is_full() { self.buffer.reserve_exact(new_size); self.size = new_size; } else { let relative_current = (self.current + self.size - self.tail) % self.size; self.current = (self.tail + self.size - new_size % self.size) % self.size; let relative_current = (relative_current + self.size - self.current - 1) % new_size; let mut new_buf = VecDeque::new(); while let Some((prev, _)) = self.next() { new_buf.push_back(prev.to_path_buf()); } self.current = relative_current; self.tail = new_size - 1; self.size = new_size; self.buffer = new_buf; } } } enum ImagePickerAction { Next, Previous, } struct GroupedRandom { surface: WlSurface, group: Rc<RefCell<WallpaperGroup>>, } impl Drop for GroupedRandom { fn drop(&mut self) { self.group.borrow_mut().surfaces.remove(&self.surface); } } enum ImagePickerSorting { Random(Queue), GroupedRandom(GroupedRandom), Ascending(usize), Descending(usize), } impl ImagePickerSorting { fn new( wallpaper_info: &WallpaperInfo, wl_surface: &WlSurface, groups: Rc<RefCell<WallpaperGroups>>, filelist_cache: Rc<RefCell<FilelistCache>>, ) -> Self { match wallpaper_info.sorting { None | Some(Sorting::Random) => { Self::new_random(wallpaper_info.drawn_images_queue_size) } Some(Sorting::GroupedRandom { group }) => Self::new_grouped_random( groups, group, wl_surface, wallpaper_info.drawn_images_queue_size, ), Some(Sorting::Ascending) => { let files_len = filelist_cache .clone() .borrow() .get(&wallpaper_info.path) .len(); Self::new_ascending(files_len) } Some(Sorting::Descending) => Self::new_descending(), } } fn new_random(queue_size: usize) -> Self { Self::Random(Queue::with_capacity(queue_size)) } fn new_descending() -> ImagePickerSorting { Self::Descending(0) } fn new_ascending(files_len: usize) -> ImagePickerSorting { Self::Ascending(files_len - 1) } fn new_grouped_random( groups: Rc<RefCell<WallpaperGroups>>, group: u8, wl_surface: &WlSurface, queue_size: usize, ) -> Self { Self::GroupedRandom(GroupedRandom { surface: wl_surface.clone(), group: groups .borrow_mut() .get_or_insert(group, wl_surface, queue_size), }) } } pub struct ImagePicker { current_img: PathBuf, pub image_changed_instant: Instant, action: Option<ImagePickerAction>, sorting: ImagePickerSorting, filelist_cache: Rc<RefCell<FilelistCache>>, reload: bool, } impl ImagePicker { pub const DEFAULT_DRAWN_IMAGES_QUEUE_SIZE: usize = 10; pub fn new( wallpaper_info: &WallpaperInfo, wl_surface: &WlSurface, filelist_cache: Rc<RefCell<FilelistCache>>, groups: Rc<RefCell<WallpaperGroups>>, ) -> Self { Self { current_img: PathBuf::from(""), image_changed_instant: Instant::now(), action: Some(ImagePickerAction::Next), sorting: ImagePickerSorting::new( wallpaper_info, wl_surface, groups, filelist_cache.clone(), ), filelist_cache, reload: false, } } /// Get the next image based on the sorting method fn get_image_path(&mut self, files: &[PathBuf], qh: &QueueHandle<Wpaperd>) -> (usize, PathBuf) { match (&self.action, &mut self.sorting) { ( None, ImagePickerSorting::Ascending(current_index) | ImagePickerSorting::Descending(current_index), ) if self.current_img.exists() => (*current_index, self.current_img.to_path_buf()), (_, ImagePickerSorting::GroupedRandom(group)) if group.group.borrow().loading_image.is_some() => { let group = group.group.borrow(); let (index, loading_image) = group.loading_image.as_ref().unwrap(); (*index, loading_image.to_path_buf()) } (_, ImagePickerSorting::GroupedRandom(group)) if group.group.borrow().current_image != self.current_img => { let group = group.group.borrow(); (group.index, group.current_image.clone()) } (None, ImagePickerSorting::Random(_) | ImagePickerSorting::GroupedRandom(_)) if self.current_img.exists() => { (0, self.current_img.to_path_buf()) } (None | Some(ImagePickerAction::Next), ImagePickerSorting::Random(queue)) => { next_random_image(&self.current_img, queue, files) } (None | Some(ImagePickerAction::Next), ImagePickerSorting::GroupedRandom(group)) => { let mut group = group.group.borrow_mut(); if self.current_img == group.current_image { // start loading a new image let (index, path) = next_random_image(&self.current_img, &mut group.queue, files); group.loading_image = Some((index, path.to_path_buf())); group.queue_all_surfaces(qh); (index, path) } else { (group.index, group.current_image.clone()) } } (Some(ImagePickerAction::Previous), ImagePickerSorting::Random(queue)) => { get_previous_image_for_random(&self.current_img, queue) } (Some(ImagePickerAction::Previous), ImagePickerSorting::GroupedRandom(group)) => { let mut group = group.group.borrow_mut(); let queue = &mut group.queue; let (index, path) = get_previous_image_for_random(&self.current_img, queue); if path != group.current_image { group.loading_image = Some((index, path.to_path_buf())); group.queue_all_surfaces(qh); } (index, path) } ( None | Some(ImagePickerAction::Next), ImagePickerSorting::Descending(current_index), ) | (Some(ImagePickerAction::Previous), ImagePickerSorting::Ascending(current_index)) => { let index = if files.get(*current_index) == Some(&self.current_img) { *current_index } else { // if the current img doesn't correspond to the index we have // try looking for it in files match files.binary_search(&self.current_img) { Ok(new_index) => new_index, Err(_err) => { // if we don't find it, use the last index as starting point // if the current_index is too big, start from last image // this is a fail safe in case many files gets deleted if *current_index >= files.len() { 0 } else { *current_index } } } }; let index = if index == 0 { files.len() - 1 } else { index - 1 }; (index, files[index].to_path_buf()) } (Some(ImagePickerAction::Previous), ImagePickerSorting::Descending(current_index)) | ( None | Some(ImagePickerAction::Next), ImagePickerSorting::Ascending(current_index), ) => { let index = if files.get(*current_index) == Some(&self.current_img) { *current_index } else { match files.binary_search(&self.current_img) { Ok(new_index) => new_index, Err(_err) => *current_index, } }; let index = (index + 1) % files.len(); (index, files[index].to_path_buf()) } } } pub fn get_image_from_path( &mut self, path: &Path, qh: &QueueHandle<Wpaperd>, ) -> Option<(PathBuf, usize)> { if path.is_dir() { let files = self.filelist_cache.borrow().get(path); // There are no images, forcefully break out of the loop if files.is_empty() { warn!("Directory {path:?} does not contain any valid image files."); None } else { let (index, img_path) = self.get_image_path(&files, qh); if img_path == self.current_img && !self.reload { None } else { Some((img_path, index)) } } } else if path == self.current_img && !self.reload { None } else { // path is not a directory, also it's not the current image or we need to reload Some((path.to_path_buf(), 0)) } } pub fn update_current_image(&mut self, img_path: PathBuf, index: usize) { match (self.action.take(), &mut self.sorting) { (Some(ImagePickerAction::Next), ImagePickerSorting::Random(queue)) => { if queue.has_reached_end() || queue.buffer.get(index).is_none() { queue.push(img_path.clone()); } } (None | Some(ImagePickerAction::Previous), ImagePickerSorting::Random { .. }) => {} ( None | Some(ImagePickerAction::Previous), ImagePickerSorting::GroupedRandom(group), ) => { let mut group = group.group.borrow_mut(); group.loading_image = None; group.current_image.clone_from(&img_path); group.index = index; } ( _, ImagePickerSorting::Ascending(current_index) | ImagePickerSorting::Descending(current_index), ) => *current_index = index, (Some(ImagePickerAction::Next), ImagePickerSorting::GroupedRandom(group)) => { let mut group = group.group.borrow_mut(); let queue = &mut group.queue; if queue.has_reached_end() || queue.buffer.get(index).is_none() { queue.push(img_path.clone()); } group.loading_image = None; group.current_image.clone_from(&img_path); group.index = index; } } self.current_img = img_path; } /// Update wallpaper by going down 1 index through the cached image paths /// Expiry timer reset even if already at the first cached image pub fn previous_image(&mut self) { self.action = Some(ImagePickerAction::Previous); } /// Update wallpaper by going up 1 index through the cached image paths pub fn next_image(&mut self, path: &Path, qh: &QueueHandle<Wpaperd>) { self.action = Some(ImagePickerAction::Next); self.get_image_from_path(path, qh); } pub fn current_image(&self) -> PathBuf { self.current_img.clone() } /// Return true if the path changed pub fn update_sorting( &mut self, new_sorting: Option<Sorting>, path: &Path, path_changed: bool, drawn_images_queue_size: usize, ) { if let Some(new_sorting) = new_sorting { match (&mut self.sorting, new_sorting) { (_, Sorting::Ascending) if path_changed => { self.sorting = ImagePickerSorting::new_ascending( self.filelist_cache.borrow().get(path).len(), ); } (_, Sorting::Descending) if path_changed => { self.sorting = ImagePickerSorting::new_descending(); } (ImagePickerSorting::Descending(current_index), Sorting::Ascending) => { self.sorting = ImagePickerSorting::Ascending(*current_index) } (ImagePickerSorting::Ascending(current_index), Sorting::Descending) => { self.sorting = ImagePickerSorting::Descending(*current_index) } (ImagePickerSorting::Random { .. }, Sorting::Ascending | Sorting::Descending) => { let files = self.filelist_cache.borrow().get(path); let index = match files.binary_search(&self.current_img) { Ok(index) => Some(index), Err(_) => None, }; self.sorting = match new_sorting { Sorting::Random | Sorting::GroupedRandom { .. } => unreachable!(), Sorting::Ascending => match index { Some(index) => ImagePickerSorting::Ascending(index), None => ImagePickerSorting::new_ascending(files.len()), }, Sorting::Descending => match index { Some(index) => ImagePickerSorting::Descending(index), None => ImagePickerSorting::new_descending(), }, }; } ( ImagePickerSorting::Descending(_) | ImagePickerSorting::Ascending(_), Sorting::Random, ) if path_changed => { // If the path was changed, use a new random sorting self.sorting = ImagePickerSorting::new_random(drawn_images_queue_size); } // The path has changed, use a new random sorting, otherwise we reuse the current // drawn_images (_, Sorting::Random) if path_changed => { self.sorting = ImagePickerSorting::new_random(drawn_images_queue_size); } ( ImagePickerSorting::Descending(_) | ImagePickerSorting::Ascending(_), Sorting::Random, ) => { // if the path was not changed, use the current image as the first image of // the drawn_images let mut queue = Queue::with_capacity(drawn_images_queue_size); queue.push(self.current_image()); self.sorting = ImagePickerSorting::Random(queue); } // No need to update the sorting if it's the same (_, _) => {} } } else { self.sorting = ImagePickerSorting::new_random(drawn_images_queue_size); } } pub fn update_queue_size(&mut self, drawn_images_queue_size: usize) { match &mut self.sorting { ImagePickerSorting::Random(queue) => { queue.resize(drawn_images_queue_size); } ImagePickerSorting::Ascending(_) | ImagePickerSorting::Descending(_) => {} ImagePickerSorting::GroupedRandom(group) => { group .group .borrow_mut() .queue .resize(drawn_images_queue_size); } } } #[inline] pub fn reload(&mut self) { self.reload = true; } #[inline] pub fn reloaded(&mut self) { self.reload = false; } #[inline] pub fn is_reloading(&self) -> bool { self.reload } } fn next_random_image( current_image: &Path, queue: &mut Queue, files: &[PathBuf], ) -> (usize, PathBuf) { // Use the next images in the queue, if any while let Some((next, index)) = queue.next() { if next.exists() { return (index, next.to_path_buf()); } } // If there is only one image just return it if files.len() == 1 { return (0, files[0].to_path_buf()); } // Otherwise pick a new random image that has not been drawn before // Try 5 times, then get a random image. We do this because it might happen // that the queue is bigger than the amount of available wallpapers let mut tries = 5; loop { let index = rand::random::<usize>() % files.len(); // search for an image that has not been drawn yet // fail after 5 tries if !queue.contains(&files[index]) { break (index, files[index].to_path_buf()); } // We have already tried a bunch of times // We still need a new image, get the first one that is different than // the current one. We also know that there is more than one image if tries == 0 { break loop { let index = rand::random::<usize>() % files.len(); if files[index] != current_image { break (index, files[index].to_path_buf()); } }; } tries -= 1; } } fn get_previous_image_for_random(current_image: &Path, queue: &mut Queue) -> (usize, PathBuf) { while let Some((prev, index)) = queue.previous() { if prev.exists() { return (index, prev.to_path_buf()); } } // We didn't find any suitable image, reset to the last working one queue.set_current_to(current_image); (usize::MAX, current_image.to_path_buf()) } #[cfg(test)] mod tests { // Note this useful idiom: importing names from outer (for mod tests) scope. use super::*; #[test] fn test_push() { let mut queue = Queue::with_capacity(2); queue.push(PathBuf::from("mypath")); queue.push(PathBuf::from("mypath2")); assert_eq!(Path::new("mypath2"), queue.current()); assert_eq!(Some((Path::new("mypath"), 0)), queue.previous()); assert_eq!(Path::new("mypath"), queue.current()); assert_eq!(None, queue.previous()); } #[test] fn test_resize() { let mut queue = Queue::with_capacity(5); queue.push(PathBuf::from("mypath")); queue.push(PathBuf::from("mypath2")); queue.push(PathBuf::from("mypath3")); queue.push(PathBuf::from("mypath4")); queue.push(PathBuf::from("mypath5")); assert_eq!(queue.buffer.len(), 5); assert_eq!(Path::new("mypath5"), queue.current()); assert_eq!(Some((Path::new("mypath4"), 3)), queue.previous()); // Test that the current index works when it's inside the resizing range queue.resize(2); assert_eq!(Path::new("mypath4"), queue.current()); assert_eq!(None, queue.previous()); assert_eq!(Some((Path::new("mypath5"), 1)), queue.next()); } #[test] fn test_resize2() { let mut queue = Queue::with_capacity(5); queue.push(PathBuf::from("mypath")); queue.push(PathBuf::from("mypath2")); queue.push(PathBuf::from("mypath3")); queue.push(PathBuf::from("mypath4")); queue.push(PathBuf::from("mypath5")); queue.push(PathBuf::from("mypath6")); queue.push(PathBuf::from("mypath7")); queue.push(PathBuf::from("mypath8")); assert_eq!(queue.buffer.len(), 5); assert_eq!(Path::new("mypath8"), queue.current()); assert_eq!(Some((Path::new("mypath7"), 3)), queue.previous()); assert_eq!(Some((Path::new("mypath6"), 2)), queue.previous()); assert_eq!(Some((Path::new("mypath5"), 1)), queue.previous()); // Test that the current item point to the first item available queue.resize(2); assert_eq!(Path::new("mypath7"), queue.current()); assert_eq!(Some((Path::new("mypath8"), 1)), queue.next()); assert_eq!(None, queue.next()); } } 0707010000001A000081A400000000000000000000000166D6DD8C0000153B000000000000000000000000000000000000003500000000wpaperd-1.0.1~git66.62af439/daemon/src/ipc_server.rs//! IPC socket server. //! Based on <https://github.com/catacombing/catacomb/blob/master/src/ipc_server.rs> use std::collections::HashSet; use std::fs; use std::io::{BufReader, BufWriter, Read, Write}; use std::os::unix::net::{UnixListener, UnixStream}; use std::path::{Path, PathBuf}; use color_eyre::eyre::{ensure, Context}; use color_eyre::{Result, Section}; use smithay_client_toolkit::reexports::client::QueueHandle; use wpaperd_ipc::{IpcError, IpcMessage, IpcResponse}; use crate::socket::SocketSource; use crate::surface::Surface; use crate::Wpaperd; /// Create an IPC socket. pub fn listen_on_ipc_socket(socket_path: &Path) -> Result<SocketSource> { // Try to delete the socket if it exists already. if socket_path.exists() { fs::remove_file(socket_path)?; } // Spawn unix socket event source. let listener = UnixListener::bind(socket_path)?; let socket = SocketSource::new(listener)?; Ok(socket) } fn check_monitors(wpaperd: &Wpaperd, monitors: &Vec<String>) -> Result<(), IpcError> { for monitor in monitors { if !wpaperd .surfaces .iter() .any(|surface| &surface.name() == monitor) { return Err(IpcError::MonitorNotFound { monitor: monitor.to_owned(), }); } } Ok(()) } fn collect_surfaces(wpaperd: &mut Wpaperd, monitors: Vec<String>) -> Vec<&mut Surface> { let monitors: HashSet<String> = HashSet::from_iter(monitors); if monitors.is_empty() { return wpaperd.surfaces.iter_mut().collect(); }; wpaperd .surfaces .iter_mut() .filter(|surface| monitors.contains(&surface.name())) .collect() } /// Handle IPC socket messages. pub fn handle_message( ustream: UnixStream, qh: QueueHandle<Wpaperd>, wpaperd: &mut Wpaperd, ) -> Result<()> { const SIZE: usize = 4096; let mut buffer = [0; SIZE]; // Read new content to buffer. let mut stream = BufReader::new(&ustream); let n = stream .read(&mut buffer) .context("error while reading line from IPC")?; // The message is empty if n == 0 { return Ok(()); } ensure!(n != SIZE, "The message received was too big"); // Read pending events on socket. let message: IpcMessage = serde_json::from_slice(&buffer[..n]) .with_context(|| format!("error while deserializing message {:?}", &buffer[..n]))?; // Handle IPC events. let resp: Result<IpcResponse, IpcError> = match message { IpcMessage::CurrentWallpaper { monitor } => wpaperd .surfaces .iter() .find(|surface| surface.name() == monitor) .map(|surface| surface.image_picker.current_image()) .map(|path| IpcResponse::CurrentWallpaper { path }) .ok_or(IpcError::MonitorNotFound { monitor }), IpcMessage::AllWallpapers => Ok(IpcResponse::AllWallpapers { entries: wpaperd .surfaces .iter() .map(|surface| { ( surface.name().to_string(), surface.image_picker.current_image(), ) }) .collect::<Vec<(String, PathBuf)>>(), }), IpcMessage::PreviousWallpaper { monitors } => { check_monitors(wpaperd, &monitors).map(|_| { for surface in collect_surfaces(wpaperd, monitors) { surface.image_picker.previous_image(); surface.queue_draw(&qh); } IpcResponse::Ok }) } IpcMessage::NextWallpaper { monitors } => check_monitors(wpaperd, &monitors).map(|_| { for surface in collect_surfaces(wpaperd, monitors) { surface .image_picker .next_image(&surface.wallpaper_info.path, &qh); surface.queue_draw(&qh); } IpcResponse::Ok }), IpcMessage::ReloadWallpaper { monitors } => check_monitors(wpaperd, &monitors).map(|_| { for surface in collect_surfaces(wpaperd, monitors) { surface.image_picker.reload(); surface.queue_draw(&qh); } IpcResponse::Ok }), IpcMessage::PauseWallpaper { monitors } => check_monitors(wpaperd, &monitors).map(|_| { for surface in collect_surfaces(wpaperd, monitors) { surface.pause(); } IpcResponse::Ok }), IpcMessage::ResumeWallpaper { monitors } => check_monitors(wpaperd, &monitors).map(|_| { for surface in collect_surfaces(wpaperd, monitors) { surface.resume(); } IpcResponse::Ok }), IpcMessage::TogglePauseWallpaper { monitors } => { check_monitors(wpaperd, &monitors).map(|_| { for surface in collect_surfaces(wpaperd, monitors) { surface.toggle_pause(); } IpcResponse::Ok }) } }; let mut stream = BufWriter::new(ustream); stream .write_all(&serde_json::to_vec(&resp).unwrap()) .context("unable to write response to the IPC client") .suggestion("Probably the client died, try running it again")?; Ok(()) } 0707010000001B000081A400000000000000000000000166D6DD8C00002018000000000000000000000000000000000000002F00000000wpaperd-1.0.1~git66.62af439/daemon/src/main.rsmod config; mod display_info; mod filelist_cache; mod image_loader; mod image_picker; mod ipc_server; mod opts; mod render; mod socket; mod surface; mod wallpaper_groups; mod wallpaper_info; mod wpaperd; extern crate khronos_egl as egl; use std::{ cell::RefCell, fs::File, io::Write, os::fd::FromRawFd, process::exit, rc::Rc, sync::{ atomic::{AtomicBool, Ordering}, Arc, }, }; use clap::Parser; use color_eyre::{ eyre::{anyhow, ContextCompat, WrapErr}, Result, Section, }; use config::Config; use egl::API as egl; use filelist_cache::FilelistCache; use flexi_logger::{Duplicate, FileSpec, Logger}; use hotwatch::Hotwatch; use ipc_server::{handle_message, listen_on_ipc_socket}; use log::error; use nix::unistd::fork; use opts::Opts; use smithay_client_toolkit::reexports::{ calloop, calloop_wayland_source::WaylandSource, client::{globals::registry_queue_init, Connection, Proxy}, }; use wallpaper_groups::WallpaperGroups; use wallpaper_info::Sorting; use wpaperd_ipc::socket_path; use xdg::BaseDirectories; use crate::wpaperd::Wpaperd; use tikv_jemallocator::Jemalloc; #[global_allocator] static GLOBAL: Jemalloc = Jemalloc; fn run(opts: Opts, xdg_dirs: BaseDirectories) -> Result<()> { // Path passed from the CLI or the wpaperd.toml file has precedence let config_file = if let Some(config) = opts.config { config } else { // Read the new config or the legacy file let legacy_config_file = xdg_dirs .place_config_file("wallpaper.toml") .context("unable to identify legacy config file wallpaper.toml")?; if legacy_config_file.exists() { legacy_config_file } else { xdg_dirs .place_config_file("config.toml") .context("unable to identify config file config.toml")? } }; let reloaded = Arc::new(AtomicBool::new(false)); // Do not stop when the configuration is invalid, we can always reload it at runtime let mut config = match Config::new_from_path(&config_file) { Ok(config) => config, Err(err) => { error!("{err:?}"); let mut config = Config::default(); config.path = config_file; config } }; config.reloaded = Some(reloaded); // we use the OpenGL ES API because it's more widely supported // and it's used by wlroots egl.bind_api(egl::OPENGL_ES_API) .context("unable to select OpenGL API")?; let conn = Connection::connect_to_env() .context("connecting to wayland") .suggestion("Are you running a wayland compositor?")?; let egl_display = unsafe { egl.get_display(conn.display().id().as_ptr() as *mut std::ffi::c_void) .context("getting the display from the WlDisplay")? }; egl.initialize(egl_display) .context("initializing the egl display")?; let (globals, event_queue) = registry_queue_init(&conn).context("initializing the wayland registry queue")?; let qh = event_queue.handle(); let mut event_loop = calloop::EventLoop::<Wpaperd>::try_new()?; WaylandSource::new(conn.clone(), event_queue) .insert(event_loop.handle()) .map_err(|e| anyhow!("insterting the wayland source into the event loop: {e}"))?; let (ping, ping_source) = calloop::ping::make_ping().context("Unable to create a calloop::ping::Ping")?; event_loop .handle() .insert_source(ping_source, |_, _, _| {}) .map_err(|e| anyhow!("inserting the hotwatch event listener in the event loop: {e}"))?; let mut hotwatch = Hotwatch::new().context("hotwatch failed to initialize")?; config.listen_to_changes(&mut hotwatch, ping)?; let (ping, filelist_cache) = FilelistCache::new(config.paths(), &mut hotwatch, event_loop.handle())?; let filelist_cache = Rc::new(RefCell::new(filelist_cache)); let groups = Rc::new(RefCell::new(WallpaperGroups::new())); let mut wpaperd = Wpaperd::new( &qh, &globals, config, egl_display, filelist_cache.clone(), groups, )?; // Start listening on the IPC socket let socket = listen_on_ipc_socket(&socket_path()?).context("spawning the ipc socket")?; // Add source to calloop loop. event_loop .handle() .insert_source(socket, |stream, _, wpaperd| { if let Err(err) = handle_message(stream, qh.clone(), wpaperd) { error!("{:?}", err); } })?; if let Some(notify) = opts.notify { let mut f = unsafe { File::from_raw_fd(notify as i32) }; if let Err(err) = writeln!(f) { // This is not a hard error, just log it and go on error!("Could not write to FD {notify}: {err:?}"); } } loop { // If the config has been modified, this value will return true if wpaperd .config .reloaded .as_ref() .unwrap() .load(Ordering::Acquire) && wpaperd.config.update() { // Update the filelist cache, keep it up to date // We need to call this before because updating the surfaces // will start loading the wallpapers in the background filelist_cache.borrow_mut().update_paths( wpaperd.config.paths(), &mut hotwatch, ping.clone(), ); // Read the config, update the paths in the surfaces wpaperd.update_surfaces(event_loop.handle(), &qh); } // Due to how LayerSurface works, we cannot attach the egl window right away. // The LayerSurface needs to have received a configure callback first. // Afterwards we need to draw for the first time and then add a timer if needed. // We cannot use WlSurface::frame() because it only works for windows that are // already visible, hence we need to draw for the first time and then commit. wpaperd.surfaces.iter_mut().for_each(|surface| { if !surface.is_configured() { return; }; // This is only true once per surface at startup (or when a new display gets connected) if !surface.has_been_drawn() { surface.add_timer(None, &event_loop.handle(), qh.clone()); if let Err(err) = surface.draw(&qh, None) { error!("{err:?}"); }; surface.drawn(); } else { // If the surface has already been drawn for the first time, then handle pausing/resuming // the automatic wallpaper sequence. surface.handle_pause_state(&event_loop.handle(), qh.clone()); if matches!( surface.wallpaper_info.sorting, Some(Sorting::GroupedRandom { .. }) ) { // surface.image_picker.handle_grouped_sorting(); } }; #[cfg(debug_assertions)] wpaperd.image_loader.borrow_mut().check_lingering_threads(); }); event_loop .dispatch(None, &mut wpaperd) .context("dispatching the event loop")?; } } fn main() -> Result<()> { color_eyre::install()?; let xdg_dirs = BaseDirectories::with_prefix("wpaperd")?; let opts = Opts::parse(); let mut logger = Logger::try_with_env_or_str(if opts.verbose { "debug" } else { "info" })?; if opts.daemon { // If wpaperd detach, then log to files logger = logger.log_to_file(FileSpec::default().directory(xdg_dirs.get_state_home())); match unsafe { fork()? } { nix::unistd::ForkResult::Parent { child: _ } => exit(0), nix::unistd::ForkResult::Child => {} } } else { // otherwise prints everything in the stdout/stderr logger = logger.duplicate_to_stderr(Duplicate::Warn); } logger.start()?; if let Err(err) = run(opts, xdg_dirs) { error!("{err:?}"); Err(err) } else { Ok(()) } } 0707010000001C000081A400000000000000000000000166D6DD8C0000032D000000000000000000000000000000000000002F00000000wpaperd-1.0.1~git66.62af439/daemon/src/opts.rsuse std::path::PathBuf; use clap::Parser; #[derive(Parser)] #[clap( author = "Danilo Spinella <danilo.spinella@suse.com>", version, about = "A wallpaper manager for Wayland compositors" )] pub struct Opts { #[clap( action, short, long, help = "Path to the configuration (XDG_CONFIG_HOME/wpaperd/config.toml by default)" )] pub config: Option<PathBuf>, #[clap( action, short, long, help = "Detach from the current terminal and run in the background" )] pub daemon: bool, #[clap(short, long, help = "Increase the verbosity of wpaperd")] pub verbose: bool, #[clap( long, help = "Readiness fd used by wpaperd to signal that it has started correctly" )] pub notify: Option<u8>, } 0707010000001D000041ED00000000000000000000000266D6DD8C00000000000000000000000000000000000000000000002E00000000wpaperd-1.0.1~git66.62af439/daemon/src/render0707010000001E000081A400000000000000000000000166D6DD8C00000795000000000000000000000000000000000000003D00000000wpaperd-1.0.1~git66.62af439/daemon/src/render/coordinates.rspub struct Coordinates { x_left: f32, x_right: f32, y_bottom: f32, y_top: f32, } impl Coordinates { pub const VEC_X_LEFT: f32 = -1.0; pub const VEC_X_RIGHT: f32 = 1.0; pub const VEC_Y_BOTTOM: f32 = 1.0; pub const VEC_Y_TOP: f32 = -1.0; pub const TEX_X_LEFT: f32 = 0.0; pub const TEX_X_RIGHT: f32 = 1.0; pub const TEX_Y_BOTTOM: f32 = 0.0; pub const TEX_Y_TOP: f32 = 1.0; #[allow(unused)] pub fn new(x_left: f32, x_right: f32, y_bottom: f32, y_top: f32) -> Self { Self { x_left, x_right, y_bottom, y_top, } } pub const fn default_vec_coordinates() -> Self { Self { x_right: Self::VEC_X_RIGHT, x_left: Self::VEC_X_LEFT, y_bottom: Self::VEC_Y_BOTTOM, y_top: Self::VEC_Y_TOP, } } pub const fn default_texture_coordinates() -> Self { Self { x_right: Self::TEX_X_RIGHT, x_left: Self::TEX_X_LEFT, y_bottom: Self::TEX_Y_BOTTOM, y_top: Self::TEX_Y_TOP, } } } pub fn get_opengl_point_coordinates( vec_coordinates: Coordinates, tex_coordinates: Coordinates, ) -> [f32; 16] { [ vec_coordinates.x_left, // top left start vec_coordinates.y_top, tex_coordinates.x_left, tex_coordinates.y_top, // top left stop vec_coordinates.x_left, // bottom left start vec_coordinates.y_bottom, tex_coordinates.x_left, tex_coordinates.y_bottom, // bottom left stop vec_coordinates.x_right, // bottom right start vec_coordinates.y_bottom, tex_coordinates.x_right, tex_coordinates.y_bottom, // bottom right stop vec_coordinates.x_right, // top right start vec_coordinates.y_top, tex_coordinates.x_right, tex_coordinates.y_top, // top right // stop ] } 0707010000001F000081A400000000000000000000000166D6DD8C00000C82000000000000000000000000000000000000003D00000000wpaperd-1.0.1~git66.62af439/daemon/src/render/egl_context.rsuse smithay_client_toolkit::reexports::client::{protocol::wl_surface::WlSurface, Proxy}; use wayland_egl::WlEglSurface; use egl::API as egl; use color_eyre::{eyre::Context, Result}; pub struct EglContext { pub display: egl::Display, pub context: egl::Context, pub config: egl::Config, wl_egl_surface: WlEglSurface, surface: khronos_egl::Surface, } impl EglContext { pub fn new(egl_display: egl::Display, wl_surface: &WlSurface) -> Self { const ATTRIBUTES: [i32; 7] = [ egl::RED_SIZE, 8, egl::GREEN_SIZE, 8, egl::BLUE_SIZE, 8, egl::NONE, ]; let config = egl .choose_first_config(egl_display, &ATTRIBUTES) .expect("unable to choose an EGL configuration") .expect("no EGL configuration found"); const CONTEXT_ATTRIBUTES: [i32; 5] = [ egl::CONTEXT_MAJOR_VERSION, 2, egl::CONTEXT_MINOR_VERSION, 0, egl::NONE, ]; let context = egl .create_context(egl_display, config, None, &CONTEXT_ATTRIBUTES) .expect("unable to create an EGL context"); // First, create a small surface, we don't know the size of the output yet let wl_egl_surface = WlEglSurface::new(wl_surface.id(), 10, 10).unwrap(); let surface = unsafe { egl.create_window_surface( egl_display, config, wl_egl_surface.ptr() as egl::NativeWindowType, None, ) .expect("unable to create an EGL surface") }; Self { display: egl_display, context, config, surface, wl_egl_surface, } } #[inline] pub fn make_current(&self) -> Result<()> { egl.make_current( self.display, Some(self.surface), Some(self.surface), Some(self.context), ) .with_context(|| "unable to make the context current") } // Swap the buffers of the surface #[inline] pub fn swap_buffers(&self) -> Result<()> { egl.swap_buffers(self.display, self.surface) .with_context(|| "unable to post the surface content") } /// Resize the surface /// Resizing the surface means to destroy the previous one and then recreate it pub fn resize(&mut self, wl_surface: &WlSurface, width: i32, height: i32) -> Result<()> { egl.destroy_surface(self.display, self.surface) .context("unable to destroy EGL surface")?; let wl_egl_surface = WlEglSurface::new(wl_surface.id(), width, height) .context("unable to create a new WlEglSurface")?; let surface = unsafe { egl.create_window_surface( self.display, self.config, wl_egl_surface.ptr() as egl::NativeWindowType, None, ) .context("unable to create an EGL surface")? }; self.surface = surface; self.wl_egl_surface = wl_egl_surface; Ok(()) } } 07070100000020000081A400000000000000000000000166D6DD8C00001499000000000000000000000000000000000000003500000000wpaperd-1.0.1~git66.62af439/daemon/src/render/mod.rsmod coordinates; mod egl_context; mod renderer; mod shader; mod transition; mod wallpaper; use std::ffi::{c_void, CStr}; use color_eyre::{ eyre::{bail, ensure}, Result, }; use coordinates::{get_opengl_point_coordinates, Coordinates}; use image::DynamicImage; pub use egl_context::EglContext; pub use renderer::Renderer; pub use transition::Transition; pub mod gl { #![allow(clippy::all)] include!(concat!(env!("OUT_DIR"), "/gl_bindings.rs")); pub use Gles2 as Gl; } // Macro that check the error code of the last OpenGL call and returns a Result. #[macro_export] macro_rules! gl_check { ($gl:expr, $desc:expr) => {{ let error = $gl.GetError(); if error != gl::NO_ERROR { let error_string = $gl.GetString(error); ensure!( !error_string.is_null(), "OpenGL error when {}: {}", $desc, error ); let error_string = CStr::from_ptr(error_string as _) .to_string_lossy() .into_owned(); bail!("OpenGL error when {}: {} ({})", $desc, error, error_string); } }}; } fn initialize_objects(gl: &gl::Gl) -> Result<(gl::types::GLuint, gl::types::GLuint)> { unsafe { let mut vbo = 0; gl.GenBuffers(1, &mut vbo); gl_check!(gl, "generating the vbo buffer"); gl.BindBuffer(gl::ARRAY_BUFFER, vbo); gl_check!(gl, "binding the vbo buffer"); let vertex_data: Vec<f32> = vec![0.0; 24 as _]; gl.BufferData( gl::ARRAY_BUFFER, (vertex_data.len() * std::mem::size_of::<f32>()) as gl::types::GLsizeiptr, vertex_data.as_ptr() as *const _, gl::STATIC_DRAW, ); gl_check!(gl, "buffering the data"); let mut eab = 0; gl.GenBuffers(1, &mut eab); gl_check!(gl, "generating the eab buffer"); gl.BindBuffer(gl::ELEMENT_ARRAY_BUFFER, eab); gl_check!(gl, "binding the eab buffer"); // We load the elements array buffer once, it's the same for each wallpaper const INDICES: [gl::types::GLuint; 6] = [0, 1, 2, 2, 3, 0]; gl.BufferData( gl::ELEMENT_ARRAY_BUFFER, (INDICES.len() * std::mem::size_of::<gl::types::GLuint>()) as gl::types::GLsizeiptr, INDICES.as_ptr() as *const _, gl::STATIC_DRAW, ); gl_check!(gl, "buffering the data"); const POS_ATTRIB: i32 = 0; const TEX_ATTRIB: i32 = 1; gl.VertexAttribPointer( POS_ATTRIB as gl::types::GLuint, 2, gl::FLOAT, 0, 4 * std::mem::size_of::<f32>() as gl::types::GLsizei, std::ptr::null(), ); gl_check!(gl, "setting the position attribute for the vertex"); gl.EnableVertexAttribArray(POS_ATTRIB as gl::types::GLuint); gl_check!(gl, "enabling the position attribute for the vertex"); gl.VertexAttribPointer( TEX_ATTRIB as gl::types::GLuint, 2, gl::FLOAT, 0, 4 * std::mem::size_of::<f32>() as gl::types::GLsizei, (2 * std::mem::size_of::<f32>()) as *const () as *const _, ); gl_check!(gl, "setting the texture attribute for the vertex"); gl.EnableVertexAttribArray(TEX_ATTRIB as gl::types::GLuint); gl_check!(gl, "enabling the texture attribute for the vertex"); // Set the Coordinates of the two triangles. These don't change during // the running of the program. let vertex_data = get_opengl_point_coordinates( Coordinates::default_vec_coordinates(), Coordinates::default_texture_coordinates(), ); // Update the vertex buffer gl.BufferSubData( gl::ARRAY_BUFFER, 0, (vertex_data.len() * std::mem::size_of::<f32>()) as gl::types::GLsizeiptr, vertex_data.as_ptr() as *const _, ); gl_check!(gl, "buffering the data"); Ok((vbo, eab)) } } fn load_texture(gl: &gl::Gl, image: DynamicImage) -> Result<gl::types::GLuint> { Ok(unsafe { let mut texture = 0; gl.GenTextures(1, &mut texture); gl_check!(gl, "generating textures"); gl.ActiveTexture(gl::TEXTURE1); gl_check!(gl, "activating textures"); gl.BindTexture(gl::TEXTURE_2D, texture); gl_check!(gl, "binding textures"); gl.TexImage2D( gl::TEXTURE_2D, 0, gl::RGBA.try_into().unwrap(), image.width().try_into().unwrap(), image.height().try_into().unwrap(), 0, gl::RGBA, gl::UNSIGNED_BYTE, image.as_bytes().as_ptr() as *const c_void, ); gl_check!(gl, "defining the texture"); gl.GenerateMipmap(gl::TEXTURE_2D); gl_check!(gl, "generating the mipmap"); gl.TexParameteri(gl::TEXTURE_2D, gl::TEXTURE_MIN_FILTER, gl::LINEAR as i32); gl_check!(gl, "defining the texture min filter"); gl.TexParameteri(gl::TEXTURE_2D, gl::TEXTURE_MAG_FILTER, gl::LINEAR as i32); gl_check!(gl, "defining the texture mag filter"); texture }) } 07070100000021000081A400000000000000000000000166D6DD8C00004A84000000000000000000000000000000000000003A00000000wpaperd-1.0.1~git66.62af439/daemon/src/render/renderer.rsuse std::{cell::RefCell, ffi::CStr, ops::Deref, rc::Rc}; use color_eyre::{ eyre::{bail, ensure, Context}, Result, }; use egl::API as egl; use image::{DynamicImage, RgbaImage}; use log::error; use smithay_client_toolkit::reexports::client::protocol::wl_output::Transform; use crate::{ display_info::DisplayInfo, gl_check, render::{ initialize_objects, load_texture, shader::{create_shader, FRAGMENT_SHADER_SOURCE, VERTEX_SHADER_SOURCE}, }, wallpaper_info::BackgroundMode, }; use super::{gl, wallpaper::Wallpaper, Transition}; fn transparent_image() -> RgbaImage { RgbaImage::from_raw(1, 1, vec![0, 0, 0, 0]).unwrap() } #[derive(Debug)] pub enum TransitionStatus { Started, Running { started: u32, progress: f32 }, Ended, } pub struct Renderer { gl: Rc<gl::Gl>, pub program: gl::types::GLuint, vbo: gl::types::GLuint, eab: gl::types::GLuint, // milliseconds time for the transition transition_time: u32, pub display_info: Rc<RefCell<DisplayInfo>>, prev_wallpaper: Option<Wallpaper>, current_wallpaper: Wallpaper, transparent_texture: gl::types::GLuint, /// contains the progress of the current animation transition_status: TransitionStatus, } impl Renderer { pub unsafe fn new( image: DynamicImage, display_info: Rc<RefCell<DisplayInfo>>, transition_time: u32, transition: Transition, transform: Transform, ) -> Result<Self> { let gl = Rc::new(gl::Gl::load_with(|name| { egl.get_proc_address(name) .expect("egl.get_proc_address to work") as *const std::ffi::c_void })); let program = create_program(&gl, transition) .context("unable to create program during openGL ES initialization")?; let (vbo, eab) = initialize_objects(&gl)?; let current_wallpaper = Wallpaper::new(gl.clone()); let transparent_texture = load_texture(&gl, transparent_image().into())?; let mut renderer = Self { gl, program, vbo, eab, transition_time, prev_wallpaper: None, current_wallpaper, display_info, transparent_texture, transition_status: TransitionStatus::Ended, }; renderer.load_wallpaper(image, BackgroundMode::Stretch, None)?; renderer.set_projection_matrix(transform)?; Ok(renderer) } #[inline] pub fn check_error(&self, msg: &str) -> Result<()> { unsafe { gl_check!(self.gl, msg); } Ok(()) } pub unsafe fn draw(&mut self) -> Result<()> { self.gl.Clear(gl::COLOR_BUFFER_BIT); self.check_error("clearing the screen")?; let loc = self .gl .GetUniformLocation(self.program, b"progress\0".as_ptr() as *const _); self.check_error("getting the uniform location")?; self.gl.Uniform1f( loc, match self.transition_status { TransitionStatus::Started => 0.0, TransitionStatus::Running { started: _, progress, } => progress, TransitionStatus::Ended => 1.0, }, ); self.check_error("calling Uniform1i")?; self.gl .DrawElements(gl::TRIANGLES, 6, gl::UNSIGNED_INT, std::ptr::null()); self.check_error("drawing the triangles")?; Ok(()) } /// Update the transition status with the current time #[inline] pub fn update_transition_status(&mut self, time: u32) -> bool { let started = match self.transition_status { TransitionStatus::Started => time, TransitionStatus::Running { started, progress: _, } => started, TransitionStatus::Ended => unreachable!(), }; let progress = ((time.saturating_sub(started)) as f32 / self.transition_time as f32).min(1.0); if progress == 1.0 { self.transition_status = TransitionStatus::Ended; false } else { self.transition_status = TransitionStatus::Running { started, progress }; true } } pub fn load_wallpaper( &mut self, image: DynamicImage, mode: BackgroundMode, offset: Option<f32>, ) -> Result<()> { self.prev_wallpaper = Some(std::mem::replace( &mut self.current_wallpaper, Wallpaper::new(self.gl.clone()), )); self.current_wallpaper.load_image(image)?; self.bind_wallpapers(mode, offset)?; Ok(()) } fn bind_wallpapers(&mut self, mode: BackgroundMode, offset: Option<f32>) -> Result<()> { self.set_mode(mode, offset)?; unsafe { self.gl.ActiveTexture(gl::TEXTURE0); self.check_error("activating gl::TEXTURE0")?; self.prev_wallpaper .as_ref() .expect("previous wallpaper to be set") .bind()?; // current_wallpaper is already binded to TEXTURE1, as load_texture loads the image // there } Ok(()) } pub fn set_mode(&mut self, mode: BackgroundMode, offset: Option<f32>) -> Result<()> { let display_info = (*self.display_info).borrow(); let display_width = display_info.scaled_width() as f32; let display_height = display_info.scaled_height() as f32; let display_ratio = display_width / display_height; let gen_texture_scale = |image_width: f32, image_height: f32| { let image_ratio: f32 = image_width / image_height; Box::new(match mode { BackgroundMode::Stretch => [1.0, 1.0], BackgroundMode::Center => [ (display_ratio / image_ratio).min(1.0), (image_ratio / display_ratio).min(1.0), ], BackgroundMode::Fit | BackgroundMode::FitBorderColor => { // Portrait mode // In this case we calculate the width relative to the height of the // screen with the ratio of the image let width = display_height * image_ratio; // Same thing as above, just with the width let height = display_width / image_ratio; // Then we calculate the proportions [ (display_width / width).max(1.0), (display_height / height).max(1.0), ] } BackgroundMode::Tile => { let width_proportion = display_width / image_width * display_ratio; let height_proportion = display_height / image_height * display_ratio; if display_ratio > image_ratio { // Portrait mode if height_proportion.max(1.0) == 1.0 { // Same as Fit let width = display_height * image_ratio; [display_width / width, 1.0] } else { [width_proportion, height_proportion] } } else { // Landscape mode if width_proportion.max(1.0) == 1.0 { // Same as Fit let height = display_width / image_ratio; [1.0, display_height / height] } else { [width_proportion, height_proportion] } } } }) }; let texture_scale = gen_texture_scale( self.current_wallpaper.get_image_width() as f32, self.current_wallpaper.get_image_height() as f32, ); let (prev_image_width, prev_image_height) = if let Some(prev_wp) = &self.prev_wallpaper { ( prev_wp.get_image_width() as f32, prev_wp.get_image_height() as f32, ) } else { (1.0, 1.0) }; let prev_texture_scale = gen_texture_scale(prev_image_width, prev_image_height); unsafe { let loc = self .gl .GetUniformLocation(self.program, b"textureScale\0".as_ptr() as *const _); self.check_error("getting the uniform location")?; ensure!(loc > 0, "textureScale not found"); self.gl .Uniform2fv(loc, 1, texture_scale.as_ptr() as *const _); self.check_error("calling Uniform2fv on textureScale")?; let loc = self .gl .GetUniformLocation(self.program, b"prevTextureScale\0".as_ptr() as *const _); self.check_error("getting the uniform location")?; ensure!(loc > 0, "prevTextureScale not found"); self.gl .Uniform2fv(loc, 1, prev_texture_scale.as_ptr() as *const _); self.check_error("calling Uniform2fv on prevTextureScale")?; let loc = self .gl .GetUniformLocation(self.program, b"ratio\0".as_ptr() as *const _); self.check_error("getting the uniform location")?; self.gl.Uniform1f(loc, display_ratio); self.check_error("calling Uniform1f")?; let offset = match (offset, mode) { ( None, BackgroundMode::Stretch | BackgroundMode::Center | BackgroundMode::Fit | BackgroundMode::FitBorderColor, ) => 0.5, (None, BackgroundMode::Tile) => 0.0, (Some(offset), _) => offset, }; let loc = self .gl .GetUniformLocation(self.program, b"texture_offset\0".as_ptr() as *const _); self.check_error("getting the uniform location")?; self.gl.Uniform1f(loc, offset); self.check_error("calling Uniform1f")?; let texture_wrap = match mode { BackgroundMode::Stretch | BackgroundMode::Center | BackgroundMode::Fit => { gl::CLAMP_TO_BORDER_EXT } BackgroundMode::Tile => gl::REPEAT, BackgroundMode::FitBorderColor => gl::CLAMP_TO_EDGE, } as i32; self.gl.ActiveTexture(gl::TEXTURE0); self.check_error("activating gl::TEXTURE0")?; self.gl .TexParameteri(gl::TEXTURE_2D, gl::TEXTURE_WRAP_S, texture_wrap); self.check_error("defining the texture wrap_s")?; self.gl .TexParameteri(gl::TEXTURE_2D, gl::TEXTURE_WRAP_T, texture_wrap); self.check_error("defining the texture wrap_t")?; self.gl.ActiveTexture(gl::TEXTURE1); self.check_error("activating gl::TEXTURE1")?; self.gl .TexParameteri(gl::TEXTURE_2D, gl::TEXTURE_WRAP_S, texture_wrap); self.check_error("defining the texture wrap_s")?; self.gl .TexParameteri(gl::TEXTURE_2D, gl::TEXTURE_WRAP_T, texture_wrap); self.check_error("defining the texture wrap_t")?; } Ok(()) } #[inline] pub fn start_transition(&mut self, transition_time: u32) { match self.transition_status { TransitionStatus::Started | TransitionStatus::Running { .. } => unreachable!(), TransitionStatus::Ended => self.transition_status = TransitionStatus::Started, } // Needed to skip the initial transition depending on the configuration self.transition_time = transition_time; } #[inline] pub fn clear_after_draw(&self) -> Result<()> { unsafe { // Unbind the framebuffer and renderbuffer before deleting. // self.gl.BindBuffer(gl::PIXEL_UNPACK_BUFFER, 0); // self.check_error("unbinding the unpack buffer")?; self.gl.BindFramebuffer(gl::FRAMEBUFFER, 0); self.check_error("unbinding the framebuffer")?; self.gl.BindRenderbuffer(gl::RENDERBUFFER, 0); self.check_error("unbinding the render buffer")?; } Ok(()) } pub fn resize(&mut self) -> Result<()> { let info = (*self.display_info).borrow(); unsafe { self.gl .Viewport(0, 0, info.adjusted_width(), info.adjusted_height()); self.check_error("resizing the viewport") } } #[inline] pub fn update_transition_time(&mut self, transition_time: u32) { self.transition_time = transition_time; } #[inline] pub fn transition_finished(&mut self) { // By binding transparent pixel into the old wallpaper, we can delete the texture, // freeing space from the GPU unsafe { // The previous wallpaper is always binding in TEXTURE0 self.gl.ActiveTexture(gl::TEXTURE0); self.gl .BindTexture(gl::TEXTURE_2D, self.transparent_texture); self.prev_wallpaper.take(); } } #[inline] pub fn force_transition_end(&mut self) { // Force the transition to end self.transition_status = TransitionStatus::Ended; } #[inline] pub fn update_transition(&mut self, transition: Transition, transform: Transform) { match create_program(&self.gl, transition) { Ok(program) => { unsafe { self.gl.DeleteProgram(self.program); } // Stop the transition immediately if self.transition_running() { self.force_transition_end(); } self.program = program; unsafe { if let Err(err) = self.set_projection_matrix(transform) { error!("{err:?}"); } } } Err(err) => error!("{err:?}"), } } #[inline] pub fn transition_running(&self) -> bool { match self.transition_status { TransitionStatus::Started | TransitionStatus::Running { .. } => true, TransitionStatus::Ended => false, } } pub unsafe fn set_projection_matrix(&self, transform: Transform) -> Result<()> { let projection_matrix = projection_matrix(transform); let loc = self .gl .GetUniformLocation(self.program, b"projection_matrix\0".as_ptr() as *const _); self.check_error("getting the uniform location for projection_matrix")?; ensure!(loc > 0, "projection_matrix not found"); self.gl .UniformMatrix2fv(loc, 1, 0, projection_matrix.as_ptr()); //self.gl // .UniformMatrix2fv(loc, 1, 0, [1.0, 0.0, 0.0, 1.0].as_ptr()); self.check_error("calling Uniform1i")?; Ok(()) } } fn create_program(gl: &gl::Gl, transition: Transition) -> Result<gl::types::GLuint> { unsafe { let program = gl.CreateProgram(); gl_check!(gl, "calling CreateProgram"); let vertex_shader = create_shader(gl, gl::VERTEX_SHADER, &[VERTEX_SHADER_SOURCE.as_ptr()]) .expect("vertex shader creation succeed"); let (uniform_callback, shader) = transition.clone().shader(); let fragment_shader = create_shader( gl, gl::FRAGMENT_SHADER, &[FRAGMENT_SHADER_SOURCE.as_ptr(), shader.as_ptr()], ) .with_context(|| { format!("unable to create fragment_shader with transisition {transition:?}") })?; gl.AttachShader(program, vertex_shader); gl_check!(gl, "attach vertex shader"); gl.AttachShader(program, fragment_shader); gl_check!(gl, "attach fragment shader"); gl.LinkProgram(program); gl_check!(gl, "linking the program"); { // This shouldn't be needed, gl_check already checks the status of LinkProgram let mut status: i32 = 0; gl.GetProgramiv(program, gl::LINK_STATUS, &mut status as *mut _); ensure!(status == 1, "Program was not linked correctly"); } gl_check!(gl, "calling UseProgram"); gl.DeleteShader(vertex_shader); gl_check!(gl, "deleting the vertex shader"); gl.DeleteShader(fragment_shader); gl_check!(gl, "deleting the fragment shader"); gl.UseProgram(program); gl_check!(gl, "calling UseProgram"); // We need to setup the uniform each time we create a program let loc = gl.GetUniformLocation(program, b"u_prev_texture\0".as_ptr() as *const _); gl_check!(gl, "getting the uniform location for u_prev_texture"); ensure!(loc > 0, "u_prev_texture not found"); gl.Uniform1i(loc, 0); gl_check!(gl, "calling Uniform1i"); let loc = gl.GetUniformLocation(program, b"u_texture\0".as_ptr() as *const _); gl_check!(gl, "getting the uniform location for u_texture"); ensure!(loc > 0, "u_texture not found"); gl.Uniform1i(loc, 1); gl_check!(gl, "calling Uniform1i"); uniform_callback(gl, program)?; Ok(program) } } #[rustfmt::skip] fn projection_matrix(transform: Transform) -> [f32; 4] { match transform { Transform::Normal => { [ 1.0, 0.0, 0.0, 1.0, ] } Transform::_90 => { [ 0.0, -1.0, 1.0, 0.0, ] } Transform::_180 => { [ -1.0, 0.0, 0.0, -1.0, ] } Transform::_270 => { [ 0.0, 1.0, -1.0, 0.0, ] } Transform::Flipped => { [ -1.0, 0.0, 0.0, 1.0, ] } Transform::Flipped90 => { [ 0.0, -1.0, -1.0, 0.0, ] } Transform::Flipped180 => { [ 1.0, 0.0, 0.0, -1.0, ] } Transform::Flipped270 => { [ 0.0, 1.0, 1.0, 0.0, ] } _ => unreachable!() } } impl Deref for Renderer { type Target = gl::Gl; fn deref(&self) -> &Self::Target { &self.gl } } impl Drop for Renderer { fn drop(&mut self) { unsafe { self.gl.DeleteBuffers(1, &self.eab); self.gl.DeleteBuffers(1, &self.vbo); self.gl.DeleteProgram(self.program); } } } 07070100000022000081A400000000000000000000000166D6DD8C00000A0D000000000000000000000000000000000000003800000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shader.rsuse std::ffi::CStr; use color_eyre::{ eyre::{bail, ensure}, Result, }; use crate::gl_check; use super::gl; pub unsafe fn create_shader( gl: &gl::Gl, shader: gl::types::GLenum, sources: &[*const i8], ) -> Result<gl::types::GLuint> { let shader = gl.CreateShader(shader); gl_check!(gl, "calling CreateShader"); gl.ShaderSource( shader, sources.len() as i32, sources.as_ptr().cast(), std::ptr::null(), ); gl_check!(gl, "calling Shadersource"); gl.CompileShader(shader); gl_check!(gl, "calling CompileShader"); let mut status: i32 = 0; gl.GetShaderiv(shader, gl::COMPILE_STATUS, &mut status as *mut _); gl_check!(gl, "calling GetShaderiv"); if status == 0 { let mut max_length: i32 = 0; let mut length: i32 = 0; gl.GetShaderiv(shader, gl::INFO_LOG_LENGTH, &mut max_length as *mut _); gl_check!(gl, "calling GetShaderiv"); let mut log: Vec<u8> = vec![0; max_length as _]; gl.GetShaderInfoLog( shader, max_length, &mut length as *mut _, log.as_mut_ptr() as _, ); gl_check!(gl, "calling GetShaderInfoLog"); let res = String::from_utf8(log); match res { Ok(log) => Err(color_eyre::eyre::anyhow!(log)), Err(err) => Err(color_eyre::eyre::anyhow!(err)), } } else { Ok(shader) } } pub const VERTEX_SHADER_SOURCE: &CStr = c" #version 310 es precision mediump float; layout (location = 0) in vec2 aPosition; layout (location = 1) in vec2 aTexCoord; layout (location = 10) uniform mat2 projection_matrix; out vec2 v_texcoord; void main() { gl_Position = vec4(aPosition* projection_matrix, 1.0, 1.0); v_texcoord = aTexCoord; }"; pub const FRAGMENT_SHADER_SOURCE: &CStr = c" #version 310 es precision mediump float; out vec4 FragColor; in vec2 v_texcoord; layout (location = 2) uniform vec2 textureScale; layout (location = 3) uniform vec2 prevTextureScale; layout (location = 4) uniform sampler2D u_prev_texture; layout (location = 5) uniform sampler2D u_texture; uniform float progress; uniform float ratio; uniform float texture_offset; vec4 transition(vec2); vec4 getFromColor(vec2 uv) { uv = (uv - texture_offset) * prevTextureScale + (texture_offset); return texture(u_prev_texture, uv); } vec4 getToColor(vec2 uv) { uv = (uv - texture_offset) * textureScale + (texture_offset); return texture(u_texture, uv); } void main() { FragColor = transition(v_texcoord); }"; 07070100000023000041ED00000000000000000000000266D6DD8C00000000000000000000000000000000000000000000003600000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders07070100000024000081A400000000000000000000000166D6DD8C00000338000000000000000000000000000000000000004400000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/BookFlip.glsl// Author: hong // License: MIT vec2 skewRight(vec2 p) { float skewX = (p.x - progress)/(0.5 - progress) * 0.5; float skewY = (p.y - 0.5)/(0.5 + progress * (p.x - 0.5) / 0.5)* 0.5 + 0.5; return vec2(skewX, skewY); } vec2 skewLeft(vec2 p) { float skewX = (p.x - 0.5)/(progress - 0.5) * 0.5 + 0.5; float skewY = (p.y - 0.5) / (0.5 + (1.0 - progress ) * (0.5 - p.x) / 0.5) * 0.5 + 0.5; return vec2(skewX, skewY); } vec4 addShade() { float shadeVal = max(0.7, abs(progress - 0.5) * 2.0); return vec4(vec3(shadeVal ), 1.0); } vec4 transition (vec2 p, vec2 prev_p) { float pr = step(1.0 - progress, p.x); if (p.x < 0.5) { return mix(getFromColor(prev_p), getToColor(skewLeft(p)) * addShade(), pr); } else { return mix(getFromColor(skewRight(prev_p)) * addShade(), getToColor(p), pr); } } 07070100000025000081A400000000000000000000000166D6DD8C000002CC000000000000000000000000000000000000004200000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/Bounce.glsluniform vec4 shadow_colour; // = vec4(0.,0.,0.,.6); uniform float shadow_height; // = 0.075; uniform float bounces; // = 3.0; const float PI = 3.14159265358; vec4 transition (vec2 uv) { float time = progress; float stime = sin(time * PI / 2.); float phase = time * PI * bounces; float y = (abs(cos(phase))) * (1.0 - stime); float d = uv.y - y; return mix( mix( getToColor(uv), shadow_colour, step(d, shadow_height) * (1. - mix( ((d / shadow_height) * shadow_colour.a) + (1.0 - shadow_colour.a), 1.0, smoothstep(0.95, 1., progress) // fade-out the shadow at the end )) ), getFromColor(vec2(uv.x, uv.y + (1.0 - y))), step(d, 0.0) ); } 07070100000026000081A400000000000000000000000166D6DD8C00000A22000000000000000000000000000000000000004C00000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/BowTieHorizontal.glsl// Author: huynx // License: MIT vec2 bottom_left = vec2(0.0, 1.0); vec2 bottom_right = vec2(1.0, 1.0); vec2 top_left = vec2(0.0, 0.0); vec2 top_right = vec2(1.0, 0.0); vec2 center = vec2(0.5, 0.5); float check(vec2 p1, vec2 p2, vec2 p3) { return (p1.x - p3.x) * (p2.y - p3.y) - (p2.x - p3.x) * (p1.y - p3.y); } bool PointInTriangle (vec2 pt, vec2 p1, vec2 p2, vec2 p3) { bool b1, b2, b3; b1 = check(pt, p1, p2) < 0.0; b2 = check(pt, p2, p3) < 0.0; b3 = check(pt, p3, p1) < 0.0; return ((b1 == b2) && (b2 == b3)); } bool in_left_triangle(vec2 p){ vec2 vertex1, vertex2, vertex3; vertex1 = vec2(progress, 0.5); vertex2 = vec2(0.0, 0.5-progress); vertex3 = vec2(0.0, 0.5+progress); if (PointInTriangle(p, vertex1, vertex2, vertex3)) { return true; } return false; } bool in_right_triangle(vec2 p){ vec2 vertex1, vertex2, vertex3; vertex1 = vec2(1.0-progress, 0.5); vertex2 = vec2(1.0, 0.5-progress); vertex3 = vec2(1.0, 0.5+progress); if (PointInTriangle(p, vertex1, vertex2, vertex3)) { return true; } return false; } float blur_edge(vec2 bot1, vec2 bot2, vec2 top, vec2 testPt) { vec2 lineDir = bot1 - top; vec2 perpDir = vec2(lineDir.y, -lineDir.x); vec2 dirToPt1 = bot1 - testPt; float dist1 = abs(dot(normalize(perpDir), dirToPt1)); lineDir = bot2 - top; perpDir = vec2(lineDir.y, -lineDir.x); dirToPt1 = bot2 - testPt; float min_dist = min(abs(dot(normalize(perpDir), dirToPt1)), dist1); if (min_dist < 0.005) { return min_dist / 0.005; } else { return 1.0; }; } vec4 transition (vec2 uv) { if (in_left_triangle(uv)) { if (progress < 0.1) { return getFromColor(uv); } if (uv.x < 0.5) { vec2 vertex1 = vec2(progress, 0.5); vec2 vertex2 = vec2(0.0, 0.5-progress); vec2 vertex3 = vec2(0.0, 0.5+progress); return mix( getFromColor(uv), getToColor(uv), blur_edge(vertex2, vertex3, vertex1, uv) ); } else { if (progress > 0.0) { return getToColor(uv); } else { return getFromColor(uv); } } } else if (in_right_triangle(uv)) { if (uv.x >= 0.5) { vec2 vertex1 = vec2(1.0-progress, 0.5); vec2 vertex2 = vec2(1.0, 0.5-progress); vec2 vertex3 = vec2(1.0, 0.5+progress); return mix( getFromColor(uv), getToColor(uv), blur_edge(vertex2, vertex3, vertex1, uv) ); } else { return getFromColor(uv); } } else { return getFromColor(uv); } } 07070100000027000081A400000000000000000000000166D6DD8C0000097D000000000000000000000000000000000000004A00000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/BowTieVertical.glsl// Author: huynx // License: MIT float check(vec2 p1, vec2 p2, vec2 p3) { return (p1.x - p3.x) * (p2.y - p3.y) - (p2.x - p3.x) * (p1.y - p3.y); } bool PointInTriangle (vec2 pt, vec2 p1, vec2 p2, vec2 p3) { bool b1, b2, b3; b1 = check(pt, p1, p2) < 0.0; b2 = check(pt, p2, p3) < 0.0; b3 = check(pt, p3, p1) < 0.0; return ((b1 == b2) && (b2 == b3)); } bool in_top_triangle(vec2 p){ vec2 vertex1, vertex2, vertex3; vertex1 = vec2(0.5, progress); vertex2 = vec2(0.5-progress, 0.0); vertex3 = vec2(0.5+progress, 0.0); if (PointInTriangle(p, vertex1, vertex2, vertex3)) { return true; } return false; } bool in_bottom_triangle(vec2 p){ vec2 vertex1, vertex2, vertex3; vertex1 = vec2(0.5, 1.0 - progress); vertex2 = vec2(0.5-progress, 1.0); vertex3 = vec2(0.5+progress, 1.0); if (PointInTriangle(p, vertex1, vertex2, vertex3)) { return true; } return false; } float blur_edge(vec2 bot1, vec2 bot2, vec2 top, vec2 testPt) { vec2 lineDir = bot1 - top; vec2 perpDir = vec2(lineDir.y, -lineDir.x); vec2 dirToPt1 = bot1 - testPt; float dist1 = abs(dot(normalize(perpDir), dirToPt1)); lineDir = bot2 - top; perpDir = vec2(lineDir.y, -lineDir.x); dirToPt1 = bot2 - testPt; float min_dist = min(abs(dot(normalize(perpDir), dirToPt1)), dist1); if (min_dist < 0.005) { return min_dist / 0.005; } else { return 1.0; }; } vec4 transition (vec2 uv) { if (in_top_triangle(uv)) { if (progress < 0.1) { return getFromColor(uv); } if (uv.y < 0.5) { vec2 vertex1 = vec2(0.5, progress); vec2 vertex2 = vec2(0.5-progress, 0.0); vec2 vertex3 = vec2(0.5+progress, 0.0); return mix( getFromColor(uv), getToColor(uv), blur_edge(vertex2, vertex3, vertex1, uv) ); } else { if (progress > 0.0) { return getToColor(uv); } else { return getFromColor(uv); } } } else if (in_bottom_triangle(uv)) { if (uv.y >= 0.5) { vec2 vertex1 = vec2(0.5, 1.0-progress); vec2 vertex2 = vec2(0.5-progress, 1.0); vec2 vertex3 = vec2(0.5+progress, 1.0); return mix( getFromColor(uv), getToColor(uv), blur_edge(vertex2, vertex3, vertex1, uv) ); } else { return getFromColor(uv); } } else { return getFromColor(uv); } } 07070100000028000081A400000000000000000000000166D6DD8C000003D5000000000000000000000000000000000000005100000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/ButterflyWaveScrawler.glsl// Author: mandubian // License: MIT uniform float amplitude; // = 1.0 uniform float waves; // = 30.0 uniform float colorSeparation; // = 0.3 float PI = 3.14159265358979323846264; float compute(vec2 p, float progress, vec2 center) { vec2 o = p*sin(progress * amplitude)-center; // horizontal vector vec2 h = vec2(1., 0.); // butterfly polar function (don't ask me why this one :)) float theta = acos(dot(o, h)) * waves; return (exp(cos(theta)) - 2.*cos(4.*theta) + pow(sin((2.*theta - PI) / 24.), 5.)) / 10.; } vec4 transition(vec2 uv) { vec2 p = uv.xy / vec2(1.0).xy; float inv = 1. - progress; vec2 dir = p - vec2(.5); float dist = length(dir); float disp = compute(p, progress, vec2(0.5, 0.5)) ; vec4 texTo = getToColor(p + inv*disp); vec4 texFrom = vec4( getFromColor(p + progress*disp*(1.0 - colorSeparation)).r, getFromColor(p + progress*disp).g, getFromColor(p + progress*disp*(1.0 + colorSeparation)).b, 1.0); return texTo*progress + texFrom*inv; } 07070100000029000081A400000000000000000000000166D6DD8C0000019B000000000000000000000000000000000000004200000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/Circle.glsl// Author: Fernando Kuteken // License: MIT vec4 transition (vec2 uv) { const vec2 center = vec2(0.5, 0.5); const vec3 backColor = vec3(0.1, 0.1, 0.1); float distance = length(uv - center); float radius = sqrt(8.0) * abs(progress - 0.5); if (distance > radius) { return vec4(backColor, 1.0); } else { if (progress < 0.5) return getFromColor(uv); else return getToColor(uv); } } 0707010000002A000081A400000000000000000000000166D6DD8C0000022A000000000000000000000000000000000000004600000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/CircleCrop.glsl// License: MIT // Author: fkuteken // ported by gre from https://gist.github.com/fkuteken/f63e3009c1143950dee9063c3b83fb88 uniform vec4 bgcolor; // = vec4(0.0, 0.0, 0.0, 1.0) vec4 transition(vec2 p) { vec2 ratio2 = vec2(1.0, 1.0 / ratio); float s = pow(2.0 * abs(progress - 0.5), 3.0); float dist = length((vec2(p) - 0.5) * ratio2); return mix( progress < 0.5 ? getFromColor(p) : getToColor(p), // branching is ok here as we statically depend on progress uniform (branching won't change over pixels) bgcolor, step(s, dist) ); } 0707010000002B000081A400000000000000000000000166D6DD8C00000199000000000000000000000000000000000000004600000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/CircleOpen.glsl// author: gre // License: MIT uniform float smoothness; // = 0.3 uniform bool opening; // = true const vec2 center = vec2(0.5, 0.5); const float SQRT_2 = 1.414213562373; vec4 transition (vec2 uv) { float x = opening ? progress : 1.-progress; float m = smoothstep(-smoothness, 0.0, SQRT_2*distance(center, uv) - x*(1.+smoothness)); return mix(getFromColor(uv), getToColor(uv), opening ? 1.-m : m); } 0707010000002C000081A400000000000000000000000166D6DD8C0000016B000000000000000000000000000000000000004A00000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/ColourDistance.glsl// License: MIT // Author: P-Seebauer // ported by gre from https://gist.github.com/P-Seebauer/2a5fa2f77c883dd661f9 uniform float power; // = 5.0 vec4 transition(vec2 p) { vec4 fTex = getFromColor(p); vec4 tTex = getToColor(p); float m = step(distance(fTex, tTex), progress); return mix( mix(fTex, tTex, m), tTex, pow(progress, power) ); } 0707010000002D000081A400000000000000000000000166D6DD8C0000013F000000000000000000000000000000000000004500000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/CrossWarp.glsl// Author: Eke Péter <peterekepeter@gmail.com> // License: MIT vec4 transition(vec2 p, vec2 pr_p) { float x = progress; float pr_x = progress; x=smoothstep(.0,1.0,(x*2.0+p.x-1.0)); pr_x=smoothstep(.0,1.0,(pr_x*2.0+pr_p.x-1.0)); return mix(getFromColor((pr_p-.5)*(1.-pr_x)+.5), getToColor((p-.5)*x+.5), x); } 0707010000002E000081A400000000000000000000000166D6DD8C0000095D000000000000000000000000000000000000004500000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/CrossZoom.glsl// License: MIT // Author: rectalogic // ported by gre from https://gist.github.com/rectalogic/b86b90161503a0023231 // Converted from https://github.com/rectalogic/rendermix-basic-effects/blob/master/assets/com/rendermix/CrossZoom/CrossZoom.frag // Which is based on https://github.com/evanw/glfx.js/blob/master/src/filters/blur/zoomblur.js // With additional easing functions from https://github.com/rectalogic/rendermix-basic-effects/blob/master/assets/com/rendermix/Easing/Easing.glsllib uniform float strength; // = 0.4 const float PI = 3.141592653589793; float Linear_ease(in float begin, in float change, in float duration, in float time) { return change * time / duration + begin; } float Exponential_easeInOut(in float begin, in float change, in float duration, in float time) { if (time == 0.0) return begin; else if (time == duration) return begin + change; time = time / (duration / 2.0); if (time < 1.0) return change / 2.0 * pow(2.0, 10.0 * (time - 1.0)) + begin; return change / 2.0 * (-pow(2.0, -10.0 * (time - 1.0)) + 2.0) + begin; } float Sinusoidal_easeInOut(in float begin, in float change, in float duration, in float time) { return -change / 2.0 * (cos(PI * time / duration) - 1.0) + begin; } float rand (vec2 co) { return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453); } vec3 crossFade(in vec2 uv, in float dissolve) { return mix(getFromColor(uv).rgb, getToColor(uv).rgb, dissolve); } vec4 transition(vec2 uv) { vec2 texCoord = uv.xy / vec2(1.0).xy; // Linear interpolate center across center half of the image vec2 center = vec2(Linear_ease(0.25, 0.5, 1.0, progress), 0.5); float dissolve = Exponential_easeInOut(0.0, 1.0, 1.0, progress); // Mirrored sinusoidal loop. 0->strength then strength->0 float strength = Sinusoidal_easeInOut(0.0, strength, 0.5, progress); vec3 color = vec3(0.0); float total = 0.0; vec2 toCenter = center - texCoord; /* randomize the lookup values to hide the fixed number of samples */ float offset = rand(uv); for (float t = 0.0; t <= 40.0; t++) { float percent = (t + offset) / 40.0; float weight = 4.0 * (percent - percent * percent); color += crossFade(texCoord + toCenter * percent * strength, dissolve) * weight; total += weight; } return vec4(color / total, 1.0); } 0707010000002F000081A400000000000000000000000166D6DD8C0000013B000000000000000000000000000000000000004700000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/Directional.glsl// Author: Gaëtan Renaudeau // License: MIT uniform vec2 direction; // = vec2(0.0, 1.0) vec4 transition (vec2 uv) { vec2 p = uv + progress * sign(direction); vec2 f = fract(p); return mix( getToColor(f), getFromColor(f), step(0.0, p.y) * step(p.y, 1.0) * step(0.0, p.x) * step(p.x, 1.0) ); } 07070100000030000081A400000000000000000000000166D6DD8C0000034B000000000000000000000000000000000000004D00000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/DirectionalScaled.glsl// Author: Thibaut Foussard // based on Directional transition by Gaëtan Renaudeau // https://gl-transitions.com/editor/Directional // License: MIT #define PI acos(-1.0) uniform vec2 direction; // = vec2(0.0, 1.0) uniform float scale; // = .7 float parabola(float x) { float y = pow(sin(x * PI), 1.); return y; } vec4 transition (vec2 uv) { float easedProgress = pow(sin(progress * PI / 2.), 3.); vec2 p = uv + easedProgress * sign(direction); vec2 f = fract(p); float s = 1. - (1. - (1. / scale)) * parabola(progress); f = (f - 0.5) * s + 0.5; float mixer = step(0.0, p.y) * step(p.y, 1.0) * step(0.0, p.x) * step(p.x, 1.0); vec4 col = mix(getToColor(f), getFromColor(f), mixer); float border = step(0., f.x) * step(0., (1. - f.x)) * step(0., f.y) * step(0., 1. - f.y); col *= border; return col; } 07070100000031000081A400000000000000000000000166D6DD8C00000241000000000000000000000000000000000000004B00000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/DirectionalWipe.glsl// Author: gre // License: MIT uniform vec2 direction; // = vec2(1.0, -1.0) uniform float smoothness; // = 0.5 const vec2 center = vec2(0.5, 0.5); vec4 transition (vec2 uv) { vec2 v = normalize(direction); v /= abs(v.x)+abs(v.y); float d = v.x * center.x + v.y * center.y; float m = (1.0-step(progress, 0.0)) * // there is something wrong with our formula that makes m not equals 0.0 with progress is 0.0 (1.0 - smoothstep(-smoothness, 0.0, v.x * uv.x + v.y * uv.y - (d-0.5+progress*(1.+smoothness)))); return mix(getFromColor(uv), getToColor(uv), m); } 07070100000032000081A400000000000000000000000166D6DD8C00000624000000000000000000000000000000000000004400000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/Dissolve.glsl// Author: hjm1fb // License: MIT #ifdef GL_ES precision mediump float; #endif uniform float uLineWidth;// = 0.1 uniform vec3 uSpreadClr;// = vec3(1.0, 0.0, 0.0); uniform vec3 uHotClr;// = vec3(0.9, 0.9, 0.2); uniform float uPow;// = 5.0; uniform float uIntensity;// = 1.0; vec2 hash(vec2 p) // replace this by something better { p = vec2(dot(p, vec2(127.1, 311.7)), dot(p, vec2(269.5, 183.3))); return -1.0 + 2.0 * fract(sin(p) * 43758.5453123); } float noise(in vec2 p) { const float K1 = 0.366025404; // (sqrt(3)-1)/2; const float K2 = 0.211324865; // (3-sqrt(3))/6; vec2 i = floor(p + (p.x + p.y) * K1); vec2 a = p - i + (i.x + i.y) * K2; float m = step(a.y, a.x); vec2 o = vec2(m, 1.0 - m); vec2 b = a - o + K2; vec2 c = a - 1.0 + 2.0 * K2; vec3 h = max(0.5 - vec3(dot(a, a), dot(b, b), dot(c, c)), 0.0); vec3 n = h * h * h * h * vec3(dot(a, hash(i + 0.0)), dot(b, hash(i + o)), dot(c, hash(i + 1.0))); return dot(n, vec3(70.0)); } vec4 transition(vec2 uv) { vec4 from = getFromColor(uv); vec4 to = getToColor(uv); vec4 outColor; float burn; burn = 0.5 + 0.5 * (0.299 * from.r + 0.587 * from.g + 0.114 * from.b); float show = burn - progress; if (show < 0.001) { outColor = to; } else { float factor = 1.0 - smoothstep(0.0, uLineWidth, show); vec3 burnColor = mix(uSpreadClr, uHotClr, factor); burnColor = pow(burnColor, vec3(uPow)) * uIntensity; vec3 finalRGB = mix(from.rgb, burnColor, factor * step(0.0001, progress)); outColor = vec4(finalRGB * from.a, from.a); } return outColor; } 07070100000033000081A400000000000000000000000166D6DD8C0000065B000000000000000000000000000000000000004000000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/Doom.glsl// Author: Zeh Fernando // License: MIT // Transition parameters -------- // Number of total bars/columns uniform int bars; // = 30 // Multiplier for speed ratio. 0 = no variation when going down, higher = some elements go much faster uniform float amplitude; // = 2 // Further variations in speed. 0 = no noise, 1 = super noisy (ignore frequency) uniform float noise; // = 0.1 // Speed variation horizontally. the bigger the value, the shorter the waves uniform float frequency; // = 0.5 // How much the bars seem to "run" from the middle of the screen first (sticking to the sides). 0 = no drip, 1 = curved drip uniform float dripScale; // = 0.5 // The code proper -------- float rand(int num) { return fract(mod(float(num) * 67123.313, 12.0) * sin(float(num) * 10.3) * cos(float(num))); } float wave(int num) { float fn = float(num) * frequency * 0.1 * float(bars); return cos(fn * 0.5) * cos(fn * 0.13) * sin((fn+10.0) * 0.3) / 2.0 + 0.5; } float drip(int num) { return sin(float(num) / float(bars - 1) * 3.141592) * dripScale; } float pos(int num) { return (noise == 0.0 ? wave(num) : mix(wave(num), rand(num), noise)) + (dripScale == 0.0 ? 0.0 : drip(num)); } vec4 transition(vec2 uv) { int bar = int(uv.x * (float(bars))); float scale = 1.0 + pos(bar) * amplitude; float phase = progress * scale; float posY = uv.y / vec2(1.0).y; vec2 p; vec4 c; if (phase + posY < 1.0) { p = vec2(uv.x, uv.y + mix(0.0, vec2(1.0).y, phase)) / vec2(1.0).xy; c = getFromColor(p); } else { p = uv.xy / vec2(1.0).xy; c = getToColor(p); } // Finally, apply the color return c; } 07070100000034000081A400000000000000000000000166D6DD8C000004C5000000000000000000000000000000000000004300000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/Doorway.glsl// author: gre // License: MIT uniform float reflection; // = 0.4 uniform float perspective; // = 0.4 uniform float depth; // = 3 const vec4 black = vec4(0.0, 0.0, 0.0, 1.0); const vec2 boundMin = vec2(0.0, 0.0); const vec2 boundMax = vec2(1.0, 1.0); bool inBounds (vec2 p) { return all(lessThan(boundMin, p)) && all(lessThan(p, boundMax)); } vec2 project (vec2 p) { return p * vec2(1.0, -1.2) + vec2(0.0, -0.02); } vec4 bgColor (vec2 p, vec2 pto) { vec4 c = black; pto = project(pto); if (inBounds(pto)) { c += mix(black, getToColor(pto), reflection * mix(1.0, 0.0, pto.y)); } return c; } vec4 transition (vec2 p) { vec2 pfr = vec2(-1.), pto = vec2(-1.); float middleSlit = 2.0 * abs(p.x-0.5) - progress; if (middleSlit > 0.0) { pfr = p + (p.x > 0.5 ? -1.0 : 1.0) * vec2(0.5*progress, 0.0); float d = 1.0/(1.0+perspective*progress*(1.0-middleSlit)); pfr.y -= d/2.; pfr.y *= d; pfr.y += d/2.; } float size = mix(1.0, depth, 1.-progress); pto = (p + vec2(-0.5, -0.5)) * vec2(size, size) + vec2(0.5, 0.5); if (inBounds(pfr)) { return getFromColor(pfr); } else if (inBounds(pto)) { return getToColor(pto); } else { return bgColor(p, pto); } } 07070100000035000081A400000000000000000000000166D6DD8C00000188000000000000000000000000000000000000004200000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/Dreamy.glsl// Author: mikolalysenko // License: MIT vec2 offset(float progress, float x, float theta) { float phase = progress*progress + progress + theta; float shifty = 0.03*progress*cos(10.0*(progress+x)); return vec2(0, shifty); } vec4 transition(vec2 p, vec2 pr_p) { return mix(getFromColor(pr_p + offset(progress, p.x, 0.0)), getToColor(p + offset(1.0-progress, p.x, 3.14)), progress); } 07070100000036000081A400000000000000000000000166D6DD8C0000048B000000000000000000000000000000000000004600000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/DreamyZoom.glsl// Author: Zeh Fernando // License: MIT // Definitions -------- #define DEG2RAD 0.03926990816987241548078304229099 // 1/180*PI // Transition parameters -------- // In degrees uniform float rotation; // = 6 // Multiplier uniform float scale; // = 1.2 // The code proper -------- vec4 transition(vec2 uv) { // Massage parameters float phase = progress < 0.5 ? progress * 2.0 : (progress - 0.5) * 2.0; float angleOffset = progress < 0.5 ? mix(0.0, rotation * DEG2RAD, phase) : mix(-rotation * DEG2RAD, 0.0, phase); float newScale = progress < 0.5 ? mix(1.0, scale, phase) : mix(scale, 1.0, phase); vec2 center = vec2(0, 0); // Calculate the source point vec2 assumedCenter = vec2(0.5, 0.5); vec2 p = (uv.xy - vec2(0.5, 0.5)) / newScale * vec2(ratio, 1.0); // This can probably be optimized (with distance()) float angle = atan(p.y, p.x) + angleOffset; float dist = distance(center, p); p.x = cos(angle) * dist / ratio + 0.5; p.y = sin(angle) * dist + 0.5; vec4 c = progress < 0.5 ? getFromColor(p) : getToColor(p); // Finally, apply the color return c + (progress < 0.5 ? mix(0.0, 1.0, phase) : mix(1.0, 0.0, phase)); } 07070100000037000081A400000000000000000000000166D6DD8C000004C0000000000000000000000000000000000000004000000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/Edge.glsl// Author: Woohyun Kim // License: MIT uniform float edge_thickness; // = 0.001; uniform float edge_brightness; // = 8.0; vec4 detectEdgeColor(vec3[9] c) { /* adjacent texel array for texel c[4] 036 147 258 */ vec3 dx = 2.0 * abs(c[7]-c[1]) + abs(c[2] - c[6]) + abs(c[8] - c[0]); vec3 dy = 2.0 * abs(c[3]-c[5]) + abs(c[6] - c[8]) + abs(c[0] - c[2]); float delta = length(0.25 * (dx + dy) * 0.5); return vec4(clamp(edge_brightness * delta, 0.0, 1.0) * c[4], 1.0); } vec4 getFromEdgeColor(vec2 uv) { vec3 c[9]; for (int i=0; i < 3; ++i) for (int j=0; j < 3; ++j) { vec4 color = getFromColor(uv + edge_thickness * vec2(i-1,j-1)); c[3*i + j] = color.rgb; } return detectEdgeColor(c); } vec4 getToEdgeColor(vec2 uv) { vec3 c[9]; for (int i=0; i < 3; ++i) for (int j=0; j < 3; ++j) { vec4 color = getToColor(uv + edge_thickness * vec2(i-1,j-1)); c[3*i + j] = color.rgb; } return detectEdgeColor(c); } vec4 transition (vec2 uv) { vec4 start = mix(getFromColor(uv), getFromEdgeColor(uv), clamp(2.0 * progress, 0.0, 1.0)); vec4 end = mix(getToEdgeColor(uv), getToColor(uv), clamp(2.0 * (progress - 0.5), 0.0, 1.0)); return mix( start, end, progress ); } 07070100000038000081A400000000000000000000000166D6DD8C00000059000000000000000000000000000000000000004000000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/Fade.glslvec4 transition(vec2 uv) { return mix(getFromColor(uv), getToColor(uv), progress); } 07070100000039000081A400000000000000000000000166D6DD8C000008BD000000000000000000000000000000000000004400000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/FilmBurn.glsl// author: Anastasia Dunbar // license: MIT uniform float Seed; // = 2.31 float sigmoid(float x, float a) { float b = pow(x*2.,a)/2.; if (x > .5) { b = 1.-pow(2.-(x*2.),a)/2.; } return b; } float rand(float co){ return fract(sin((co*24.9898)+Seed)*43758.5453); } float rand(vec2 co){ return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453); } float apow(float a,float b) { return pow(abs(a),b)*sign(b); } vec3 pow3(vec3 a,vec3 b) { return vec3(apow(a.r,b.r),apow(a.g,b.g),apow(a.b,b.b)); } float smooth_mix(float a,float b,float c) { return mix(a,b,sigmoid(c,2.)); } float random(vec2 co, float shft){ co += 10.; return smooth_mix(fract(sin(dot(co.xy ,vec2(12.9898+(floor(shft)*.5),78.233+Seed))) * 43758.5453),fract(sin(dot(co.xy ,vec2(12.9898+(floor(shft+1.)*.5),78.233+Seed))) * 43758.5453),fract(shft)); } float smooth_random(vec2 co, float shft) { return smooth_mix(smooth_mix(random(floor(co),shft),random(floor(co+vec2(1.,0.)),shft),fract(co.x)),smooth_mix(random(floor(co+vec2(0.,1.)),shft),random(floor(co+vec2(1.,1.)),shft),fract(co.x)),fract(co.y)); } vec4 my_texture(vec2 p) { return mix(getFromColor(p), getToColor(p), sigmoid(progress,10.)); } #define pi 3.14159265358979323 #define clamps(x) clamp(x,0.,1.) vec4 transition(vec2 p) { vec3 f = vec3(0.); for (float i = 0.; i < 13.; i++) { f += sin(((p.x*rand(i)*6.)+(progress*8.))+rand(i+1.43))*sin(((p.y*rand(i+4.4)*6.)+(progress*6.))+rand(i+2.4)); f += 1.-clamps(length(p-vec2(smooth_random(vec2(progress*1.3),i+1.),smooth_random(vec2(progress*.5),i+6.25)))*mix(20.,70.,rand(i))); } f += 4.; f /= 11.; f = pow3(f*vec3(1.,0.7,0.6),vec3(1.,2.-sin(progress*pi),1.3)); f *= sin(progress*pi); p -= .5; p *= 1.+(smooth_random(vec2(progress*5.),6.3)*sin(progress*pi)*.05); p += .5; vec4 blurred_image = vec4(0.); float bluramount = sin(progress*pi)*.03; #define repeats 50. for (float i = 0.; i < repeats; i++) { vec2 q = vec2(cos(degrees((i/repeats)*360.)),sin(degrees((i/repeats)*360.))) * (rand(vec2(i,p.x+p.y))+bluramount); vec2 uv2 = p+(q*bluramount); blurred_image += my_texture(uv2); } blurred_image /= repeats; return blurred_image+vec4(f,0.); } 0707010000003A000081A400000000000000000000000166D6DD8C000008C8000000000000000000000000000000000000004A00000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/GlitchDisplace.glsl// Author: Matt DesLauriers // License: MIT //#ifdef GL_ES //precision highp float; //#endif float random(vec2 co) { float a = 12.9898; float b = 78.233; float c = 43758.5453; float dt= dot(co.xy ,vec2(a,b)); float sn= mod(dt,3.14); return fract(sin(sn) * c); } float voronoi( in vec2 x ) { vec2 p = floor( x ); vec2 f = fract( x ); float res = 8.0; for( float j=-1.; j<=1.; j++ ) for( float i=-1.; i<=1.; i++ ) { vec2 b = vec2( i, j ); vec2 r = b - f + random( p + b ); float d = dot( r, r ); res = min( res, d ); } return sqrt( res ); } vec2 displace(vec4 tex, vec2 texCoord, float dotDepth, float textureDepth, float strength) { float b = voronoi(.003 * texCoord + 2.0); float g = voronoi(0.2 * texCoord); float r = voronoi(texCoord - 1.0); vec4 dt = tex * 1.0; vec4 dis = dt * dotDepth + 1.0 - tex * textureDepth; dis.x = dis.x - 1.0 + textureDepth*dotDepth; dis.y = dis.y - 1.0 + textureDepth*dotDepth; dis.x *= strength; dis.y *= strength; vec2 res_uv = texCoord ; res_uv.x = res_uv.x + dis.x - 0.0; res_uv.y = res_uv.y + dis.y; return res_uv; } float ease1(float t) { return t == 0.0 || t == 1.0 ? t : t < 0.5 ? +0.5 * pow(2.0, (20.0 * t) - 10.0) : -0.5 * pow(2.0, 10.0 - (t * 20.0)) + 1.0; } float ease2(float t) { return t == 1.0 ? t : 1.0 - pow(2.0, -10.0 * t); } vec4 transition(vec2 uv) { vec2 p = uv.xy / vec2(1.0).xy; vec4 color1 = getFromColor(p); vec4 color2 = getToColor(p); vec2 disp = displace(color1, p, 0.33, 0.7, 1.0-ease1(progress)); vec2 disp2 = displace(color2, p, 0.33, 0.5, ease2(progress)); vec4 dColor1 = getToColor(disp); vec4 dColor2 = getFromColor(disp2); float val = ease1(progress); vec3 gray = vec3(dot(min(dColor2, dColor1).rgb, vec3(0.299, 0.587, 0.114))); dColor2 = vec4(gray, 1.0); dColor2 *= 2.0; color1 = mix(color1, dColor2, smoothstep(0.0, 0.5, progress)); color2 = mix(color2, dColor1, smoothstep(1.0, 0.5, progress)); return mix(color1, color2, val); //gl_FragColor = mix(gl_FragColor, dColor, smoothstep(0.0, 0.5, progress)); //gl_FragColor = mix(texture2D(from, p), texture2D(to, p), progress); } 0707010000003B000081A400000000000000000000000166D6DD8C0000025E000000000000000000000000000000000000004A00000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/GlitchMemories.glsl// author: Gunnar Roth // based on work from natewave // license: MIT vec4 transition(vec2 p) { vec2 block = floor(p.xy / vec2(16)); vec2 uv_noise = block / vec2(64); uv_noise += floor(vec2(progress) * vec2(1200.0, 3500.0)) / vec2(64); vec2 dist = progress > 0.0 ? (fract(uv_noise) - 0.5) * 0.3 *(1.0 -progress) : vec2(0.0); vec2 red = p + dist * 0.2; vec2 green = p + dist * .3; vec2 blue = p + dist * .5; return vec4(mix(getFromColor(red), getToColor(red), progress).r,mix(getFromColor(green), getToColor(green), progress).g,mix(getFromColor(blue), getToColor(blue), progress).b,1.0); } 0707010000003C000081A400000000000000000000000166D6DD8C000008FC000000000000000000000000000000000000004400000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/GridFlip.glsl// License: MIT // Author: TimDonselaar // ported by gre from https://gist.github.com/TimDonselaar/9bcd1c4b5934ba60087bdb55c2ea92e5 uniform ivec2 size; // = ivec2(4) uniform float pause; // = 0.1 uniform float dividerWidth; // = 0.05 uniform vec4 bgcolor; // = vec4(0.0, 0.0, 0.0, 1.0) uniform float randomness; // = 0.1 float rand (vec2 co) { return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453); } float getDelta(vec2 p) { vec2 rectanglePos = floor(vec2(size) * p); vec2 rectangleSize = vec2(1.0 / vec2(size).x, 1.0 / vec2(size).y); float top = rectangleSize.y * (rectanglePos.y + 1.0); float bottom = rectangleSize.y * rectanglePos.y; float left = rectangleSize.x * rectanglePos.x; float right = rectangleSize.x * (rectanglePos.x + 1.0); float minX = min(abs(p.x - left), abs(p.x - right)); float minY = min(abs(p.y - top), abs(p.y - bottom)); return min(minX, minY); } float getDividerSize() { vec2 rectangleSize = vec2(1.0 / vec2(size).x, 1.0 / vec2(size).y); return min(rectangleSize.x, rectangleSize.y) * dividerWidth; } vec4 transition(vec2 p) { if(progress < pause) { float currentProg = progress / pause; float a = 1.0; if(getDelta(p) < getDividerSize()) { a = 1.0 - currentProg; } return mix(bgcolor, getFromColor(p), a); } else if(progress < 1.0 - pause){ if(getDelta(p) < getDividerSize()) { return bgcolor; } else { float currentProg = (progress - pause) / (1.0 - pause * 2.0); vec2 q = p; vec2 rectanglePos = floor(vec2(size) * q); float r = rand(rectanglePos) - randomness; float cp = smoothstep(0.0, 1.0 - r, currentProg); float rectangleSize = 1.0 / vec2(size).x; float delta = rectanglePos.x * rectangleSize; float offset = rectangleSize / 2.0 + delta; p.x = (p.x - offset)/abs(cp - 0.5)*0.5 + offset; vec4 a = getFromColor(p); vec4 b = getToColor(p); float s = step(abs(vec2(size).x * (q.x - delta) - 0.5), abs(cp - 0.5)); return mix(bgcolor, mix(b, a, step(cp, 0.5)), s); } } else { float currentProg = (progress - 1.0 + pause) / pause; float a = 1.0; if(getDelta(p) < getDividerSize()) { a = currentProg; } return mix(bgcolor, getToColor(p), a); } } 0707010000003D000081A400000000000000000000000166D6DD8C0000066D000000000000000000000000000000000000004800000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/Hexagonalize.glsl// Author: Fernando Kuteken // License: MIT // Hexagonal math from: http://www.redblobgames.com/grids/hexagons/ uniform int steps; // = 50; uniform float horizontalHexagons; //= 20; struct Hexagon { float q; float r; float s; }; Hexagon createHexagon(float q, float r){ Hexagon hex; hex.q = q; hex.r = r; hex.s = -q - r; return hex; } Hexagon roundHexagon(Hexagon hex){ float q = floor(hex.q + 0.5); float r = floor(hex.r + 0.5); float s = floor(hex.s + 0.5); float deltaQ = abs(q - hex.q); float deltaR = abs(r - hex.r); float deltaS = abs(s - hex.s); if (deltaQ > deltaR && deltaQ > deltaS) q = -r - s; else if (deltaR > deltaS) r = -q - s; else s = -q - r; return createHexagon(q, r); } Hexagon hexagonFromPoint(vec2 point, float size) { point.y /= ratio; point = (point - 0.5) / size; float q = (sqrt(3.0) / 3.0) * point.x + (-1.0 / 3.0) * point.y; float r = 0.0 * point.x + 2.0 / 3.0 * point.y; Hexagon hex = createHexagon(q, r); return roundHexagon(hex); } vec2 pointFromHexagon(Hexagon hex, float size) { float x = (sqrt(3.0) * hex.q + (sqrt(3.0) / 2.0) * hex.r) * size + 0.5; float y = (0.0 * hex.q + (3.0 / 2.0) * hex.r) * size + 0.5; return vec2(x, y * ratio); } vec4 transition (vec2 uv) { float dist = 2.0 * min(progress, 1.0 - progress); dist = steps > 0 ? ceil(dist * float(steps)) / float(steps) : dist; float size = (sqrt(3.0) / 3.0) * dist / horizontalHexagons; vec2 point = dist > 0.0 ? pointFromHexagon(hexagonFromPoint(uv, size), size) : uv; return mix(getFromColor(point), getToColor(point), progress); } 0707010000003E000081A400000000000000000000000166D6DD8C000000EB000000000000000000000000000000000000004B00000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/HorizontalClose.glsl// Author: martiniti // License: MIT vec4 transition (vec2 uv) { float s = 2.0 - abs((uv.y - 0.5) / (progress - 1.0)) - 2.0 * progress; return mix( getFromColor(uv), getToColor(uv), smoothstep(0.5, 0.0, s) ); } 0707010000003F000081A400000000000000000000000166D6DD8C0000010D000000000000000000000000000000000000004A00000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/HorizontalOpen.glsl// Author: martiniti // License: MIT vec4 transition (vec2 uv) { float regress = 1.0 - progress; float s = 2.0 - abs((uv.y - 0.5) / (regress - 1.0)) - 2.0 * regress; return mix( getFromColor(uv), getToColor(uv), smoothstep(0.0, 0.5, s) ); } 07070100000040000081A400000000000000000000000166D6DD8C00001E1B000000000000000000000000000000000000004C00000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/InvertedPageCurl.glsl// author: Hewlett-Packard // license: BSD 3 Clause // Adapted by Sergey Kosarevsky from: // http://rectalogic.github.io/webvfx/examples_2transition-shader-pagecurl_8html-example.html /* Copyright (c) 2010 Hewlett-Packard Development Company, L.P. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Hewlett-Packard nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. in vec2 texCoord; */ const float MIN_AMOUNT = -0.16; const float MAX_AMOUNT = 1.5; const float PI = 3.141592653589793; const float scale = 512.0; const float sharpness = 3.0; const float cylinderRadius = 1.0 / PI / 2.0; vec3 hitPoint(float hitAngle, float yc, vec3 point, mat3 rrotation) { float hitPoint = hitAngle / (2.0 * PI); point.y = hitPoint; return rrotation * point; } vec4 antiAlias(vec4 color1, vec4 color2, float distanc) { distanc *= scale; if (distanc < 0.0) return color2; if (distanc > 2.0) return color1; float dd = pow(1.0 - distanc / 2.0, sharpness); return ((color2 - color1) * dd) + color1; } float distanceToEdge(vec3 point) { float dx = abs(point.x > 0.5 ? 1.0 - point.x : point.x); float dy = abs(point.y > 0.5 ? 1.0 - point.y : point.y); if (point.x < 0.0) dx = -point.x; if (point.x > 1.0) dx = point.x - 1.0; if (point.y < 0.0) dy = -point.y; if (point.y > 1.0) dy = point.y - 1.0; if ((point.x < 0.0 || point.x > 1.0) && (point.y < 0.0 || point.y > 1.0)) return sqrt(dx * dx + dy * dy); return min(dx, dy); } vec4 seeThrough(float yc, vec2 p, mat3 rotation, mat3 rrotation, float cylinderAngle) { float hitAngle = PI - (acos(yc / cylinderRadius) - cylinderAngle); vec3 point = hitPoint(hitAngle, yc, rotation * vec3(p, 1.0), rrotation); if (yc <= 0.0 && (point.x < 0.0 || point.y < 0.0 || point.x > 1.0 || point.y > 1.0)) { return getToColor(p); } if (yc > 0.0) return getFromColor(p); vec4 color = getFromColor(point.xy); vec4 tcolor = vec4(0.0); return antiAlias(color, tcolor, distanceToEdge(point)); } vec4 seeThroughWithShadow(float yc, vec2 p, vec3 point, mat3 rotation, mat3 rrotation, float amount, float cylinderAngle) { float shadow = distanceToEdge(point) * 30.0; shadow = (1.0 - shadow) / 3.0; if (shadow < 0.0) shadow = 0.0; else shadow *= amount; vec4 shadowColor = seeThrough(yc, p, rotation, rrotation, cylinderAngle); shadowColor.r -= shadow; shadowColor.g -= shadow; shadowColor.b -= shadow; return shadowColor; } vec4 backside(float yc, vec3 point) { vec4 color = getFromColor(point.xy); float gray = (color.r + color.b + color.g) / 15.0; gray += (8.0 / 10.0) * (pow(1.0 - abs(yc / cylinderRadius), 2.0 / 10.0) / 2.0 + (5.0 / 10.0)); color.rgb = vec3(gray); return color; } vec4 behindSurface(vec2 p, float yc, vec3 point, mat3 rrotation, float amount, float cylinderAngle) { float shado = (1.0 - ((-cylinderRadius - yc) / amount * 7.0)) / 6.0; shado *= 1.0 - abs(point.x - 0.5); yc = (-cylinderRadius - cylinderRadius - yc); float hitAngle = (acos(yc / cylinderRadius) + cylinderAngle) - PI; point = hitPoint(hitAngle, yc, point, rrotation); if (yc < 0.0 && point.x >= 0.0 && point.y >= 0.0 && point.x <= 1.0 && point.y <= 1.0 && (hitAngle < PI || amount > 0.5)) { shado = 1.0 - (sqrt(pow(point.x - 0.5, 2.0) + pow(point.y - 0.5, 2.0)) / (71.0 / 100.0)); shado *= pow(-yc / cylinderRadius, 3.0); shado *= 0.5; } else { shado = 0.0; } return vec4(getToColor(p).rgb - shado, 1.0); } vec4 transition(vec2 p) { const float angle = 100.0 * PI / 180.0; float c = cos(-angle); float s = sin(-angle); mat3 rotation = mat3( c, s, 0, -s, c, 0, -0.801, 0.8900, 1 ); c = cos(angle); s = sin(angle); mat3 rrotation = mat3( c, s, 0, -s, c, 0, 0.98500, 0.985, 1 ); vec3 point = rotation * vec3(p, 1.0); float amount = progress * (MAX_AMOUNT - MIN_AMOUNT) + MIN_AMOUNT; float cylinderCenter = amount; float cylinderAngle = 2.0 * PI * amount; float yc = point.y - cylinderCenter; if (yc < -cylinderRadius) { // Behind surface return behindSurface(p,yc, point, rrotation, amount, cylinderAngle); } if (yc > cylinderRadius) { // Flat surface return getFromColor(p); } float hitAngle = (acos(yc / cylinderRadius) + cylinderAngle) - PI; float hitAngleMod = mod(hitAngle, 2.0 * PI); if ((hitAngleMod > PI && amount < 0.5) || (hitAngleMod > PI/2.0 && amount < 0.0)) { return seeThrough(yc, p, rotation, rrotation, cylinderAngle); } point = hitPoint(hitAngle, yc, point, rrotation); if (point.x < 0.0 || point.y < 0.0 || point.x > 1.0 || point.y > 1.0) { return seeThroughWithShadow(yc, p, point, rotation, rrotation, amount, cylinderAngle); } vec4 color = backside(yc, point); vec4 otherColor; if (yc < 0.0) { float shado = 1.0 - (sqrt(pow(point.x - 0.5, 2.0) + pow(point.y - 0.5, 2.0)) / 0.71); shado *= pow(-yc / cylinderRadius, 3.0); shado *= 0.5; otherColor = vec4(0.0, 0.0, 0.0, shado); } else { otherColor = getFromColor(p); } color = antiAlias(color, otherColor, cylinderRadius - abs(yc)); vec4 cl = seeThroughWithShadow(yc, p, point, rotation, rrotation, amount, cylinderAngle); float dist = distanceToEdge(point); return antiAlias(color, cl, dist); } 07070100000041000081A400000000000000000000000166D6DD8C00000288000000000000000000000000000000000000004500000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/LeftRight.glsl// Author:zhmy // License: MIT const vec4 black = vec4(0.0, 0.0, 0.0, 1.0); const vec2 boundMin = vec2(0.0, 0.0); const vec2 boundMax = vec2(1.0, 1.0); bool inBounds (vec2 p) { return all(lessThan(boundMin, p)) && all(lessThan(p, boundMax)); } vec4 transition (vec2 uv) { vec2 spfr,spto = vec2(-1.); float size = mix(1.0, 3.0, progress*0.2); spto = (uv + vec2(-0.5,-0.5))*vec2(size,size)+vec2(0.5,0.5); spfr = (uv - vec2(1.-progress, 0.0)); if(inBounds(spfr)){ return getToColor(spfr); }else if(inBounds(spto)){ return getFromColor(spto) * (1.0 - progress); } else{ return black; } } 07070100000042000081A400000000000000000000000166D6DD8C000002AC000000000000000000000000000000000000004600000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/LinearBlur.glsl// author: gre // license: MIT uniform float intensity; // = 0.1 const int passes = 6; vec4 transition(vec2 uv) { vec4 c1 = vec4(0.0); vec4 c2 = vec4(0.0); float disp = intensity*(0.5-distance(0.5, progress)); for (int xi=0; xi<passes; xi++) { float x = float(xi) / float(passes) - 0.5; for (int yi=0; yi<passes; yi++) { float y = float(yi) / float(passes) - 0.5; vec2 v = vec2(x,y); float d = disp; c1 += getFromColor( uv + d*v); c2 += getToColor( uv + d*v); } } c1 /= float(passes*passes); c2 /= float(passes*passes); return mix(c1, c2, progress); } 07070100000043000081A400000000000000000000000166D6DD8C00000467000000000000000000000000000000000000004200000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/Mosaic.glsl// License: MIT // Author: Xaychru // ported by gre from https://gist.github.com/Xaychru/130bb7b7affedbda9df5 #define PI 3.14159265358979323 #define POW2(X) X*X #define POW3(X) X*X*X uniform int endx; // = 2 uniform int endy; // = -1 float Rand(vec2 v) { return fract(sin(dot(v.xy ,vec2(12.9898,78.233))) * 43758.5453); } vec2 Rotate(vec2 v, float a) { mat2 rm = mat2(cos(a), -sin(a), sin(a), cos(a)); return rm*v; } float CosInterpolation(float x) { return -cos(x*PI)/2.+.5; } vec4 transition(vec2 uv) { vec2 p = uv.xy / vec2(1.0).xy - .5; vec2 rp = p; float rpr = (progress*2.-1.); float z = -(rpr*rpr*2.) + 3.; float az = abs(z); rp *= az; rp += mix(vec2(.5, .5), vec2(float(endx) + .5, float(endy) + .5), POW2(CosInterpolation(progress))); vec2 mrp = mod(rp, 1.); vec2 crp = rp; bool onEnd = int(floor(crp.x))==endx&&int(floor(crp.y))==endy; if(!onEnd) { float ang = float(int(Rand(floor(crp))*4.))*.5*PI; mrp = vec2(.5) + Rotate(mrp-vec2(.5), ang); } if(onEnd || Rand(floor(crp))>.5) { return getToColor(mrp); } else { return getFromColor(mrp); } } 07070100000044000081A400000000000000000000000166D6DD8C00000222000000000000000000000000000000000000004800000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/Overexposure.glsl// Author: Ben Zhang // License: MIT uniform float strength; //= 0.6; const float PI = 3.141592653589793; vec4 transition (vec2 uv) { vec4 from = getFromColor(uv); vec4 to = getToColor(uv); // Multipliers float from_m = 1.0 - progress + sin(PI * progress) * strength; float to_m = progress + sin(PI * progress) * strength; return vec4( from.r * from.a * from_m + to.r * to.a * to_m, from.g * from.a * from_m + to.g * to.a * to_m, from.b * from.a * from_m + to.b * to.a * to_m, mix(from.a, to.a, progress) ); } 07070100000045000081A400000000000000000000000166D6DD8C0000024E000000000000000000000000000000000000004400000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/Pixelize.glsl// Author: gre // License: MIT // forked from https://gist.github.com/benraziel/c528607361d90a072e98 // minimum number of squares (when the effect is at its higher level) uniform ivec2 squaresMin; // = ivec2(20) // zero disable the stepping uniform int steps; // = 50 vec4 transition(vec2 uv) { float d = min(progress, 1.0 - progress); float dist = steps>0 ? ceil(d * float(steps)) / float(steps) : d; vec2 squareSize = 2.0 * dist / vec2(squaresMin); vec2 p = dist>0.0 ? (floor(uv / squareSize) + 0.5) * squareSize : uv; return mix(getFromColor(p), getToColor(p), progress); } 07070100000046000081A400000000000000000000000166D6DD8C00000146000000000000000000000000000000000000004C00000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/PolkaDotsCurtain.glsl// author: bobylito // license: MIT const float SQRT_2 = 1.414213562373; uniform float dots;// = 20.0; uniform vec2 center;// = vec2(0, 0); vec4 transition(vec2 uv) { bool nextImage = distance(fract(uv * dots), vec2(0.5, 0.5)) < ( progress / distance(uv, center)); return nextImage ? getToColor(uv) : getFromColor(uv); } 07070100000047000081A400000000000000000000000166D6DD8C0000016D000000000000000000000000000000000000004200000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/Radial.glsl// License: MIT // Author: Xaychru // ported by gre from https://gist.github.com/Xaychru/ce1d48f0ce00bb379750 uniform float smoothness; // = 1.0 const float PI = 3.141592653589; vec4 transition(vec2 p) { vec2 rp = p*2.-1.; return mix( getToColor(p), getFromColor(p), smoothstep(0., smoothness, atan(rp.y,rp.x) - (progress-.5) * PI * 2.5) ); } 07070100000048000081A400000000000000000000000166D6DD8C00000217000000000000000000000000000000000000004500000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/Rectangle.glsl// Author: martiniti // License: MIT uniform vec4 bgcolor; // = vec4(0.0, 0.0, 0.0, 1.0) vec4 transition(vec2 p) { float s = pow(2.0 * abs(progress - 0.5), 3.0); vec2 sq = p.xy / vec2(1.0).xy; // bottom-left vec2 bl = step(vec2(abs(1. - 2.*progress)), sq + .25); float dist = bl.x * bl.y; // top-right vec2 tr = step(vec2(abs(1. - 2.*progress)), 1.25-sq); dist *= 1. * tr.x * tr.y; return mix( progress < 0.5 ? getFromColor(p) : getToColor(p), bgcolor, step(s, dist) ); } 07070100000049000081A400000000000000000000000166D6DD8C0000017A000000000000000000000000000000000000004200000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/Ripple.glsl// Author: gre // License: MIT uniform float amplitude; // = 100.0 uniform float speed; // = 50.0 vec4 transition (vec2 uv) { vec2 dir = uv - vec2(.5); float dist = length(dir); vec2 offset = dir * (sin(progress * dist * amplitude - progress * speed) + .5) / 30.; return mix( getFromColor(uv + offset), getToColor(uv), smoothstep(0.2, 1.0, progress) ); } 0707010000004A000081A400000000000000000000000166D6DD8C00000584000000000000000000000000000000000000004100000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/Rolls.glsl// Author: Mark Craig // mrmcsoftware on github and youtube ( http://www.youtube.com/MrMcSoftware ) // License: MIT // Rolls Transition by Mark Craig (Copyright © 2022) uniform int type; // = 0 uniform bool RotDown; // = false // type (0-3): Rotate/Roll from which corner // RotDown: if true rotate old image down, otherwise rotate old image up #define M_PI 3.14159265358979323846 vec4 transition(vec2 uv) { float theta, c1, s1; vec2 iResolution = vec2(ratio, 1.0); vec2 uvi; // I used if/else instead of switch in case it's an old GPU if (type == 0) { theta = (RotDown ? M_PI : -M_PI) / 2.0 * progress; uvi.x = 1.0 - uv.x; uvi.y = uv.y; } else if (type == 1) { theta = (RotDown ? M_PI : -M_PI) / 2.0 * progress; uvi = uv; } else if (type == 2) { theta = (RotDown ? -M_PI : M_PI) / 2.0 * progress; uvi.x = uv.x; uvi.y = 1.0 - uv.y; } else if (type == 3) { theta = (RotDown ? -M_PI : M_PI) / 2.0 * progress; uvi = 1.0 - uv; } c1 = cos(theta); s1 = sin(theta); vec2 uv2; uv2.x = (uvi.x * iResolution.x * c1 - uvi.y * iResolution.y * s1); uv2.y = (uvi.x * iResolution.x * s1 + uvi.y * iResolution.y * c1); if ((uv2.x >= 0.0) && (uv2.x <= iResolution.x) && (uv2.y >= 0.0) && (uv2.y <= iResolution.y)) { uv2 /= iResolution; if (type == 0) { uv2.x = 1.0 - uv2.x; } else if (type == 2) { uv2.y = 1.0 - uv2.y; } else if (type == 3) { uv2 = 1.0 - uv2; } return(getFromColor(uv2)); } return(getToColor(uv)); } 0707010000004B000081A400000000000000000000000166D6DD8C00000368000000000000000000000000000000000000004B00000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/RotateScaleFade.glsl// Author: Fernando Kuteken // License: MIT #define PI 3.14159265359 uniform vec2 center; // = vec2(0.5, 0.5); uniform float rotations; // = 1; uniform float scale; // = 8; uniform vec4 backColor; // = vec4(0.15, 0.15, 0.15, 1.0); vec4 transition (vec2 uv) { float angle = 2.0 * PI * rotations * progress; float c = cos(angle); float s = sin(angle); float currentScale = mix(scale, 1.0, 2.0 * abs(progress - 0.5)); vec2 difference = uv - center; vec2 dir = normalize(difference); float dist = length(difference); vec2 rotatedDir = vec2(dir.x * c - dir.y * s, dir.x * s + dir.y * c); vec2 rotatedUv = center + rotatedDir * dist / currentScale; if (rotatedUv.x < 0.0 || rotatedUv.x > 1.0 || rotatedUv.y < 0.0 || rotatedUv.y > 1.0) return backColor; return mix(getFromColor(rotatedUv), getToColor(rotatedUv), progress); } 0707010000004C000081A400000000000000000000000166D6DD8C000004F7000000000000000000000000000000000000004D00000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/RotateScaleVanish.glsl// Author: Mark Craig // mrmcsoftware on github and youtube ( http://www.youtube.com/MrMcSoftware ) // License: MIT // RotateScaleVanish Transition by Mark Craig (Copyright © 2022) uniform bool FadeInSecond; // = true uniform bool ReverseEffect; // = false uniform bool ReverseRotation; // = false #define M_PI 3.14159265358979323846 #define _TWOPI 6.283185307179586476925286766559 vec4 transition(vec2 uv) { vec2 iResolution = vec2(ratio, 1.0); float t = ReverseEffect ? 1.0 - progress : progress; float theta = ReverseRotation ? _TWOPI * t : -_TWOPI * t; float c1 = cos(theta); float s1 = sin(theta); float rad = max(0.00001, 1.0 - t); float xc1 = (uv.x - 0.5) * iResolution.x; float yc1 = (uv.y - 0.5) * iResolution.y; float xc2 = (xc1 * c1 - yc1 * s1) / rad; float yc2 = (xc1 * s1 + yc1 * c1) / rad; vec2 uv2 = vec2(xc2 + iResolution.x / 2.0, yc2 + iResolution.y / 2.0); vec4 col3; vec4 ColorTo = ReverseEffect ? getFromColor(uv) : getToColor(uv); if ((uv2.x >= 0.0) && (uv2.x <= iResolution.x) && (uv2.y >= 0.0) && (uv2.y <= iResolution.y)) { uv2 /= iResolution; col3 = ReverseEffect ? getToColor(uv2) : getFromColor(uv2); } else { col3 = FadeInSecond ? vec4(0.0, 0.0, 0.0, 1.0) : ColorTo; } return((1.0 - t) * col3 + t * ColorTo); // could have used mix } 0707010000004D000081A400000000000000000000000166D6DD8C0000017B000000000000000000000000000000000000004600000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/SimpleZoom.glsl// Author: 0gust1 // License: MIT uniform float zoom_quickness; // = 0.8 vec2 zoom(vec2 uv, float amount) { return 0.5 + ((uv - 0.5) * (1.0-amount)); } vec4 transition (vec2 uv) { float nQuick = clamp(zoom_quickness,0.2,1.0); return mix( getFromColor(zoom(uv, smoothstep(0.0, nQuick, progress))), getToColor(uv), smoothstep(nQuick-0.2, 1.0, progress) ); } 0707010000004E000081A400000000000000000000000166D6DD8C00000511000000000000000000000000000000000000004200000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/Slides.glsl// Author: Mark Craig // mrmcsoftware on github and youtube ( http://www.youtube.com/MrMcSoftware ) // License: MIT // Slides Transition by Mark Craig (Copyright © 2022) uniform int type; // = 0 uniform bool In; // = false // type: slide to/from which edge, which corner, or center // In: if true slide new image in, otherwise slide old image out #define rad2 rad / 2.0 vec4 transition(vec2 uv) { vec2 uv0 = uv; float rad = In ? progress : 1.0 - progress; float xc1, yc1; // I used if/else instead of switch in case it's an old GPU if (type == 0) { xc1 = .5 - rad2; yc1 = 0.0; } else if (type == 1) { xc1 = 1.0 - rad; yc1 = .5 - rad2; } else if (type == 2) { xc1 = .5 - rad2; yc1 = 1.0 - rad; } else if (type == 3) { xc1 = 0.0; yc1 = .5 - rad2; } else if (type == 4) { xc1 = 1.0 - rad; yc1 = 0.0; } else if (type == 5) { xc1 = 1.0 - rad; yc1 = 1.0 - rad; } else if (type == 6) { xc1 = 0.0; yc1 = 1.0 - rad; } else if (type == 7) { xc1 = 0.0; yc1 = 0.0; } else if (type == 8) { xc1 = .5 - rad2; yc1 = .5 - rad2; } uv.y = 1.0 - uv.y; vec2 uv2; if ((uv.x >= xc1) && (uv.x <= xc1 + rad) && (uv.y >= yc1) && (uv.y <= yc1 + rad)) { uv2 = vec2((uv.x - xc1) / rad, 1.0 - (uv.y - yc1) / rad); return(In ? getToColor(uv2) : getFromColor(uv2)); } return(In ? getFromColor(uv0) : getToColor(uv0)); } 0707010000004F000081A400000000000000000000000166D6DD8C000004E2000000000000000000000000000000000000004600000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/StaticFade.glsl// Author: Ben Lucas // License: MIT uniform float n_noise_pixels ; // = 200.0 uniform float static_luminosity ; // = 0.8 float rnd (vec2 st) { return fract(sin(dot(st.xy, vec2(10.5302340293,70.23492931)))* 12345.5453123); } vec4 staticNoise (vec2 st, float offset, float luminosity) { float staticR = luminosity * rnd(st * vec2(offset * 2.0, offset * 3.0)); float staticG = luminosity * rnd(st * vec2(offset * 3.0, offset * 5.0)); float staticB = luminosity * rnd(st * vec2(offset * 5.0, offset * 7.0)); return vec4(staticR, staticG, staticB, 1.0); } float staticIntensity(float t) { float transitionProgress = abs(2.0*(t-0.5)); float transformedThreshold =1.2*(1.0 - transitionProgress)-0.1; return min(1.0, transformedThreshold); } vec4 transition (vec2 uv) { float baseMix = step(0.5, progress); vec4 transitionMix = mix( getFromColor(uv), getToColor(uv), baseMix ); vec2 uvStatic = floor(uv * n_noise_pixels)/n_noise_pixels; vec4 staticColor = staticNoise(uvStatic, progress, static_luminosity); float staticThresh = staticIntensity(progress); float staticMix = step(rnd(uvStatic), staticThresh); return mix(transitionMix, staticColor, staticMix); } 07070100000050000081A400000000000000000000000166D6DD8C00001F4F000000000000000000000000000000000000004800000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/StereoViewer.glsl// Tunable parameters // How much to zoom (out) for the effect ~ 0.5 - 1.0 uniform float zoom; // = 0.88 // Corner radius as a fraction of the image height uniform float corner_radius; // = 0.22 // author: Ted Schundler // license: BSD 2 Clause // Free for use and modification by anyone with credit // Copyright (c) 2016, Theodore K Schundler // All rights reserved. // Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: // 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /////////////////////////////////////////////////////////////////////////////// // Stereo Viewer Toy Transition // // // // Inspired by ViewMaster / Image3D image viewer devices. // // This effect is similar to what you see when you press the device's lever. // // There is a quick zoom in / out to make the transition 'valid' for GLSL.io // /////////////////////////////////////////////////////////////////////////////// const vec4 black = vec4(0.0, 0.0, 0.0, 1.0); const vec2 c00 = vec2(0.0, 0.0); // the four corner points const vec2 c01 = vec2(0.0, 1.0); const vec2 c11 = vec2(1.0, 1.0); const vec2 c10 = vec2(1.0, 0.0); // Check if a point is within a given corner bool in_corner(vec2 p, vec2 corner, vec2 radius) { // determine the direction we want to be filled vec2 axis = (c11 - corner) - corner; // warp the point so we are always testing the bottom left point with the // circle centered on the origin p = p - (corner + axis * radius); p *= axis / radius; return (p.x > 0.0 && p.y > -1.0) || (p.y > 0.0 && p.x > -1.0) || dot(p, p) < 1.0; } // Check all four corners // return a float for v2 for anti-aliasing? bool test_rounded_mask(vec2 p, vec2 corner_size) { return in_corner(p, c00, corner_size) && in_corner(p, c01, corner_size) && in_corner(p, c10, corner_size) && in_corner(p, c11, corner_size); } // Screen blend mode - https://en.wikipedia.org/wiki/Blend_modes // This more closely approximates what you see than linear blending vec4 screen(vec4 a, vec4 b) { return 1.0 - (1.0 - a) * (1.0 -b); } // Given RGBA, find a value that when screened with itself // will yield the original value. vec4 unscreen(vec4 c) { return 1.0 - sqrt(1.0 - c); } // Grab a pixel, only if it isn't masked out by the rounded corners vec4 sample_with_corners_from(vec2 p, vec2 corner_size) { p = (p - 0.5) / zoom + 0.5; if (!test_rounded_mask(p, corner_size)) { return black; } return unscreen(getFromColor(p)); } vec4 sample_with_corners_to(vec2 p, vec2 corner_size) { p = (p - 0.5) / zoom + 0.5; if (!test_rounded_mask(p, corner_size)) { return black; } return unscreen(getToColor(p)); } // special sampling used when zooming - extra zoom parameter and don't unscreen vec4 simple_sample_with_corners_from(vec2 p, vec2 corner_size, float zoom_amt) { p = (p - 0.5) / (1.0 - zoom_amt + zoom * zoom_amt) + 0.5; if (!test_rounded_mask(p, corner_size)) { return black; } return getFromColor(p); } vec4 simple_sample_with_corners_to(vec2 p, vec2 corner_size, float zoom_amt) { p = (p - 0.5) / (1.0 - zoom_amt + zoom * zoom_amt) + 0.5; if (!test_rounded_mask(p, corner_size)) { return black; } return getToColor(p); } // Basic 2D affine transform matrix helpers // These really shouldn't be used in a fragment shader - I should work out the // the math for a translate & rotate function as a pair of dot products instead mat3 rotate2d(float angle, float ratio) { float s = sin(angle); float c = cos(angle); return mat3( c, s ,0.0, -s, c, 0.0, 0.0, 0.0, 1.0); } mat3 translate2d(float x, float y) { return mat3( 1.0, 0.0, 0, 0.0, 1.0, 0, -x, -y, 1.0); } mat3 scale2d(float x, float y) { return mat3( x, 0.0, 0, 0.0, y, 0, 0, 0, 1.0); } // Split an image and rotate one up and one down along off screen pivot points vec4 get_cross_rotated(vec3 p3, float angle, vec2 corner_size, float ratio) { angle = angle * angle; // easing angle /= 2.4; // works out to be a good number of radians mat3 center_and_scale = translate2d(-0.5, -0.5) * scale2d(1.0, ratio); mat3 unscale_and_uncenter = scale2d(1.0, 1.0/ratio) * translate2d(0.5,0.5); mat3 slide_left = translate2d(-2.0,0.0); mat3 slide_right = translate2d(2.0,0.0); mat3 rotate = rotate2d(angle, ratio); mat3 op_a = center_and_scale * slide_right * rotate * slide_left * unscale_and_uncenter; mat3 op_b = center_and_scale * slide_left * rotate * slide_right * unscale_and_uncenter; vec4 a = sample_with_corners_from((op_a * p3).xy, corner_size); vec4 b = sample_with_corners_from((op_b * p3).xy, corner_size); return screen(a, b); } // Image stays put, but this time move two masks vec4 get_cross_masked(vec3 p3, float angle, vec2 corner_size, float ratio) { angle = 1.0 - angle; angle = angle * angle; // easing angle /= 2.4; vec4 img; mat3 center_and_scale = translate2d(-0.5, -0.5) * scale2d(1.0, ratio); mat3 unscale_and_uncenter = scale2d(1.0 / zoom, 1.0 / (zoom * ratio)) * translate2d(0.5,0.5); mat3 slide_left = translate2d(-2.0,0.0); mat3 slide_right = translate2d(2.0,0.0); mat3 rotate = rotate2d(angle, ratio); mat3 op_a = center_and_scale * slide_right * rotate * slide_left * unscale_and_uncenter; mat3 op_b = center_and_scale * slide_left * rotate * slide_right * unscale_and_uncenter; bool mask_a = test_rounded_mask((op_a * p3).xy, corner_size); bool mask_b = test_rounded_mask((op_b * p3).xy, corner_size); if (mask_a || mask_b) { img = sample_with_corners_to(p3.xy, corner_size); return screen(mask_a ? img : black, mask_b ? img : black); } else { return black; } } vec4 transition(vec2 uv) { float a; vec2 p=uv.xy/vec2(1.0).xy; vec3 p3 = vec3(p.xy, 1.0); // for 2D matrix transforms // corner is warped to represent to size after mapping to 1.0, 1.0 vec2 corner_size = vec2(corner_radius / ratio, corner_radius); if (progress <= 0.0) { // 0.0: start with the base frame always return getFromColor(p); } else if (progress < 0.1) { // 0.0-0.1: zoom out and add rounded corners a = progress / 0.1; return simple_sample_with_corners_from(p, corner_size * a, a); } else if (progress < 0.48) { // 0.1-0.48: Split original image apart a = (progress - 0.1)/0.38; return get_cross_rotated(p3, a, corner_size, ratio); } else if (progress < 0.9) { // 0.48-0.52: black // 0.52 - 0.9: unmask new image return get_cross_masked(p3, (progress - 0.52)/0.38, corner_size, ratio); } else if (progress < 1.0) { // zoom out and add rounded corners a = (1.0 - progress) / 0.1; return simple_sample_with_corners_to(p, corner_size * a, a); } else { // 1.0 end with base frame return getToColor(p); } } 07070100000051000081A400000000000000000000000166D6DD8C000002CB000000000000000000000000000000000000004100000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/Swirl.glsl// License: MIT // Author: Sergey Kosarevsky // ( http://www.linderdaum.com ) // ported by gre from https://gist.github.com/corporateshark/cacfedb8cca0f5ce3f7c vec4 transition(vec2 UV) { float Radius = 1.0; float T = progress; UV -= vec2( 0.5, 0.5 ); float Dist = length(UV); if ( Dist < Radius ) { float Percent = (Radius - Dist) / Radius; float A = ( T <= 0.5 ) ? mix( 0.0, 1.0, T/0.5 ) : mix( 1.0, 0.0, (T-0.5)/0.5 ); float Theta = Percent * Percent * A * 8.0 * 3.14159; float S = sin( Theta ); float C = cos( Theta ); UV = vec2( dot(UV, vec2(C, -S)), dot(UV, vec2(S, C)) ); } UV += vec2( 0.5, 0.5 ); vec4 C0 = getFromColor(UV); vec4 C1 = getToColor(UV); return mix( C0, C1, T ); } 07070100000052000081A400000000000000000000000166D6DD8C0000028B000000000000000000000000000000000000004400000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/TvStatic.glsl// author: Brandon Anzaldi // license: MIT uniform float offset; // = 0.05 // Pseudo-random noise function // http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/ highp float noise(vec2 co) { highp float a = 12.9898; highp float b = 78.233; highp float c = 43758.5453; highp float dt= dot(co.xy * progress, vec2(a, b)); highp float sn= mod(dt,3.14); return fract(sin(sn) * c); } vec4 transition(vec2 p) { if (progress < offset) { return getFromColor(p); } else if (progress > (1.0 - offset)) { return getToColor(p); } else { return vec4(vec3(noise(p)), 1.0); } } 07070100000053000081A400000000000000000000000166D6DD8C000001AD000000000000000000000000000000000000004500000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/WaterDrop.glsl// author: Paweł Płóciennik // license: MIT uniform float amplitude; // = 30 uniform float speed; // = 30 vec4 transition(vec2 p) { vec2 dir = p - vec2(.5); float dist = length(dir); if (dist > progress) { return mix(getFromColor( p), getToColor( p), progress); } else { vec2 offset = dir * sin(dist * amplitude - progress * speed); return mix(getFromColor( p + offset), getToColor( p), progress); } } 07070100000054000081A400000000000000000000000166D6DD8C00000112000000000000000000000000000000000000004800000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/WindowBlinds.glsl// Author: Fabien Benetou // License: MIT vec4 transition (vec2 uv) { float t = progress; if (mod(floor(uv.y*100.*progress),2.)==0.) t*=2.-.5; return mix( getFromColor(uv), getToColor(uv), mix(t, progress, smoothstep(0.8, 1.0, progress)) ); } 07070100000055000081A400000000000000000000000166D6DD8C00000248000000000000000000000000000000000000004900000000wpaperd-1.0.1~git66.62af439/daemon/src/render/shaders/ZoomInCircles.glsl// Author: gre // License: MIT // forked from https://gist.github.com/benraziel/c528607361d90a072e98 // minimum number of squares (when the effect is at its higher level) uniform ivec2 squaresMin; // = ivec2(20) // zero disable the stepping uniform int steps; // = 50 float d = min(progress, 1.0 - progress); float dist = steps>0 ? ceil(d * float(steps)) / float(steps) : d; vec2 squareSize = 2.0 * dist / vec2(squaresMin); vec4 transition(vec2 uv) { vec2 p = dist>0.0 ? (floor(uv / squareSize) + 0.5) * squareSize : uv; return mix(getFromColor(p), getToColor(p), progress); } 07070100000056000081A400000000000000000000000166D6DD8C000025E1000000000000000000000000000000000000003C00000000wpaperd-1.0.1~git66.62af439/daemon/src/render/transition.rsuse std::ffi::CStr; use color_eyre::{ eyre::{bail, ensure}, Result, }; use serde::Deserialize; //use wpaperd_transitions_proc_macro::Transitions; use crate::gl_check; use super::gl; type UniformCallback = dyn Fn(&gl::Gl, gl::types::GLuint) -> Result<()>; macro_rules! include_cstr { ( $path:expr $(,)? ) => {{ // Use a constant to force the verification to run at compile time. const VALUE: &'static ::core::ffi::CStr = match ::core::ffi::CStr::from_bytes_with_nul( concat!(include_str!($path), "\0").as_bytes(), ) { Ok(value) => value, Err(_) => panic!(concat!("interior NUL byte(s) in `", $path, "`")), }; VALUE }}; } use format_bytes::format_bytes; trait UniformSetter { unsafe fn set_uniform(&self, gl: &gl::Gl, loc: gl::types::GLint); } impl UniformSetter for bool { unsafe fn set_uniform(&self, gl: &gl::Gl, loc: gl::types::GLint) { unsafe { gl.Uniform1i(loc, (*self).into()); } } } impl UniformSetter for i32 { unsafe fn set_uniform(&self, gl: &gl::Gl, loc: gl::types::GLint) { unsafe { gl.Uniform1i(loc, *self); } } } impl UniformSetter for f32 { unsafe fn set_uniform(&self, gl: &gl::Gl, loc: gl::types::GLint) { gl.Uniform1f(loc, *self); } } impl UniformSetter for [i32; 2] { unsafe fn set_uniform(&self, gl: &gl::Gl, loc: gl::types::GLint) { unsafe { gl.Uniform2iv(loc, 1, self.as_ptr()); } } } impl UniformSetter for [u32; 2] { unsafe fn set_uniform(&self, gl: &gl::Gl, loc: gl::types::GLint) { unsafe { gl.Uniform2iv(loc, 1, self.as_ptr() as *const _); } } } impl UniformSetter for [f32; 2] { unsafe fn set_uniform(&self, gl: &gl::Gl, loc: gl::types::GLint) { unsafe { gl.Uniform2fv(loc, 1, self.as_ptr()); } } } impl UniformSetter for [f32; 3] { unsafe fn set_uniform(&self, gl: &gl::Gl, loc: gl::types::GLint) { unsafe { gl.Uniform3fv(loc, 1, self.as_ptr()); } } } impl UniformSetter for [f32; 4] { unsafe fn set_uniform(&self, gl: &gl::Gl, loc: gl::types::GLint) { unsafe { gl.Uniform4fv(loc, 1, self.as_ptr()); } } } macro_rules! transition_shader { ($enum:ident { $($variant:ident { $($field_name:ident: $field_ty:ty = ($glsl_name:literal, $default_value:expr)),* } => $default_time:expr),* }) => { #[derive(Deserialize, Clone, Debug, PartialEq)] #[serde(rename_all = "kebab-case", rename_all_fields = "kebab-case", deny_unknown_fields)] pub enum $enum { $($variant { $($field_name: Option<$field_ty>),* }),* } impl $enum { pub fn shader(self) -> (Box<UniformCallback>, &'static CStr) { match self { //$($enum::$variant => ( // Box::new(|_, _| Ok(())), // include_cstr!(concat!("shaders/", stringify!($variant), ".glsl")), //),)* $($enum::$variant { $($field_name),* } => ( #[allow(unused)] Box::new(move |gl, program| { $( unsafe { let loc = gl.GetUniformLocation(program, format_bytes!(b"{}\0", $glsl_name.as_bytes()).as_ptr() as *const _); gl_check!(gl, format!("getting the uniform location for {}", $glsl_name)); ensure!(loc >= 0, "uniform {} cannot be found", $glsl_name); $field_name.unwrap_or($default_value).set_uniform(gl, loc); gl_check!(gl, format!("calling Uniform on {}", $glsl_name)); } )* Ok(()) }), include_cstr!(concat!("shaders/", stringify!($variant), ".glsl")) ),)* } } pub const fn default_transition_time(&self) -> u32 { match self { $($enum::$variant { .. } => $default_time,)* } } } }; } transition_shader! { Transition { BookFlip{} => 2000, Bounce { shadow_colour: [f32; 4] = ("shadow_colour", [0.0, 0.0, 0.0, 0.6]), shadow_height: f32 = ("shadow_height", 0.075), bounces: f32 = ("bounces", 3.0) } => 4000, BowTieHorizontal{} => 1500, BowTieVertical{} => 1500, ButterflyWaveScrawler { amplitude: f32 = ("amplitude", 1.0), waves: f32 = ("waves", 30.0), color_separation: f32 = ("colorSeparation", 0.3) } => 2000, Circle{} => 3000, CircleCrop{ bgcolor: [f32; 4] = ("bgcolor", [0.0, 0.0, 0.0, 1.0]) } => 3000, CircleOpen { smoothness: f32 = ("smoothness", 0.3), opening: bool = ("opening", true) } => 1500, ColourDistance { power: f32 = ("power", 5.0) } => 2000, CrossWarp{} => 1000, CrossZoom { strength: f32 = ("strength", 0.4) } => 2000, Directional { direction: [f32; 2] = ("direction", [0.0, 1.0]) } => 1000, DirectionalScaled { direction: [f32; 2] = ("direction", [0.0, 1.0]), scale: f32 = ("scale", 0.7) } => 1000, DirectionalWipe { direction: [f32; 2] = ("direction", [1.0, -1.0]), smoothness: f32 = ("smoothness", 0.5) } => 1000, Dissolve { line_width: f32 = ("uLineWidth", 0.1), spread_clr: [f32; 3] = ("uSpreadClr", [1.0, 0.0, 0.0]), hot_clr: [f32; 3] = ("uHotClr", [0.9, 0.9, 0.2]), pow: f32 = ("uPow", 5.0), intensity: f32 = ("uIntensity", 1.0) } => 1000, Doom { bars: i32 = ("bars", 30), amplitude: f32 = ("amplitude", 2.0), noise: f32 = ("noise", 0.1), frequency: f32 = ("frequency", 0.5), drip_scale: f32 = ("dripScale", 0.5) } => 2000, Doorway { reflection: f32 = ("reflection", 0.4), perspective: f32 = ("perspective", 0.4), depth: f32 = ("depth", 3.0) } => 1500, Dreamy{} => 1500, DreamyZoom{ rotation: f32 = ("rotation", 6.0), scale: f32 = ("scale", 1.2) } => 1500, Edge{ thickness: f32 = ("edge_thickness", 0.001), brightness: f32 = ("edge_brightness", 8.0) } => 1500, Fade{} => 300, FilmBurn { seed: f32 = ("Seed", 2.31) } => 2000, GlitchDisplace{} => 1500, GlitchMemories{} => 1500, GridFlip { size: [i32; 2] = ("size", [4, 4]), pause: f32 = ("pause", 0.1), divider_width: f32 = ("dividerWidth", 0.05), bgcolor: [f32; 4] = ("bgcolor", [0.0, 0.0, 0.0, 1.0]), randomness: f32 = ("randomness", 0.1) } => 1500, Hexagonalize { steps: i32 = ("steps", 50), horizontal_hexagons: f32 = ("horizontalHexagons", 20.0) } => 2000, HorizontalClose{} => 2000, HorizontalOpen{} => 2000, InvertedPageCurl{} => 2000, LeftRight{} => 2000, LinearBlur { intensity: f32 = ("intensity", 0.1) } => 800, Mosaic{ endx: i32 = ("endx", 2), endy: i32 = ("endy", -1) } => 2000, Overexposure{} => 2000, Pixelize { squares_min: [i32; 2] = ("squaresMin", [20, 20]), steps: i32 = ("steps", 50) } => 1500, PolkaDotsCurtain { dots: f32 = ("dots", 20.0), center: [f32; 2] = ("center", [0.0, 0.0]) } => 2000, Radial { smoothness: f32 = ("smoothness", 1.0) } => 1500, Rectangle { bgcolor: [f32; 4] = ("bgcolor", [0.0, 0.0, 0.0, 1.0]) } => 2000, Ripple { amplitude: f32 = ("amplitude", 100.0), speed: f32 = ("speed", 50.0) } => 1500, Rolls { rolls_type: i32 = ("type", 0), rot_down: bool = ("RotDown", false) } => 2000, RotateScaleFade { center: [f32; 2] = ("center", [0.5, 0.5]), rotations: f32 = ("rotations", 1.0), scale: f32 = ("scale", 8.0), back_color: [f32; 4] = ("backColor", [0.15, 0.15, 0.15, 1.0]) } => 1500, RotateScaleVanish { fade_in_second: bool = ("FadeInSecond", true), reverse_effect: bool = ("ReverseEffect", false), reverse_rotation: bool = ("ReverseRotation", false) } => 1500, SimpleZoom { zoom_quickness: f32 = ("zoom_quickness", 0.8) } => 1500, Slides { slides_type: i32 = ("type", 0), slides_in: bool = ("In", false) } => 1500, StaticFade { n_noise_pixels: f32 = ("n_noise_pixels", 200.0), static_luminosity: f32 = ("static_luminosity", 0.8) } => 1500, StereoViewer { zoom: f32 = ("zoom", 0.88), corner_radius: f32 = ("corner_radius", 0.22) } => 2000, Swirl {} => 1500, TvStatic { offset: f32 = ("offset", 0.05) } => 1000, WaterDrop { amplitude: f32 = ("amplitude", 30.0), speed: f32 = ("speed", 30.0) } => 1500, WindowBlinds {} => 1500 } } 07070100000057000081A400000000000000000000000166D6DD8C00000561000000000000000000000000000000000000003B00000000wpaperd-1.0.1~git66.62af439/daemon/src/render/wallpaper.rsuse std::{ffi::CStr, rc::Rc}; use color_eyre::{ eyre::{bail, ensure}, Result, }; use image::DynamicImage; use crate::{gl_check, render::gl}; use super::load_texture; pub struct Wallpaper { gl: Rc<gl::Gl>, texture: gl::types::GLuint, image_width: u32, image_height: u32, } impl Wallpaper { pub const fn new(gl: Rc<gl::Gl>) -> Self { Self { gl, texture: 0, image_width: 10, image_height: 10, } } pub fn bind(&self) -> Result<()> { unsafe { self.gl.BindTexture(gl::TEXTURE_2D, self.texture); gl_check!(self.gl, "binding textures"); } Ok(()) } pub fn load_image(&mut self, image: DynamicImage) -> Result<()> { self.image_width = image.width(); self.image_height = image.height(); let texture = load_texture(&self.gl, image)?; unsafe { // Delete from memory the previous texture self.gl.DeleteTextures(1, &self.texture); } self.texture = texture; Ok(()) } pub fn get_image_height(&self) -> u32 { self.image_height } pub fn get_image_width(&self) -> u32 { self.image_width } } impl Drop for Wallpaper { fn drop(&mut self) { unsafe { self.gl.DeleteTextures(1, &self.texture) }; } } 07070100000058000081A400000000000000000000000166D6DD8C00000A29000000000000000000000000000000000000003100000000wpaperd-1.0.1~git66.62af439/daemon/src/socket.rs//! Calloop socket event source. //! //! This module provides a Calloop event source for Unix domain sockets. //! <https://github.com/catacombing/catacomb/blob/master/src/socket.rs> use std::io::{self, ErrorKind}; use std::os::unix::net::{UnixListener, UnixStream}; use smithay_client_toolkit::reexports::calloop::generic::Generic; use smithay_client_toolkit::reexports::calloop::{ self, EventSource, Interest, Mode, Poll, PostAction, Readiness, Token, TokenFactory, }; /// Unix domain socket source. #[derive(Debug)] pub struct SocketSource { socket: Generic<UnixListener>, } impl SocketSource { /// Create a new socket event source. /// /// This will always call [`UnixListener::set_nonblocking`] on the socket /// automatically, to prevent it from blocking up the calloop event /// loop. pub fn new(socket: UnixListener) -> calloop::Result<Self> { // Ensure we'll get `WouldBlock` when reading from an empty socket. socket.set_nonblocking(true)?; Ok(Self { socket: Generic::new(socket, Interest::READ, Mode::Level), }) } } impl EventSource for SocketSource { type Error = io::Error; type Event = UnixStream; type Metadata = (); type Ret = (); fn process_events<F>( &mut self, readiness: Readiness, token: Token, mut callback: F, ) -> io::Result<PostAction> where F: FnMut(Self::Event, &mut Self::Metadata) -> Self::Ret, { self.socket.process_events(readiness, token, |_, socket| { // Accept next connection, separating `WouldBlock` from other errors. let accept_next = || match socket.accept() { Ok((stream, _)) => Ok(Some(stream)), Err(err) if err.kind() == ErrorKind::WouldBlock => Ok(None), Err(err) => Err(err), }; // Read from the socket until it would block. while let Some(stream) = accept_next()? { callback(stream, &mut ()); } Ok(PostAction::Continue) }) } fn register( &mut self, poll: &mut Poll, token_factory: &mut TokenFactory, ) -> calloop::Result<()> { self.socket.register(poll, token_factory) } fn reregister( &mut self, poll: &mut Poll, token_factory: &mut TokenFactory, ) -> calloop::Result<()> { self.socket.reregister(poll, token_factory) } fn unregister(&mut self, poll: &mut Poll) -> calloop::Result<()> { self.socket.unregister(poll) } } 07070100000059000081A400000000000000000000000166D6DD8C000058F6000000000000000000000000000000000000003200000000wpaperd-1.0.1~git66.62af439/daemon/src/surface.rsuse std::{ cell::RefCell, path::PathBuf, rc::Rc, time::{Duration, Instant}, }; use color_eyre::eyre::{Context, ContextCompat}; use color_eyre::Result; use image::RgbaImage; use log::{error, warn}; use smithay_client_toolkit::reexports::calloop::{LoopHandle, RegistrationToken}; use smithay_client_toolkit::reexports::client::protocol::wl_output::{Transform, WlOutput}; use smithay_client_toolkit::reexports::client::protocol::wl_surface; use smithay_client_toolkit::reexports::client::QueueHandle; use smithay_client_toolkit::shell::wlr_layer::{LayerSurface, LayerSurfaceConfigure}; use smithay_client_toolkit::{ reexports::calloop::timer::{TimeoutAction, Timer}, shell::WaylandSurface, }; use crate::render::{EglContext, Renderer}; use crate::wpaperd::Wpaperd; use crate::{display_info::DisplayInfo, wallpaper_info::WallpaperInfo}; use crate::{image_loader::ImageLoader, image_picker::ImagePicker}; #[derive(Debug)] pub enum EventSource { NotSet, Running(RegistrationToken), // The contained value is the duration that was left on the previous timer, used for starting the next timer. Paused(Duration), } pub struct Surface { wl_surface: wl_surface::WlSurface, wl_output: WlOutput, layer: LayerSurface, egl_context: EglContext, renderer: Renderer, pub image_picker: ImagePicker, event_source: EventSource, pub wallpaper_info: WallpaperInfo, info: Rc<RefCell<DisplayInfo>>, image_loader: Rc<RefCell<ImageLoader>>, window_drawn: bool, loading_image: Option<(PathBuf, usize)>, loading_image_tries: u8, /// Determines whether we should skip the next transition. Used to skip /// the first transition when starting up. /// /// See [crate::wallpaper_info::WallpaperInfo]'s `initial_transition` field skip_next_transition: bool, /// Pause state of the automatic wallpaper sequence. /// Setting this to true will mean only an explicit next/previous wallpaper command will change /// the wallpaper. should_pause: bool, } impl Surface { pub fn new( wpaperd: &Wpaperd, wl_layer: LayerSurface, wl_output: WlOutput, info: DisplayInfo, wallpaper_info: WallpaperInfo, egl_display: egl::Display, qh: &QueueHandle<Wpaperd>, ) -> Self { let wl_surface = wl_layer.wl_surface().clone(); let egl_context = EglContext::new(egl_display, &wl_surface); // Make the egl context as current to make the renderer creation work egl_context .make_current() .expect("EGL context switching to work"); // Commit the surface wl_surface.commit(); let image_picker = ImagePicker::new( &wallpaper_info, &wl_surface, wpaperd.filelist_cache.clone(), wpaperd.wallpaper_groups.clone(), ); let image = black_image(); let info = Rc::new(RefCell::new(info)); let renderer = unsafe { Renderer::new( image.into(), info.clone(), 0, wallpaper_info.transition.clone(), info.borrow().transform, ) .expect("unable to create the renderer") }; let first_transition = !wallpaper_info.initial_transition; let mut surface = Self { wl_output, layer: wl_layer, info, wl_surface, egl_context, renderer, image_picker, event_source: EventSource::NotSet, wallpaper_info, window_drawn: false, should_pause: false, image_loader: wpaperd.image_loader.clone(), loading_image: None, loading_image_tries: 0, skip_next_transition: first_transition, }; // Start loading the wallpaper as soon as possible (i.e. surface creation) // It will still be loaded as a texture when we have an openGL context if let Err(err) = surface.load_wallpaper(qh) { warn!("{err:?}"); } surface } /// Returns true if something has been drawn to the surface pub fn draw(&mut self, qh: &QueueHandle<Wpaperd>, time: Option<u32>) -> Result<()> { let info = self.info.borrow(); let width = info.adjusted_width(); let height = info.adjusted_height(); // Drop the borrow to self drop(info); // Use the correct context before loading the texture and drawing self.egl_context.make_current()?; let wallpaper_loaded = self.load_wallpaper(qh)?; if self.renderer.transition_running() { // Recalculate the current progress, the transition might end now let transition_running = self.renderer.update_transition_status(time.unwrap_or(0)); // If we don't have any time passed, just consider the transition to be ended if transition_running { // Don't call queue_draw as it calls load_wallpaper again self.wl_surface.frame(qh, self.wl_surface.clone()); } else { self.renderer.transition_finished(); } } else if !wallpaper_loaded { self.wl_surface.frame(qh, self.wl_surface.clone()); if self.window_drawn { // We need to call commit, otherwise the call to frame above doesn't work self.wl_surface().commit(); return Ok(()); } } unsafe { self.renderer.draw()? } self.renderer.clear_after_draw()?; self.egl_context.swap_buffers()?; // Reset the context egl::API .make_current(self.egl_context.display, None, None, None) .context("Resetting the GL context")?; // Mark the entire surface as damaged self.wl_surface.damage_buffer(0, 0, width, height); // Finally, commit the surface self.wl_surface.commit(); Ok(()) } // Call surface::frame when this return false pub fn load_wallpaper(&mut self, qh: &QueueHandle<Wpaperd>) -> Result<bool> { Ok(loop { // If we were not already trying to load an image if self.loading_image.is_none() { if let Some(item) = self .image_picker .get_image_from_path(&self.wallpaper_info.path, qh) { if self.image_picker.current_image() == item.0 && !self.image_picker.is_reloading() { break true; } else { // We are trying to load a new image self.loading_image = Some(item); } } else { // we don't need to load any image break true; } } let (image_path, index) = self .loading_image .as_ref() .expect("loading image to be set") .clone(); if self.renderer.transition_running() { break true; } let res = self .image_loader .borrow_mut() .background_load(image_path.to_owned(), self.name()); match res { crate::image_loader::ImageLoaderStatus::Loaded(data) => { // Renderer::load_wallpaper load the wallpaper in a openGL texture // Set the correct opengl context self.egl_context.make_current()?; self.renderer.load_wallpaper( data.into(), self.wallpaper_info.mode, self.wallpaper_info.offset, )?; let transition_time = if self.skip_next_transition { 0 } else { self.wallpaper_info.transition_time }; self.skip_next_transition = false; if self.image_picker.is_reloading() { self.image_picker.reloaded(); } else { self.image_picker.update_current_image(image_path, index); self.renderer.start_transition(transition_time); } // Restart the counter self.loading_image_tries = 0; self.loading_image = None; break true; } crate::image_loader::ImageLoaderStatus::Waiting => { // wait until the image has been loaded break false; } crate::image_loader::ImageLoaderStatus::Error => { // We don't want to try too many times self.loading_image_tries += 1; // The image we were trying to load failed self.loading_image = None; } } // If we have tried too many times, stop if self.loading_image_tries == 5 { break true; } }) } pub fn name(&self) -> String { self.info.borrow().name.to_string() } /// Resize the surface pub fn resize(&mut self, qh: &QueueHandle<Wpaperd>) -> Result<()> { let info = self.info.borrow(); let width = info.adjusted_width(); let height = info.adjusted_height(); // Drop the borrow to self drop(info); // self.layer.set_size(width as u32, height as u32); let display_name = self.name(); self.egl_context .resize(&self.wl_surface, width, height) .with_context(|| { format!("unable to switch resize EGL context for display {display_name}",) })?; self.egl_context.make_current().with_context(|| { format!("unable to switch the openGL context for display {display_name}") })?; self.renderer.resize().with_context(|| { format!("unable to resize the GL window for display {display_name}") })?; // If we resize, stop immediately any lingering transition self.renderer.force_transition_end(); // Queue drawing for the next frame. We can directly draw here, but we would still // need to queue the draw for the next frame, otherwise wpaperd doesn't work at startup self.queue_draw(qh); Ok(()) } pub fn change_size(&mut self, configure: LayerSurfaceConfigure, qh: &QueueHandle<Wpaperd>) { let mut info = self.info.borrow_mut(); if info.change_size(configure) { drop(info); if let Err(err) = self.resize(qh) { error!("{err:?}"); } } } pub fn change_transform(&mut self, transform: Transform, qh: &QueueHandle<Wpaperd>) { let mut info = self.info.borrow_mut(); if info.change_transform(transform) { drop(info); self.wl_surface.set_buffer_transform(transform); if let Err(err) = self .resize(qh) .and_then(|_| { self.renderer .set_mode(self.wallpaper_info.mode, self.wallpaper_info.offset) }) .and_then(|_| unsafe { self.renderer.set_projection_matrix(transform) }) { error!("{err:?}"); } } } pub fn change_scale_factor(&mut self, scale_factor: i32, qh: &QueueHandle<Wpaperd>) { let mut info = self.info.borrow_mut(); if info.change_scale_factor(scale_factor) { drop(info); self.wl_surface.set_buffer_scale(scale_factor); // Resize the gl viewport if let Err(err) = self.resize(qh) { error!("{err:?}"); } } } /// Check that the dimensions are valid pub fn is_configured(&self) -> bool { let info = self.info.borrow(); info.width != 0 && info.height != 0 } pub fn has_been_drawn(&self) -> bool { self.window_drawn } pub fn drawn(&mut self) { self.window_drawn = true; } /// Update the wallpaper_info of this Surface /// return true if the duration has changed pub fn update_wallpaper_info( &mut self, handle: &LoopHandle<Wpaperd>, qh: &QueueHandle<Wpaperd>, mut wallpaper_info: WallpaperInfo, ) { if self.wallpaper_info == wallpaper_info { return; } // Put the new value in place std::mem::swap(&mut self.wallpaper_info, &mut wallpaper_info); let path_changed = self.wallpaper_info.path != wallpaper_info.path; self.image_picker.update_sorting( self.wallpaper_info.sorting, &self.wallpaper_info.path, path_changed, wallpaper_info.drawn_images_queue_size, ); if path_changed { // ask the image_picker to pick a new a image self.image_picker.next_image(&self.wallpaper_info.path, qh); self.queue_draw(qh); } if self.wallpaper_info.duration != wallpaper_info.duration { match (self.wallpaper_info.duration, wallpaper_info.duration) { (None, None) => { unreachable!() } // There was a duration before but now it has been removed (None, Some(_)) => { if let EventSource::Running(registration_token) = self.event_source { handle.remove(registration_token); } } // There wasn't a duration before but now it has been added or it has changed (Some(new_duration), None) | (Some(new_duration), Some(_)) => { if let EventSource::Running(registration_token) = self.event_source { handle.remove(registration_token); } // if the path has not changed or the duration has changed // and the remaining time is great than 0 let timer = if let (false, Some(remaining_time)) = ( path_changed, remaining_duration(new_duration, self.image_picker.image_changed_instant), ) { Some(Timer::from_duration(remaining_time)) } else { // otherwise draw the image immediately, the next timer // will be set to the new duration Some(Timer::immediate()) }; self.event_source = EventSource::NotSet; self.add_timer(timer, handle, qh.clone()); } } } if self.wallpaper_info.mode != wallpaper_info.mode || self.wallpaper_info.offset != wallpaper_info.offset { if let Err(err) = self.egl_context.make_current().and_then(|_| { self.renderer .set_mode(self.wallpaper_info.mode, self.wallpaper_info.offset) }) { error!("{err:?}"); } if !path_changed { // We should draw immediately if let Err(err) = self.draw(qh, None) { warn!("{err:?}"); } } } if self.wallpaper_info.transition != wallpaper_info.transition { match self.egl_context.make_current() { Ok(_) => { let transform = self.renderer.display_info.borrow().transform; self.renderer .update_transition(self.wallpaper_info.transition.clone(), transform); } Err(err) => { error!("{err:?}"); } } } if self.wallpaper_info.drawn_images_queue_size != wallpaper_info.drawn_images_queue_size { self.image_picker .update_queue_size(self.wallpaper_info.drawn_images_queue_size); } if self.wallpaper_info.transition_time != wallpaper_info.transition_time { self.renderer .update_transition_time(self.wallpaper_info.transition_time); } } /// Add a new timer in the event_loop for the current duration /// Stop if there is already a timer added pub fn add_timer( &mut self, timer: Option<Timer>, handle: &LoopHandle<Wpaperd>, qh: QueueHandle<Wpaperd>, ) { if matches!(self.event_source, EventSource::Running(_)) { return; } let Some(duration) = self.wallpaper_info.duration else { return; }; let timer = timer.unwrap_or(Timer::from_duration(duration)); let name = self.name().clone(); let registration_token = handle .insert_source( timer, move |_deadline, _: &mut (), wpaperd: &mut Wpaperd| { let surface = match wpaperd .surface_from_name(&name) .with_context(|| format!("expecting surface {name} to be available")) { Ok(surface) => surface, Err(err) => { error!("{err:?}"); return TimeoutAction::Drop; } }; if let Some(duration) = surface.wallpaper_info.duration { // Check that the timer has expired // if the daemon received a next or previous image command // the timer will be reset and we need to account that here // i.e. there is a timer of 1 minute. The user changes the image // with a previous wallpaper command at 50 seconds. // The timer will be reset to 1 minute and the image will be changed if let Some(remaining_time) = remaining_duration(duration, surface.image_picker.image_changed_instant) { TimeoutAction::ToDuration(remaining_time) } else { // Change the drawn image surface .image_picker .next_image(&surface.wallpaper_info.path, &qh); surface.queue_draw(&qh); TimeoutAction::ToDuration(duration) } } else { TimeoutAction::Drop } }, ) .expect("Failed to insert event source!"); self.event_source = EventSource::Running(registration_token); } /// Handle updating the timer based on the pause state of the automatic wallpaper sequence. /// Remove the timer if pausing, and add a new timer with the remaining duration of the old /// timer when resuming. pub fn handle_pause_state(&mut self, handle: &LoopHandle<Wpaperd>, qh: QueueHandle<Wpaperd>) { match (self.should_pause, &self.event_source) { // Should pause, but timer is still currently running (true, EventSource::Running(registration_token)) => { let remaining_duration = self.get_remaining_duration().unwrap_or_default(); handle.remove(*registration_token); self.event_source = EventSource::Paused(remaining_duration); } // Should resume, but timer is not currently running (false, EventSource::Paused(duration)) => { self.add_timer(Some(Timer::from_duration(*duration)), handle, qh.clone()); } // Otherwise no update is necessary (_, _) => {} } } #[inline] pub fn queue_draw(&mut self, qh: &QueueHandle<Wpaperd>) { // Start loading the next image immediately if let Err(err) = self.load_wallpaper(qh) { warn!("{err:?}"); } self.wl_surface.frame(qh, self.wl_surface.clone()); self.wl_surface.commit(); } #[inline] fn get_remaining_duration(&self) -> Option<Duration> { let duration = self.wallpaper_info.duration?; remaining_duration(duration, self.image_picker.image_changed_instant) } /// Indicate to the main event loop that the automatic wallpaper sequence for this [`Surface`] /// should be paused. /// The actual pausing/resuming is handled in [`Surface::handle_pause_state`] #[inline] pub fn pause(&mut self) { self.should_pause = true; } /// Indicate to the main event loop that the automatic wallpaper sequence for this [`Surface`] /// should be resumed. /// The actual pausing/resuming is handled in [`Surface::handle_pause_state`] #[inline] pub fn resume(&mut self) { self.should_pause = false; } /// Toggle the pause state for this [`Surface`], which is responsible for indicating to the main /// event loop that the automatic wallpaper sequence should be paused. /// The actual pausing/resuming is handled in [`Surface::handle_pause_state`] #[inline] pub fn toggle_pause(&mut self) { if self.should_pause() { self.resume(); } else { self.pause(); }; } /// Returns a boolean representing whether this [`Surface`] is set to indicate to the main event /// loop that its automatic wallpaper sequence should be paused. #[inline] pub fn should_pause(&self) -> bool { self.should_pause } pub fn wl_surface(&self) -> &wl_surface::WlSurface { &self.wl_surface } pub fn wl_output(&self) -> &WlOutput { &self.wl_output } pub fn layer(&self) -> &LayerSurface { &self.layer } } fn black_image() -> RgbaImage { RgbaImage::from_raw(1, 1, vec![0, 0, 0, 255]).unwrap() } fn remaining_duration(duration: Duration, image_changed: Instant) -> Option<Duration> { // The timer has already expired let diff = image_changed.elapsed(); if duration.saturating_sub(diff).is_zero() { None } else { Some(duration - diff) } } 0707010000005A000081A400000000000000000000000166D6DD8C0000063F000000000000000000000000000000000000003B00000000wpaperd-1.0.1~git66.62af439/daemon/src/wallpaper_groups.rsuse std::{ cell::RefCell, collections::{HashMap, HashSet}, path::PathBuf, rc::Rc, }; use smithay_client_toolkit::reexports::client::{protocol::wl_surface::WlSurface, QueueHandle}; use crate::{image_picker::Queue, wpaperd::Wpaperd}; pub struct WallpaperGroup { pub index: usize, pub current_image: PathBuf, pub loading_image: Option<(usize, PathBuf)>, pub surfaces: HashSet<WlSurface>, pub queue: Queue, } impl WallpaperGroup { pub fn new(queue_size: usize) -> Self { Self { index: 0, current_image: PathBuf::from(""), loading_image: None, surfaces: HashSet::new(), queue: Queue::with_capacity(queue_size), } } pub fn queue_all_surfaces(&self, qh: &QueueHandle<Wpaperd>) { for surface in &self.surfaces { surface.frame(qh, surface.clone()); surface.commit(); } } } pub struct WallpaperGroups { groups: HashMap<u8, Rc<RefCell<WallpaperGroup>>>, } impl WallpaperGroups { pub fn new() -> Self { Self { groups: HashMap::new(), } } pub fn get_or_insert( &mut self, group: u8, wl_surface: &WlSurface, queue_size: usize, ) -> Rc<RefCell<WallpaperGroup>> { self.groups .entry(group) .or_insert_with(|| Rc::new(RefCell::new(WallpaperGroup::new(queue_size)))); let wp_group = self.groups.get_mut(&group).unwrap(); wp_group.borrow_mut().surfaces.insert(wl_surface.clone()); wp_group.clone() } } 0707010000005B000081A400000000000000000000000166D6DD8C0000073B000000000000000000000000000000000000003900000000wpaperd-1.0.1~git66.62af439/daemon/src/wallpaper_info.rsuse std::{path::PathBuf, time::Duration}; use serde::Deserialize; use crate::{image_picker::ImagePicker, render::Transition}; #[derive(PartialEq, Debug)] pub struct WallpaperInfo { pub path: PathBuf, pub duration: Option<Duration>, pub apply_shadow: bool, pub sorting: Option<Sorting>, pub mode: BackgroundMode, pub drawn_images_queue_size: usize, pub transition_time: u32, /// Determines if we should show the transition between black and first /// wallpaper. `false` means we instantly cut to the first wallpaper, /// `true` means we fade from black to the first wallpaper. pub initial_transition: bool, pub transition: Transition, /// Determine the offset for the wallpaper to be drawn into the screen /// Must be from 0.0 to 1.0, by default is 0.0 in tile mode and 0.5 in all the others pub offset: Option<f32>, } impl Default for WallpaperInfo { fn default() -> Self { Self { path: PathBuf::new(), duration: None, apply_shadow: false, sorting: None, mode: BackgroundMode::default(), drawn_images_queue_size: ImagePicker::DEFAULT_DRAWN_IMAGES_QUEUE_SIZE, transition_time: Transition::Fade {}.default_transition_time(), initial_transition: true, transition: Transition::Fade {}, offset: None, } } } #[derive(Debug, Copy, Clone, Default, Eq, PartialEq, Deserialize)] #[serde(rename_all = "lowercase")] pub enum Sorting { #[default] Random, GroupedRandom { group: u8, }, Ascending, Descending, } #[derive(Debug, Copy, Clone, Default, Eq, PartialEq, Deserialize)] #[serde(rename_all = "kebab-case")] pub enum BackgroundMode { Stretch, #[default] Center, Fit, Tile, FitBorderColor, } 0707010000005C000081A400000000000000000000000166D6DD8C0000258F000000000000000000000000000000000000003200000000wpaperd-1.0.1~git66.62af439/daemon/src/wpaperd.rsuse std::cell::RefCell; use std::rc::Rc; use color_eyre::owo_colors::OwoColorize; use color_eyre::Result; use log::{error, warn}; use smithay_client_toolkit::compositor::{CompositorHandler, CompositorState, Region}; use smithay_client_toolkit::output::{OutputHandler, OutputState}; use smithay_client_toolkit::reexports::calloop::LoopHandle; use smithay_client_toolkit::reexports::client::globals::GlobalList; use smithay_client_toolkit::reexports::client::protocol::{wl_output, wl_surface}; use smithay_client_toolkit::reexports::client::{Connection, QueueHandle}; use smithay_client_toolkit::registry::{ProvidesRegistryState, RegistryState}; use smithay_client_toolkit::shell::wlr_layer::{ Anchor, Layer, LayerShell, LayerShellHandler, LayerSurface, LayerSurfaceConfigure, }; use smithay_client_toolkit::shm::{Shm, ShmHandler}; use smithay_client_toolkit::{ delegate_compositor, delegate_layer, delegate_output, delegate_registry, delegate_shm, registry_handlers, }; use crate::config::Config; use crate::display_info::DisplayInfo; use crate::filelist_cache::FilelistCache; use crate::image_loader::ImageLoader; use crate::surface::Surface; use crate::wallpaper_groups::WallpaperGroups; use crate::wallpaper_info::WallpaperInfo; pub struct Wpaperd { pub compositor_state: CompositorState, pub output_state: OutputState, pub shm_state: Shm, pub layer_state: LayerShell, pub registry_state: RegistryState, pub surfaces: Vec<Surface>, pub config: Config, egl_display: egl::Display, pub filelist_cache: Rc<RefCell<FilelistCache>>, pub image_loader: Rc<RefCell<ImageLoader>>, pub wallpaper_groups: Rc<RefCell<WallpaperGroups>>, } impl Wpaperd { pub fn new( qh: &QueueHandle<Self>, globals: &GlobalList, config: Config, egl_display: egl::Display, filelist_cache: Rc<RefCell<FilelistCache>>, wallpaper_groups: Rc<RefCell<WallpaperGroups>>, ) -> Result<Self> { let shm_state = Shm::bind(globals, qh)?; let image_loader = Rc::new(RefCell::new(ImageLoader::new())); Ok(Self { compositor_state: CompositorState::bind(globals, qh)?, output_state: OutputState::new(globals, qh), shm_state, layer_state: LayerShell::bind(globals, qh)?, registry_state: RegistryState::new(globals), surfaces: Vec::new(), config, egl_display, filelist_cache, image_loader, wallpaper_groups, }) } pub fn update_surfaces(&mut self, ev_handle: LoopHandle<Wpaperd>, qh: &QueueHandle<Wpaperd>) { for surface in &mut self.surfaces { let res = self.config.get_output_by_name(&surface.name()); match res { Ok(wallpaper_info) => { surface.update_wallpaper_info(&ev_handle, qh, wallpaper_info); } Err(err) => warn!( "Configuration error for display {}: {err:?}", surface.name() ), } } } pub fn surface_from_name(&mut self, name: &str) -> Option<&mut Surface> { self.surfaces .iter_mut() .find(|surface| surface.name() == name) } pub fn surface_from_wl_surface(&mut self, surface: &wl_surface::WlSurface) -> &mut Surface { self.surfaces .iter_mut() .find(|s| surface == s.wl_surface()) .expect("surface to be registered in wpaperd") } } impl CompositorHandler for Wpaperd { fn scale_factor_changed( &mut self, _conn: &Connection, qh: &QueueHandle<Self>, surface: &wl_surface::WlSurface, new_factor: i32, ) { self.surface_from_wl_surface(surface) .change_scale_factor(new_factor, qh); } fn frame( &mut self, _conn: &Connection, qh: &QueueHandle<Self>, surface: &wl_surface::WlSurface, time: u32, ) { let surface = self.surface_from_wl_surface(surface); match surface.draw(qh, Some(time)) { Ok(_) => {} Err(err) => { error!("Error drawing surface: {err:?}"); } } } fn transform_changed( &mut self, _conn: &Connection, qh: &QueueHandle<Self>, surface: &wl_surface::WlSurface, new_transform: wl_output::Transform, ) { self.surface_from_wl_surface(surface) .change_transform(new_transform, qh); } fn surface_enter( &mut self, _conn: &Connection, _qh: &QueueHandle<Self>, _surface: &wl_surface::WlSurface, _output: &wl_output::WlOutput, ) { } fn surface_leave( &mut self, _conn: &Connection, _qh: &QueueHandle<Self>, _surface: &wl_surface::WlSurface, _output: &wl_output::WlOutput, ) { } } impl OutputHandler for Wpaperd { fn output_state(&mut self) -> &mut OutputState { &mut self.output_state } fn new_output( &mut self, _conn: &Connection, qh: &QueueHandle<Self>, output: wl_output::WlOutput, ) { let surface = self.compositor_state.create_surface(qh); let info = match self.output_state.info(&output) { Some(info) => info, None => { error!("could not get info about output"); return; } }; surface.set_buffer_scale(info.scale_factor); surface.set_buffer_transform(info.transform); let name = info .name .as_ref() .map(|name| name.to_string()) .unwrap_or_else(|| "unnamed".to_string()); let display_info = DisplayInfo::new(info); let layer = self.layer_state.create_layer_surface( qh, surface.clone(), Layer::Background, Some(format!("wpaperd-{}", name)), Some(&output), ); layer.set_anchor(Anchor::TOP | Anchor::LEFT | Anchor::RIGHT | Anchor::BOTTOM); layer.set_exclusive_zone(-1); layer.set_size( display_info.adjusted_width() as u32, display_info.adjusted_height() as u32, ); match Region::new(&self.compositor_state) { Ok(region) => { // Wayland clients are expected to render the cursor on their input region. By setting the // input region to an empty region, the compositor renders the default cursor. Without // this, and empty desktop won't render a cursor. surface.set_input_region(Some(region.wl_region())); // From `wl_surface::set_opaque_region`: // > Setting the pending opaque region has copy semantics, and the // > wl_region object can be destroyed immediately. region.wl_region().destroy(); } Err(_) => { warn!("could not create region, cursor won't be shown for display {name}"); return; } }; let wallpaper_info = match self.config.get_output_by_name(&name) { Ok(wallpaper_info) => wallpaper_info, Err(err) => { warn!( "Configuration error on display {}: {err:?}", name.bold().magenta() ); WallpaperInfo::default() } }; self.surfaces.push(Surface::new( self, layer, output, display_info, wallpaper_info, self.egl_display, qh, )); } fn update_output( &mut self, _conn: &Connection, _qh: &QueueHandle<Self>, _output: wl_output::WlOutput, ) { // TODO: Do we need to do something here? } fn output_destroyed( &mut self, _conn: &Connection, _qh: &QueueHandle<Self>, output: wl_output::WlOutput, ) { // Find the destroyed output and remove it match self .surfaces .iter() .enumerate() .find(|(_, surface)| *surface.wl_output() == output) { Some((index, _)) => { self.surfaces.swap_remove(index); } None => error!("could not find display while handling output_destroyed"), } } } impl LayerShellHandler for Wpaperd { fn closed(&mut self, _conn: &Connection, _qh: &QueueHandle<Self>, _layer: &LayerSurface) {} fn configure( &mut self, _conn: &Connection, qh: &QueueHandle<Self>, layer: &LayerSurface, configure: LayerSurfaceConfigure, _serial: u32, ) { match self .surfaces .iter_mut() .find(|surface| surface.layer() == layer) { Some(surface) => surface.change_size(configure, qh), None => error!("could not find display while handling configure in wayland"), } } } impl ShmHandler for Wpaperd { fn shm_state(&mut self) -> &mut Shm { &mut self.shm_state } } delegate_compositor!(Wpaperd); delegate_output!(Wpaperd); delegate_shm!(Wpaperd); delegate_registry!(Wpaperd); delegate_layer!(Wpaperd); impl ProvidesRegistryState for Wpaperd { fn registry(&mut self) -> &mut RegistryState { &mut self.registry_state } registry_handlers![OutputState]; } 0707010000005D000081A400000000000000000000000166D6DD8C0000061E000000000000000000000000000000000000002700000000wpaperd-1.0.1~git66.62af439/flake.lock{ "nodes": { "nixpkgs": { "locked": { "lastModified": 1721379653, "narHash": "sha256-8MUgifkJ7lkZs3u99UDZMB4kbOxvMEXQZ31FO3SopZ0=", "owner": "NixOS", "repo": "nixpkgs", "rev": "1d9c2c9b3e71b9ee663d11c5d298727dace8d374", "type": "github" }, "original": { "owner": "NixOS", "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } }, "root": { "inputs": { "nixpkgs": "nixpkgs", "rust-overlay": "rust-overlay", "systems": "systems" } }, "rust-overlay": { "inputs": { "nixpkgs": [ "nixpkgs" ] }, "locked": { "lastModified": 1721528458, "narHash": "sha256-uruH/EV8Rpa/CRxn8CiMzhoA6tJe8qO5c8NdgP1g0rM=", "owner": "oxalica", "repo": "rust-overlay", "rev": "0b2b2da1dad1c675c45d9e23c75674de969de83b", "type": "github" }, "original": { "owner": "oxalica", "repo": "rust-overlay", "type": "github" } }, "systems": { "locked": { "lastModified": 1689347949, "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", "owner": "nix-systems", "repo": "default-linux", "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", "type": "github" }, "original": { "owner": "nix-systems", "repo": "default-linux", "type": "github" } } }, "root": "root", "version": 7 } 0707010000005E000081A400000000000000000000000166D6DD8C0000050C000000000000000000000000000000000000002600000000wpaperd-1.0.1~git66.62af439/flake.nix{ description = "Wallpaper daemon for Wayland"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; systems.url = "github:nix-systems/default-linux"; rust-overlay = { url = "github:oxalica/rust-overlay"; inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = { self, nixpkgs, systems, rust-overlay, ... }: let inherit (nixpkgs) lib; eachSystem = lib.genAttrs (import systems); pkgsFor = eachSystem (system: import nixpkgs { inherit system; overlays = [self.overlays.default (import rust-overlay)]; }); in { overlays = import ./nix/overlays.nix {inherit self lib pkgsFor;}; packages = eachSystem (system: { default = self.packages.${system}.wpaperd; inherit (pkgsFor.${system}) wpaperd ; }); devShells = eachSystem (system: with pkgsFor.${system}; { default = mkShell { buildInputs = [ rust-bin.stable.latest.default ]; packages = [ pkg-config wayland glew-egl ]; }; }); formatter = eachSystem (system: pkgsFor.${system}.alejandra); homeManagerModules.default = import ./nix/hm-module.nix self; }; } 0707010000005F000081A400000000000000000000000166D6DD8C00000244000000000000000000000000000000000000002800000000wpaperd-1.0.1~git66.62af439/install.ymlrinstall: 0.2.0 pkgs: wpaperd: type: rust exe: - wpaperd - wpaperctl man: - man/wpaperctl.1 - man/wpaperd.1 - man/wpaperd-output.5 licenses: - LICENSE.md docs: - README.md completions: bash: - completions/wpaperd.bash - completions/wpaperctl.bash elvish: - completions/wpaperd.elv - completions/wpaperctl.elv fish: - completions/wpaperd.fish - completions/wpaperctl.fish zsh: - completions/_wpaperd - completions/_wpaperctl 07070100000060000041ED00000000000000000000000266D6DD8C00000000000000000000000000000000000000000000002000000000wpaperd-1.0.1~git66.62af439/ipc07070100000061000081A400000000000000000000000166D6DD8C0000023C000000000000000000000000000000000000002B00000000wpaperd-1.0.1~git66.62af439/ipc/Cargo.toml[package] name = "wpaperd-ipc" version = "1.0.1" edition = "2021" authors = ["Danilo Spinella <danilo.spinella@suse.com>"] description = "IPC library for wpaperd" homepage = "https://github.com/danyspin97/wpaperd" repository = "https://github.com/danyspin97/wpaperd" license = "GPL-3.0+" keywords = ["wallpaper", "wayland", "wlroots"] categories = ["command-line-utilities", "multimedia"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] serde = { version = "1.0.203", features = ["derive"] } xdg = "2.5.2" 07070100000062000041ED00000000000000000000000266D6DD8C00000000000000000000000000000000000000000000002400000000wpaperd-1.0.1~git66.62af439/ipc/src07070100000063000081A400000000000000000000000166D6DD8C000003F8000000000000000000000000000000000000002B00000000wpaperd-1.0.1~git66.62af439/ipc/src/lib.rsuse std::path::PathBuf; use serde::{Deserialize, Serialize}; use xdg::{BaseDirectories, BaseDirectoriesError}; #[derive(Serialize, Deserialize)] pub enum IpcMessage { CurrentWallpaper { monitor: String }, NextWallpaper { monitors: Vec<String> }, PreviousWallpaper { monitors: Vec<String> }, PauseWallpaper { monitors: Vec<String> }, ResumeWallpaper { monitors: Vec<String> }, TogglePauseWallpaper { monitors: Vec<String> }, AllWallpapers, ReloadWallpaper { monitors: Vec<String> }, } #[derive(Serialize, Deserialize)] pub enum IpcResponse { CurrentWallpaper { path: PathBuf }, AllWallpapers { entries: Vec<(String, PathBuf)> }, Ok, } #[derive(Serialize, Deserialize, Debug)] pub enum IpcError { MonitorNotFound { monitor: String }, DrawErrors(Vec<(String, String)>), } pub fn socket_path() -> Result<PathBuf, BaseDirectoriesError> { let xdg_dirs = BaseDirectories::with_prefix("wpaperd")?; Ok(xdg_dirs.get_runtime_directory()?.join("wpaperd.sock")) } 07070100000064000041ED00000000000000000000000266D6DD8C00000000000000000000000000000000000000000000002000000000wpaperd-1.0.1~git66.62af439/man07070100000065000081A400000000000000000000000166D6DD8C00000CBA000000000000000000000000000000000000003500000000wpaperd-1.0.1~git66.62af439/man/wpaperd-output.5.scdwpaperd-output(5) # NAME wpaperd-output - format used by wpaperd to define the various displays # DESCRIPTION The wpaperd configuration file contains the information about each display, the corresponding wallpaper and its settings. This file is located in XDG_CONFIG_HOME/wpaperd/config.toml (which defaults to $HOME/.config/wpaperd/config.toml). # SYNTAX This file is a simple TOML configuration divided in sections, one for each display. ## SECTION Each section is named after the display identifier. If you are using _sway_, you can lookup the output identifier by calling: ``` $ swaymsg -t get_outputs ``` On Hyprland, you can do it with: ``` $ hyprctl monitors ``` The configuration file for *wpaperd* is located in `XDG_CONFIG_HOME/wpaperd/config.toml` (which defaults to `~/.config/wpaperd/config.toml`). Each section represents a different display and can contain the following keys: - `path`, path to the image to use as wallpaper or to a directory to pick the wallpaper from - `duration`, how much time the image should be displayed until it is changed with a new one. It supports a human format for declaring the duration (e.g. `30s` or `10m`), described [here](https://docs.rs/humantime/latest/humantime/fn.parse_duration.html). This is only valid when path points to a directory. (_Optional_) - `sorting`, choose the sorting order. Valid options are `ascending`, `descending`, and `random`, with the default being `random`. This is only valid when path points to a directory. (_Optional_) - `mode`, choose how to display the wallpaper when the size is different than the display resolution: - `fit` shows the entire image with black corners covering the empty space left - `center` centers the image on the screen, leaving out the corners of the image that couldn't fit - `stretch` shows the entire image stretching it to fit the entire screen without leaving any black corner, changing the aspect ratio - `tile` shows the image multiple times horizontally and vertically to fill the screen - `transition_time`, how many milliseconds should the transition run. (_Optional_, `300` by default). - `queue_size`, decide how big the queue should be when `path` is set a directory and `sorting` is set to `random`. (_Optional_, `10` by default) - `initial_transition`, whether or not to transition from the initial black screen (_Optional_, `true` by default) ## DEFAULT SECTION The section "*default*" will be used as base for the all the display configuration; the section "*any*" will be used for all the displays that are not explictly listed. This allows to have a flexible configuration without repeating any settings. _wpaperd_ will check the configuration at startup and each time it changes and provide help when it is incorrect. # EXAMPLE The simplest configuration looks like this: ``` [DP-3] path = "/home/danyspin97/github_octupus.png" [DP-4] path = "/home/danyspin97/Wallpapers" duration = "30m" ``` A more complex configuration is also possible: ``` [default] duration = "30m" mode = "center" sorting = "ascending" [any] path = "/home/danyspin97/default_wallpaper.png" [DP-3] path = "/home/danyspin97/Wallpapers" ``` # AUTHOR Maintained by Danilo Spinella <danilo.spinella@suse.com>. 07070100000066000041ED00000000000000000000000266D6DD8C00000000000000000000000000000000000000000000002000000000wpaperd-1.0.1~git66.62af439/nix07070100000067000081A400000000000000000000000166D6DD8C0000046B000000000000000000000000000000000000002C00000000wpaperd-1.0.1~git66.62af439/nix/default.nix{ lib, rustPlatform, pkg-config, wayland, glew-egl, version ? "git", }: rustPlatform.buildRustPackage rec { pname = "wpaperd"; inherit version; src = lib.cleanSourceWith { filter = name: _type: let baseName = baseNameOf (toString name); in !(lib.hasSuffix ".nix" baseName); src = lib.cleanSource ../.; }; nativeBuildInputs = [ pkg-config ]; buildInputs = [ wayland glew-egl ]; cargoLock.lockFile = ../Cargo.lock; meta = with lib; { description = "Wallpaper daemon for Wayland"; longDescription = '' It allows the user to choose a different image for each output (aka for each monitor) just as swaybg. Moreover, a directory can be chosen and wpaperd will randomly choose an image from it. Optionally, the user can set a duration, after which the image displayed will be changed with another random one. ''; homepage = "https://github.com/danyspin97/wpaperd"; license = licenses.gpl3Plus; platforms = platforms.linux; maintainers = with maintainers; [yunfachi]; mainProgram = "wpaperd"; }; } 07070100000068000081A400000000000000000000000166D6DD8C000000D7000000000000000000000000000000000000002E00000000wpaperd-1.0.1~git66.62af439/nix/hm-module.nixself: { config, lib, pkgs, ... }: let inherit (pkgs.stdenv.hostPlatform) system; package = self.packages.${system}.default; in { config = { programs.wpaperd.package = lib.mkDefault package; }; } 07070100000069000081A400000000000000000000000166D6DD8C00000325000000000000000000000000000000000000002D00000000wpaperd-1.0.1~git66.62af439/nix/overlays.nix{ self, lib, pkgsFor }: let inherit ((builtins.fromTOML (builtins.readFile ../daemon/Cargo.toml)).package) version rust-overlay; mkDate = longDate: (lib.concatStringsSep "-" [ (builtins.substring 0 4 longDate) (builtins.substring 4 2 longDate) (builtins.substring 6 2 longDate) ]); in { default = lib.composeManyExtensions [ (final: _prev: let date = mkDate self.lastModifiedDate or "19700101"; in { wpaperd = final.callPackage ./default.nix { version = "${version}+date=${date}_${self.shortRev or "dirty"}"; rustPlatform = let toolchain = pkgsFor.${final.system}.rust-bin.stable.latest.default; in (final.makeRustPlatform { cargo = toolchain; rustc = toolchain; }); }; }) ]; } 07070100000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000B00000000TRAILER!!!689 blocks
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor