state man. API && modularisation

- adds functions
  - util_create_state
  - util_read_state
  - util_write_state
  - util_delete_state
for state management API. see docs/about_states.md for details.

- moves functions from _reve.sh to _reve_utils.sh to prevent circular
imports.
This commit is contained in:
2024-10-09 20:01:30 +03:00
parent dd663f47a0
commit 245dc99887
10 changed files with 262 additions and 41 deletions

22
chores/mode/swww_slideshow.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/bash
# reve desktop environment framework
# Yigid BALABAN <fyb@fybx.dev> 2024
# chore script
# type mode
# name swww-based wallpaper slideshow
# desc reruns utility/swww_slideshow when mode changes
# vars swwwss.dark, swwwss.light, swwwss.folder
# reload no
# shellcheck source=../../_reve.sh
source "$(reve where)/_reve"
desktop_mode=$(util_read_config base.desktop_mode)
if [ "$desktop_mode" == "dark" ]; then
util_write_config swwwss.folder "$(util_read_config swwwss.dark)"
else
util_write_config swwwss.folder "$(util_read_config swwwss.light)"
fi