hyprpaper integration

This commit is contained in:
andrzej 2024-10-27 01:47:38 +02:00
parent 26d83f7117
commit 7352e9e999
1 changed files with 34 additions and 0 deletions

34
hyprpaper.go Normal file
View File

@ -0,0 +1,34 @@
package main
import (
"errors"
"os/exec"
)
func hyprpaperPreload(path string) error {
var err error
var out []byte
out, err = exec.Command("hyprctl", "hyprpaper", "preload", path).Output()
if err != nil {
return err
}
str := string(out)
if str != "ok\n" {
return errors.New(str)
}
return nil
}
func hyprpaperWallpaper(path string) error {
var err error
var out []byte
out, err = exec.Command("hyprctl", "hyprpaper", "wallpaper", ","+path).Output()
if err != nil {
return err
}
str := string(out)
if str != "ok\n" {
return errors.New(str)
}
return nil
}