mirror of
https://github.com/nwg-piotr/nwg-drawer.git
synced 2024-08-16 17:20:22 +03:00
hide and delete invalid pinned items #74
This commit is contained in:
parent
3fe6d71234
commit
ebdbe71ac6
10
go.mod
10
go.mod
@ -1,6 +1,6 @@
|
||||
module github.com/nwg-piotr/nwg-drawer
|
||||
|
||||
go 1.16
|
||||
go 1.18
|
||||
|
||||
require (
|
||||
github.com/allan-simon/go-singleinstance v0.0.0-20210120080615-d0997106ab37
|
||||
@ -10,3 +10,11 @@ require (
|
||||
github.com/joshuarubin/go-sway v0.0.4
|
||||
github.com/sirupsen/logrus v1.8.1
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/joshuarubin/lifecycle v1.0.0 // indirect
|
||||
go.uber.org/atomic v1.3.2 // indirect
|
||||
go.uber.org/multierr v1.1.0 // indirect
|
||||
golang.org/x/sync v0.0.0-20190412183630-56d357773e84 // indirect
|
||||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c // indirect
|
||||
)
|
||||
|
2
main.go
2
main.go
@ -21,7 +21,7 @@ import (
|
||||
"github.com/gotk3/gotk3/gtk"
|
||||
)
|
||||
|
||||
const version = "0.3.3"
|
||||
const version = "0.3.4"
|
||||
|
||||
var (
|
||||
appDirs []string
|
||||
|
3
tools.go
3
tools.go
@ -534,7 +534,8 @@ func savePinned() {
|
||||
}(f)
|
||||
|
||||
for _, line := range pinned {
|
||||
if line != "" {
|
||||
//skip invalid lines
|
||||
if line != "" && id2entry[line].DesktopID != "" {
|
||||
_, err := f.WriteString(line + "\n")
|
||||
|
||||
if err != nil {
|
||||
|
@ -32,6 +32,10 @@ func setUpPinnedFlowBox() *gtk.FlowBox {
|
||||
if len(pinned) > 0 {
|
||||
for _, desktopID := range pinned {
|
||||
entry := id2entry[desktopID]
|
||||
if entry.DesktopID == "" {
|
||||
log.Debugf("Pinned item doesn't seem to exist: %s", desktopID)
|
||||
continue
|
||||
}
|
||||
|
||||
btn, _ := gtk.ButtonNew()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user