diff --git a/Configs/.config/hyde/hyde.conf b/Configs/.config/hyde/hyde.conf index 817c599bfd..e2a4a1089f 100644 --- a/Configs/.config/hyde/hyde.conf +++ b/Configs/.config/hyde/hyde.conf @@ -87,3 +87,31 @@ rofiScale=9 #// available styles - 1 (default) , 2 wlogoutStyle=1 +# waybar + +# // waybar_cava_bar - bar for waybar cava - default "▁▂▃▄▅▆▇█" +# waybar_cava_bar="░▒▓█" +# waybar_cava_bar="▖▗▘▙▚▛▜▝▞▟" +# waybar_cava_bar="▂▃▄▅▆▇█" +# waybar_cava_bar="▕▏▎▍▌▋▊▉" +# waybar_cava_bar="⣀⣄⣤⣦⣶⣷⣿" +# waybar_cava_bar="⠁⠂⠄⡀⢀⠠⠐⠈" +# waybar_cava_bar="⠋⠙⠹⢸⣰⣤⣦⣶" +# waybar_cava_bar="🌑🌒🌓🌔🌕🌖🌗🌘" +# waybar_cava_bar="🌕🌖🌗🌘🌒🌓🌔🌕" +# waybar_cava_bar="★☆★☆★☆★☆" +# waybar_cava_bar="⣾⣽⣻⢿⡿⣟⣯⣷" +# waybar_cava_bar="ᗧᗣᗤᗥᗦᗧᗣᗤᗥᗦ" + +# // waybar_cava_width - width for waybar cava - default 8 +# waybar_cava_width=10 + +# // waybar_cava_range - range for waybar cava - default 7 +# waybar_cava_range=7 + +# // waybar_cava_stbmode - standby mode for waybar cava - default 0 +# 0: clean - totally hides the module +# 1: blank - makes module expand as spaces +# 2: full - occupies the module with full bar +# 3: low - makes the module display the lowest set bar +# waybar_cava_stbmode=0 \ No newline at end of file diff --git a/Configs/.config/waybar/modules/cava.jsonc b/Configs/.config/waybar/modules/cava.jsonc index 46d64e32c8..d5d22777ce 100644 --- a/Configs/.config/waybar/modules/cava.jsonc +++ b/Configs/.config/waybar/modules/cava.jsonc @@ -1,4 +1,6 @@ "custom/cava": { + "format": "{}", "exec": "waybar_cava.sh", - "format": "{}" -}, + "restart-interval": 1, + "hide-empty": true +}, \ No newline at end of file diff --git a/Configs/.local/share/bin/logoutlaunch.sh b/Configs/.local/share/bin/logoutlaunch.sh index 4b4e6f2727..a7cbf32525 100755 --- a/Configs/.local/share/bin/logoutlaunch.sh +++ b/Configs/.local/share/bin/logoutlaunch.sh @@ -55,6 +55,16 @@ export fntSize=$(( y_mon * 2 / 100 )) #// detect wallpaper brightness [ -f "${cacheDir}/wall.dcol" ] && source "${cacheDir}/wall.dcol" +# Theme mode: detects the color-scheme set in hypr.theme and falls back if nothing is parsed. +if [ "${enableWallDcol}" -eq 0 ]; then + colorScheme="$({ grep -q "^[[:space:]]*\$COLOR[-_]SCHEME\s*=" "${hydeThemeDir}/hypr.theme" && grep "^[[:space:]]*\$COLOR[-_]SCHEME\s*=" "${hydeThemeDir}/hypr.theme" | cut -d '=' -f2 | sed 's/^[[:space:]]*//;s/[[:space:]]*$//' ;} || + grep 'gsettings set org.gnome.desktop.interface color-scheme' "${hydeThemeDir}/hypr.theme" | awk -F "'" '{print $((NF - 1))}')" + colorScheme=${colorScheme:-$(gsettings get org.gnome.desktop.interface color-scheme)} + # should be declared explicitly so we can easily debug + grep -q "dark" <<< "${colorScheme}" && dcol_mode="dark" + grep -q "light" <<< "${colorScheme}" && dcol_mode="light" +[ -f "${hydeThemeDir}/theme.dcol" ] && source "${hydeThemeDir}/theme.dcol" +fi [ "${dcol_mode}" == "dark" ] && export BtnCol="white" || export BtnCol="black" diff --git a/Configs/.local/share/bin/swwwallbash.sh b/Configs/.local/share/bin/swwwallbash.sh index c50dc704b0..9cc516a975 100755 --- a/Configs/.local/share/bin/swwwallbash.sh +++ b/Configs/.local/share/bin/swwwallbash.sh @@ -1,6 +1,5 @@ #!/usr/bin/env bash - #// set variables export scrDir="$(dirname "$(realpath "$0")")" @@ -14,7 +13,6 @@ if [ -z "${wallbashImg}" ] || [ ! -f "${wallbashImg}" ] ; then echo "Error: Input wallpaper not found!" exit 1 fi - wallbashOut="${dcolDir}/$(set_hash "${wallbashImg}").dcol" if [ ! -f "${wallbashOut}" ] ; then @@ -23,6 +21,11 @@ fi set -a source "${wallbashOut}" +if [ -f "${hydeThemeDir}/theme.dcol" ] && [ "${enableWallDcol}" -eq 0 ] ; then + source "${hydeThemeDir}/theme.dcol" + echo "[theme] Overriding dominant colors from \"${hydeTheme}\"" + echo "[note] Remove \"${hydeThemeDir}/theme.dcol\" to use wallpaper dominant colors" +fi [ "${dcol_mode}" == "dark" ] && dcol_invt="light" || dcol_invt="dark" set +a @@ -263,5 +266,4 @@ if [ "${enableWallDcol}" -eq 0 ]; then grep -q "light" <<< "${colorScheme}" && enableWallDcol=3 fi -find "${wallbashDir}/Wall-Ways" -type f -name "*.dcol" | parallel fn_wallbash {} - +find "${wallbashDir}/Wall-Ways" -type f -name "*.dcol" | parallel fn_wallbash {} \ No newline at end of file diff --git a/Configs/.local/share/bin/waybar_cava.sh b/Configs/.local/share/bin/waybar_cava.sh index 44199440fc..784e426bd3 100755 --- a/Configs/.local/share/bin/waybar_cava.sh +++ b/Configs/.local/share/bin/waybar_cava.sh @@ -1,35 +1,117 @@ #!/bin/env bash #----- Optimized bars animation without much CPU usage increase -------- -bar="▁▂▃▄▅▆▇█" +#----- Optimized bars animation without much CPU usage increase pt2 -------- + +scrDir=$(dirname "$(realpath "$0")") +# shellcheck source=/dev/null +. "${scrDir}/globalcontrol.sh" +usage() { + cat < Specify the characters to use for the bar animation (default: ▁▂▃▄▅▆▇█). + --width Specify the width of the bar. + --range Specify the range of the bar. + --help Display this help message and exit. + --restart Restart the waybar_cava. + --mode Specify the standby mode for waybar cava (default: 0). +HELP + exit 1 +} + +# Parse command line arguments using getopt +if ! ARGS=$(getopt -o "hr" -l "help,bar:,width:,range:,restart,mode:" -n "$0" -- "$@"); then + usage +fi + +eval set -- "$ARGS" +while true; do + case "$1" in + --help | -h) + usage + ;; + --bar) + waybar_cava_bar="$2" + shift 2 + ;; + --width) + waybar_cava_width="$2" + shift 2 + ;; + --range) + waybar_cava_range="$2" + shift 2 + ;; + --restart) # restart the waybar_cava + pkill -f "cava -p /tmp/bar_cava_config" + exit 0 + ;; + --mode) + waybar_cava_stbmode="$2" + shift 2 + ;; + --) + shift + break + ;; + *) + usage + ;; + esac +done + +bar="${waybar_cava_bar:-▁▂▃▄▅▆▇█}" dict="s/;//g" # Calculate the length of the bar outside the loop bar_length=${#bar} +bar_width=${waybar_cava_width:-${bar_length}} +bar_range=${waybar_cava_range:-$((bar_length - 1))} +standby_mode=${waybar_cava_stbmode:-0} # 0:clean, 1:blank, 2:full,3:last +if [ "${standby_mode}" -le 0 ]; then unset standby_bar; fi # Create dictionary to replace char with bar -for ((i = 0; i < bar_length; i++)); do - dict+=";s/$i/${bar:$i:1}/g" +i=0 +while [ $i -lt "${bar_length}" ] || [ $i -lt "${bar_width}" ]; do + if [ $i -lt "${bar_length}" ]; then + dict="$dict;s/$i/${bar:$i:1}/g" + fi + if [ $i -lt "${bar_width}" ] && [ "${standby_mode}" -gt 0 ]; then + if [ "${standby_mode}" -eq 2 ]; then + standby_bar="$standby_bar${bar:$i:1}" + elif [ "${standby_mode}" -eq 1 ]; then + standby_bar="$standby_bar " + fi + fi + ((i++)) done # Create cava config config_file="/tmp/bar_cava_config" cat >"$config_file" < do not exist in ${Theme_Dir}/Configs/" fi done <<< "$config" +if [ -f "${Fav_Theme_Dir}/theme.dcol" ];then +print_prompt -n "[ok] " "found theme.dcol to override wallpaper dominant colors" +restore_list+="Y|Y|\${HOME}/.config/hyde/themes/${Fav_Theme}|theme.dcol|hyprland\n" +fi readonly restore_list # Get Wallpapers