Skip to content

Commit

Permalink
Add Wayland watcher prototype implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Saveau committed Nov 30, 2024
1 parent ba8edcb commit 7368ac1
Show file tree
Hide file tree
Showing 8 changed files with 680 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/cid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ jobs:
cargo publish --package clipboard-history-x11
cargo publish --package wayland-interface-check
cargo publish --package clipboard-history-watcher-utils
cargo publish --package clipboard-history-wayland
cargo publish --package clipboard-history-egui
cargo publish --package clipboard-history-tui
Expand All @@ -68,6 +69,8 @@ jobs:
cargo publish --package ringboard --allow-dirty
sed -i 's/name = "clipboard-history-x11"/name = "ringboard-x11"/' x11/Cargo.toml
cargo publish --package ringboard-x11 --allow-dirty
sed -i 's/name = "clipboard-history-wayland"/name = "ringboard-wayland"/' wayland/Cargo.toml
cargo publish --package ringboard-wayland --allow-dirty
sed -i 's/name = "clipboard-history-egui"/name = "ringboard-egui"/' egui/Cargo.toml
cargo publish --package ringboard-egui --allow-dirty
sed -i 's/name = "clipboard-history-tui"/name = "ringboard-tui"/' tui/Cargo.toml
Expand Down Expand Up @@ -135,6 +138,13 @@ jobs:
file: target/${{ matrix.target }}/release/wayland-interface-check
asset_name: ${{ matrix.target }}-wayland-interface-check
tag: ${{ github.ref }}
- name: Upload binary
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/${{ matrix.target }}/release/ringboard-wayland
asset_name: ${{ matrix.target }}-ringboard-wayland
tag: ${{ github.ref }}
- name: Upload binary
uses: svenstaro/upload-release-action@v2
with:
Expand Down
25 changes: 25 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ members = [
"server",
"tui",
"watcher-utils",
"wayland",
"wayland-interface-check",
"x11",
]
Expand Down
30 changes: 30 additions & 0 deletions wayland/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[package]
name = "clipboard-history-wayland"
version.workspace = true
authors.workspace = true
edition.workspace = true
description = "Wayland Ringboard clipboard listener."
repository.workspace = true
keywords = ["ringboard", "clipboard", "tools", "wayland"]
categories = ["command-line-utilities", "development-tools", "filesystem"]
license.workspace = true

[dependencies]
env_logger = { version = "0.11.5", default-features = false }
error-stack = { version = "0.5.0", default-features = false, features = ["std"] }
log = { version = "0.4.22", features = ["release_max_level_info"] }
ringboard-sdk = { package = "clipboard-history-client-sdk", version = "0", path = "../client-sdk", features = ["error-stack", "config"] }
ringboard-watcher-utils = { package = "clipboard-history-watcher-utils", version = "0", path = "../watcher-utils" }
rustc-hash = "2.0.0"
rustix = { version = "0.38.41", features = ["pipe"] }
thiserror = "2.0.3"
wayland-client = "0.31.7"
wayland-protocols-wlr = { version = "0.3.5", features = ["client"] }

[features]
default = ["human-logs"]
human-logs = ["env_logger/default"]

[[bin]]
name = "ringboard-wayland"
path = "src/main.rs"
1 change: 1 addition & 0 deletions wayland/LICENSE
10 changes: 10 additions & 0 deletions wayland/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Ringboard Wayland

<a href="https://crates.io/crates/clipboard-history-wayland">![Crates.io Version](https://img.shields.io/crates/v/clipboard-history-wayland)</a>

This binary provides a Wayland clipboard watching service for the Ringboard database. It connects to
the Wayland and Ringboard servers and uses the `ext_data_control_v1` protocol to monitor the
clipboard for new clipboard selections to send to the Ringboard server.

Additionally, it offers a paste server capable of becoming the Wayland selection owner for clients
to call. Implementation notes are similar to the [X11 watcher](../x11).
17 changes: 17 additions & 0 deletions wayland/ringboard-wayland.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[Unit]
Description=Wayland Ringboard clipboard listener
Documentation=https://github.com/SUPERCILEX/clipboard-history
Requires=ringboard-server.service
After=ringboard-server.service
BindsTo=graphical-session.target
After=graphical-session.target

[Service]
Type=exec
Environment=RUST_LOG=trace
ExecStart=ringboard-wayland
Restart=on-failure
Slice=ringboard.slice

[Install]
WantedBy=graphical-session.target
Loading

0 comments on commit 7368ac1

Please sign in to comment.