fix some shellcheck warnings

This commit is contained in:
end-4
2024-01-29 14:38:40 +07:00
parent 61931d07b2
commit 2b8d308b4f
2 changed files with 17 additions and 18 deletions
@@ -105,8 +105,8 @@ apply_term() {
echo "Template file not found for Terminal. Skipping that." echo "Template file not found for Terminal. Skipping that."
return return
fi fi
if [ ! -d $HOME/.cache/ags/user/colorschemes ]; then if [ ! -d "$HOME/.cache/ags/user/colorschemes" ]; then
mkdir -p $HOME/.cache/ags/user/colorschemes mkdir -p "$HOME/.cache/ags/user/colorschemes"
fi fi
# Copy template # Copy template
cp "scripts/templates/terminal/sequences.material" "$HOME/.cache/ags/user/colorschemes/sequences" cp "scripts/templates/terminal/sequences.material" "$HOME/.cache/ags/user/colorschemes/sequences"
@@ -117,7 +117,7 @@ apply_term() {
for file in /dev/pts/*; do for file in /dev/pts/*; do
if [[ $file =~ ^/dev/pts/[0-9]+$ ]]; then if [[ $file =~ ^/dev/pts/[0-9]+$ ]]; then
cat "$HOME/.cache/ags/user/colorschemes/sequences" > $file cat "$HOME/.cache/ags/user/colorschemes/sequences" > "$file"
fi fi
done done
} }
@@ -175,4 +175,4 @@ apply_hyprland &
apply_gtk & apply_gtk &
apply_gtklock & apply_gtklock &
apply_fuzzel & apply_fuzzel &
apply_term apply_term &
@@ -23,38 +23,37 @@ fi
cd "$HOME/.config/ags/scripts/" || exit cd "$HOME/.config/ags/scripts/" || exit
if [[ "$1" = "#"* ]]; then # this is a color 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 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 color_generation/applycolor.sh
fi fi
elif [ "$backend" = "material" ]; then 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 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 color_generation/applycolor.sh
fi fi
elif [ "$backend" = "pywal" ]; then elif [ "$backend" = "pywal" ]; then
# clear and generate # clear and generate
wal -c wal -c
#echo wal -i "$1" -n -t -s -e "$lightdark" -q
wal -i "$1" -n $lightdark -q wal -i "$1" -n $lightdark -q
# copy scss # copy scss
cp "$HOME/.cache/wal/colors.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 cat color_generation/pywal_to_material.scss >> "$HOME/.cache/ags/user/generated_colors.txt"
if [ "$2" = "--apply" ]; then if [ "$2" = "--apply" ]; then
sassc $HOME/.cache/ags/user/generated_colors.txt $HOME/.cache/ags/user/generated_colors_classes.scss --style compact 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/ { 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"
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 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 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 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 color_generation/applycolor.sh
fi fi