This commit is contained in:
sankalp committed 2024-09-05 23:01:21 +05:45
1 parent c35c69d902
commit 7f0375f24a
17 files changed
-1076

No files matched your search

@@ -1,182 +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"
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
fi
cd "$CONFIG_DIR" || exit
colornames=''
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_png=$(echo "$wallpath_png" | sed 's/\//\\\//g')
# wallpath_png=$(sed 's/\//\\\\\//g' <<< "$wallpath_png")
transparentize() {
local hex="$1"
local alpha="$2"
local red green blue
red=$((16#${hex:1:2}))
green=$((16#${hex:3:2}))
blue=$((16#${hex:5:2}))
printf 'rgba(%d, %d, %d, %.2f)\n' "$red" "$green" "$blue" "$alpha"
}
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_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
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"
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
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/{{ 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
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
}
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
# 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
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
}
apply_ags() {
ags run-js "handleStyles(false);"
ags run-js 'openColorScheme.value = true; Utils.timeout(2000, () => openColorScheme.value = false);'
}
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
apply_ags &
apply_hyprland &
apply_hyprlock &
apply_lightdark &
apply_gtk &
apply_fuzzel &
apply_term &
@@ -1,94 +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"
# check if no arguments
if [ $# -eq 0 ]; then
echo "Usage: colorgen.sh /path/to/image (--apply)"
exit 1
fi
# check if the file $STATE_DIR/user/colormode.txt exists. if not, create it. else, read it to $lightdark
colormodefile="$STATE_DIR/user/colormode.txt"
lightdark="dark"
transparency="opaque"
materialscheme="vibrant"
terminalscheme="$XDG_CONFIG_HOME/ags/scripts/templates/terminal/scheme-base.json"
if [ ! -f $colormodefile ]; then
echo "dark" > $colormodefile
echo "opaque" >> $colormodefile
echo "vibrant" >> $colormodefile
elif [[ $(wc -l < $colormodefile) -ne 4 || $(wc -w < $colormodefile) -ne 4 ]]; then
echo "dark" > $colormodefile
echo "opaque" >> $colormodefile
echo "vibrant" >> $colormodefile
echo "yesgradience" >> $colormodefile
else
lightdark=$(sed -n '1p' $colormodefile)
transparency=$(sed -n '2p' $colormodefile)
materialscheme=$(sed -n '3p' $colormodefile)
if [ "$materialscheme" = "monochrome" ]; then
terminalscheme="$XDG_CONFIG_HOME/ags/scripts/templates/terminal/scheme-monochrome.json"
fi
fi
backend="material" # color generator backend
if [ ! -f "$STATE_DIR/user/colorbackend.txt" ]; then
echo "material" > "$STATE_DIR/user/colorbackend.txt"
else
backend=$(cat "$STATE_DIR/user/colorbackend.txt") # either "" or "-l"
fi
cd "$CONFIG_DIR/scripts/" || exit
if [[ "$1" = "#"* ]]; then # this is a color
color_generation/generate_colors_material.py --color "$1" \
--mode "$lightdark" --scheme "$materialscheme" --transparency "$transparency" \
--termscheme $terminalscheme --blend_bg_fg \
> "$CACHE_DIR"/user/generated/material_colors.scss
if [ "$2" = "--apply" ]; then
cp "$CACHE_DIR"/user/generated/material_colors.scss "$STATE_DIR/scss/_material.scss"
color_generation/applycolor.sh
fi
elif [ "$backend" = "material" ]; then
smartflag=''
if [ "$3" = "--smart" ]; then
smartflag='--smart'
fi
color_generation/generate_colors_material.py --path "$1" \
--mode "$lightdark" --scheme "$materialscheme" --transparency "$transparency" \
--termscheme $terminalscheme --blend_bg_fg \
--cache "$STATE_DIR/user/color.txt" $smartflag \
> "$CACHE_DIR"/user/generated/material_colors.scss
if [ "$2" = "--apply" ]; then
cp "$CACHE_DIR"/user/generated/material_colors.scss "$STATE_DIR/scss/_material.scss"
color_generation/applycolor.sh
fi
elif [ "$backend" = "pywal" ]; then
# clear and generate
wal -c
wal -i "$1" -n $lightdark -q
# copy scss
cp "$XDG_CACHE_HOME/wal/colors.scss" "$CACHE_DIR"/user/generated/material_colors.scss
cat color_generation/pywal_to_material.scss >> "$CACHE_DIR"/user/generated/material_colors.scss
if [ "$2" = "--apply" ]; then
sass -I "$STATE_DIR/scss" -I "$CONFIG_DIR/scss/fallback" "$CACHE_DIR"/user/generated/material_colors.scss "$CACHE_DIR"/user/generated/colors_classes.scss --style compressed
sed -i "s/ { color//g" "$CACHE_DIR"/user/generated/colors_classes.scss
sed -i "s/\./$/g" "$CACHE_DIR"/user/generated/colors_classes.scss
sed -i "s/}//g" "$CACHE_DIR"/user/generated/colors_classes.scss
if [ "$lightdark" = "-l" ]; then
printf "\n""\$darkmode: false;""\n" >> "$CACHE_DIR"/user/generated/colors_classes.scss
else
printf "\n""\$darkmode: true;""\n" >> "$CACHE_DIR"/user/generated/colors_classes.scss
fi
cp "$CACHE_DIR"/user/generated/colors_classes.scss "$STATE_DIR/scss/_material.scss"
color_generation/applycolor.sh
fi
fi
@@ -1,182 +0,0 @@
#!/usr/bin/env python3
import argparse
import math
import json
from PIL import Image
from materialyoucolor.quantize import QuantizeCelebi
from materialyoucolor.score.score import Score
from materialyoucolor.hct import Hct
from materialyoucolor.dynamiccolor.material_dynamic_colors import MaterialDynamicColors
from materialyoucolor.utils.color_utils import (rgba_from_argb, argb_from_rgb, argb_from_rgba)
from materialyoucolor.utils.math_utils import (sanitize_degrees_double, difference_degrees, rotation_direction)
parser = argparse.ArgumentParser(description='Color generation script')
parser.add_argument('--path', type=str, default=None, help='generate colorscheme from image')
parser.add_argument('--size', type=int , default=128 , help='bitmap image size')
parser.add_argument('--color', type=str, default=None, help='generate colorscheme from color')
parser.add_argument('--mode', type=str, choices=['dark', 'light'], default='dark', help='dark or light mode')
parser.add_argument('--scheme', type=str, default='vibrant', help='material scheme to use')
parser.add_argument('--smart', action='store_true', default=False, help='decide scheme type based on image color')
parser.add_argument('--transparency', type=str, choices=['opaque', 'transparent'], default='opaque', help='enable transparency')
parser.add_argument('--termscheme', type=str, default=None, help='JSON file containg the terminal scheme for generating term colors')
parser.add_argument('--harmony', type=float , default=0.8, help='(0-1) Color hue shift towards accent')
parser.add_argument('--harmonize_threshold', type=float , default=100, help='(0-180) Max threshold angle to limit color hue shift')
parser.add_argument('--term_fg_boost', type=float , default=0.35, help='Make terminal foreground more different from the background')
parser.add_argument('--blend_bg_fg', action='store_true', default=False, help='Shift terminal background or foreground towards accent')
parser.add_argument('--cache', type=str, default=None, help='file path to store the generated color')
parser.add_argument('--debug', action='store_true', default=False, help='debug mode')
args = parser.parse_args()
rgba_to_hex = lambda rgba: "#{:02X}{:02X}{:02X}".format(rgba[0], rgba[1], rgba[2])
argb_to_hex = lambda argb: "#{:02X}{:02X}{:02X}".format(*map(round, rgba_from_argb(argb)))
hex_to_argb = lambda hex_code: argb_from_rgb(int(hex_code[1:3], 16), int(hex_code[3:5], 16), int(hex_code[5:], 16))
display_color = lambda rgba : "\x1B[38;2;{};{};{}m{}\x1B[0m".format(rgba[0], rgba[1], rgba[2], "\x1b[7m \x1b[7m")
def calculate_optimal_size (width: int, height: int, bitmap_size: int) -> (int, int):
image_area = width * height;
bitmap_area = bitmap_size ** 2
scale = math.sqrt(bitmap_area/image_area) if image_area > bitmap_area else 1
new_width = round(width * scale)
new_height = round(height * scale)
if new_width == 0:
new_width = 1
if new_height == 0:
new_height = 1
return new_width, new_height
def harmonize (design_color: int, source_color: int, threshold: float = 35, harmony: float = 0.5) -> int:
from_hct = Hct.from_int(design_color)
to_hct = Hct.from_int(source_color)
difference_degrees_ = difference_degrees(from_hct.hue, to_hct.hue)
rotation_degrees = min(difference_degrees_ * harmony, threshold)
output_hue = sanitize_degrees_double(
from_hct.hue + rotation_degrees * rotation_direction(from_hct.hue, to_hct.hue)
)
return Hct.from_hct(output_hue, from_hct.chroma, from_hct.tone).to_int()
def boost_chroma_tone (argb: int, chroma: float = 1, tone: float = 1) -> int:
hct = Hct.from_int(argb)
return Hct.from_hct(hct.hue, hct.chroma * chroma, hct.tone * tone).to_int()
darkmode = (args.mode == 'dark')
transparent = (args.transparency == 'transparent')
if args.path is not None:
image = Image.open(args.path)
if image.format == "GIF":
image.seek(1)
wsize, hsize = image.size
wsize_new, hsize_new = calculate_optimal_size(wsize, hsize, args.size)
if wsize_new < wsize or hsize_new < hsize:
image = image.resize((wsize_new, hsize_new), Image.Resampling.BICUBIC)
colors = QuantizeCelebi(list(image.getdata()), 128)
argb = Score.score(colors)[0]
if args.cache is not None:
with open(args.cache, 'w') as file:
file.write(argb_to_hex(argb))
hct = Hct.from_int(argb)
if(args.smart):
if(hct.chroma < 20):
args.scheme = 'neutral'
if(hct.tone > 60):
darkmode = False
elif args.color is not None:
argb = hex_to_argb(args.color)
hct = Hct.from_int(argb)
if args.scheme == 'fruitsalad':
from materialyoucolor.scheme.scheme_fruit_salad import SchemeFruitSalad as Scheme
elif args.scheme == 'expressive':
from materialyoucolor.scheme.scheme_expressive import SchemeExpressive as Scheme
elif args.scheme == 'monochrome':
from materialyoucolor.scheme.scheme_monochrome import SchemeMonochrome as Scheme
elif args.scheme == 'rainbow':
from materialyoucolor.scheme.scheme_rainbow import SchemeRainbow as Scheme
elif args.scheme == 'tonalspot':
from materialyoucolor.scheme.scheme_tonal_spot import SchemeTonalSpot as Scheme
elif args.scheme == 'neutral':
from materialyoucolor.scheme.scheme_neutral import SchemeNeutral as Scheme
elif args.scheme == 'fidelity':
from materialyoucolor.scheme.scheme_fidelity import SchemeFidelity as Scheme
elif args.scheme == 'content':
from materialyoucolor.scheme.scheme_content import SchemeContent as Scheme
elif args.scheme == 'vibrant':
from materialyoucolor.scheme.scheme_vibrant import SchemeVibrant as Scheme
else:
from schemes.scheme_morevibrant import SchemeMoreVibrant as Scheme
# Generate
scheme = Scheme(hct, darkmode, 0.0)
material_colors = {}
term_colors = {}
for color in vars(MaterialDynamicColors).keys():
color_name = getattr(MaterialDynamicColors, color)
if hasattr(color_name, "get_hct"):
rgba = color_name.get_hct(scheme).to_rgba()
material_colors[color] = rgba_to_hex(rgba)
# Extended material
if darkmode == True:
material_colors['success'] = '#B5CCBA'
material_colors['onSuccess'] = '#213528'
material_colors['successContainer'] = '#374B3E'
material_colors['onSuccessContainer'] = '#D1E9D6'
else:
material_colors['success'] = '#4F6354'
material_colors['onSuccess'] = '#FFFFFF'
material_colors['successContainer'] = '#D1E8D5'
material_colors['onSuccessContainer'] = '#0C1F13'
# Terminal Colors
if args.termscheme is not None:
with open(args.termscheme, 'r') as f:
json_termscheme = f.read()
term_source_colors = json.loads(json_termscheme)['dark' if darkmode else 'light']
primary_color_argb = hex_to_argb(material_colors['primary_paletteKeyColor'])
for color, val in term_source_colors.items():
if(args.scheme == 'monochrome') :
term_colors[color] = val
continue
if args.blend_bg_fg and color == "term0":
harmonized = boost_chroma_tone(hex_to_argb(material_colors['surfaceContainerLow']), 1.2, 0.95)
elif args.blend_bg_fg and color == "term15":
harmonized = boost_chroma_tone(hex_to_argb(material_colors['onSurface']), 3, 1)
else:
harmonized = harmonize(hex_to_argb(val), primary_color_argb, args.harmonize_threshold, args.harmony)
harmonized = boost_chroma_tone(harmonized, 1, 1 + (args.term_fg_boost * (1 if darkmode else -1)))
term_colors[color] = argb_to_hex(harmonized)
if args.debug == False:
print(f"$darkmode: {darkmode};")
print(f"$transparent: {transparent};")
for color, code in material_colors.items():
print(f"${color}: {code};")
for color, code in term_colors.items():
print(f"${color}: {code};")
else:
if args.path is not None:
print('\n--------------Image properties-----------------')
print(f"Image size: {wsize} x {hsize}")
print(f"Resized image: {wsize_new} x {hsize_new}")
print('\n---------------Selected color------------------')
print(f"Dark mode: {darkmode}")
print(f"Scheme: {args.scheme}")
print(f"Accent color: {display_color(rgba_from_argb(argb))} {argb_to_hex(argb)}")
print(f"HCT: {hct.hue:.2f} {hct.chroma:.2f} {hct.tone:.2f}")
print('\n---------------Material colors-----------------')
for color, code in material_colors.items():
rgba = rgba_from_argb(hex_to_argb(code))
print(f"{color.ljust(32)} : {display_color(rgba)} {code}")
print('\n----------Harmonize terminal colors------------')
for color, code in term_colors.items():
rgba = rgba_from_argb(hex_to_argb(code))
code_source = term_source_colors[color]
rgba_source = rgba_from_argb(hex_to_argb(code_source))
print(f"{color.ljust(6)} : {display_color(rgba_source)} {code_source} --> {display_color(rgba)} {code}")
print('-----------------------------------------------')
@@ -1,57 +0,0 @@
$primary: lighten($color4, 20%);
$onPrimary: darken($color2, 20%);
$primaryContainer: darken($color2, 10%);
$onPrimaryContainer: lighten($color4, 10%);
$secondary: desaturate(lighten($color5, 20%), 20%);
$onSecondary: desaturate(darken($color3, 20%), 20%);
$secondaryContainer: desaturate(darken($color3, 20%), 20%);
$onSecondaryContainer: desaturate(lighten($color5, 20%), 20%);
$tertiary: adjust-hue(lighten($color4, 20%), 30deg);
$onTertiary: adjust-hue(darken($color2, 20%), 30deg);
$tertiaryContainer: adjust-hue(darken($color2, 10%), 30deg);
$tertiaryContainer: adjust-hue(lighten($color4, 10%), 30deg);
$error: #ffb4a9;
$onError: #680003;
$errorContainer: #930006;
$onErrorContainer: #ffb4a9;
$colorbarbg: $color0;
$background: $color0;
$onBackground: $color7;
$surface: $color0;
$onSurface: $color7;
$surfaceVariant: $color1;
$onSurfaceVariant: $color7;
$outline: $color7;
$shadow: #000000;
$inverseSurface: invert($surface);
$inverseOnSurface: invert($onSurface);
$inversePrimary: invert($primary);
.primary { color: $primary; }
.onPrimary { color: $onPrimary; }
.primaryContainer { color: $primaryContainer; }
.onPrimaryContainer { color: $onPrimaryContainer; }
.secondary { color: $secondary; }
.onSecondary { color: $onSecondary; }
.secondaryContainer { color: $secondaryContainer; }
.onSecondaryContainer { color: $onSecondaryContainer; }
.tertiary { color: $tertiary; }
.onTertiary { color: $onTertiary; }
.tertiaryContainer { color: $tertiaryContainer; }
.onTertiaryContainer { color: $tertiaryContainer; }
.error { color: $error; }
.onError { color: $onError; }
.errorContainer { color: $errorContainer; }
.onErrorContainer { color: $onErrorContainer; }
.colorbarbg { color: $colorbarbg; }
.background { color: $background; }
.onBackground { color: $onBackground; }
.surface { color: $surface; }
.onSurface { color: $onSurface; }
.surfaceVariant { color: $surfaceVariant; }
.onSurfaceVariant { color: $onSurfaceVariant; }
.outline { color: $outline; }
.shadow { color: $shadow; }
.inverseSurface { color: $inverseSurface; }
.inverseOnSurface { color: $inverseOnSurface; }
.inversePrimary { color: $inversePrimary; }
@@ -1,4 +0,0 @@
#!/usr/bin/env bash
XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
CONFIG_DIR="$XDG_CONFIG_HOME/ags"
$CONFIG_DIR/scripts/color_generation/switchwall.sh "$(fd . $(xdg-user-dir PICTURES)/wallpapers/ -e .png -e .jpg -e .svg | xargs shuf -n1 -e)"
@@ -1,44 +0,0 @@
from materialyoucolor.scheme.dynamic_scheme import DynamicSchemeOptions, DynamicScheme
from materialyoucolor.scheme.variant import Variant
from materialyoucolor.palettes.tonal_palette import TonalPalette
class SchemeMoreVibrant(DynamicScheme):
hues = [0.0, 41.0, 61.0, 101.0, 131.0, 181.0, 251.0, 301.0, 360.0]
secondary_rotations = [18.0, 15.0, 10.0, 12.0, 15.0, 18.0, 15.0, 12.0, 12.0]
tertiary_rotations = [35.0, 30.0, 20.0, 25.0, 30.0, 35.0, 30.0, 25.0, 25.0]
def __init__(self, source_color_hct, is_dark, contrast_level):
super().__init__(
DynamicSchemeOptions(
source_color_argb=source_color_hct.to_int(),
variant=Variant.VIBRANT,
contrast_level=contrast_level,
is_dark=is_dark,
primary_palette=TonalPalette.from_hue_and_chroma(
source_color_hct.hue, 200.0
),
secondary_palette=TonalPalette.from_hue_and_chroma(
DynamicScheme.get_rotated_hue(
source_color_hct,
SchemeMoreVibrant.hues,
SchemeMoreVibrant.secondary_rotations,
),
32.0,
),
tertiary_palette=TonalPalette.from_hue_and_chroma(
DynamicScheme.get_rotated_hue(
source_color_hct,
SchemeMoreVibrant.hues,
SchemeMoreVibrant.tertiary_rotations,
),
32.0,
),
neutral_palette=TonalPalette.from_hue_and_chroma(
source_color_hct.hue, 13.0
),
neutral_variant_palette=TonalPalette.from_hue_and_chroma(
source_color_hct.hue, 15.0
),
)
)
@@ -1,29 +0,0 @@
$darkmode: false;
$primary: #000000;
$onPrimary: #FFFFFF ;
$primaryContainer: #d4d4d4;
$onPrimaryContainer: #000000;
$secondary: #000000;
$onSecondary: #FFFFFF ;
$secondaryContainer: #bebebe;
$onSecondaryContainer: #000000;
$tertiary: #000000;
$onTertiary: #FFFFFF ;
$tertiaryContainer: #FFFFFF ;
$onTertiaryContainer: #000000;
$error: #000000;
$onError: #FFFFFF ;
$errorContainer: #FFFFFF ;
$onErrorContainer: #000000;
$colorbarbg: #FFFFFF ;
$background: #FFFFFF ;
$onBackground: #000000;
$surface: #f0f0f0;
$onSurface: #000000;
$surfaceVariant: #dddddd;
$onSurfaceVariant: #000000;
$outline: #525252;
$shadow: #000000 ;
$inverseSurface: #000000;
$inverseOnSurface: #FFFFFF;
$inversePrimary: #000000;
@@ -1,29 +0,0 @@
$darkmode: true;
$primary: #e2e2e2;
$onPrimary: #000000;
$primaryContainer: #6b6b6b;
$onPrimaryContainer: #e2e2e2;
$secondary: #e2e2e2;
$onSecondary: #000000;
$secondaryContainer: #313131;
$onSecondaryContainer: #e2e2e2;
$tertiary: #e2e2e2;
$onTertiary: #000000;
$tertiaryContainer: #000000;
$onTertiaryContainer: #e2e2e2;
$error: #e2e2e2;
$onError: #000000;
$errorContainer: #000000;
$onErrorContainer: #e2e2e2;
$colorbarbg: #000000;
$background: #000000;
$onBackground: #e2e2e2;
$surface: #161616;
$onSurface: #e2e2e2;
$surfaceVariant: #242424;
$onSurfaceVariant: #e2e2e2;
$outline: #a1a1a1;
$shadow: #000000;
$inverseSurface: #e2e2e2;
$inverseOnSurface: #000000;
$inversePrimary: #e2e2e2;
@@ -1,39 +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"
COLORMODE_FILE_DIR="$STATE_DIR/user/colormode.txt"
if [ "$1" == "--pick" ]; then
color=$(hyprpicker --no-fancy)
elif [[ "$1" = "#"* ]]; then # this is a color
color=$1
else
color=$(cut -f1 "$STATE_DIR/user/color.txt")
fi
sed -i "1s/.*/$color/" "$STATE_DIR/user/color.txt"
# Use Gradience?
colormodelines=$(wc -l "$COLORMODE_FILE_DIR" | awk '{print $1}' )
if [ "$2" == "--no-gradience" ]; then
if [ "$colormodelines" == "3" ]; then
echo 'nogradience' >> "$COLORMODE_FILE_DIR"
else
sed -i "4s/.*/nogradience/" "$COLORMODE_FILE_DIR"
fi
elif [ "$2" == "--yes-gradience" ]; then
if [ "$colormodelines" == "3" ]; then
echo 'yesgradience' >> "$COLORMODE_FILE_DIR"
else
sed -i "4s/.*/yesgradience/" "$COLORMODE_FILE_DIR"
fi
fi
# Generate colors for ags n stuff
"$CONFIG_DIR"/scripts/color_generation/colorgen.sh "${color}" --apply
@@ -1,40 +0,0 @@
#!/usr/bin/env bash
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))
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"
}
if [ "$1" == "--noswitch" ]; then
imgpath=$(swww query | awk -F 'image: ' '{print $2}')
# imgpath=$(ags run-js 'wallpaper.get(0)')
elif [[ "$1" ]]; then
switch "$1"
else
# 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')"
fi
# Generate colors for ags n stuff
"$CONFIG_DIR"/scripts/color_generation/colorgen.sh "${imgpath}" --apply --smart
@@ -1,21 +0,0 @@
font=Gabarito
terminal=foot -e
prompt=">> "
layer=overlay
[colors]
background={{ $background }}ff
text={{ $onBackground }}ff
selection={{ $surfaceVariant }}ff
selection-text={{ $onSurfaceVariant }}ff
border={{ $surfaceVariant }}dd
match={{ $primary }}ff
selection-match={{ $primary }}ff
[border]
radius=17
width=1
[dmenu]
exit-immediately-if-empty=yes
@@ -1,144 +0,0 @@
{
"name": "Material3_Generated",
"variables": {
"theme_fg_color": "#AEE5FA",
"theme_text_color": "#AEE5FA",
"theme_bg_color": "#1a1b26",
"theme_base_color": "#1a1b26",
"theme_selected_bg_color": "#AEE5FA",
"theme_selected_fg_color": "rgba(0, 0, 0, 0.87)",
"insensitive_bg_color": "#1a1b26",
"insensitive_fg_color": "rgba(192, 202, 245, 0.5)",
"insensitive_base_color": "#24283b",
"theme_unfocused_fg_color": "#AEE5FA",
"theme_unfocused_text_color": "#c0caf5",
"theme_unfocused_bg_color": "#1a1b26",
"theme_unfocused_base_color": "#1a1b26",
"theme_unfocused_selected_bg_color": "#a9b1d6",
"theme_unfocused_selected_fg_color": "rgba(0, 0, 0, 0.87)",
"unfocused_insensitive_color": "rgba(192, 202, 245, 0.5)",
"borders": "rgba(192, 202, 245, 0.12)",
"unfocused_borders": "rgba(192, 202, 245, 0.12)",
"warning_color": "#FDD633",
"error_color": "#BA1B1B",
"success_color": "#81C995",
"wm_title": "#AEE5FA",
"wm_unfocused_title": "rgba(192, 202, 245, 0.7)",
"wm_highlight": "rgba(192, 202, 245, 0.1)",
"wm_bg": "#1a1b26",
"wm_unfocused_bg": "#1a1b26",
"wm_button_close_icon": "#1a1b26",
"wm_button_close_hover_bg": "#a9b1d6",
"wm_button_close_active_bg": "#c7c7c7",
"content_view_bg": "#1a1b26",
"placeholder_text_color": "silver",
"text_view_bg": "#1d1d1d",
"budgie_tasklist_indicator_color": "#90D1F6",
"budgie_tasklist_indicator_color_active": "#90D1F6",
"budgie_tasklist_indicator_color_active_window": "#999999",
"budgie_tasklist_indicator_color_attention": "#FDD633",
"STRAWBERRY_100": "#FF9262",
"STRAWBERRY_300": "#FF793E",
"STRAWBERRY_500": "#F15D22",
"STRAWBERRY_700": "#CF3B00",
"STRAWBERRY_900": "#AC1800",
"ORANGE_100": "#FFDB91",
"ORANGE_300": "#FFCA40",
"ORANGE_500": "#FAA41A",
"ORANGE_700": "#DE8800",
"ORANGE_900": "#C26C00",
"BANANA_100": "#FFFFA8",
"BANANA_300": "#FFFA7D",
"BANANA_500": "#FFCE51",
"BANANA_700": "#D1A023",
"BANANA_900": "#A27100",
"LIME_100": "#A2F3BE",
"LIME_300": "#8ADBA6",
"LIME_500": "#73C48F",
"LIME_700": "#479863",
"LIME_900": "#1C6D38",
"BLUEBERRY_100": "#94A6FF",
"BLUEBERRY_300": "#6A7CE0",
"BLUEBERRY_500": "#3F51B5",
"BLUEBERRY_700": "#213397",
"BLUEBERRY_900": "#031579",
"GRAPE_100": "#D25DE6",
"GRAPE_300": "#B84ACB",
"GRAPE_500": "#9C27B0",
"GRAPE_700": "#830E97",
"GRAPE_900": "#6A007E",
"COCOA_100": "#9F9792",
"COCOA_300": "#7B736E",
"COCOA_500": "#574F4A",
"COCOA_700": "#463E39",
"COCOA_900": "#342C27",
"SILVER_100": "#EEE",
"SILVER_300": "#CCC",
"SILVER_500": "#AAA",
"SILVER_700": "#888",
"SILVER_900": "#666",
"SLATE_100": "#888",
"SLATE_300": "#666",
"SLATE_500": "#444",
"SLATE_700": "#222",
"SLATE_900": "#111",
"BLACK_100": "#474341",
"BLACK_300": "#403C3A",
"BLACK_500": "#393634",
"BLACK_700": "#33302F",
"BLACK_900": "#2B2928",
"accent_bg_color": "{{ $primary }}",
"accent_fg_color": "{{ $onPrimary }}",
"accent_color": "{{ $primary }}",
"destructive_bg_color": "{{ $error }}",
"destructive_fg_color": "{{ $onError }}",
"destructive_color": "{{ $error }}",
"success_bg_color": "#81C995",
"success_fg_color": "rgba(0, 0, 0, 0.87)",
"warning_bg_color": "#FDD633",
"warning_fg_color": "rgba(0, 0, 0, 0.87)",
"error_bg_color": "{{ $error }}",
"error_fg_color": "{{ $onError }}",
"window_bg_color": "{{ $background }}",
"window_fg_color": "{{ $onBackground }}",
"view_bg_color": "{{ $surface }}",
"view_fg_color": "{{ $onSurface }}",
"headerbar_bg_color": "mix(@dialog_bg_color, @window_bg_color, 0.5)",
"headerbar_fg_color": "{{ $onSecondaryContainer }}",
"headerbar_border_color": "{{ $secondaryContainer }}",
"headerbar_backdrop_color": "@headerbar_bg_color",
"headerbar_shade_color": "rgba(0, 0, 0, 0.09)",
"card_bg_color": "{{ $background }}",
"card_fg_color": "{{ $onSecondaryContainer }}",
"card_shade_color": "rgba(0, 0, 0, 0.09)",
"dialog_bg_color": "{{ $secondaryContainer }}",
"dialog_fg_color": "{{ $onSecondaryContainer }}",
"popover_bg_color": "{{ $secondaryContainer }}",
"popover_fg_color": "{{ $onSecondaryContainer }}",
"thumbnail_bg_color": "#1a1b26",
"thumbnail_fg_color": "#AEE5FA",
"shade_color": "rgba(0, 0, 0, 0.36)",
"scrollbar_outline_color": "rgba(0, 0, 0, 0.5)",
"sidebar_bg_color": "@window_bg_color",
"sidebar_fg_color":"@window_fg_color",
"sidebar_border_color": "@sidebar_bg_color",
"sidebar_backdrop_color": "@sidebar_bg_color"
},
"palette": {
"blue_": {},
"green_": {},
"yellow_": {},
"orange_": {},
"red_": {},
"purple_": {},
"brown_": {},
"light_": {},
"dark_": {}
},
"custom_css": {
"gtk4": "",
"gtk3": ""
},
"plugins": {}
}
@@ -1,34 +0,0 @@
# exec = export SLURP_ARGS='-d -c {{ $onSecondaryContainer }}BB -b {{ $secondaryContainer }}44 -s 00000000'
general {
col.active_border = rgba({{ $onSurface }}39)
col.inactive_border = rgba({{ $outline }}30)
}
misc {
background_color = rgba({{ $surface }}FF)
}
plugin {
hyprbars {
# Honestly idk if it works like css, but well, why not
bar_text_font = Rubik, Geist, AR One Sans, Reddit Sans, Inter, Roboto, Ubuntu, Noto Sans, sans-serif
bar_height = 30
bar_padding = 10
bar_button_padding = 5
bar_precedence_over_border = true
bar_part_of_window = true
bar_color = rgba({{ $background }}FF)
col.text = rgba({{ $onBackground }}FF)
# example buttons (R -> L)
# hyprbars-button = color, size, on-click
hyprbars-button = rgb({{ $onBackground }}), 13, 󰖭, hyprctl dispatch killactive
hyprbars-button = rgb({{ $onBackground }}), 13, 󰖯, hyprctl dispatch fullscreen 1
hyprbars-button = rgb({{ $onBackground }}), 13, 󰖰, hyprctl dispatch movetoworkspacesilent special
}
}
windowrulev2 = bordercolor rgba({{ $primary }}AA) rgba({{ $primary }}77),pinned:1
@@ -1,102 +0,0 @@
# $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 = Rubik Light
$font_material_symbols = Material Symbols Rounded
background {
# color = rgba({{ $surfaceContainerLowest }}FF)
color = rgba(000000FF)
# path = {{ SWWW_WALL }}
# path = screenshot
# blur_size = 5
# blur_passes = 4
}
input-field {
monitor =
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
position = 0, 20
halign = center
valign = center
}
label { # Clock
monitor =
text = $TIME
shadow_passes = 1
shadow_boost = 0.5
color = $text_color
font_size = 65
font_family = $font_family_clock
position = 0, 300
halign = center
valign = center
}
label { # Greeting
monitor =
text = hi $USER !!!
shadow_passes = 1
shadow_boost = 0.5
color = $text_color
font_size = 20
font_family = $font_family
position = 0, 240
halign = center
valign = center
}
label { # lock icon
monitor =
text = lock
shadow_passes = 1
shadow_boost = 0.5
color = $text_color
font_size = 21
font_family = $font_material_symbols
position = 0, 65
halign = center
valign = bottom
}
label { # "locked" text
monitor =
text = locked
shadow_passes = 1
shadow_boost = 0.5
color = $text_color
font_size = 14
font_family = $font_family
position = 0, 45
halign = center
valign = bottom
}
label { # Status
monitor =
text = cmd[update:5000] ${XDG_CONFIG_HOME:-$HOME/.config}/hypr/hyprlock/status.sh
shadow_passes = 1
shadow_boost = 0.5
color = $text_color
font_size = 14
font_family = $font_family
position = 30, -30
halign = left
valign = top
}
@@ -1,38 +0,0 @@
{
"dark": {
"term0" : "#282828",
"term1" : "#CC241D",
"term2" : "#98971A",
"term3" : "#D79921",
"term4" : "#458588",
"term5" : "#B16286",
"term6" : "#689D6A",
"term7" : "#A89984",
"term8" : "#928374",
"term9" : "#FB4934",
"term10" : "#B8BB26",
"term11" : "#FABD2F",
"term12" : "#83A598",
"term13" : "#D3869B",
"term14" : "#8EC07C",
"term15" : "#EBDBB2"
},
"light": {
"term0" : "#FDF9F3",
"term1" : "#FF6188",
"term2" : "#A9DC76",
"term3" : "#FC9867",
"term4" : "#FFD866",
"term5" : "#F47FD4",
"term6" : "#78DCE8",
"term7" : "#333034",
"term8" : "#121212",
"term9" : "#FF6188",
"term10" : "#A9DC76",
"term11" : "#FC9867",
"term12" : "#FFD866",
"term13" : "#F47FD4",
"term14" : "#78DCE8",
"term15" : "#333034"
}
}
@@ -1,36 +0,0 @@
{
"dark": {
"term0": "#000000",
"term1": "#FFFFFF",
"term2": "#CCCCCC",
"term3": "#8f8f8f",
"term4": "#FFFFFF",
"term5": "#111111",
"term6": "#CCCCCC",
"term7": "#FFFFFF",
"term8": "#404040",
"term9": "#CCCCCC",
"term10": "#FFFFFF",
"term11": "#909090",
"term12": "#CCCCCC",
"term13": "#808080",
"term14": "#CCCCCC",
"term15": "#FFFFFF"
},
"light": {
"term0": "#EAE9EA",
"term1": "#777777",
"term2": "#000000",
"term3": "#000000",
"term4": "#000000",
"term5": "#000000",
"term6": "#000000",
"term7": "#202020",
"term8": "#000000",
"term9": "#000000",
"term10": "#CCCCCC",
"term11": "#808080",
"term12": "#CCCCCC",
"term13": "#FFFFFF"
}
}
@@ -1 +0,0 @@
]4;0;#$term0 #\]4;1;#$term1 #\]4;2;#$term2 #\]4;3;#$term3 #\]4;4;#$term4 #\]4;5;#$term5 #\]4;6;#$term6 #\]4;7;#$term7 #\]4;8;#$term8 #\]4;9;#$term9 #\]4;10;#$term10 #\]4;11;#$term11 #\]4;12;#$term12 #\]4;13;#$term13 #\]4;14;#$term14 #\]4;15;#$term15 #\]10;#$term7 #\]11;[$alpha]#$term0 #\]12;#$term7 #\]13;#$term7 #\]17;#$term7 #\]19;#$term0 #\]4;232;#$term7 #\]4;256;#$term7 #\]708;[$alpha]#$term0 #\