-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
87c3475
commit 161f396
Showing
3 changed files
with
183 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
# Patch to make go test works, | ||
--- a/internal/modules/clipboard/clipboard.go | ||
+++ b/internal/modules/clipboard/clipboard.go | ||
@@ -197,7 +197,7 @@ | ||
for { | ||
conn, err := l.AcceptUnix() | ||
if err != nil { | ||
- slog.Error("clipboard", "error", "accept", err) | ||
+ slog.Error("clipboard error", "accept", err) | ||
} | ||
|
||
b := make([]byte, 104_857_600) | ||
@@ -262,13 +262,13 @@ | ||
|
||
conn, err := net.Dial("unix", ClipboardSocketAddrUpdate) | ||
if err != nil { | ||
- slog.Error("clipboard", "error", "socket", err) | ||
+ slog.Error("clipboard error", "socket", err) | ||
return | ||
} | ||
|
||
_, err = conn.Write(content) | ||
if err != nil { | ||
- slog.Error("clipboard", "error", "write", err) | ||
+ slog.Error("clipboard error", "write", err) | ||
} | ||
} | ||
|
||
--- a/internal/ui/modules.go | ||
+++ b/internal/ui/modules.go | ||
@@ -126,7 +126,7 @@ | ||
|
||
if ok := v.Setup(); ok { | ||
if v.General().Name == "" { | ||
- log.Panicln("module has no name\n") | ||
+ log.Panicln("module has no name") | ||
} | ||
|
||
if slices.Contains(config.Cfg.Disabled, v.General().Name) { | ||
--- a/internal/ui/keybinds.go | ||
+++ b/internal/ui/keybinds.go | ||
@@ -201,7 +201,7 @@ | ||
_, existsSpecial := specialKeys[v] | ||
|
||
if !existsMod && !existsSpecial { | ||
- slog.Error("invalid keybind", bind, "key", v) | ||
+ slog.Error("invalid keybind", "bind", bind, "key", v) | ||
} | ||
} | ||
} | ||
@@ -212,7 +212,7 @@ | ||
_, exists := modifiersInt[fields[0]] | ||
|
||
if !exists || len(fields[0]) == 1 { | ||
- slog.Error("invalid trigger_label keybind", bind) | ||
+ slog.Error("invalid trigger_label keybind", "bind", bind) | ||
} | ||
} | ||
|
||
--- a/internal/ui/ui.go | ||
+++ b/internal/ui/ui.go | ||
@@ -966,7 +966,7 @@ | ||
|
||
err = watcher.Add(themes) | ||
if err != nil { | ||
- slog.Error("watcher add error", err) | ||
+ slog.Error("watcher add", "error", err) | ||
return | ||
} | ||
|
||
--- a/internal/ui/interactions.go | ||
+++ b/internal/ui/interactions.go | ||
@@ -12,6 +12,7 @@ | ||
"sync" | ||
"syscall" | ||
"time" | ||
+ "strconv" | ||
|
||
"github.com/abenz1267/walker/internal/config" | ||
"github.com/abenz1267/walker/internal/history" | ||
@@ -265,7 +266,8 @@ | ||
uc := gdk.KeyvalToUnicode(gdk.KeyvalToLower(val)) | ||
|
||
if uc != 0 { | ||
- index := slices.Index(appstate.UsedLabels, string(uc)) | ||
+ ucString := strconv.Itoa(int(uc)) | ||
+ index := slices.Index(appstate.UsedLabels, string(ucString)) | ||
|
||
if index != -1 { | ||
keepOpen := modifier == (keepOpenModifier | labelModifier) | ||
@@ -301,8 +303,11 @@ | ||
if !hasFocus { | ||
elements.input.GrabFocus() | ||
char := gdk.KeyvalToUnicode(val) | ||
- elements.input.SetText(elements.input.Text() + string(char)) | ||
- elements.input.SetPosition(-1) | ||
+ | ||
+ if char != 0 { | ||
+ elements.input.SetText(elements.input.Text() + strconv.Itoa(int(char))) | ||
+ elements.input.SetPosition(-1) | ||
+ } | ||
} | ||
|
||
return false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- a/cmd/walker.go | ||
+++ b/cmd/walker.go | ||
@@ -21,7 +21,6 @@ | ||
"github.com/abenz1267/walker/internal/state" | ||
"github.com/abenz1267/walker/internal/ui" | ||
"github.com/abenz1267/walker/internal/util" | ||
- "github.com/adrg/xdg" | ||
"github.com/davidbyttow/govips/v2/vips" | ||
"github.com/diamondburned/gotk4/pkg/gio/v2" | ||
"github.com/diamondburned/gotk4/pkg/glib/v2" | ||
@@ -125,34 +124,6 @@ | ||
} | ||
} | ||
|
||
- if slices.Contains(args, "-A") || slices.Contains(args, "--enableautostart") { | ||
- content := ` | ||
-[Desktop Entry] | ||
-Name=Walker | ||
-Comment=Walker Service | ||
-Exec=walker --gapplication-service | ||
-StartupNotify=false | ||
-Terminal=false | ||
-Type=Application | ||
- ` | ||
- | ||
- err := os.WriteFile(filepath.Join(xdg.ConfigHome, "autostart", "walker-service.desktop"), []byte(strings.TrimSpace(content)), 0644) | ||
- if err != nil { | ||
- log.Panicln(err) | ||
- } | ||
- | ||
- return | ||
- } | ||
- | ||
- if slices.Contains(args, "-D") || slices.Contains(args, "--disableautostart") { | ||
- err := os.Remove(filepath.Join(xdg.ConfigHome, "autostart", "walker-service.desktop")) | ||
- if err != nil { | ||
- log.Panicln(err) | ||
- } | ||
- | ||
- return | ||
- } | ||
- | ||
if isNew { | ||
appName = fmt.Sprintf("%s-%d", appName, time.Now().Unix()) | ||
} | ||
@@ -178,8 +149,6 @@ | ||
app.AddMainOption("forceprint", 'f', glib.OptionFlagNone, glib.OptionArgNone, "forces printing input if no item is selected", "") | ||
app.AddMainOption("bench", 'b', glib.OptionFlagNone, glib.OptionArgNone, "prints nanoseconds for start and displaying in both service and client", "") | ||
app.AddMainOption("active", 'a', glib.OptionFlagNone, glib.OptionArgString, "active item", "") | ||
- app.AddMainOption("enableautostart", 'A', glib.OptionFlagNone, glib.OptionArgNone, "creates a desktop file for autostarting on login", "") | ||
- app.AddMainOption("disableautostart", 'D', glib.OptionFlagNone, glib.OptionArgNone, "removes the autostart desktop file", "") | ||
|
||
app.Connect("activate", ui.Activate(state)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Template file for 'walker' | ||
pkgname=walker | ||
version=0.11.18 | ||
revision=1 | ||
build_style=go | ||
build_helper="gir" | ||
go_import_path=github.com/abenz1267/walker | ||
go_package="./cmd" | ||
hostmakedepends="gobject-introspection pkg-config" | ||
makedepends="gtk4-layer-shell-devel libvips-devel" | ||
short_desc="Multi-Purpose highly extendable application launcher" | ||
maintainer="Xavier Fortier <[email protected]>" | ||
license="MIT" | ||
homepage="https://github.com/abenz1267/walker" | ||
changelog="https://github.com/abenz1267/walker/releases" | ||
distfiles="https://github.com/abenz1267/walker/archive/v${version}.tar.gz" | ||
checksum=e153e6a32370d7edf63dc94567fac10d9fd48e9e3365c8fde267461fe606c7f1 | ||
|
||
do_build() { | ||
go build -o ${GOPATH}/bin/${pkgname} ${go_package} | ||
} | ||
|
||
post_install() { | ||
vlicense LICENSE | ||
} |