From cb888d0a905179ea25e5b860b1a1a31f8de64e13 Mon Sep 17 00:00:00 2001 From: Inqiyad Sabr Date: Thu, 16 Oct 2025 21:56:07 +0600 Subject: renamed to sbc --- README.md | 2 +- brl | 33 --------------------------------- sbc | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 34 deletions(-) delete mode 100755 brl create mode 100755 sbc diff --git a/README.md b/README.md index 88f7124..c78008e 100644 --- a/README.md +++ b/README.md @@ -9,4 +9,4 @@ To install this you just need to put this script in one of your preferred `${PAT (or maybe I'll just add a `./install` file) # Usage -See `brl -h` for more information. (Or check Line23 in the brl script) +See `brl -h` for more information. diff --git a/brl b/brl deleted file mode 100755 index 9e0cb69..0000000 --- a/brl +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh -# ==================================== -# Program : brl (brightness control) -# License : The Unlicense -# Author : sabr@ariamath.xyz -# Version : 0.0.1 -# ==================================== -# Honestly, brightnessctl is bloat. -# ==================================== -device="$(find /sys/class/backlight/*)" -fmax="$device/max_brightness" -fnow="$device/brightness" -m="$(cat "$fmax")" -c="$(cat "$fnow")" -case "$1" in - "-s") printf "%d" $(($2 * m / 100)) > "$fnow";; - "-i") printf "%d" $((c + $2 * m / 100)) > "$fnow";; - "-d") printf "%d" $((c - $2 * m / 100)) > "$fnow";; - "-v") - printf "brl v0.0.1\n" - printf "A simple brightness control program\n" - ;; - "-h") - printf "brl [options] [value]\n" - printf " -s set brightness %%\n" - printf " -i increase brightness %%\n" - printf " -d decrease brightness %%\n" - ;; - *) - printf "Current brightness: %d%% (%d)\n"\ - $((c * 100 / m)) "$c" - ;; -esac diff --git a/sbc b/sbc new file mode 100755 index 0000000..e269c16 --- /dev/null +++ b/sbc @@ -0,0 +1,34 @@ +#!/bin/sh +# ==================================== +# Program : brl (brightness control) +# License : The Unlicense +# Author : sabr@ariamath.xyz +# Version : 0.0.1 +# ==================================== +# Honestly, brightnessctl is bloat. +# ==================================== +device="$(find /sys/class/backlight/*)" +fmax="${device}/max_brightness" +fnow="${device}/brightness" +m="$(cat "${fmax}")" +c="$(cat "${fnow}")" +v=$2 +case "$1" in + "-s") printf "%d" $((v * m / 100)) > "${fnow}";; + "-i") printf "%d" $((c + v * m / 100)) > "${fnow}";; + "-d") printf "%d" $((c - v * m / 100)) > "${fnow}";; + "-v") + printf "brl v0.0.1\n" + printf "A simple brightness control program\n" + ;; + "-h") + printf "brl [options] [value]\n" + printf " -s set brightness %%\n" + printf " -i increase brightness %%\n" + printf " -d decrease brightness %%\n" + ;; + *) + printf "Current brightness: %d%% (%d)\n"\ + $((c * 100 / m)) "$c" + ;; +esac -- cgit v1.2.3