Compare commits
No commits in common. "795e6941f83daef55ac957a7136a45abf050fb78" and "1561acdb5f9aece73c15368fd896c403e00bffeb" have entirely different histories.
795e6941f8
...
1561acdb5f
5 changed files with 6 additions and 64 deletions
|
@ -17,7 +17,6 @@ type
|
||||||
id*: int
|
id*: int
|
||||||
Monitor = object
|
Monitor = object
|
||||||
activeWorkspace*: ActiveWorkspace
|
activeWorkspace*: ActiveWorkspace
|
||||||
name: string
|
|
||||||
id*: int
|
id*: int
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,8 @@
|
||||||
## hyprman, the hyprland companion
|
## hyprman, the hyprland companion
|
||||||
|
|
||||||
import std/[os, osproc, strformat]
|
import std/[osproc, strformat]
|
||||||
import hwylterm/cligen, cligen
|
import hwylterm/cligen, cligen
|
||||||
import ./[
|
import ./[mako,hyprland, lib]# state]
|
||||||
hyprland,
|
|
||||||
lib,
|
|
||||||
mako,
|
|
||||||
swww
|
|
||||||
]
|
|
||||||
|
|
||||||
hwylCli(clCfg)
|
hwylCli(clCfg)
|
||||||
|
|
||||||
|
@ -23,10 +18,6 @@ proc watch() =
|
||||||
## watch hyprland events for eww class changes
|
## watch hyprland events for eww class changes
|
||||||
watchHyprland()
|
watchHyprland()
|
||||||
|
|
||||||
proc swww() =
|
|
||||||
## set swww to cycle through wallpapers
|
|
||||||
runSwww()
|
|
||||||
|
|
||||||
when isMainModule:
|
when isMainModule:
|
||||||
const
|
const
|
||||||
config = //{"config": "path/to/config"}
|
config = //{"config": "path/to/config"}
|
||||||
|
@ -36,19 +27,7 @@ when isMainModule:
|
||||||
"reverse": "swap notification order"
|
"reverse": "swap notification order"
|
||||||
}
|
}
|
||||||
dispatchMulti(
|
dispatchMulti(
|
||||||
[makoCmd, usage = clCfg.use, help = makoHelp, cmdName = "mako",],
|
[makoCmd, cmdName = "mako", usage = clCfg.use, help = makoHelp],
|
||||||
[start , usage = clCfg.use],
|
[start, usage = clCfg.use],
|
||||||
[watch , usage = clCfg.use],
|
[watch, usage = clCfg.use]
|
||||||
[swww , usage = clCfg.use],
|
|
||||||
)
|
)
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
#[
|
|
||||||
DIR=./woodblock-cherry-blossom/
|
|
||||||
while : ; do
|
|
||||||
for file in $(find $DIR -type f -name '*.png');do
|
|
||||||
swww img "$file" --transition-type wave
|
|
||||||
sleep 3600
|
|
||||||
done
|
|
||||||
done
|
|
||||||
]#
|
|
||||||
|
|
|
@ -10,7 +10,6 @@ proc notify*(message: string) =
|
||||||
type
|
type
|
||||||
Icons = Table[string, string]
|
Icons = Table[string, string]
|
||||||
Config = object # config vs icons?
|
Config = object # config vs icons?
|
||||||
wallpapers* {.defaultVal: ""}: string
|
|
||||||
classes*: Icons
|
classes*: Icons
|
||||||
`no-client`*: string
|
`no-client`*: string
|
||||||
`default-icon`*: string
|
`default-icon`*: string
|
||||||
|
@ -20,7 +19,6 @@ proc loadConfig*(): Config =
|
||||||
if fileExists(configPath):
|
if fileExists(configPath):
|
||||||
var s = newFileStream(configPath)
|
var s = newFileStream(configPath)
|
||||||
load(s, result)
|
load(s, result)
|
||||||
result.wallpapers = expandTilde(result.wallpapers)
|
|
||||||
|
|
||||||
func pickIcon*(
|
func pickIcon*(
|
||||||
c: Config,
|
c: Config,
|
||||||
|
|
33
src/swww.nim
33
src/swww.nim
|
@ -1,33 +0,0 @@
|
||||||
import std/[os, osproc, strformat, strutils, random]
|
|
||||||
import ./lib
|
|
||||||
|
|
||||||
proc loadGallery(): seq[string] =
|
|
||||||
for path in walkDirRec(
|
|
||||||
config.wallpapers, yieldFilter = {pcFile, pcLinkToFile}
|
|
||||||
):
|
|
||||||
let (_,_, ext) = splitFile(path)
|
|
||||||
if ext in [".png", ".jpeg"]:
|
|
||||||
result.add path
|
|
||||||
|
|
||||||
proc swwwMonitors(): seq[string] =
|
|
||||||
let (output, code) = execCmdEx("swww query")
|
|
||||||
if code != 0: notify "swww failed"
|
|
||||||
for line in output.strip().splitLines():
|
|
||||||
result.add line.split(':', 1)[0]
|
|
||||||
|
|
||||||
proc setImg(path: string, output: string) =
|
|
||||||
let code =
|
|
||||||
execCmd(fmt"swww img --transition-type fade --outputs {output} {path}")
|
|
||||||
if code != 0: notify "swww failed"
|
|
||||||
|
|
||||||
proc runSwww*() =
|
|
||||||
if config.wallpapers == "": quit(0)
|
|
||||||
if not dirExists(config.wallpapers):
|
|
||||||
notify(fmt"{config.wallpapers} directory does not exist")
|
|
||||||
quit(1)
|
|
||||||
let gallery = loadGallery()
|
|
||||||
while true:
|
|
||||||
for monitor in swwwMonitors():
|
|
||||||
setImg(gallery.sample(), monitor)
|
|
||||||
sleep 1000 * 60 * 30
|
|
||||||
|
|
3
todo.md
3
todo.md
|
@ -2,8 +2,7 @@
|
||||||
|
|
||||||
- [ ] include in class the 'other' active monitor?
|
- [ ] include in class the 'other' active monitor?
|
||||||
- [ ] switch to usu once parser is stable again
|
- [ ] switch to usu once parser is stable again
|
||||||
- [x] make swww powered wallpaper cycler
|
- [ ] make swww powered wallpaper cycler
|
||||||
- [ ] add support for monitor orientation?
|
|
||||||
|
|
||||||
<!-- generated with <3 by daylinmorgan/todo -->
|
<!-- generated with <3 by daylinmorgan/todo -->
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue