3 Commits

Author SHA1 Message Date
Piotr Miller
6ca8e6a175 Merge pull request #24 from nwg-piotr/fix_nodisplay
Fix nodisplay, fix running in terminal
2021-09-07 02:51:26 +02:00
piotr
f12be46583 fix #23 2021-09-07 02:47:17 +02:00
piotr
9d50258042 don't skip hidden entries: fixes #22 added in #19 2021-09-07 02:07:29 +02:00
4 changed files with 7 additions and 3 deletions

View File

@@ -20,4 +20,5 @@ uninstall:
rm /usr/bin/nwg-drawer rm /usr/bin/nwg-drawer
run: run:
go run *.go go build -o bin/nwg-drawer *.go
bin/nwg-drawer

Binary file not shown.

View File

@@ -101,7 +101,9 @@ var (
func defaultStringIfBlank(s, fallback string) string { func defaultStringIfBlank(s, fallback string) string {
s = strings.TrimSpace(s) s = strings.TrimSpace(s)
if s == "" { // os.Getenv("TERM") returns "linux" instead of empty string, if program has been started
// from a key binding defined in the config file. See #23.
if s == "" || s == "linux" {
return fallback return fallback
} }
return s return s

View File

@@ -366,7 +366,8 @@ func parseDesktopFiles(desktopFiles []string) string {
if entry.NoDisplay { if entry.NoDisplay {
hidden++ hidden++
continue // We still need hidden entries, so `continue` is disallowed here
// Fixes introduced in #19
} }
id2entry[entry.DesktopID] = entry id2entry[entry.DesktopID] = entry