about summary refs log tree commit diff stats
path: root/modules/by-name/ri/river/init_base.sh
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xmodules/by-name/ri/river/init_base.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/modules/by-name/ri/river/init_base.sh b/modules/by-name/ri/river/init_base.sh
new file mode 100755
index 00000000..edd7827f
--- /dev/null
+++ b/modules/by-name/ri/river/init_base.sh
@@ -0,0 +1,33 @@
+#!/usr/bin/env sh
+
+# nixos-config - My current NixOS configuration
+#
+# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+# SPDX-License-Identifier: GPL-3.0-or-later
+#
+# This file is part of my nixos-config.
+#
+# You should have received a copy of the License along with this program.
+# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
+
+RIVER_LOG_FILE="$HOME/.cache/river/init-log"
+
+echo >"$RIVER_LOG_FILE"
+
+err_fail() {
+    if ! "$@"; then
+        output=""
+        for arg in "$@"; do
+            if [ -z "$output" ]; then
+                output="'$arg'"
+            else
+                output="$output '$arg'"
+            fi
+        done
+        printf "%s failed!\n" "$output" >>"$RIVER_LOG_FILE"
+    fi
+}
+exec 1>>"$RIVER_LOG_FILE"
+exec 2>>"$RIVER_LOG_FILE"
+
+# Start of the generated stuff.