summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2025-08-14 18:44:42 -0400
committerAndrew Opalach <andrew@akon.city> 2025-08-14 18:44:42 -0400
commitca800f761080289735561154f02eddb21198a876 (patch)
treecb46400e1b2ecd2cb5606f66d920438102782426
parent7198754d5139bf0d865bb4994ff5dba5651bf06d (diff)
downloadmauri-ca800f761080289735561154f02eddb21198a876.tar.gz
mauri-ca800f761080289735561154f02eddb21198a876.tar.bz2
mauri-ca800f761080289735561154f02eddb21198a876.zip
Monitor config dir for changes
Signed-off-by: Andrew Opalach <andrew@akon.city>
-rw-r--r--README.txt70
-rw-r--r--flake.lock6
-rw-r--r--flake.nix2
-rw-r--r--meson.build4
-rw-r--r--taro/daemon.c25
5 files changed, 67 insertions, 40 deletions
diff --git a/README.txt b/README.txt
index 65f5c9c..f47400f 100644
--- a/README.txt
+++ b/README.txt
@@ -11,7 +11,6 @@
* lz4
* stb_image
* glm
-* fftw3 `optional (audio)`
* notcurses `optional (taro)`
* jansson `optional (taro)`
@@ -27,25 +26,31 @@
* wlr-protocols
debian12: +
-{nbsp}common: `sudo apt install git meson cmake pkg-config libegl-dev nlohmann-json3-dev liblz4-dev libstb-dev libglm-dev libjansson-dev libavcodec-dev libavdevice-dev libunistring-dev libdeflate-dev libtinfo-dev` +
-{nbsp}wayland: `sudo apt install libwayland-dev` +
-{nbsp}x11: `sudo apt install libxext-dev libxrandr-dev` +
+{nbsp}common: +
+{nbsp}{nbsp} `sudo apt install git meson cmake pkg-config libegl-dev nlohmann-json3-dev liblz4-dev libstb-dev libglm-dev libjansson-dev libavcodec-dev libavdevice-dev libunistring-dev libdeflate-dev libtinfo-dev` +
+{nbsp}wayland: +
+{nbsp}{nbsp} `sudo apt install libwayland-dev` +
+{nbsp}x11: +
+{nbsp}{nbsp} `sudo apt install libxext-dev libxrandr-dev` +
archlinux: +
-{nbsp}common: `sudo pacman -S --needed git meson cmake libegl nlohmann-json lz4 stb glm jansson ffmpeg libdeflate` +
-{nbsp}wayland: `sudo pacman -S --needed wayland wayland-protocols wlr-protocols` +
-{nbsp}x11: `sudo pacman -S --needed libxext libxrandr` +
+{nbsp}common: +
+{nbsp}{nbsp} `sudo pacman -S --needed git meson cmake libegl nlohmann-json lz4 stb glm jansson ffmpeg libdeflate` +
+{nbsp}wayland: +
+{nbsp}{nbsp} `sudo pacman -S --needed wayland wayland-protocols wlr-protocols` +
+{nbsp}x11: +
+{nbsp}{nbsp} `sudo pacman -S --needed libxext libxrandr` +
=== Compiling
-[source,console]
+[source,sh]
----
-$ meson setup build -Dwindow=(x11|wayland) -Daudio=(enabled|disabled) -Dtaro=(enabled|disabled)
+$ meson setup build -Dwindow=(x11|wayland) -Dtaro=(enabled|disabled)
$ ninja -C build
----
== Installing
=== Local
-[source,console]
+[source,sh]
----
$ sudo ninja -C build install
----
@@ -73,7 +78,7 @@ nixosSystem {
----
== Usage
-[source,console]
+[source,sh]
----
$ mauri --help
----
@@ -89,7 +94,7 @@ Usage: mauri (-p, --package [path_to_scene.pkg]|-d, --directory [path_to_wallpap
-t, --target dump the scene tree into this directory and exit
----
=== Examples
-[source,console]
+[source,sh]
----
# Set as the background of DP-1.
$ ./mauri -p /mnt/hdd/SteamLibrary/steamapps/workshop/content/431960/1761287874/scene.pkg \
@@ -101,7 +106,7 @@ $ ./mauri -p /mnt/hdd/SteamLibrary/steamapps/workshop/content/431960/1582967473/
----
== Taro
-[source,console]
+[source,sh]
----
# Run `tarod` once before anything to generate the necessary files for your setup.
$ tarod
@@ -111,16 +116,19 @@ $ taro
----
=== Keybinds
-*←↓↑→/hjkl* - Move Selection, Edit Value +
-*Enter/Space* - Confirm Selection +
-*Tab* - Cycle Between Grid and Info/Options +
-*m* - Goto Monitor Selection +
-*f/b* - Next/Previous Page +
-*n/N* - Set Next/Previous Wallpaper in Grid +
-*r* - Remove Current Wallpaper +
+[cols="19%,50%",width="44%"]
+|================
+|←↓↑→/hjkl |Move Selection, Edit Value
+|Enter/Space|Confirm Selection
+|Tab |Cycle Between Grid and Info/Options
+|m |Goto Monitor Selection
+|f/b |Next/Previous Page
+|n/N |Set Next/Previous Wallpaper in Grid
+|r |Remove Current Wallpaper
+|================
=== Config
-[source,console]
+[source,sh]
----
$ cat $HOME/.config/taro/config.json
----
@@ -148,17 +156,17 @@ exec tarod
----
== Known Issues
-- Some gifs are incorrectly positioned.
-- Some objects are incorrectly scaled and/or positioned.
-- Some shaders fail to compile for various reasons.
+* Some gifs are incorrectly positioned.
+* Some objects are incorrectly scaled and/or positioned.
+* Some shaders fail to compile for various reasons.
=== Not Implemented
-- Particles
-- Mouse Paralax
-- Camera Shake
-- Animations/Puppet Warp
-- Javascript Scripting
-- 3d Models
-- And much more\...
+* Particles
+* Mouse Paralax
+* Camera Shake
+* Animations/Puppet Warp
+* Javascript Scripting
+* 3d Models
+* And much more\...
// vim: set syntax=asciidoc:
diff --git a/flake.lock b/flake.lock
index a63de06..f2d2da2 100644
--- a/flake.lock
+++ b/flake.lock
@@ -2,11 +2,11 @@
"nodes": {
"nixpkgs": {
"locked": {
- "lastModified": 1751792365,
- "narHash": "sha256-J1kI6oAj25IG4EdVlg2hQz8NZTBNYvIS0l4wpr9KcUo=",
+ "lastModified": 1755027561,
+ "narHash": "sha256-IVft239Bc8p8Dtvf7UAACMG5P3ZV+3/aO28gXpGtMXI=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "1fd8bada0b6117e6c7eb54aad5813023eed37ccb",
+ "rev": "005433b926e16227259a1843015b5b2b7f7d1fc3",
"type": "github"
},
"original": {
diff --git a/flake.nix b/flake.nix
index 09cfd12..8c53776 100644
--- a/flake.nix
+++ b/flake.nix
@@ -127,9 +127,11 @@
];
shellHook = ''
export SHELL="${pkgs.bashInteractive}/bin/bash"
+ export __EGL_VENDOR_LIBRARY_DIRS="${pkgs.mesa}/share/glvnd/egl_vendor.d:$__EGL_VENDOR_LIBRARY_DIRS"
export NIX_BUILD_SHELL=$SHELL
export NIX_SHELL="mauri"
export PS1="(\$NIX_SHELL)"$PS1
+ echo -en '\033]2;'nix-shell: $NIX_SHELL'\007'
'';
};
diff --git a/meson.build b/meson.build
index 791cd82..c6b0ae6 100644
--- a/meson.build
+++ b/meson.build
@@ -60,6 +60,7 @@ endif
mauri_deps += [janus, json, lz4, s3tc, glm]
if get_option('audio').enabled()
+ error('Audio support currently unimplemented.')
fftw3 = dependency('fftw3')
mauri_deps += [fftw3]
mauri_cpp_args += ['-DMAURI_HAVE_AUDIO']
@@ -69,7 +70,8 @@ if is_windows and meson.is_cross_build()
mauri_link_args += ['-static', '-static-libgcc', '-static-libstdc++', '-municode', '-mwindows']
endif
-executable('mauri', mauri_src, dependencies: mauri_deps, cpp_args: mauri_cpp_args, link_args: mauri_link_args, install: true)
+executable('mauri', mauri_src, dependencies: mauri_deps,
+ cpp_args: mauri_cpp_args, link_args: mauri_link_args, install: true)
if get_option('taro').enabled()
subdir('taro')
diff --git a/taro/daemon.c b/taro/daemon.c
index 895ce53..bd993bc 100644
--- a/taro/daemon.c
+++ b/taro/daemon.c
@@ -54,6 +54,7 @@ struct daemon {
} ipc;
#endif
struct config conf;
+ struct nn_fs_event conf_dir_event;
struct nn_fs_event conf_event;
};
@@ -271,7 +272,8 @@ static void create_monitor(struct daemon *dmon, str *dir, struct stl_monitor *os
run_wallpaper(dmon, monitor);
monitor->self_event_skip = false;
- nn_fs_event_init(&monitor->selection_event, &monitor->selection_path, NNWT_CLOSE_WRITE, selection_fs_event_callback, monitor);
+ nn_fs_event_init(&monitor->selection_event, &monitor->selection_path,
+ NNWT_FS_CLOSE_WRITE, selection_fs_event_callback, monitor);
nn_fs_event_start(&monitor->selection_event, &monitor->dmon->loop);
}
@@ -305,12 +307,19 @@ static void output_discovered_callback(void *userdata, struct stl_monitor *os_mo
}
// https://vi.stackexchange.com/questions/25030/vim-not-firing-inotify-events-when-writing-file
+static void conf_dir_fs_event_callback(void *userdata, struct inotify_event *event)
+{
+ struct daemon *dmon = (struct daemon *)userdata;
+ if (al_strncmp(event->name, "config.json", event->len) == 0) {
+ nn_fs_event_stop(&dmon->conf_event);
+ nn_fs_event_start(&dmon->conf_event, &dmon->loop);
+ }
+}
+
static void conf_fs_event_callback(void *userdata, struct inotify_event *event)
{
struct daemon *dmon = (struct daemon *)userdata;
(void)event;
- nn_fs_event_stop(&dmon->conf_event);
- nn_fs_event_start(&dmon->conf_event, &dmon->loop);
if (!dmon->conf.errored) close_config(&dmon->conf);
if (open_config(&dmon->conf, false) == CONFIG_LOADED && dmon->conf.valid) {
log_info("config successfully reloaded");
@@ -473,6 +482,7 @@ static void quit_signal_callback(void *userdata)
al_array_foreach(dmon->monitors, i, monitor) {
nn_fs_event_stop(&monitor->selection_event);
}
+ nn_fs_event_stop(&dmon->conf_dir_event);
nn_fs_event_stop(&dmon->conf_event);
#ifdef USE_SWAYIPC
if (!dmon->ipc_errored) nn_poll_stop(&dmon->ipc_poll);
@@ -506,7 +516,7 @@ s32 main()
switch (open_config(&dmon.conf, true)) {
case CONFIG_CREATED:
- log_info("config generated in $HOME%s, go fill it out", CONFIG_PATH);
+ log_info("config generated at $HOME%s/config.json, go fill it out", CONFIG_PATH);
break;
case CONFIG_LOADED:
break;
@@ -575,13 +585,18 @@ s32 main()
}
#endif
- nn_fs_event_init(&dmon.conf_event, &dmon.conf.config_path, NNWT_CLOSE_WRITE, conf_fs_event_callback, &dmon);
+ nn_fs_event_init(&dmon.conf_dir_event, &dmon.conf.config_dir,
+ NNWT_FS_CREATE, conf_dir_fs_event_callback, &dmon);
+ nn_fs_event_start(&dmon.conf_dir_event, &dmon.loop);
+ nn_fs_event_init(&dmon.conf_event, &dmon.conf.config_path,
+ NNWT_FS_CLOSE_WRITE, conf_fs_event_callback, &dmon);
nn_fs_event_start(&dmon.conf_event, &dmon.loop);
nn_event_loop_run(&dmon.loop);
exit_status = EXIT_SUCCESS;
+ nn_fs_event_free(&dmon.conf_dir_event);
nn_fs_event_free(&dmon.conf_event);
#ifdef USE_SWAYIPC