#!/usr/bin/env sh # nixos-config - My current NixOS configuration # # Copyright (C) 2025 Benedikt Peetz # 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 . die() { echo "ERROR: $1" exit 1 } help() { cat <"$BACKLIGHT/brightness" } for arg in "$@"; do case "$arg" in "--help" | "-h") help exit 0 ;; esac done [ "$(id --user)" != 0 ] && die "This script requires root (as it needs to write into '$BACKLIGHT/brightness')" case "$1" in "set") shift 1 if [ -n "$1" ]; then value="$1" else die "No value specified" fi brightness "$value" ;; *) die "The command '$1' does not exist! See '--help' for a list" ;; esac # vim: ft=sh