From 03631efca24cbb8e59fed5db63db14c085b8cc27 Mon Sep 17 00:00:00 2001 From: Kimiblock Moe Date: Tue, 14 May 2024 23:46:25 +0800 Subject: [PATCH] Use PW --- README.md | 8 ++++++-- snotify.go | 2 +- snotify.service | 3 ++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 944cae2..4415fb4 100644 --- a/README.md +++ b/README.md @@ -2,14 +2,18 @@ [![Go](https://github.com/Kimiblock/snotify/actions/workflows/go.yml/badge.svg)](https://github.com/Kimiblock/snotify/actions/workflows/go.yml) -Notifications, with sound. +Audible Notifications. # Packages -[AUR](https://aur.archlinux.org/packages/snotify-git) +[AUR](https://aur.archlinux.org/packages/snotify) + +[AUR (Git)](https://aur.archlinux.org/packages/snotify-git) # Usage +Requires Pipewire sound server. + Install the AUR package, then enable **user** service `snotify.service`. # Credits diff --git a/snotify.go b/snotify.go index 9873285..436855c 100644 --- a/snotify.go +++ b/snotify.go @@ -76,7 +76,7 @@ func playSoundOnNewLine() { } func playSound() { - soundCmd := exec.Command("mpv", "--audio-client-name=snotify", "--no-video", "--no-terminal", "--no-audio-display", "--no-config", "--really-quiet", "--volume=80", "/opt/snotify/message.ogg") + soundCmd := exec.Command("pw-play", "/opt/snotify/message.ogg") if err := soundCmd.Start(); err != nil { fmt.Println("Error playing sound:", err) return diff --git a/snotify.service b/snotify.service index 3c1ca07..6d6f1a5 100644 --- a/snotify.service +++ b/snotify.service @@ -1,6 +1,7 @@ [Unit] -Description=Snotify user daemon +Description=Audible Notifications After=dbus.service +Requires=pipewire.service [Service] ExecStart=/usr/bin/snotify