about summary refs log tree commit diff stats
path: root/modules/by-name/ri/river/init_base.sh
blob: b92f59e0d8a379ce5720f71ee89cdef0079bd464 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/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>.

# NOTE: Keep this in sync with the file from `river-start` <2025-02-03>
RIVER_LOG_FILE="$HOME/.local/share/river/log"

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.