Skip to content

Commit

Permalink
Merge pull request #24 from nwg-piotr/fix_nodisplay
Browse files Browse the repository at this point in the history
Fix nodisplay, fix running in terminal
  • Loading branch information
nwg-piotr authored Sep 7, 2021
2 parents 1be8e43 + f12be46 commit 6ca8e6a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ uninstall:
rm /usr/bin/nwg-drawer

run:
go run *.go
go build -o bin/nwg-drawer *.go
bin/nwg-drawer
Binary file modified bin/nwg-drawer
Binary file not shown.
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ var (

func defaultStringIfBlank(s, fallback string) string {
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 s
Expand Down
3 changes: 2 additions & 1 deletion tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,8 @@ func parseDesktopFiles(desktopFiles []string) string {

if entry.NoDisplay {
hidden++
continue
// We still need hidden entries, so `continue` is disallowed here
// Fixes introduced in #19
}

id2entry[entry.DesktopID] = entry
Expand Down

0 comments on commit 6ca8e6a

Please sign in to comment.