scripts: add unnecessary descriptions
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
# Description:
|
||||
# Helper script to apply color schemes.
|
||||
# - Parse and validate parameters.
|
||||
# - Provide useful aliases and functions.
|
||||
# Should be sourced, not executed directly.
|
||||
|
||||
[ "$(basename "$0")" = "apply-color-helper" ] && {
|
||||
echo "This script is meant to be sourced, not executed directly."
|
||||
exit 1
|
||||
@@ -10,6 +16,17 @@ colorName="$2"
|
||||
[ -z "$3" ] && exit 1
|
||||
colorHex="$3"
|
||||
|
||||
# remove leading '#' if present
|
||||
if [[ $colorHex == \#* ]]; then
|
||||
colorHex="${colorHex#\#}"
|
||||
fi
|
||||
|
||||
# check if hex
|
||||
if ! [[ $colorHex =~ ^[0-9A-Fa-f]{6}$ ]]; then
|
||||
log_error "Invalid color hex: $colorHex"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
function log_error {
|
||||
printf "\033[0;31mError:\033[0m $1\n" >&2
|
||||
}
|
||||
@@ -29,18 +46,6 @@ function color_ansi {
|
||||
printf "\033[38;2;%d;%d;%dm" $r $g $b
|
||||
}
|
||||
|
||||
|
||||
# remove leading '#' if present
|
||||
if [[ $colorHex == \#* ]]; then
|
||||
colorHex="${colorHex#\#}"
|
||||
fi
|
||||
|
||||
# check if hex
|
||||
if ! [[ $colorHex =~ ^[0-9A-Fa-f]{6}$ ]]; then
|
||||
log_error "Invalid color hex: $colorHex"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
function log_success {
|
||||
log_info "Applied palette \033[1;34m${palette}\033[0m with primary color $(color_ansi $colorHex)${colorName} (#${colorHex})\033[0m to \033[1;34m$1\033[0m"
|
||||
}
|
||||
@@ -1,5 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Description:
|
||||
# Select which GPU to use for rendering for Hyprland and Niri.
|
||||
|
||||
# AMD -> Nvidia -> Intel
|
||||
prefer_order=(amd nvidia intel)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user