Compare commits

..

No commits in common. "bba3a43bb83064cb47a6d04192bdff0c42bb45af" and "b317ef0339c4175c88e5488f8295951c85e80c90" have entirely different histories.

2 changed files with 10 additions and 18 deletions

View File

@ -30,11 +30,6 @@ func makeDefaultImageFilters() ImageFilters {
}
}
func hexToHSL(string) [3]int {
return [3]int{1, 1, 1}
}
func pickRandomImage(dir string) (string, error) {
dir = config.ImagesDir + dir

View File

@ -1,7 +1,7 @@
package main
import (
// "bufio"
"bufio"
"fmt"
"log"
"os/exec"
@ -14,15 +14,14 @@ func slideshow(ch <-chan string) {
//set a flat background color based on config defaults
fillCmd := exec.Command("swaybg", "-c", "#232136")
// stdout, _ := fillCmd.StdoutPipe()
// scanner := bufio.NewScanner(stdout)
// out := make(chan string)
// go func() {
// for scanner.Scan() {
// fmt.Println("scanner: ", scanner.Text())
// out <- scanner.Text()
// }
// }()
stdout, _ := fillCmd.StdoutPipe()
scanner := bufio.NewScanner(stdout)
out := make(chan string)
go func() {
for scanner.Scan() {
out <- scanner.Text()
}
}()
ready := make(chan bool)
go func() {
@ -30,8 +29,7 @@ func slideshow(ch <-chan string) {
if err != nil {
fmt.Println("could not set background color", err)
}
//NOTE: this is *very* hacky, but it is difficult to know when swaybg has initiated
time.Sleep(100 * time.Millisecond)
<-out
ready <- true
fmt.Println("bg color set!")
fillCmd.Wait()
@ -40,7 +38,6 @@ func slideshow(ch <-chan string) {
var cmd *exec.Cmd
go func() {
for {
<-ready
newCmd := setRandomWallpaper(dir)
if cmd != nil {
err := cmd.Process.Kill()