diff --git a/README.md b/README.md index 844b752..bcc33a9 100644 --- a/README.md +++ b/README.md @@ -57,8 +57,8 @@ It tries to deliver all these features in one command, without any configuration Install using one of the following ways: - binary from [the releases page](https://github.com/pancsta/sway-yasm/releases/latest) -- `go install github.com/pancsta/sway-yasm@latest` -- `git clone; cd; go mod tidy; ./scripts/build` +- `go install github.com/pancsta/sway-yasm/cmd/sway-yasm@latest` +- `git clone; cd; ./scripts/build` ## features @@ -159,13 +159,13 @@ Switcher mode: Example - switch to the 3rd MRU window: -- `alt+tab` +- `alt+tab` (release) - `tab` - `space` Example - switch to Krusader by name: -- `alt+tab` +- `alt+tab` (release) - `k`, `r`, `u` - `enter` diff --git a/cmd/sway-yasm/main.go b/cmd/sway-yasm/sway_yasm.go similarity index 85% rename from cmd/sway-yasm/main.go rename to cmd/sway-yasm/sway_yasm.go index 6c15c2e..605fba0 100644 --- a/cmd/sway-yasm/main.go +++ b/cmd/sway-yasm/sway_yasm.go @@ -10,12 +10,13 @@ import ( func main() { // TODO --status (PID, config, windows count) - if os.Getenv("YASM_LOG") == "" { - log.SetOutput(io.Discard) - } // TODO slog logger := log.New(os.Stdout, "", 0) + if os.Getenv("YASM_LOG") == "" { + logger.SetOutput(io.Discard) + } + // start the root command err := cmds.GetRootCmd(logger).Execute() if err != nil { logger.Fatal("cobra error:", err) diff --git a/internal/daemon/daemon.go b/internal/daemon/daemon.go index 287bee4..6803b4c 100644 --- a/internal/daemon/daemon.go +++ b/internal/daemon/daemon.go @@ -148,7 +148,7 @@ func (d *Daemon) Start() { case err := <-s.Errors: // TODO reconnect / backoff log.Println("Error:", err) - break + os.Exit(1) } } } diff --git a/scripts/build.sh b/scripts/build.sh index 039f452..8157f06 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,3 +1,4 @@ #!/usr/bin/env sh -go build -o sway-yasm cmd/sway-yasm/main.go +go mod tidy +go build -o sway-yasm ./cmd/sway-yasm