From 6e50396b4d2a27e98c40d7cf01fc719a3ce1d718 Mon Sep 17 00:00:00 2001
From: end-4 <97237370+end-4@users.noreply.github.com>
Date: Thu, 3 Apr 2025 21:48:25 +0200
Subject: [PATCH] ai: code blocks: nicer themes
---
.../assets/themes/sourceviewtheme-light.xml | 4 +-
.config/ags/assets/themes/sourceviewtheme.xml | 4 +-
.config/ags/modules/.miscutils/md2pango.js | 6 +-
.../scripts/color_generation/applycolor.sh | 27 +++-
.../templates/ags/sourceviewtheme-light.xml | 95 ++++++++++++++
.../scripts/templates/ags/sourceviewtheme.xml | 121 ++++++++++++++++++
6 files changed, 248 insertions(+), 9 deletions(-)
create mode 100644 .config/ags/scripts/templates/ags/sourceviewtheme-light.xml
create mode 100644 .config/ags/scripts/templates/ags/sourceviewtheme.xml
diff --git a/.config/ags/assets/themes/sourceviewtheme-light.xml b/.config/ags/assets/themes/sourceviewtheme-light.xml
index bf39bfb58..c880404dc 100644
--- a/.config/ags/assets/themes/sourceviewtheme-light.xml
+++ b/.config/ags/assets/themes/sourceviewtheme-light.xml
@@ -3,13 +3,13 @@
end_4
<_description>Catppuccin port but very random
-
+
-
+
diff --git a/.config/ags/assets/themes/sourceviewtheme.xml b/.config/ags/assets/themes/sourceviewtheme.xml
index 248d7afac..ef76a7414 100644
--- a/.config/ags/assets/themes/sourceviewtheme.xml
+++ b/.config/ags/assets/themes/sourceviewtheme.xml
@@ -27,13 +27,13 @@
Leo Iannacone
<_description>Based on SublimeText Monokai Extended - Generated with tm2gtksw2
-
+
-
+
diff --git a/.config/ags/modules/.miscutils/md2pango.js b/.config/ags/modules/.miscutils/md2pango.js
index f688fc003..19999bd3a 100644
--- a/.config/ags/modules/.miscutils/md2pango.js
+++ b/.config/ags/modules/.miscutils/md2pango.js
@@ -68,8 +68,10 @@ export const markdownTest = `## Inline formatting
## Code block
\`\`\`cpp
#include
-const std::string GREETING="UwU";
-int main() { std::cout << GREETING; }
+const std::string GREETING = "UwU";
+int main(int argc, char* argv[]) {
+ std::cout << GREETING;
+}
\`\`\`
## LaTeX
\`\`\`latex
diff --git a/.config/ags/scripts/color_generation/applycolor.sh b/.config/ags/scripts/color_generation/applycolor.sh
index 6c371f40c..9bf56d392 100755
--- a/.config/ags/scripts/color_generation/applycolor.sh
+++ b/.config/ags/scripts/color_generation/applycolor.sh
@@ -48,7 +48,7 @@ get_light_dark() {
}
apply_fuzzel() {
- # Check if scripts/templates/fuzzel/fuzzel.ini exists
+ # Check if template exists
if [ ! -f "scripts/templates/fuzzel/fuzzel.ini" ]; then
echo "Template file not found for Fuzzel. Skipping that."
return
@@ -88,7 +88,7 @@ apply_term() {
}
apply_hyprland() {
- # Check if scripts/templates/hypr/hyprland/colors.conf exists
+ # Check if template exists
if [ ! -f "scripts/templates/hypr/hyprland/colors.conf" ]; then
echo "Template file not found for Hyprland colors. Skipping that."
return
@@ -105,7 +105,7 @@ apply_hyprland() {
}
apply_hyprlock() {
- # Check if scripts/templates/hypr/hyprlock.conf exists
+ # Check if template exists
if [ ! -f "scripts/templates/hypr/hyprlock.conf" ]; then
echo "Template file not found for hyprlock. Skipping that."
return
@@ -122,6 +122,26 @@ apply_hyprlock() {
cp "$CACHE_DIR"/user/generated/hypr/hyprlock.conf "$XDG_CONFIG_HOME"/hypr/hyprlock.conf
}
+apply_ags_sourceview() {
+ # Check if template file exists
+ if [ ! -f "scripts/templates/ags/sourceviewtheme.xml" ]; then
+ echo "Template file not found for ags sourceview. Skipping that."
+ return
+ fi
+ # Copy template
+ mkdir -p "$CACHE_DIR"/user/generated/ags
+ cp "scripts/templates/ags/sourceviewtheme.xml" "$CACHE_DIR"/user/generated/ags/sourceviewtheme.xml
+ cp "scripts/templates/ags/sourceviewtheme-light.xml" "$CACHE_DIR"/user/generated/ags/sourceviewtheme-light.xml
+ # Apply colors
+ for i in "${!colorlist[@]}"; do
+ sed -i "s/{{ ${colorlist[$i]} }}/#${colorvalues[$i]#\#}/g" "$CACHE_DIR"/user/generated/ags/sourceviewtheme.xml
+ sed -i "s/{{ ${colorlist[$i]} }}/#${colorvalues[$i]#\#}/g" "$CACHE_DIR"/user/generated/ags/sourceviewtheme-light.xml
+ done
+
+ cp "$CACHE_DIR"/user/generated/ags/sourceviewtheme.xml "$XDG_CONFIG_HOME"/ags/assets/themes/sourceviewtheme.xml
+ cp "$CACHE_DIR"/user/generated/ags/sourceviewtheme-light.xml "$XDG_CONFIG_HOME"/ags/assets/themes/sourceviewtheme-light.xml
+}
+
apply_lightdark() {
lightdark=$(get_light_dark)
if [ "$lightdark" = "light" ]; then
@@ -180,6 +200,7 @@ colorlist=($colornames) # Array of color names
colorvalues=($colorstrings) # Array of color values
apply_ags &
+apply_ags_sourceview &
apply_hyprland &
apply_hyprlock &
apply_lightdark &
diff --git a/.config/ags/scripts/templates/ags/sourceviewtheme-light.xml b/.config/ags/scripts/templates/ags/sourceviewtheme-light.xml
new file mode 100644
index 000000000..eca04bf3b
--- /dev/null
+++ b/.config/ags/scripts/templates/ags/sourceviewtheme-light.xml
@@ -0,0 +1,95 @@
+
+
+ end_4
+ <_description>Catppuccin port but very random
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.config/ags/scripts/templates/ags/sourceviewtheme.xml b/.config/ags/scripts/templates/ags/sourceviewtheme.xml
new file mode 100644
index 000000000..e2e5fe9a4
--- /dev/null
+++ b/.config/ags/scripts/templates/ags/sourceviewtheme.xml
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+ Leo Iannacone
+ <_description>Based on SublimeText Monokai Extended - Generated with tm2gtksw2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+