base configs

This commit is contained in:
nx-smul
2025-01-17 18:08:55 +06:00
parent 4a173bceb9
commit 272e677bfb
49 changed files with 403 additions and 22461 deletions
+105 -121
View File
@@ -10,7 +10,7 @@ STATE_DIR="$XDG_STATE_HOME/ags"
term_alpha=100 #Set this to < 100 make all your terminals transparent
# sleep 0 # idk i wanted some delay or colors dont get applied properly
if [ ! -d "$CACHE_DIR"/user/generated ]; then
mkdir -p "$CACHE_DIR"/user/generated
mkdir -p "$CACHE_DIR"/user/generated
fi
cd "$CONFIG_DIR" || exit
@@ -19,9 +19,9 @@ colorstrings=''
colorlist=()
colorvalues=()
wallpath=$(swww query | head -1 | awk -F 'image: ' '{print $2}')
wallpath_png="$CACHE_DIR/user/generated/hypr/lockscreen.png"
convert "$wallpath" "$wallpath_png"
# wallpath=$(swww query | head -1 | awk -F 'image: ' '{print $2}')
# wallpath_png="$CACHE_DIR/user/generated/hypr/lockscreen.png"
# convert "$wallpath" "$wallpath_png"
# wallpath_png=$(echo "$wallpath_png" | sed 's/\//\\\//g')
# wallpath_png=$(sed 's/\//\\\\\//g' <<< "$wallpath_png")
@@ -38,161 +38,145 @@ transparentize() {
}
get_light_dark() {
lightdark=""
if [ ! -f "$STATE_DIR/user/colormode.txt" ]; then
echo "" >"$STATE_DIR/user/colormode.txt"
else
lightdark=$(sed -n '1p' "$STATE_DIR/user/colormode.txt")
fi
echo "$lightdark"
lightdark=""
if [ ! -f "$STATE_DIR/user/colormode.txt" ]; then
echo "" > "$STATE_DIR/user/colormode.txt"
else
lightdark=$(sed -n '1p' "$STATE_DIR/user/colormode.txt")
fi
echo "$lightdark"
}
apply_fuzzel() {
# Check if scripts/templates/fuzzel/fuzzel.ini exists
if [ ! -f "scripts/templates/fuzzel/fuzzel.ini" ]; then
echo "Template file not found for Fuzzel. Skipping that."
return
fi
# Copy template
mkdir -p "$CACHE_DIR"/user/generated/fuzzel
cp "scripts/templates/fuzzel/fuzzel.ini" "$CACHE_DIR"/user/generated/fuzzel/fuzzel.ini
# Apply colors
for i in "${!colorlist[@]}"; do
sed -i "s/{{ ${colorlist[$i]} }}/${colorvalues[$i]#\#}/g" "$CACHE_DIR"/user/generated/fuzzel/fuzzel.ini
done
# Check if scripts/templates/fuzzel/fuzzel.ini exists
if [ ! -f "scripts/templates/fuzzel/fuzzel.ini" ]; then
echo "Template file not found for Fuzzel. Skipping that."
return
fi
# Copy template
mkdir -p "$CACHE_DIR"/user/generated/fuzzel
cp "scripts/templates/fuzzel/fuzzel.ini" "$CACHE_DIR"/user/generated/fuzzel/fuzzel.ini
# Apply colors
for i in "${!colorlist[@]}"; do
sed -i "s/{{ ${colorlist[$i]} }}/${colorvalues[$i]#\#}/g" "$CACHE_DIR"/user/generated/fuzzel/fuzzel.ini
done
cp "$CACHE_DIR"/user/generated/fuzzel/fuzzel.ini "$XDG_CONFIG_HOME"/fuzzel/fuzzel.ini
cp "$CACHE_DIR"/user/generated/fuzzel/fuzzel.ini "$XDG_CONFIG_HOME"/fuzzel/fuzzel.ini
}
apply_term() {
# Check if terminal escape sequence template exists
if [ ! -f "scripts/templates/terminal/sequences.txt" ]; then
echo "Template file not found for Terminal. Skipping that."
return
fi
# Copy template
mkdir -p "$CACHE_DIR"/user/generated/terminal
cp "scripts/templates/terminal/sequences.txt" "$CACHE_DIR"/user/generated/terminal/sequences.txt
# Apply colors
for i in "${!colorlist[@]}"; do
sed -i "s/${colorlist[$i]} #/${colorvalues[$i]#\#}/g" "$CACHE_DIR"/user/generated/terminal/sequences.txt
done
sed -i "s/\$alpha/$term_alpha/g" "$CACHE_DIR/user/generated/terminal/sequences.txt"
for file in /dev/pts/*; do
if [[ $file =~ ^/dev/pts/[0-9]+$ ]]; then
cat "$CACHE_DIR"/user/generated/terminal/sequences.txt >"$file"
# Check if terminal escape sequence template exists
if [ ! -f "scripts/templates/terminal/sequences.txt" ]; then
echo "Template file not found for Terminal. Skipping that."
return
fi
done
# Copy template
mkdir -p "$CACHE_DIR"/user/generated/terminal
cp "scripts/templates/terminal/sequences.txt" "$CACHE_DIR"/user/generated/terminal/sequences.txt
# Apply colors
for i in "${!colorlist[@]}"; do
sed -i "s/${colorlist[$i]} #/${colorvalues[$i]#\#}/g" "$CACHE_DIR"/user/generated/terminal/sequences.txt
done
sed -i "s/\$alpha/$term_alpha/g" "$CACHE_DIR/user/generated/terminal/sequences.txt"
for file in /dev/pts/*; do
if [[ $file =~ ^/dev/pts/[0-9]+$ ]]; then
cat "$CACHE_DIR"/user/generated/terminal/sequences.txt > "$file"
fi
done
}
apply_hyprland() {
# Check if scripts/templates/hypr/hyprland/colors.conf exists
if [ ! -f "scripts/templates/hypr/hyprland/colors.conf" ]; then
echo "Template file not found for Hyprland colors. Skipping that."
return
fi
# Copy template
mkdir -p "$CACHE_DIR"/user/generated/hypr/hyprland
cp "scripts/templates/hypr/hyprland/colors.conf" "$CACHE_DIR"/user/generated/hypr/hyprland/colors.conf
# Apply colors
for i in "${!colorlist[@]}"; do
sed -i "s/{{ ${colorlist[$i]} }}/${colorvalues[$i]#\#}/g" "$CACHE_DIR"/user/generated/hypr/hyprland/colors.conf
done
# Check if scripts/templates/hypr/hyprland/colors.conf exists
if [ ! -f "scripts/templates/hypr/hyprland/colors.conf" ]; then
echo "Template file not found for Hyprland colors. Skipping that."
return
fi
# Copy template
mkdir -p "$CACHE_DIR"/user/generated/hypr/hyprland
cp "scripts/templates/hypr/hyprland/colors.conf" "$CACHE_DIR"/user/generated/hypr/hyprland/colors.conf
# Apply colors
for i in "${!colorlist[@]}"; do
sed -i "s/{{ ${colorlist[$i]} }}/${colorvalues[$i]#\#}/g" "$CACHE_DIR"/user/generated/hypr/hyprland/colors.conf
done
cp "$CACHE_DIR"/user/generated/hypr/hyprland/colors.conf "$XDG_CONFIG_HOME"/hypr/hyprland/colors.conf
cp "$CACHE_DIR"/user/generated/hypr/hyprland/colors.conf "$XDG_CONFIG_HOME"/hypr/hyprland/colors.conf
}
apply_hyprlock() {
# Check if scripts/templates/hypr/hyprlock.conf exists
if [ ! -f "scripts/templates/hypr/hyprlock.conf" ]; then
echo "Template file not found for hyprlock. Skipping that."
return
fi
# Copy template
mkdir -p "$CACHE_DIR"/user/generated/hypr/
cp "scripts/templates/hypr/hyprlock.conf" "$CACHE_DIR"/user/generated/hypr/hyprlock.conf
# Apply colors
sed -i "s|path = \$path|path = $wallpath_png|" "$CACHE_DIR"/user/generated/hypr/hyprlock.conf
# Check if scripts/templates/hypr/hyprlock.conf exists
if [ ! -f "scripts/templates/hypr/hyprlock.conf" ]; then
echo "Template file not found for hyprlock. Skipping that."
return
fi
# Copy template
mkdir -p "$CACHE_DIR"/user/generated/hypr/
cp "scripts/templates/hypr/hyprlock.conf" "$CACHE_DIR"/user/generated/hypr/hyprlock.conf
# Apply colors
# sed -i "s/{{ SWWW_WALL }}/${wallpath_png}/g" "$CACHE_DIR"/user/generated/hypr/hyprlock.conf
for i in "${!colorlist[@]}"; do
sed -i "s/{{ ${colorlist[$i]} }}/${colorvalues[$i]#\#}/g" "$CACHE_DIR"/user/generated/hypr/hyprlock.conf
done
for i in "${!colorlist[@]}"; do
sed -i "s/{{ ${colorlist[$i]} }}/${colorvalues[$i]#\#}/g" "$CACHE_DIR"/user/generated/hypr/hyprlock.conf
done
cp "$CACHE_DIR"/user/generated/hypr/hyprlock.conf "$XDG_CONFIG_HOME"/hypr/hyprlock.conf
cp "$CACHE_DIR"/user/generated/hypr/hyprlock.conf "$XDG_CONFIG_HOME"/hypr/hyprlock.conf
}
apply_lightdark() {
lightdark=$(get_light_dark)
if [ "$lightdark" = "light" ]; then
gsettings set org.gnome.desktop.interface color-scheme 'prefer-light'
else
gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
fi
lightdark=$(get_light_dark)
if [ "$lightdark" = "light" ]; then
gsettings set org.gnome.desktop.interface color-scheme 'prefer-light'
else
gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
fi
}
apply_gtk() { # Using gradience-cli
usegradience=$(sed -n '4p' "$STATE_DIR/user/colormode.txt")
if [[ "$usegradience" = "nogradience" ]]; then
rm "$XDG_CONFIG_HOME/gtk-3.0/gtk.css"
rm "$XDG_CONFIG_HOME/gtk-4.0/gtk.css"
return
fi
usegradience=$(sed -n '4p' "$STATE_DIR/user/colormode.txt")
if [[ "$usegradience" = "nogradience" ]]; then
rm "$XDG_CONFIG_HOME/gtk-3.0/gtk.css"
rm "$XDG_CONFIG_HOME/gtk-4.0/gtk.css"
return
fi
# Copy template
mkdir -p "$CACHE_DIR"/user/generated/gradience
cp "scripts/templates/gradience/preset.json" "$CACHE_DIR"/user/generated/gradience/preset.json
# Copy template
mkdir -p "$CACHE_DIR"/user/generated/gradience
cp "scripts/templates/gradience/preset.json" "$CACHE_DIR"/user/generated/gradience/preset.json
# Apply colors
for i in "${!colorlist[@]}"; do
sed -i "s/{{ ${colorlist[$i]} }}/${colorvalues[$i]}/g" "$CACHE_DIR"/user/generated/gradience/preset.json
done
# Apply colors
for i in "${!colorlist[@]}"; do
sed -i "s/{{ ${colorlist[$i]} }}/${colorvalues[$i]}/g" "$CACHE_DIR"/user/generated/gradience/preset.json
done
mkdir -p "$XDG_CONFIG_HOME/presets" # create gradience presets folder
gradience-cli apply -p "$CACHE_DIR"/user/generated/gradience/preset.json --gtk both
mkdir -p "$XDG_CONFIG_HOME/presets" # create gradience presets folder
gradience-cli apply -p "$CACHE_DIR"/user/generated/gradience/preset.json --gtk both
# And set GTK theme manually as Gradience defaults to light adw-gtk3
# (which is unreadable when broken when you use dark mode)
lightdark=$(get_light_dark)
if [ "$lightdark" = "light" ]; then
gsettings set org.gnome.desktop.interface gtk-theme 'adw-gtk3'
else
gsettings set org.gnome.desktop.interface gtk-theme adw-gtk3-dark
fi
# And set GTK theme manually as Gradience defaults to light adw-gtk3
# (which is unreadable when broken when you use dark mode)
lightdark=$(get_light_dark)
if [ "$lightdark" = "light" ]; then
gsettings set org.gnome.desktop.interface gtk-theme 'adw-gtk3'
else
gsettings set org.gnome.desktop.interface gtk-theme adw-gtk3-dark
fi
}
apply_ags() {
ags run-js "handleStyles(false);"
ags run-js 'openColorScheme.value = true; Utils.timeout(2000, () => openColorScheme.value = false);'
ags run-js "handleStyles(false);"
ags run-js 'openColorScheme.value = true; Utils.timeout(2000, () => openColorScheme.value = false);'
}
apply_pywal() {
# generate pywal colors
mkdir -p "$CACHE_DIR"/user/generated/pywal
python "$CONFIG_DIR/scripts/color_generation/gen_materialwal.py" # generate wal colors
wal -n -f "$CACHE_DIR/user/generated/pywal/pywal.json" --cols16 # apply pywal
# apply other scripts
sh "$XDG_CONFIG_HOME/pywal/gen-pywal"
}
apply_qt() {
sh "$CONFIG_DIR/scripts/kvantum/materialQT.sh" # generate kvantum theme
python "$CONFIG_DIR/scripts/kvantum/changeAwdColors.py" # apply config colors
}
colornames=$(cat "$STATE_DIR"/scss/_material.scss | cut -d: -f1)
colorstrings=$(cat "$STATE_DIR"/scss/_material.scss | cut -d: -f2 | cut -d ' ' -f2 | cut -d ";" -f1)
colornames=$(cat $STATE_DIR/scss/_material.scss | cut -d: -f1)
colorstrings=$(cat $STATE_DIR/scss/_material.scss | cut -d: -f2 | cut -d ' ' -f2 | cut -d ";" -f1)
IFS=$'\n'
colorlist=($colornames) # Array of color names
colorvalues=($colorstrings) # Array of color values
colorlist=( $colornames ) # Array of color names
colorvalues=( $colorstrings ) # Array of color values
apply_ags &
apply_hyprland &
apply_hyprlock &
apply_lightdark &
apply_gtk &
apply_qt &
apply_pywal &
apply_fuzzel &
apply_term &
@@ -1,56 +0,0 @@
import json
import re
import os
import argparse
def parse_scss_file(file_path):
scss_colors = {}
with open(file_path, 'r') as file:
for line in file:
match = re.match(r'\$(\w+):\s*(#[0-9A-Fa-f]{6});', line)
if match:
scss_colors[match.group(1)] = match.group(2)
return scss_colors
def scss_to_pywal(scss_file, output_file='pywal_colors.json'):
scss_colors = parse_scss_file(scss_file)
pywal_colors = {
"special": {
"background": scss_colors["background"],
"foreground": scss_colors["onBackground"],
"cursor": scss_colors["onBackground"]
},
"colors": {
"color0": scss_colors["term0"],
"color1": scss_colors["term1"],
"color2": scss_colors["term2"],
"color3": scss_colors["term3"],
"color4": scss_colors["term4"],
"color5": scss_colors["term5"],
"color6": scss_colors["term6"],
"color7": scss_colors["term7"],
"color8": scss_colors["term8"],
"color9": scss_colors["term9"],
"color10": scss_colors["term10"],
"color11": scss_colors["term11"],
"color12": scss_colors["term12"],
"color13": scss_colors["term13"],
"color14": scss_colors["term14"],
"color15": scss_colors["term15"]
}
}
# Write the Pywal colors to a JSON file
with open(output_file, 'w') as file:
json.dump(pywal_colors, file, indent=4)
print(f"Pywal colors have been saved to {output_file}")
if __name__ == "__main__":
# Hardcode the file paths
scss_file = os.path.expanduser('~/.local/state/ags/scss/_material.scss')
output_file = os.path.expanduser('~/.cache/ags/user/generated/pywal/pywal.json')
scss_to_pywal(scss_file, output_file)
@@ -4,36 +4,36 @@ XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
CONFIG_DIR="$XDG_CONFIG_HOME/ags"
switch() {
imgpath=$1
read scale screenx screeny screensizey < <(hyprctl monitors -j | jq '.[] | select(.focused) | .scale, .x, .y, .height' | xargs)
cursorposx=$(hyprctl cursorpos -j | jq '.x' 2>/dev/null) || cursorposx=960
cursorposx=$(bc <<<"scale=0; ($cursorposx - $screenx) * $scale / 1")
cursorposy=$(hyprctl cursorpos -j | jq '.y' 2>/dev/null) || cursorposy=540
cursorposy=$(bc <<<"scale=0; ($cursorposy - $screeny) * $scale / 1")
cursorposy_inverted=$((screensizey - cursorposy))
imgpath=$1
read scale screenx screeny screensizey < <(hyprctl monitors -j | jq '.[] | select(.focused) | .scale, .x, .y, .height' | xargs)
cursorposx=$(hyprctl cursorpos -j | jq '.x' 2>/dev/null) || cursorposx=960
cursorposx=$(bc <<< "scale=0; ($cursorposx - $screenx) * $scale / 1")
cursorposy=$(hyprctl cursorpos -j | jq '.y' 2>/dev/null) || cursorposy=540
cursorposy=$(bc <<< "scale=0; ($cursorposy - $screeny) * $scale / 1")
cursorposy_inverted=$((screensizey - cursorposy))
if [ "$imgpath" == '' ]; then
echo 'Aborted'
exit 0
fi
if [ "$imgpath" == '' ]; then
echo 'Aborted'
exit 0
fi
# ags run-js "wallpaper.set('')"
# sleep 0.1 && ags run-js "wallpaper.set('${imgpath}')" &
swww img "$imgpath" --transition-step 100 --transition-fps 120 \
--transition-type grow --transition-angle 30 --transition-duration 1 \
--transition-pos "$cursorposx, $cursorposy_inverted"
# ags run-js "wallpaper.set('')"
# sleep 0.1 && ags run-js "wallpaper.set('${imgpath}')" &
swww img "$imgpath" --transition-step 100 --transition-fps 120 \
--transition-type grow --transition-angle 30 --transition-duration 1 \
--transition-pos "$cursorposx, $cursorposy_inverted"
}
if [ "$1" == "--noswitch" ]; then
imgpath=$(swww query | awk -F 'image: ' '{print $2}')
# imgpath=$(ags run-js 'wallpaper.get(0)')
imgpath=$(swww query | awk -F 'image: ' '{print $2}')
# imgpath=$(ags run-js 'wallpaper.get(0)')
elif [[ "$1" ]]; then
switch "$1"
switch "$1"
else
# Select and set image (hyprland)
# Select and set image (hyprland)
cd "$(xdg-user-dir PICTURES)" || return 1
switch "$(yad --width 1200 --height 800 --file --add-preview --large-preview --title='Choose wallpaper')"
cd "$(xdg-user-dir PICTURES)" || return 1
switch "$(yad --width 1200 --height 800 --file --add-preview --large-preview --title='Choose wallpaper')"
fi
# Generate colors for ags n stuff
+3 -3
View File
@@ -38,9 +38,9 @@ env_editor_confirm() {
fi
}
NOTIFY=yes
CURSOR=no
FREEZE=yes
NOTIFY=no
CURSOR=
FREEZE=
WAIT=no
SCALE=
HYPRPICKER_PID=-1
-76
View File
@@ -1,76 +0,0 @@
import re
import os
def read_scss(file_path):
"""Reads an SCSS file and returns a dictionary of color variables."""
colors = {}
with open(file_path, 'r') as file:
for line in file:
match = re.match(r'\$(\w+):\s*(#[0-9A-Fa-f]{6});', line.strip())
if match:
variable_name, color = match.groups()
colors[variable_name] = color
return colors
def update_svg_colors(svg_path, old_to_new_colors, output_path):
"""
Updates the colors in an SVG file based on the provided color map.
:param svg_path: Path to the SVG file.
:param old_to_new_colors: Dictionary mapping old colors to new colors.
:param output_path: Path to save the updated SVG file.
"""
# Read the SVG content
with open(svg_path, 'r') as file:
svg_content = file.read()
# Replace old colors with new colors
for old_color, new_color in old_to_new_colors.items():
svg_content = re.sub(old_color, new_color, svg_content, flags=re.IGNORECASE)
# Write the updated SVG content to the output file
with open(output_path, 'w') as file:
file.write(svg_content)
print(f"SVG colors have been updated and saved to {output_path}!")
def main():
scss_file = os.path.expanduser('~/.local/state/ags/scss/_material.scss') # Hardcoded path to the SCSS file
svg_path = os.path.expanduser('~/.config/Kvantum/Colloid/Colloid.svg') # Hardcoded path to the input SVG file
output_path = os.path.expanduser('~/.config/Kvantum/MaterialAdw/MaterialAdw.svg') # Hardcoded path to the output SVG file
# Read colors from the SCSS file
color_data = read_scss(scss_file)
# Specify the old colors and map them to new colors from the SCSS file
old_to_new_colors = {
#'#cccccc': color_data['surfaceDim'], # Map old SVG color to new SCSS color
#'#666666': color_data['surfaceDim'],
'#3c84f7': color_data['primary'],
#'#5a5a5a': color_data['neutral_paletteKeyColor'],
'#000000': color_data['shadow'],
'#f04a50': color_data['error'],
'#4285f4': color_data['primaryFixedDim'],
'#f2f2f2': color_data['background'],
#'#dfdfdf': color_data['surfaceContainerLow'],
'#ffffff': color_data['background'],
'#1e1e1e': color_data['onPrimaryFixed'],
#'#b6b6b6': color_data['surfaceContainer'],
'#333': color_data['inverseSurface'],
'#212121': color_data['onSecondaryFixed'],
'#5b9bf8': color_data['secondaryContainer'],
'#26272a': color_data['term7'],
#'#b3b3b3': color_data['surfaceBright'],
#'#b74aff': color_data['tertiary'],
#'#989898': color_data['surfaceContainerHighest'],
#'#c1c1c1': color_data['surfaceContainerHigh'],
'#444444': color_data['onBackground'],
'#333333': color_data['onPrimaryFixed'],
}
# Update the SVG colors
update_svg_colors(svg_path, old_to_new_colors, output_path)
if __name__ == "__main__":
main()
-84
View File
@@ -1,84 +0,0 @@
import re
import os
def read_scss(file_path):
"""Reads an SCSS file and returns a dictionary of color variables."""
colors = {}
with open(file_path, 'r') as file:
for line in file:
match = re.match(r'\$(\w+):\s*(#[0-9A-Fa-f]{6});', line.strip())
if match:
variable_name, color = match.groups()
colors[variable_name] = color
return colors
def update_svg_colors(svg_path, old_to_new_colors, output_path):
"""
Updates the colors in an SVG file based on the provided color map.
:param svg_path: Path to the SVG file.
:param old_to_new_colors: Dictionary mapping old colors to new colors.
:param output_path: Path to save the updated SVG file.
"""
# Read the SVG content
with open(svg_path, 'r') as file:
svg_content = file.read()
# Replace old colors with new colors
for old_color, new_color in old_to_new_colors.items():
svg_content = re.sub(old_color, new_color, svg_content, flags=re.IGNORECASE)
# Write the updated SVG content to the output file
with open(output_path, 'w') as file:
file.write(svg_content)
print(f"SVG colors have been updated and saved to {output_path}!")
def main():
scss_file = os.path.expanduser('~/.local/state/ags/scss/_material.scss') # Hardcoded path to the SCSS file
svg_path = os.path.expanduser('~/.config/Kvantum/Colloid/ColloidDark.svg') # Hardcoded path to the input SVG file
output_path = os.path.expanduser('~/.config/Kvantum/MaterialAdw/MaterialAdw.svg') # Hardcoded path to the output SVG file
# Read colors from the SCSS file
color_data = read_scss(scss_file)
# Specify the old colors and map them to new colors from the SCSS file
old_to_new_colors = {
#'#525252': color_data['surfaceDim'], # Map old SVG color to new SCSS color
#'#666666': color_data['surfaceDim'],
'#31363b': color_data['background'],
#'#eff0f1': color_data['neutral_paletteKeyColor'],
'#000000': color_data['shadow'],
'#5b9bf8': color_data['primary'],
'#93cee9': color_data['onSecondaryContainer'],
'#3daee9': color_data['secondary'],
#'#fff': color_data['term10'],
#'#5a5a5a': color_data['surfaceVariant'],
#'#acb1bc': color_data['onPrimaryFixed'],
'#ffffff': color_data['term11'],
'#5a616e': color_data['surfaceVariant'],
'#f04a50': color_data['error'],
'#4285f4': color_data['secondary'],
'#242424': color_data['background'],
'#2c2c2c': color_data['background'],
#'#dfdfdf': color_data['onSurfaceVariant'],
#'#646464': color_data['surfaceContainerHighest'],
#'#989898': color_data['surfaceContainerHigh'],
#'#c1c1c1': color_data['primaryFixedDim'],
'#1e1e1e': color_data['background'],
'#3c3c3c': color_data['background'],
'#26272a': color_data['surfaceBright'],
'#000000': color_data['shadow'],
'#b74aff': color_data['tertiary'],
#'#b6b6b6': color_data['onSurfaceVariant'],
'#1a1a1a': color_data['background'],
'#333': color_data['term0'],
'#212121': color_data['background'],
}
# Update the SVG colors
update_svg_colors(svg_path, old_to_new_colors, output_path)
if __name__ == "__main__":
main()
@@ -1,68 +0,0 @@
import re
import os
def get_colors_from_scss(scss_file):
colors = {}
with open(scss_file, 'r') as file:
for line in file:
match = re.match(r'\$(\w+):\s*(#[0-9A-Fa-f]{6});', line)
if match:
colors[match.group(1)] = match.group(2)
return colors
def update_config_colors(config_file, colors, mappings):
with open(config_file, 'r') as file:
config_content = file.read()
for key, variable in mappings.items():
if variable in colors:
color = colors[variable]
pattern = rf'({key}=)#?\w+\b'
new_line = f'\\1{color}'
if re.search(pattern, config_content):
config_content = re.sub(pattern, new_line, config_content)
else:
config_content += f"\n{key}={color}"
with open(config_file, 'w') as file:
file.write(config_content)
if __name__ == "__main__":
scss_file = os.path.expanduser('~/.local/state/ags/scss/_material.scss')
config_file = os.path.expanduser('~/.config/Kvantum/MaterialAdw/MaterialAdw.kvconfig') # Replace with the actual path to your config file
# Define your mappings here
mappings = {
'window.color': 'background',
'base.color': 'background',
'alt.base.color': 'background',
'button.color': 'surfaceContainer',
'light.color': 'surfaceContainerLow',
'mid.light.color': 'surfaceContainer',
'dark.color': 'surfaceContainerHighest',
'mid.color': 'surfaceContainerHigh',
'highlight.color': 'primary',
'inactive.highlight.color': 'primary',
'text.color': 'onBackground',
'window.text.color': 'onBackground',
'button.text.color': 'onBackground',
'disabled.text.color': 'onBackground',
'tooltip.text.color': 'onBackground',
'highlight.text.color': 'onSurface',
'link.color': 'tertiary',
'link.visited.color': 'tertiaryFixed',
'progress.indicator.text.color': 'onBackground',
'text.normal.color': 'onBackground',
'text.focus.color': 'onBackground',
'text.press.color': 'onsecondarycontainer',
'text.toggle.color': 'onsecondarycontainer',
'text.disabled.color': 'surfaceDim',
# Add more mappings as needed
}
colors = get_colors_from_scss(scss_file)
update_config_colors(config_file, colors, mappings)
print("Config colors updated successfully!")
-43
View File
@@ -1,43 +0,0 @@
#!/usr/bin/env bash
XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}"
XDG_STATE_HOME="${XDG_STATE_HOME:-$HOME/.local/state}"
CONFIG_DIR="$XDG_CONFIG_HOME/ags"
CACHE_DIR="$XDG_CACHE_HOME/ags"
STATE_DIR="$XDG_STATE_HOME/ags"
get_light_dark() {
lightdark=""
if [ ! -f "$STATE_DIR/user/colormode.txt" ]; then
echo "" >"$STATE_DIR/user/colormode.txt"
else
lightdark=$(sed -n '1p' "$STATE_DIR/user/colormode.txt")
fi
echo "$lightdark"
}
apply_qt() {
# Check if the theme exists
FOLDER_PATH="$XDG_CONFIG_HOME/Kvantum/Colloid/"
if [ ! -d "$FOLDER_PATH" ]; then
# Send a notification
notify-send "Colloid-kde theme required" " The folder '$FOLDER_PATH' does not exist."
exit 1 # Exit the function if the folder does not exist
fi
lightdark=$(get_light_dark)
if [ "$lightdark" = "light" ]; then
# apply ligght colors
cp "$XDG_CONFIG_HOME/Kvantum/Colloid/Colloid.kvconfig" "$XDG_CONFIG_HOME/Kvantum/MaterialAdw/MaterialAdw.kvconfig"
python "$CONFIG_DIR/scripts/kvantum/adwsvg.py"
else
#apply dark colors
cp "$XDG_CONFIG_HOME/Kvantum/Colloid/ColloidDark.kvconfig" "$XDG_CONFIG_HOME/Kvantum/MaterialAdw/MaterialAdw.kvconfig"
python "$CONFIG_DIR/scripts/kvantum/adwsvgDark.py"
fi
}
apply_qt
@@ -4,18 +4,6 @@ general {
col.active_border = rgba({{ $onSurface }}39)
col.inactive_border = rgba({{ $outline }}30)
}
group {
col.border_active = rgba({{ $onSurface }}39)
col.border_inactive = rgba({{ $outline }}30)
groupbar {
col.active = rgba({{ $background }}FF)
col.inactive = rgba({{ $outline }}50)
scrolling = true
font_size = 11
text_color = rgba({{ $onBackground }}FF)
}
}
misc {
background_color = rgba({{ $surface }}FF)
@@ -43,4 +31,4 @@ plugin {
}
}
windowrulev2 = bordercolor rgba({{ $primary }}AA) rgba({{ $primary }}77),pinned:1
windowrulev2 = bordercolor rgba({{ $primary }}AA) rgba({{ $primary }}77),pinned:1
@@ -1,97 +1,90 @@
#hyprlock config
$text_color = rgba({{ $term3 }}FF)
$text_key_color = rgba({{ $term1 }}FF)
$text_status_color = rgba({{ $tertiary }}FF)
$base_color = rgba({{ $term0 }}FF)
# $text_color = rgba({{ $onBackground }}FF)
# $entry_background_color = rgba({{ $background }}11)
# $entry_border_color = rgba({{ $outline }}55)
# $entry_color = rgba({{ $onSurfaceVariant }}FF)
$text_color = rgba(FFFFFFFF)
$entry_background_color = rgba(33333311)
$entry_border_color = rgba(3B3B3B55)
$entry_color = rgba(FFFFFFFF)
$font_family = Rubik Light
$font_family_clock = Geist Mono 10
$font_family_date = JetBrainsMono Nerd Font 10
$font_family_clock = Rubik Light
$font_material_symbols = Material Symbols Rounded
general {
#hide cursor
hide_cursor = true
}
background {
# color = rgba({{ $surfaceContainerLowest }}FF)
color = rgba(000000FF)
# path = {{ SWWW_WALL }}
# path = screenshot
# blur_size = 5
# blur_passes = 4
}
input-field {
monitor =
path = $path # only png supported for now
# color = $color1
size = 250, 50
outline_thickness = 2
dots_size = 0.1
dots_spacing = 0.3
outer_color = $entry_border_color
inner_color = $entry_background_color
font_color = $entry_color
# fade_on_empty = true
# all these options are taken from hyprland, see https://wiki.hyprland.org/Configuring/Variables/#blur for explanations
blur_size = 4
blur_passes = 3 # 0 disables blurring
noise = 0.0117
contrast = 1.3000 # Vibrant!!!
brightness = 0.8000
vibrancy = 0.2100
vibrancy_darkness = 0.0
position = 0, 20
halign = center
valign = center
}
# Hours
label {
label { # Clock
monitor =
text = cmd[update:1000] echo "<b><big> $(date +"%H") </big></b>"
text = $TIME
shadow_passes = 1
shadow_boost = 0.5
color = $text_color
font_size = 112
font_size = 65
font_family = $font_family_clock
shadow_passes = 3
shadow_size = 4
position = 0, 220
position = 0, 300
halign = center
valign = center
}
# Minutes
label {
label { # Greeting
monitor =
text = cmd[update:1000] echo "<b><big> $(date +"%M") </big></b>"
color = $text_key_color
font_size = 112
font_family = $font_family_clock
shadow_passes = 3
shadow_size = 4
text = hi $USER !!!
shadow_passes = 1
shadow_boost = 0.5
color = $text_color
font_size = 20
font_family = $font_family
position = 0, 80
position = 0, 240
halign = center
valign = center
}
# Today
label {
label { # lock icon
monitor =
text = cmd[update:18000000] echo "<b><big> "$(date +'%A')" </big></b>"
<<<<<<< HEAD
color = rgba(FFFFFF80)
=======
color = rgba({{ $primaryContainer }}FF)
>>>>>>> parent of 1a3fa77... heda hau fixed
font_size = 22
font_family = $font_family_date
text = lock
shadow_passes = 1
shadow_boost = 0.5
color = $text_color
font_size = 21
font_family = $font_material_symbols
position = 0, -20
position = 0, 65
halign = center
valign = center
valign = bottom
}
# Week
label {
label { # "locked" text
monitor =
text = cmd[update:18000000] echo "<b> "$(date +'%d %b')" </b>"
<<<<<<< HEAD
color = rgba(FFFFFF80)
=======
color = rgba({{ $primaryContainer }}FF)
>>>>>>> parent of 1a3fa77... heda hau fixed
font_size = 18
font_family = $font_family_date
text = locked
shadow_passes = 1
shadow_boost = 0.5
color = $text_color
font_size = 14
font_family = $font_family
position = 0, -50
position = 0, 45
halign = center
valign = center
valign = bottom
}
label { # Status
@@ -99,33 +92,11 @@ label { # Status
text = cmd[update:5000] ${XDG_CONFIG_HOME:-$HOME/.config}/hypr/hyprlock/status.sh
shadow_passes = 1
shadow_boost = 0.5
color = $text_status_color
color = $text_color
font_size = 14
font_family = $font_family
position = -30, 30
halign = right
valign = bottom
}
input-field {
monitor =
size = 230, 50
outline_thickness = 1
dots_size = 0.24 # Scale of input-field height, 0.2 - 0.8
dots_spacing = 0.64 # Scale of dots' absolute size, 0.0 - 1.0
dots_center = true
# dots_rouding = 1
rounding = 28
outer_color = $text_key_color
inner_color = $base_color
font_color = $text_color
fade_on_empty = true
placeholder_text = <i>Password...</i> # Text rendered in the input box when it's empty.
position = 0, 120
halign = center
valign = bottom
}
position = 30, -30
halign = left
valign = top
}