add manual accent color arg to launcher cmd (#534)

This commit is contained in:
end-4 2024-05-25 07:55:00 +07:00
parent f251554043
commit d6b6f79f03
2 changed files with 8 additions and 3 deletions

View file

@ -29,7 +29,10 @@ export function launchCustomCommand(command) {
execAsync([`bash`, `-c`, `${App.configDir}/scripts/color_generation/switchwall.sh`, `&`]).catch(print);
}
else if (args[0] == '>color') { // Generate colorscheme from color picker
execAsync([`bash`, `-c`, `${App.configDir}/scripts/color_generation/switchcolor.sh --pick`, `&`]).catch(print);
if (!args[1])
execAsync([`bash`, `-c`, `${App.configDir}/scripts/color_generation/switchcolor.sh --pick`, `&`]).catch(print);
else if(args[1][0] === '#')
execAsync([`bash`, `-c`, `${App.configDir}/scripts/color_generation/switchcolor.sh "${args[1]}"`, `&`]).catch(print);
}
else if (args[0] == '>light') { // Light mode
darkMode.value = false;
@ -45,8 +48,8 @@ export function launchCustomCommand(command) {
}
else if (args[0] == '>badapple') { // Black and white
execAsync([`bash`, `-c`, `mkdir -p ${GLib.get_user_state_dir()}/ags/user && sed -i "3s/.*/monochrome/" ${GLib.get_user_state_dir()}/ags/user/colormode.txt`])
.then(execAsync(['bash', '-c', `${App.configDir}/scripts/color_generation/switchcolor.sh`]))
.catch(print);
.then(execAsync(['bash', '-c', `${App.configDir}/scripts/color_generation/switchcolor.sh`]))
.catch(print);
}
else if (args[0] == '>material') { // Use material colors
execAsync([`bash`, `-c`, `mkdir -p ${GLib.get_user_state_dir()}/ags/user && echo "material" > ${GLib.get_user_state_dir()}/ags/user/colorbackend.txt`]).catch(print)

View file

@ -9,6 +9,8 @@ STATE_DIR="$XDG_STATE_HOME/ags"
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