improve notify

This commit is contained in:
Daylin Morgan 2024-10-20 23:05:00 -05:00
parent f5b54f962f
commit 8fa101f0e2
Signed by: daylin
GPG key ID: 950D13E9719334AD
3 changed files with 8 additions and 3 deletions

View file

@ -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]

View file

@ -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

View file

@ -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
<!-- generated with <3 by daylinmorgan/todo -->