backlight and colorscheme updates

This commit is contained in:
Wryn (yage) Wagner 2024-06-26 18:33:14 -06:00
parent 40992361c0
commit c109674cf9
3 changed files with 33 additions and 21 deletions

View File

@ -20,7 +20,7 @@ MAIN() {
case $1 in case $1 in
up ) up )
case $UTIL in case $UTIL in
xbacklight ) xbacklight + 10 ;; xbacklight ) xbacklight -inc 10 ;;
gmux_backlight ) gmux_backlight +100 ;; gmux_backlight ) gmux_backlight +100 ;;
enlighten ) enlighten )
@ -31,7 +31,13 @@ MAIN() {
;; ;;
down ) down )
case $UTIL in case $UTIL in
xbacklight ) xbacklight - 10 ;; xbacklight )
[[ $(xbacklight -get) -le 10 ]] \
&& xbacklight -set 1 \
|| xbacklight -dec 10 \
;
[[ $(xbacklight -get) -le 0 ]] && xbacklight -set 1
;;
gmux_backlight ) gmux_backlight -100 ;; gmux_backlight ) gmux_backlight -100 ;;
enlighten ) enlighten )

View File

@ -5,31 +5,31 @@ _GENERATE_THEME__alacritty() {
echo "# do not edit; generated by scwrypts echo "# do not edit; generated by scwrypts
# theme : $THEME_NAME # theme : $THEME_NAME
[colors.cursor] [colors.cursor]
cursor = '0x$CURSOR' cursor = '0x$(_GET_HEX .alacritty.cursor cursor)'
[colors.primary] [colors.primary]
background = '0x$BACKGROUND' background = '0x$(_GET_HEX .alacritty.background .background)'
foreground = '0x$FOREGROUND' foreground = '0x$(_GET_HEX .alacritty.foreground .foreground)'
[colors.normal] [colors.normal]
black = '0x$BLACK' black = '0x$(_GET_HEX .ansi.gray.black)'
red = '0x$RED' red = '0x$(_GET_HEX .ansi.red.regular)'
green = '0x$GREEN' green = '0x$(_GET_HEX .ansi.green.regular)'
yellow = '0x$YELLOW' yellow = '0x$(_GET_HEX .ansi.yellow.regular)'
blue = '0x$BLUE' blue = '0x$(_GET_HEX .ansi.blue.regular)'
magenta = '0x$MAGENTA' magenta = '0x$(_GET_HEX .ansi.magenta.regular)'
cyan = '0x$CYAN' cyan = '0x$(_GET_HEX .ansi.cyan.regular)'
white = '0x$WHITE' white = '0x$(_GET_HEX .ansi.gray.white)'
[colors.bright] [colors.bright]
black = '0x$BRIGHT_BLACK' black = '0x$(_GET_HEX .ansi.gray.regular)'
red = '0x$BRIGHT_RED' red = '0x$(_GET_HEX .ansi.red.bright)'
green = '0x$BRIGHT_GREEN' green = '0x$(_GET_HEX .ansi.green.bright)'
yellow = '0x$BRIGHT_YELLOW' yellow = '0x$(_GET_HEX .ansi.yellow.bright)'
blue = '0x$BRIGHT_BLUE' blue = '0x$(_GET_HEX .ansi.blue.bright)'
magenta = '0x$BRIGHT_MAGENTA' magenta = '0x$(_GET_HEX .ansi.magenta.bright)'
cyan = '0x$BRIGHT_CYAN' cyan = '0x$(_GET_HEX .ansi.cyan.bright)'
white = '0x$BRIGHT_WHITE' white = '0x$(_GET_HEX .ansi.gray.bright)'
" | sed '$d' > "$_COLORSCHEME_FILE__alacritty_toml" " | sed '$d' > "$_COLORSCHEME_FILE__alacritty_toml"
# backwards yaml compatibility # backwards yaml compatibility

View File

@ -17,6 +17,8 @@ DEFAULT_MATERIAL_REFERENCES="$ACTIVE_THEME_PATH/default.yaml"
DEPENDENCIES+=(sed yq) DEPENDENCIES+=(sed yq)
__CHECK_ENV_VAR DESKTOP__WALLPAPER_PATH --optional
##################################################################### #####################################################################
MAX_LOOKUP_RECURSION=10 MAX_LOOKUP_RECURSION=10
@ -226,6 +228,10 @@ SET_THEME() {
} }
done done
local WALLPAPER="$(find "$DESKTOP__WALLPAPER_PATH" -type f -name $THEME_NAME.\* 2>/dev/null | head -n1)"
[ "$WALLPAPER" ] && command -v feh &>/dev/null \
&& feh --bg-fill "$WALLPAPER"
CHECK_ERRORS --no-usage \ CHECK_ERRORS --no-usage \
&& echo "$THEME_NAME" > "$ACTIVE_THEME_PATH/name.txt" && echo "$THEME_NAME" > "$ACTIVE_THEME_PATH/name.txt"
} }