mirror of
https://github.com/end-4/dots-hyprland.git
synced 2026-06-06 07:19:27 -05:00
chore: move color .scss files to XDG_STATE_HOME
This commit is contained in:
@@ -33,11 +33,12 @@ function forMonitorsAsync(widget) {
|
||||
}
|
||||
|
||||
// SCSS compilation
|
||||
Utils.exec(`bash -c 'echo "" > ${App.configDir}/scss/_musicwal.scss'`); // reset music styles
|
||||
Utils.exec(`bash -c 'echo "" > ${App.configDir}/scss/_musicmaterial.scss'`); // reset music styles
|
||||
Utils.exec(`mkdir -p "${GLib.get_user_state_dir()}/ags/scss"`);
|
||||
Utils.exec(`bash -c 'echo "" > ${GLib.get_user_state_dir()}/ags/scss/_musicwal.scss'`); // reset music styles
|
||||
Utils.exec(`bash -c 'echo "" > ${GLib.get_user_state_dir()}/ags/scss/_musicmaterial.scss'`); // reset music styles
|
||||
async function applyStyle() {
|
||||
Utils.exec(`mkdir -p ${COMPILED_STYLE_DIR}`);
|
||||
Utils.exec(`sass ${App.configDir}/scss/main.scss ${COMPILED_STYLE_DIR}/style.css`);
|
||||
Utils.exec(`sass -I "${GLib.get_user_state_dir()}/ags/scss" -I "${App.configDir}/scss/fallback" "${App.configDir}/scss/main.scss" "${COMPILED_STYLE_DIR}/style.css"`);
|
||||
App.resetCss();
|
||||
App.applyCss(`${COMPILED_STYLE_DIR}/style.css`);
|
||||
console.log('[LOG] Styles loaded')
|
||||
|
||||
@@ -16,12 +16,13 @@ import userOptions from './modules/.configuration/user_options.js';
|
||||
// Widgets
|
||||
import Overview from './modules/overview/main.js';
|
||||
|
||||
Utils.exec(`bash -c 'echo "" > ${App.configDir}/scss/_musicwal.scss'`); // reset music styles
|
||||
Utils.exec(`bash -c 'echo "" > ${App.configDir}/scss/_musicmaterial.scss'`); // reset music styles
|
||||
const COMPILED_STYLE_DIR = `${GLib.get_user_cache_dir()}/ags/user/generated`
|
||||
Utils.exec(`mkdir -p "${GLib.get_user_state_dir()}/ags/scss"`);
|
||||
Utils.exec(`bash -c 'echo "" > ${GLib.get_user_state_dir()}/ags/scss/_musicwal.scss'`); // reset music styles
|
||||
Utils.exec(`bash -c 'echo "" > ${GLib.get_user_state_dir()}/ags/scss/_musicmaterial.scss'`); // reset music styles
|
||||
async function applyStyle() {
|
||||
Utils.exec(`mkdir -p ${COMPILED_STYLE_DIR}`);
|
||||
Utils.exec(`sass ${App.configDir}/scss/main.scss ${COMPILED_STYLE_DIR}/style.css`);
|
||||
Utils.exec(`sass -I "${GLib.get_user_state_dir()}/ags/scss" -I "${App.configDir}/scss/fallback" "${App.configDir}/scss/main.scss" "${COMPILED_STYLE_DIR}/style.css"`);
|
||||
App.resetCss();
|
||||
App.applyCss(`${COMPILED_STYLE_DIR}/style.css`);
|
||||
console.log('[LOG] Styles loaded')
|
||||
|
||||
@@ -206,11 +206,11 @@ const CoverArt = ({ player, ...rest }) => {
|
||||
|
||||
// Generate colors
|
||||
execAsync(['bash', '-c',
|
||||
`${App.configDir}/scripts/color_generation/generate_colors_material.py --path '${coverPath}' --mode ${darkMode.value ? 'dark' : 'light'} > ${App.configDir}/scss/_musicmaterial.scss`])
|
||||
`${App.configDir}/scripts/color_generation/generate_colors_material.py --path '${coverPath}' --mode ${darkMode.value ? 'dark' : 'light'} > ${GLib.get_user_state_dir()}/ags/scss/_musicmaterial.scss`])
|
||||
.then(() => {
|
||||
exec(`wal -i "${player.coverPath}" -n -t -s -e -q ${darkMode.value ? '' : '-l'}`)
|
||||
exec(`cp ${GLib.get_user_cache_dir()}/wal/colors.scss ${App.configDir}/scss/_musicwal.scss`);
|
||||
exec(`sass ${App.configDir}/scss/_music.scss ${stylePath}`);
|
||||
exec(`cp ${GLib.get_user_cache_dir()}/wal/colors.scss ${GLib.get_user_state_dir()}/ags/scss/_musicwal.scss`);
|
||||
exec(`sass -I "${GLib.get_user_state_dir()}/ags/scss" -I "${App.configDir}/scss/fallback" "${App.configDir}/scss/_music.scss" "${stylePath}"`);
|
||||
Utils.timeout(200, () => {
|
||||
// self.attribute.showImage(self, coverPath)
|
||||
self.css = `background-image: url('${coverPath}');`; // CSS image
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
|
||||
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
|
||||
@@ -148,22 +150,22 @@ apply_gtk() { # Using gradience-cli
|
||||
}
|
||||
|
||||
apply_ags() {
|
||||
sass "$CONFIG_DIR"/scss/main.scss "$CACHE_DIR"/user/generated/style.css
|
||||
sass -I "$STATE_DIR/scss" -I "$CONFIG_DIR/scss/fallback" "$CONFIG_DIR"/scss/main.scss "$CACHE_DIR"/user/generated/style.css
|
||||
ags run-js 'openColorScheme.value = true; Utils.timeout(2000, () => openColorScheme.value = false);'
|
||||
ags run-js "App.resetCss(); App.applyCss('${CACHE_DIR}/user/generated/style.css');"
|
||||
}
|
||||
|
||||
if [[ "$1" = "--bad-apple" ]]; then
|
||||
lightdark=$(get_light_dark)
|
||||
cp scripts/color_generation/specials/_material_badapple"${lightdark}".scss scss/_material.scss
|
||||
cp scripts/color_generation/specials/_material_badapple"${lightdark}".scss $STATE_DIR/scss/_material.scss
|
||||
colornames=$(cat scripts/color_generation/specials/_material_badapple"${lightdark}".scss | cut -d: -f1)
|
||||
colorstrings=$(cat scripts/color_generation/specials/_material_badapple"${lightdark}".scss | cut -d: -f2 | cut -d ' ' -f2 | cut -d ";" -f1)
|
||||
IFS=$'\n'
|
||||
colorlist=( $colornames ) # Array of color names
|
||||
colorvalues=( $colorstrings ) # Array of color values
|
||||
else
|
||||
colornames=$(cat scss/_material.scss | cut -d: -f1)
|
||||
colorstrings=$(cat 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
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
|
||||
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
|
||||
@@ -48,7 +50,7 @@ if [[ "$1" = "#"* ]]; then # this is a color
|
||||
--termscheme $terminalscheme --blend_bg_fg \
|
||||
> "$CACHE_DIR"/user/generated/material_colors.scss
|
||||
if [ "$2" = "--apply" ]; then
|
||||
cp "$CACHE_DIR"/user/generated/material_colors.scss "$CONFIG_DIR/scss/_material.scss"
|
||||
cp "$CACHE_DIR"/user/generated/material_colors.scss "$STATE_DIR/scss/_material.scss"
|
||||
color_generation/applycolor.sh
|
||||
fi
|
||||
elif [ "$backend" = "material" ]; then
|
||||
@@ -62,7 +64,7 @@ elif [ "$backend" = "material" ]; then
|
||||
--cache "$CACHE_DIR/user/color.txt" $smartflag \
|
||||
> "$CACHE_DIR"/user/generated/material_colors.scss
|
||||
if [ "$2" = "--apply" ]; then
|
||||
cp "$CACHE_DIR"/user/generated/material_colors.scss "$CONFIG_DIR/scss/_material.scss"
|
||||
cp "$CACHE_DIR"/user/generated/material_colors.scss "$STATE_DIR/scss/_material.scss"
|
||||
color_generation/applycolor.sh
|
||||
fi
|
||||
elif [ "$backend" = "pywal" ]; then
|
||||
@@ -74,7 +76,7 @@ elif [ "$backend" = "pywal" ]; then
|
||||
|
||||
cat color_generation/pywal_to_material.scss >> "$CACHE_DIR"/user/generated/material_colors.scss
|
||||
if [ "$2" = "--apply" ]; then
|
||||
sass "$CACHE_DIR"/user/generated/material_colors.scss "$CACHE_DIR"/user/generated/colors_classes.scss --style compact
|
||||
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
|
||||
@@ -84,7 +86,7 @@ elif [ "$backend" = "pywal" ]; then
|
||||
printf "\n""\$darkmode: true;""\n" >> "$CACHE_DIR"/user/generated/colors_classes.scss
|
||||
fi
|
||||
|
||||
cp "$CACHE_DIR"/user/generated/colors_classes.scss "$CONFIG_DIR/scss/_material.scss"
|
||||
cp "$CACHE_DIR"/user/generated/colors_classes.scss "$STATE_DIR/scss/_material.scss"
|
||||
|
||||
color_generation/applycolor.sh
|
||||
fi
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
@import './material';
|
||||
@import './musicmaterial';
|
||||
@import 'material';
|
||||
@import 'musicmaterial';
|
||||
@import './wal';
|
||||
@import './musicwal';
|
||||
@import 'musicwal';
|
||||
@import './colors';
|
||||
@import './lib_mixins';
|
||||
$music_transparentize_amount: 0.3;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*:not(popover) { all: unset; }
|
||||
|
||||
// Colors
|
||||
@import './material'; // Material colors
|
||||
@import 'material'; // Material colors
|
||||
@import './colors'; // Global color definitions. Uses material colors as base.
|
||||
@import './lib_mixins';
|
||||
@import './lib_classes';
|
||||
|
||||
Reference in New Issue
Block a user