ags: sync

This commit is contained in:
end-4
2024-02-05 13:20:00 +07:00
parent 14368314e5
commit 73c8454c1c
61 changed files with 1327 additions and 1220 deletions
@@ -41,7 +41,7 @@ get_light_dark() {
lightdark=""
if [ ! -f ~/.cache/ags/user/colormode.txt ]; then
echo "" > ~/.cache/ags/user/colormode.txt
else
else
lightdark=$(cat ~/.cache/ags/user/colormode.txt) # either "" or "-l"
fi
echo "$lightdark"
@@ -55,7 +55,7 @@ apply_gtklock() {
sassc ~/.config/ags/scripts/templates/gtklock/main.scss ~/.config/gtklock/style.css
return
fi
# Check if scripts/templates/gtklock/style.css exists
if [ ! -f "scripts/templates/gtklock/style.css" ]; then
echo "Template file not found for Gtklock. Skipping that."
@@ -99,6 +99,29 @@ apply_foot() {
cp "$HOME/.config/foot/foot_new.ini" "$HOME/.config/foot/foot.ini"
}
apply_term() {
# Check if scripts/templates/foot/foot.ini exists
if [ ! -f "scripts/templates/terminal/sequences.material" ]; then
echo "Template file not found for Terminal. Skipping that."
return
fi
if [ ! -d "$HOME/.cache/ags/user/colorschemes" ]; then
mkdir -p "$HOME/.cache/ags/user/colorschemes"
fi
# Copy template
cp "scripts/templates/terminal/sequences.material" "$HOME/.cache/ags/user/colorschemes/sequences"
# Apply colors
for i in "${!colorlist[@]}"; do
sed -i "s/${colorlist[$i]} #/${colorvalues[$i]#\#}/g" "$HOME/.cache/ags/user/colorschemes/sequences"
done
for file in /dev/pts/*; do
if [[ $file =~ ^/dev/pts/[0-9]+$ ]]; then
cat "$HOME/.cache/ags/user/colorschemes/sequences" > "$file"
fi
done
}
apply_hyprland() {
# Check if scripts/templates/hypr/colors.conf exists
if [ ! -f "scripts/templates/hypr/colors.conf" ]; then
@@ -111,14 +134,14 @@ apply_hyprland() {
for i in "${!colorlist[@]}"; do
sed -i "s/{{ ${colorlist[$i]} }}/${colorvalues[$i]#\#}/g" "$HOME/.config/hypr/colors_new.conf"
done
mv "$HOME/.config/hypr/colors_new.conf" "$HOME/.config/hypr/colors.conf"
}
apply_gtk() { # Using gradience-cli
lightdark=$(get_light_dark)
# Copy template
# Copy template
cp "scripts/templates/gradience/preset_template.json" "scripts/templates/gradience/preset.json"
# Apply colors
@@ -129,8 +152,8 @@ apply_gtk() { # Using gradience-cli
mkdir -p "$HOME/.config/presets" # create gradience presets folder
gradience-cli apply -p scripts/templates/gradience/preset.json --gtk both
# Set light/dark preference
# And set GTK theme manually as Gradience defaults to light adw-gtk3
# Set light/dark preference
# And set GTK theme manually as Gradience defaults to light adw-gtk3
# (which is unreadable when broken when you use dark mode)
if [ "$lightdark" = "-l" ]; then
gsettings set org.gnome.desktop.interface gtk-theme 'adw-gtk3'
@@ -152,4 +175,4 @@ apply_hyprland &
apply_gtk &
apply_gtklock &
apply_fuzzel &
apply_foot
apply_term &
@@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/usr/bin/env bash
# check if no arguments
if [ $# -eq 0 ]; then
@@ -10,51 +10,50 @@ fi
lightdark=""
if [ ! -f "$HOME/.cache/ags/user/colormode.txt" ]; then
echo "" > "$HOME/.cache/ags/user/colormode.txt"
else
else
lightdark=$(cat "$HOME/.cache/ags/user/colormode.txt") # either "" or "-l"
fi
# check if the file ~/.cache/ags/user/colorbackend.txt exists. if not, create it. else, read it to $lightdark
backend="material"
if [ ! -f "$HOME/.cache/ags/user/colorbackend.txt" ]; then
echo "material" > "$HOME/.cache/ags/user/colorbackend.txt"
else
else
backend=$(cat "$HOME/.cache/ags/user/colorbackend.txt") # either "" or "-l"
fi
cd "$HOME/.config/ags/scripts/" || exit
if [[ "$1" = "#"* ]]; then # this is a color
color_generation/generate_colors_material.py --color "$1" "$lightdark" > $HOME/.cache/ags/user/generated_colors.txt
color_generation/generate_colors_material.py --color "$1" "$lightdark" > "$HOME/.cache/ags/user/generated_colors.txt"
if [ "$2" = "--apply" ]; then
cp $HOME/.cache/ags/user/generated_colors.txt "$HOME/.config/ags/scss/_material.scss"
cp "$HOME/.cache/ags/user/generated_colors.txt" "$HOME/.config/ags/scss/_material.scss"
color_generation/applycolor.sh
fi
elif [ "$backend" = "material" ]; then
color_generation/generate_colors_material.py --path "$1" "$lightdark" > $HOME/.cache/ags/user/generated_colors.txt
color_generation/generate_colors_material.py --path "$1" "$lightdark" > "$HOME/.cache/ags/user/generated_colors.txt"
if [ "$2" = "--apply" ]; then
cp $HOME/.cache/ags/user/generated_colors.txt "$HOME/.config/ags/scss/_material.scss"
cp "$HOME/.cache/ags/user/generated_colors.txt" "$HOME/.config/ags/scss/_material.scss"
color_generation/applycolor.sh
fi
elif [ "$backend" = "pywal" ]; then
# clear and generate
wal -c
echo wal -i "$1" -n -t -s -e "$lightdark" -q
wal -i "$1" -n -t -s -e $lightdark -q
wal -i "$1" -n $lightdark -q
# copy scss
cp "$HOME/.cache/wal/colors.scss" $HOME/.cache/ags/user/generated_colors.txt
cat color_generation/pywal_to_material.scss >> $HOME/.cache/ags/user/generated_colors.txt
cp "$HOME/.cache/wal/colors.scss" "$HOME/.cache/ags/user/generated_colors.txt"
cat color_generation/pywal_to_material.scss >> "$HOME/.cache/ags/user/generated_colors.txt"
if [ "$2" = "--apply" ]; then
sassc $HOME/.cache/ags/user/generated_colors.txt $HOME/.cache/ags/user/generated_colors_classes.scss --style compact
sed -i "s/ { color//g" $HOME/.cache/ags/user/generated_colors_classes.scss
sed -i "s/\./$/g" $HOME/.cache/ags/user/generated_colors_classes.scss
sed -i "s/}//g" $HOME/.cache/ags/user/generated_colors_classes.scss
sassc "$HOME/.cache/ags/user/generated_colors.txt" "$HOME/.cache/ags/user/generated_colors_classes.scss" --style compact
sed -i "s/ { color//g" "$HOME/.cache/ags/user/generated_colors_classes.scss"
sed -i "s/\./$/g" "$HOME/.cache/ags/user/generated_colors_classes.scss"
sed -i "s/}//g" "$HOME/.cache/ags/user/generated_colors_classes.scss"
if [ "$lightdark" = "-l" ]; then
printf "\n"'$darkmode: false;'"\n" >> $HOME/.cache/ags/user/generated_colors_classes.scss
printf "\n""\$darkmode: false;""\n" >> "$HOME/.cache/ags/user/generated_colors_classes.scss"
else
printf "\n"'$darkmode: true;'"\n" >> $HOME/.cache/ags/user/generated_colors_classes.scss
printf "\n""\$darkmode: true;""\n" >> "$HOME/.cache/ags/user/generated_colors_classes.scss"
fi
cp $HOME/.cache/ags/user/generated_colors_classes.scss "$HOME/.config/ags/scss/_material.scss"
cp "$HOME/.cache/ags/user/generated_colors_classes.scss" "$HOME/.config/ags/scss/_material.scss"
color_generation/applycolor.sh
fi
@@ -1,4 +1,4 @@
#!/bin/python3
#!/usr/bin/env python3
from material_color_utilities_python import *
from pathlib import Path
import sys
@@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/usr/bin/env bash
color=$(hyprpicker --no-fancy)
@@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/usr/bin/env bash
if [ "$1" == "--noswitch" ]; then
imgpath=$(swww query | awk -F 'image: ' '{print $2}')
+2
View File
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
hyprctl dispatch "$1" $(((($(hyprctl activeworkspace -j | gojq -r .id) - 1) / 10) * 10 + $2))
+9 -2
View File
@@ -1,4 +1,11 @@
#!/bin/bash
#!/usr/bin/env bash
# Check if sway is running
if ! pgrep -x sway > /dev/null; then
echo "Sway is not running"
exit 1
fi
# Get the current workspace number
current=$(swaymsg -t get_workspaces | gojq '.[] | select(.focused==true) | .num')
@@ -20,4 +27,4 @@ if [[ $2 == 'move' ]]; then
swaymsg move container to workspace $new_workspace
else
swaymsg workspace $new_workspace
fi
fi
@@ -87,9 +87,9 @@
"BLACK_500": "#393634",
"BLACK_700": "#33302F",
"BLACK_900": "#2B2928",
"accent_bg_color": "#e4b5ff",
"accent_fg_color": "#471868",
"accent_color": "#e4b5ff",
"accent_bg_color": "#ffb1c3",
"accent_fg_color": "#66002a",
"accent_color": "#ffb1c3",
"destructive_bg_color": "#ffb4a9",
"destructive_fg_color": "#680003",
"destructive_color": "#ffb4a9",
@@ -99,22 +99,22 @@
"warning_fg_color": "rgba(0, 0, 0, 0.87)",
"error_bg_color": "#ffb4a9",
"error_fg_color": "#680003",
"window_bg_color": "#111012",
"window_fg_color": "#e7e0e5",
"view_bg_color": "#1d1b1e",
"view_fg_color": "#e7e0e5",
"window_bg_color": "#130F10",
"window_fg_color": "#ecdfe0",
"view_bg_color": "#201a1b",
"view_fg_color": "#ecdfe0",
"headerbar_bg_color": "mix(@dialog_bg_color, @window_bg_color, 0.5)",
"headerbar_fg_color": "#eedcf5",
"headerbar_border_color": "#4f4256",
"headerbar_fg_color": "#ffd9df",
"headerbar_border_color": "#5c3f45",
"headerbar_backdrop_color": "@headerbar_bg_color",
"headerbar_shade_color": "rgba(0, 0, 0, 0.09)",
"card_bg_color": "#111012",
"card_fg_color": "#eedcf5",
"card_bg_color": "#130F10",
"card_fg_color": "#ffd9df",
"card_shade_color": "rgba(0, 0, 0, 0.09)",
"dialog_bg_color": "#4f4256",
"dialog_fg_color": "#eedcf5",
"popover_bg_color": "#4f4256",
"popover_fg_color": "#eedcf5",
"dialog_bg_color": "#5c3f45",
"dialog_fg_color": "#ffd9df",
"popover_bg_color": "#5c3f45",
"popover_fg_color": "#ffd9df",
"thumbnail_bg_color": "#1a1b26",
"thumbnail_fg_color": "#AEE5FA",
"shade_color": "rgba(0, 0, 0, 0.36)",
+4 -16
View File
@@ -5,23 +5,11 @@ general {
col.inactive_border = rgba({{ $secondaryContainer }}CC)
}
plugin {
droidbars { # This is my hyprbars mod that broke :(
# example config
bar_height = 30
background_color = rgba({{ $background }}FF)
# background_color_active = rgba({{ $surfaceVariant }}FF) # Not added yet
text_color = rgba({{ $onSecondaryContainer }}FF)
font_family = Rubik, Geist, AR One Sans, Reddit Sans, Inter, Roboto, Ubuntu, Noto Sans, sans-serif
button_font_fmily = JetBrainsMono NF
misc {
background_color = rgba({{ $surface }}FF)
}
# example buttons (R -> L)
# droidbars-button = [0]isLeft(0/1), [1]color, [2]color2, [3]width, [4]height, [5]icon, [6]buttonType, [7]on-click
droidbars-button = 0, rgba({{ $onSecondaryContainer }}FF), rgba({{ $primary }}FF), 42, 16, 󰖭, normal, hyprctl dispatch killactive
droidbars-button = 0, rgba({{ $onSecondaryContainer }}FF), rgba({{ $primary }}FF), 42, 16, , normal, hyprctl dispatch fullscreen 1
droidbars-button = 1, rgba({{ $onSecondaryContainer }}FF), rgba({{ $primary }}FF), 16, 16,‎󰐃, pin, hyprctl dispatch pin
droidbars-button = 1, rgba({{ $onSecondaryContainer }}FF), rgba({{ $primary }}FF), 16, 16,󰗘, float, hyprctl dispatch togglefloating
}
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
@@ -0,0 +1 @@
]4;0;#$background #\]4;1;#$error #\]4;2;#$inversePrimary #\]4;3;#$onPrimaryContainer #\]4;4;#$onPrimaryContainer #\]4;5;#$onSecondaryContainer #\]4;6;#$primary #\]4;7;#$onSurfaceVariant #\]4;8;#$background #\]4;9;#$error #\]4;10;#$inversePrimary #\]4;11;#$onPrimaryContainer #\]4;12;#$onPrimaryContainer #\]4;13;#$onSecondaryContainer #\]4;14;#$primary #\]4;15;#$onSurfaceVariant #\]10;#$onSurfaceVariant #\]11;#$background #\]12;#$onSurfaceVariant #\]13;#$onSurfaceVariant #\]17;#$onSurfaceVariant #\]19;#$background #\]4;232;#$background #\]4;256;#$onSurfaceVariant #\]708;#$background #\
@@ -0,0 +1 @@
]4;0;#regular0\]4;1;#regular1\]4;2;#regular2\]4;3;#regular3\]4;4;#regular4\]4;5;#regular5\]4;6;#regular6\]4;7;#regular7\]4;8;#bright0\]4;9;#bright1\]4;10;#bright2\]4;11;#bright3\]4;12;#bright4\]4;13;#bright5\]4;14;#bright6\]4;15;#bright7\]10;#regular7\]11;#regular0\]12;#regular7\]13;#regular7\]17;#regular7\]19;#regular0\]4;232;#regular0\]4;256;#regular7\]708;#regular0\