vscode theming with Material Code extension (#2146)

This commit is contained in:
end-4
2025-10-29 22:06:53 +01:00
parent 961d5e7721
commit ee1fbf72cc
2 changed files with 17 additions and 11 deletions
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
COLOR_FILE_PATH="${XDG_STATE_HOME:-$HOME/.local/state}/quickshell/user/generated/color.txt"
CODE_SETTINGS_PATH="${XDG_CONFIG_HOME:-$HOME/.config}/Code/User/settings.json"
new_color=$(cat "$COLOR_FILE_PATH")
# Try to update the key if it exists
if grep -q '"material-code.primaryColor"' "$CODE_SETTINGS_PATH"; then
sed -i -E \
"s/(\"material-code.primaryColor\"\s*:\s*\")[^\"]*(\")/\1${new_color}\2/" \
"$CODE_SETTINGS_PATH"
else # If the key is not already there, add it
sed -i '$ s/}/,\n "material-code.primaryColor": "'${new_color}'"\n}/' "$CODE_SETTINGS_PATH"
sed -i '$ s/,\n,/,/' "$CODE_SETTINGS_PATH"
fi
@@ -55,18 +55,8 @@ post_process() {
local screen_height="$2"
local wallpaper_path="$3"
handle_kde_material_you_colors &
# Determine the largest region on the wallpaper that's sufficiently un-busy to put widgets in
# if [ ! -f "$MATUGEN_DIR/scripts/least_busy_region.py" ]; then
# echo "Error: least_busy_region.py script not found in $MATUGEN_DIR/scripts/"
# else
# "$MATUGEN_DIR/scripts/least_busy_region.py" \
# --screen-width "$screen_width" --screen-height "$screen_height" \
# --width 300 --height 200 \
# "$wallpaper_path" > "$STATE_DIR"/user/generated/wallpaper/least_busy_region.json
# fi
"$SCRIPT_DIR/code/material-code-set-color.sh" &
}
check_and_prompt_upscale() {