Skip to content

Commit

Permalink
Merge pull request 'AudStopper -> SuperShush' (#2) from rename into main
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkoid committed Jun 2, 2024
2 parents d334d46 + 4ba073d commit 985abd4
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 25 deletions.
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,43 @@
# AudStopper
# SuperShush

## What is AudStopper?
## What is SuperShush?

AudStopper is a daemon that is designed to prevent audio from continuing to play when the output device is changed, such as when switching from headphones to speakers.
SuperShush is a daemon that is designed to prevent audio from continuing to play when the output device is changed, such as when switching from headphones to speakers.

# Installation

To stop audio playback when the output device is changed, AudStopper **requires** the `playerctl` package if the option in the config is enabled.
To stop audio playback when the output device is changed, SuperShush **requires** the `playerctl` package if the option in the config is enabled.
## From Source

To compile AudStopper from source, you'll need to have Go installed on your system. You can download the Go installer from the official Go website.
To compile SuperShush from source, you'll need to have Go installed on your system. You can download the Go installer from the official Go website.

Once you have Go installed, run the following command to install audstopper:
Once you have Go installed, run the following command to install SuperShush:

```bash
go install codeberg.org/tomkoid/audstopper@0.1.0
go install codeberg.org/tomkoid/supershush@0.1.0
```

# Running

To run AudStopper, simply execute the audstopper command:
To run supershush, simply execute the `supershush` command:

```bash
audstopper
supershush
```

This will start the AudStopper daemon, which will monitor audio output changes and stop audio playback when necessary.
This will start the SuperShush daemon, which will monitor audio output changes and stop audio playback when necessary.

# Configuring

To configure AudStopper, you can edit the configuration file located at `~/.config/audstopper/config.toml`. Here is an example configuration file:
To configure SuperShush, you can edit the configuration file located at `~/.config/supershush/config.toml`. Here is an example configuration file:

```toml
# Resume audio after you change output back
# WARNING: This feature is not stable yet. The current implementation has big issues.
# Example: audio is playing on audio 1 and then you switch to
# audio 2, the audio gets paused. after you switch
# back to audio 1, the audio gets unmuted.
resume = false

# Enable MPC pausing
mpc = false
Expand All @@ -47,8 +48,8 @@ playerctl = true

# License

AudStopper is licensed under the MIT License. See the LICENSE file for more information.
SuperShush is licensed under the MIT License. See the LICENSE file for more information.

# Contributing

If you'd like to contribute to AudStopper, please fork the repository and submit a pull request with your changes. You can also report issues or suggest new features on the issue tracker.
If you'd like to contribute to SuperShush, please fork the repository and submit a pull request with your changes. You can also report issues or suggest new features on the issue tracker.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module codeberg.org/tomkoid/audstopper
module codeberg.org/tomkoid/supershush

go 1.22.2

Expand Down
2 changes: 1 addition & 1 deletion internal/audio/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"mrogalski.eu/go/pulseaudio"

"codeberg.org/tomkoid/audstopper/internal/config"
"codeberg.org/tomkoid/supershush/internal/config"
)

type mutedSink struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/audio/players.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package audio
import (
"os/exec"

"codeberg.org/tomkoid/audstopper/internal/config"
"codeberg.org/tomkoid/supershush/internal/config"
)

type Player struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/audio/playing.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package audio
import (
"strings"

"codeberg.org/tomkoid/audstopper/internal/tools"
"codeberg.org/tomkoid/supershush/internal/tools"
)

func isPlaying(player string) (bool, []string) {
Expand Down
4 changes: 2 additions & 2 deletions internal/audio/resume.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package audio
import (
"log"

"codeberg.org/tomkoid/audstopper/internal/config"
"codeberg.org/tomkoid/audstopper/internal/tools"
"codeberg.org/tomkoid/supershush/internal/config"
"codeberg.org/tomkoid/supershush/internal/tools"
)

func resumeAudio(config *config.Config, givenPlayers []string) {
Expand Down
4 changes: 2 additions & 2 deletions internal/audio/stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package audio
import (
"log"

"codeberg.org/tomkoid/audstopper/internal/config"
"codeberg.org/tomkoid/audstopper/internal/tools"
"codeberg.org/tomkoid/supershush/internal/config"
"codeberg.org/tomkoid/supershush/internal/tools"
)

/// returns an array of players that were playing before stopped
Expand Down
2 changes: 1 addition & 1 deletion internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func GetConfig() Config {
log.Fatal(err)
}

configFilePath := userConfigDir + "/audstopper/config.toml"
configFilePath := userConfigDir + "/supershush/config.toml"

configStr, err := readConfigFile(configFilePath)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (

"mrogalski.eu/go/pulseaudio"

"codeberg.org/tomkoid/audstopper/internal/audio"
"codeberg.org/tomkoid/audstopper/internal/config"
"codeberg.org/tomkoid/audstopper/internal/tools"
"codeberg.org/tomkoid/supershush/internal/audio"
"codeberg.org/tomkoid/supershush/internal/config"
"codeberg.org/tomkoid/supershush/internal/tools"
)

func main() {
Expand Down

0 comments on commit 985abd4

Please sign in to comment.