fix #1: add cache of latest command to not run wallpaper update when it's already up to date
This commit is contained in:
parent
f8b846018b
commit
3e3f4445a4
4 changed files with 20 additions and 9 deletions
7
main.go
7
main.go
|
|
@ -16,18 +16,21 @@ func main() {
|
|||
}
|
||||
|
||||
config, err := LoadConfiguration(os.Args[1])
|
||||
|
||||
if err != nil {
|
||||
log.Printf("[ERROR] %s", err.Error())
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
UpdateWallapers(config)
|
||||
var lastCommand string
|
||||
|
||||
UpdateWallapers(config, &lastCommand)
|
||||
|
||||
for recv.Next() {
|
||||
event := recv.Event().(*i3.WorkspaceEvent)
|
||||
|
||||
if event.Change == "focus" {
|
||||
UpdateWallapers(config)
|
||||
UpdateWallapers(config, &lastCommand)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue