Compare commits
No commits in common. "bba3a43bb83064cb47a6d04192bdff0c42bb45af" and "b317ef0339c4175c88e5488f8295951c85e80c90" have entirely different histories.
bba3a43bb8
...
b317ef0339
5
image.go
5
image.go
|
@ -30,11 +30,6 @@ func makeDefaultImageFilters() ImageFilters {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func hexToHSL(string) [3]int {
|
|
||||||
|
|
||||||
return [3]int{1, 1, 1}
|
|
||||||
}
|
|
||||||
|
|
||||||
func pickRandomImage(dir string) (string, error) {
|
func pickRandomImage(dir string) (string, error) {
|
||||||
|
|
||||||
dir = config.ImagesDir + dir
|
dir = config.ImagesDir + dir
|
||||||
|
|
23
slideshow.go
23
slideshow.go
|
@ -1,7 +1,7 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
// "bufio"
|
"bufio"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
@ -14,15 +14,14 @@ func slideshow(ch <-chan string) {
|
||||||
|
|
||||||
//set a flat background color based on config defaults
|
//set a flat background color based on config defaults
|
||||||
fillCmd := exec.Command("swaybg", "-c", "#232136")
|
fillCmd := exec.Command("swaybg", "-c", "#232136")
|
||||||
// stdout, _ := fillCmd.StdoutPipe()
|
stdout, _ := fillCmd.StdoutPipe()
|
||||||
// scanner := bufio.NewScanner(stdout)
|
scanner := bufio.NewScanner(stdout)
|
||||||
// out := make(chan string)
|
out := make(chan string)
|
||||||
// go func() {
|
go func() {
|
||||||
// for scanner.Scan() {
|
for scanner.Scan() {
|
||||||
// fmt.Println("scanner: ", scanner.Text())
|
out <- scanner.Text()
|
||||||
// out <- scanner.Text()
|
}
|
||||||
// }
|
}()
|
||||||
// }()
|
|
||||||
|
|
||||||
ready := make(chan bool)
|
ready := make(chan bool)
|
||||||
go func() {
|
go func() {
|
||||||
|
@ -30,8 +29,7 @@ func slideshow(ch <-chan string) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("could not set background color", err)
|
fmt.Println("could not set background color", err)
|
||||||
}
|
}
|
||||||
//NOTE: this is *very* hacky, but it is difficult to know when swaybg has initiated
|
<-out
|
||||||
time.Sleep(100 * time.Millisecond)
|
|
||||||
ready <- true
|
ready <- true
|
||||||
fmt.Println("bg color set!")
|
fmt.Println("bg color set!")
|
||||||
fillCmd.Wait()
|
fillCmd.Wait()
|
||||||
|
@ -40,7 +38,6 @@ func slideshow(ch <-chan string) {
|
||||||
var cmd *exec.Cmd
|
var cmd *exec.Cmd
|
||||||
go func() {
|
go func() {
|
||||||
for {
|
for {
|
||||||
<-ready
|
|
||||||
newCmd := setRandomWallpaper(dir)
|
newCmd := setRandomWallpaper(dir)
|
||||||
if cmd != nil {
|
if cmd != nil {
|
||||||
err := cmd.Process.Kill()
|
err := cmd.Process.Kill()
|
||||||
|
|
Loading…
Reference in New Issue