diff --git a/src/lib.nim b/src/lib.nim index 3da952d..2e42f36 100644 --- a/src/lib.nim +++ b/src/lib.nim @@ -1,11 +1,13 @@ import std/[ - os, osproc, streams, strformat, strutils, tables + os, osproc, streams, strutils, tables ] export tables import yaml proc notify*(message: string) = - discard execCmd fmt"notify-send --app-name=hyprman --transient '{message}'" + var cmd = "notify-send --app-name=hyprman --transient hyprman " + cmd.add message + discard execCmd(cmd) type Icons = Table[string, string] diff --git a/src/swww.nim b/src/swww.nim index 3b4e307..6984128 100644 --- a/src/swww.nim +++ b/src/swww.nim @@ -20,6 +20,8 @@ proc setImg(path: string, output: string) = execCmd(fmt"swww img --transition-type fade --outputs {output} {path}") if code != 0: notify "swww failed" +const oneMinute = 1000 * 60 + proc runSwww*() = if config.wallpapers == "": quit(0) if not dirExists(config.wallpapers): @@ -29,5 +31,5 @@ proc runSwww*() = while true: for monitor in swwwMonitors(): setImg(gallery.sample(), monitor) - sleep 1000 * 60 * 30 + sleep 5 * oneMinute diff --git a/todo.md b/todo.md index 7167720..26daa38 100644 --- a/todo.md +++ b/todo.md @@ -4,6 +4,7 @@ - [ ] switch to usu once parser is stable again - [x] make swww powered wallpaper cycler - [ ] add support for monitor orientation? +- [ ] make `hyprman swww` support monitor changes by watching hyprland IPC