#!/usr/bin/bash


if [[ "$1" == ">"* ]]; then
    args=( $1 )
    ~/.config/eww/scripts/toggle-overview.sh --close &
    if [[ "${args[0]}" == ">music" ]]; then
        scripts/colormanage get
    elif [[ "${args[0]}" == ">load" ]]; then
        scripts/colormanage load "${args[1]}"
    elif [[ "${args[0]}" == ">save" ]]; then
        scripts/colormanage save "${args[1]}"
    elif [[ "${args[0]}" == ">light" ]]; then
        scripts/togglelight light
    elif [[ "${args[0]}" == ">dark" ]]; then
        scripts/togglelight dark
    elif [[ "${args[0]}" == ">wall" ]]; then
        scripts/colorgen 'images/wallpaper/wallpaper' '[Local wallpaper]' ''
        scripts/colormanage get
    else
        # notify-send 'eww' 'Invalid command!'
        false
    fi
else 
    cd ~
    ~/.config/eww/scripts/toggle-overview.sh --close &
    app=$1
    eval "${app%\%*}" &
    pkill launchapp
fi


