Skip to content

Commit f5edfdd

Browse files
author
Anthony Templeton
committed
no roads
1 parent 56b8d6d commit f5edfdd

File tree

6 files changed

+28
-36
lines changed

6 files changed

+28
-36
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "swaddle"
3-
version = "0.1.0"
3+
version = "0.1.2"
44
edition = "2021"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

PKGBUILD

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,24 @@
11
pkgname=swaddle
2-
pkgver=0.1.1
2+
pkgver=0.1.2
33
pkgrel=1
44
pkgdesc="Swayidle inhibitor when watching content or listening to audio"
55
arch=('x86_64')
6-
license=('GPL')
7-
depends=('dbus' 'openssl')
8-
makedepends=('cargo' 'rust')
9-
source=("$pkgname-$pkgver.tar.gz::https://github.com/attron/$pkgname/archive/v$pkgver.tar.gz"
10-
"$pkgname.service")
11-
sha256sums=('SKIP'
12-
'SKIP')
13-
6+
url="https://github.com/ATTron/swaddle"
7+
license=('MIT')
8+
source=("$url/archive/$pkgver.tar.gz")
9+
sha256sums=('SKIP')
1410

1511
build() {
1612
cd "$srcdir/$pkgname-$pkgver"
17-
cargo build --release --locked
13+
cargo build --release
1814
}
1915

2016
package() {
2117
cd "$srcdir/$pkgname-$pkgver"
22-
install -Dm755 "target/release/$pkgname" "$pkgdir/usr/bin/$pkgname"
23-
install -Dm644 "$srcdir/$pkgname.service" "$pkgdir/usr/lib/systemd/system/$pkgname.service"
24-
}
25-
26-
post_install() {
27-
systemctl daemon-reload
28-
}
18+
install -Dm755 "target/release/swaddle" "$pkgdir/usr/local/bin/swaddle"
2919

30-
post_upgrade() {
31-
post_install
20+
# Post-install instructions
21+
echo "Swaddle has been installed. To integrate it with Sway, add the following line to your Sway configuration:"
22+
echo "exec_always --no-startup-id /usr/local/bin/swaddle &"
23+
echo "Then reload your Sway configuration or restart Sway."
3224
}

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22

33
**note**
44
**right now this has only been tested with firefox, not sure how well it will work with chrome based browsers at this time**
5+
## Installation
6+
7+
Swaddle can be installed from the AUR:
8+
9+
```sh
10+
yay -S swaddle
11+
```
12+
13+
## Post-Install
14+
To integrate swaddle with Sway, add the following line to your Sway configuration:
15+
`exec_always --no-startup-id /usr/bin/swaddle &`
16+
Then reload your Sway configuration or restart Sway.
17+
518
## Overview
619

720
The main function of this project is to keep swayWM from going into an idle state when watching Youtube videos. This Rust project includes a D-Bus Runner (`DBusRunner`) and an Idle Application (`IdleApp`). It is designed to interface with D-Bus for message handling, particularly for managing media playback statuses, and to execute commands based on these statuses.

src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ impl DBusRunner {
3636

3737
impl DBusInterface for DBusRunner {
3838
fn add_match(&self) -> Result<(), Box<dyn Error>> {
39-
let m_rule = MatchRule::new()
39+
let rule = MatchRule::new()
4040
.with_interface(INTERFACE_NAME)
4141
.with_namespaced_path(DBUS_NAMESPACE);
4242

4343
let sending_clone = Arc::clone(&self.good_to_send);
44-
self.connection.add_match(m_rule, move |_: (), _, msg| {
44+
self.connection.add_match(rule, move |_: (), _, msg| {
4545
let items: HashMap<String, Variant<Box<dyn RefArg>>> =
4646
msg.read3::<String, HashMap<_, _>, Vec<String>>().unwrap().1;
4747
if let Some(playback_status) = items.get("PlaybackStatus") {

swaddle.service

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)