From 0078bd29488cf2ddf4c913b08697830fb990162c Mon Sep 17 00:00:00 2001 From: Breizh Date: Sat, 16 Jan 2021 00:20:54 +0100 Subject: [PATCH] Initation du script de notif --- .local/bin/rgb-notif | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 .local/bin/rgb-notif diff --git a/.local/bin/rgb-notif b/.local/bin/rgb-notif new file mode 100755 index 0000000..5fbd9c2 --- /dev/null +++ b/.local/bin/rgb-notif @@ -0,0 +1,38 @@ +#!/bin/bash + +declare -A colors=( + [r]=0 # Red + [o]=10 # Orange + [y]=30 # Yellow + [h]=70 # cHartreuse + [g]=120 # Green + [s]=135 # Spring + [c]=165 # Cyan + [a]=210 # Azure + [b]=240 # Blue + [v]=270 # Violet + [m]=320 # Magenta + [p]=350 # Pink +) + +declare -A colors_name=( + [r]="red" + [o]="orange" + [y]="yellow" + [h]="chartreuse" + [g]="green" + [s]="spring" + [c]="cyan" + [a]="azure" + [b]="blue" + [v]="violet" + [m]="magenta" + [p]="pink" +) + +lumi=20 +mode=${3:-Direct} # Direct, Pulse, Flashing, 'Color Cycle' +logo="$(hsv2rgb "${colors[${1:-r}]}" 100 "$lumi")" +fans="$(hsv2rgb "${colors[${2:-r}]}" 100 "$lumi")" + +openrgb -d 0 -m "$mode" -c 000000,000000,"$logo","$logo","$fans",000000 &>/dev/null