From b16bf691353f59e2ed454990d915c870efc3a6b8 Mon Sep 17 00:00:00 2001 From: Breizh Date: Sat, 16 Jan 2021 00:27:10 +0100 Subject: [PATCH] Update rgb-ocntrol --- .local/bin/rgb-control | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.local/bin/rgb-control b/.local/bin/rgb-control index 5fbd9c2..8044d41 100755 --- a/.local/bin/rgb-control +++ b/.local/bin/rgb-control @@ -30,9 +30,19 @@ declare -A colors_name=( [p]="pink" ) +if [[ "$1" == "off" ]] +then + openrgb -d 0 -c 000000 &>/dev/null + exit +elif [[ "$1" == "cycle" || "$#" -eq 0 ]] +then + openrgb -d 0 -m "Color Cycle" &>/dev/null + exit +fi + lumi=20 -mode=${3:-Direct} # Direct, Pulse, Flashing, 'Color Cycle' -logo="$(hsv2rgb "${colors[${1:-r}]}" 100 "$lumi")" -fans="$(hsv2rgb "${colors[${2:-r}]}" 100 "$lumi")" +mode=${3:-Direct} # Direct, Pulse, Flashing +logo="$(hsv2rgb "${colors[${1}]}" 100 "$lumi")" +fans="$(hsv2rgb "${colors[${2:-$1}]}" 100 "$lumi")" openrgb -d 0 -m "$mode" -c 000000,000000,"$logo","$logo","$fans",000000 &>/dev/null