Skip to content

Commit

Permalink
fix: add small fixes
Browse files Browse the repository at this point in the history
- go installation
- daemon exit
- build script
  • Loading branch information
pancsta committed Sep 5, 2024
1 parent ba7bf9d commit d0aa59d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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`

Expand Down
7 changes: 4 additions & 3 deletions cmd/sway-yasm/main.go → cmd/sway-yasm/sway_yasm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion internal/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func (d *Daemon) Start() {
case err := <-s.Errors:
// TODO reconnect / backoff
log.Println("Error:", err)
break
os.Exit(1)
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit d0aa59d

Please sign in to comment.