Skip to content

Commit 455d751

Browse files
committed
fix: add small fixes
- go installation - daemon exit - build script
1 parent ba7bf9d commit 455d751

File tree

10 files changed

+23
-22
lines changed

10 files changed

+23
-22
lines changed

.goreleaser.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
builds:
22
- id: "sway-yasm"
3-
main: "./cmd/sway-yasm/main.go"
3+
main: "./cmd/sway-yasm/"
44
binary: "sway-yasm"
55
goos:
66
- linux

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ It tries to deliver all these features in one command, without any configuration
5757
Install using one of the following ways:
5858

5959
- binary from [the releases page](https://github.com/pancsta/sway-yasm/releases/latest)
60-
- `go install github.com/pancsta/sway-yasm@latest`
61-
- `git clone; cd; go mod tidy; ./scripts/build`
60+
- `go install github.com/pancsta/sway-yasm/cmd/sway-yasm@latest`
61+
- `git clone; cd; ./scripts/build`
6262

6363
## features
6464

@@ -159,13 +159,13 @@ Switcher mode:
159159

160160
Example - switch to the 3rd MRU window:
161161

162-
- `alt+tab`
162+
- `alt+tab` (release)
163163
- `tab`
164164
- `space`
165165

166166
Example - switch to Krusader by name:
167167

168-
- `alt+tab`
168+
- `alt+tab` (release)
169169
- `k`, `r`, `u`
170170
- `enter`
171171

cmd/sway-yasm/main.go cmd/sway-yasm/sway_yasm.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ import (
1010

1111
func main() {
1212
// TODO --status (PID, config, windows count)
13-
if os.Getenv("YASM_LOG") == "" {
14-
log.SetOutput(io.Discard)
15-
}
1613
// TODO slog
1714
logger := log.New(os.Stdout, "", 0)
15+
if os.Getenv("YASM_LOG") == "" {
16+
logger.SetOutput(io.Discard)
17+
}
1818

19+
// start the root command
1920
err := cmds.GetRootCmd(logger).Execute()
2021
if err != nil {
2122
logger.Fatal("cobra error:", err)

go.mod

+1-4
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,11 @@ module github.com/pancsta/sway-yasm
22

33
go 1.22.3
44

5-
// TODO PR
6-
replace github.com/Difrex/gosway/ipc => github.com/pancsta/gosway/ipc v0.0.0-20240714161203-b47bb358f535
7-
85
require (
9-
github.com/Difrex/gosway/ipc v0.0.0-20240312143858-20214f4c38d6
106
github.com/fsnotify/fsnotify v1.7.0
117
github.com/lithammer/dedent v1.1.0
128
github.com/pancsta/asyncmachine-go v0.6.1
9+
github.com/pancsta/gosway/ipc v0.0.0-20240905082428-317fdc2bcf9c
1310
github.com/samber/lo v1.39.0
1411
github.com/spf13/cobra v1.8.0
1512
)

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ github.com/lithammer/dedent v1.1.0 h1:VNzHMVCBNG1j0fh3OrsFRkVUwStdDArbgBWoPAffkt
1111
github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z9BP0jIOc=
1212
github.com/pancsta/asyncmachine-go v0.6.1 h1:WEOKXV+qYAM1tVESt3dnHyyPmrrVI02iIqOdSkrcP1c=
1313
github.com/pancsta/asyncmachine-go v0.6.1/go.mod h1:hoG7VB315eqgnRvVfZQQcw7B7CrJMkwqNNHH8N+7CGs=
14-
github.com/pancsta/gosway/ipc v0.0.0-20240714161203-b47bb358f535 h1:lzXo+KaitWLZhckXizQ5Lkl5dOZ+ENeO0mWWfeYikN4=
15-
github.com/pancsta/gosway/ipc v0.0.0-20240714161203-b47bb358f535/go.mod h1:hZTd2MPJSe6oi3O8arSxP2WEoIuHLgct4v0t1ssBtTU=
14+
github.com/pancsta/gosway/ipc v0.0.0-20240905082428-317fdc2bcf9c h1:2B9GDAHUtpW+DhDsWPzCpUx7pdSp9EgGxGyCcoyGGyU=
15+
github.com/pancsta/gosway/ipc v0.0.0-20240905082428-317fdc2bcf9c/go.mod h1:lcI50E2ufUPm3w+deWAyUkamTvxX7q9IFd0E9fhErZA=
1616
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
1717
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
1818
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=

internal/daemon/daemon.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ import (
1212
"strings"
1313
"time"
1414

15+
"github.com/pancsta/gosway/ipc"
16+
"github.com/samber/lo"
17+
1518
"github.com/pancsta/sway-yasm/internal/types"
1619
"github.com/pancsta/sway-yasm/internal/watcher"
17-
18-
"github.com/Difrex/gosway/ipc"
1920
usrCmds "github.com/pancsta/sway-yasm/pkg/usr-cmds"
20-
"github.com/samber/lo"
2121
)
2222

2323
// CONFIG TODO file
@@ -148,7 +148,7 @@ func (d *Daemon) Start() {
148148
case err := <-s.Errors:
149149
// TODO reconnect / backoff
150150
log.Println("Error:", err)
151-
break
151+
os.Exit(1)
152152
}
153153
}
154154
}

internal/types/types.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package types
22

3-
import "github.com/Difrex/gosway/ipc"
3+
import "github.com/pancsta/gosway/ipc"
44

55
type WindowData struct {
66
ID int

internal/watcher/watcher.go

+1
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ func (w *PathWatcher) RefreshingState(e *am.Event) {
239239
return // expired
240240
}
241241

242+
// TODO returns deleted files on delete event
242243
executables, err := listExecutables(dir)
243244
if err != nil {
244245
e.Machine.AddErr(err)

pkg/usr-cmds/api.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
package usrCmds
22

33
import (
4-
"github.com/Difrex/gosway/ipc"
5-
"github.com/pancsta/sway-yasm/internal/types"
64
"log"
5+
6+
"github.com/pancsta/gosway/ipc"
7+
"github.com/pancsta/sway-yasm/internal/types"
78
)
89

910
type DaemonAPI interface {

scripts/build.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
#!/usr/bin/env sh
22

3-
go build -o sway-yasm cmd/sway-yasm/main.go
3+
go mod tidy
4+
go build -o sway-yasm ./cmd/sway-yasm

0 commit comments

Comments
 (0)