#!/usr/bin/env bash
set -e

# Nomarchy Wallpaper Helper
# Usage: nomarchy-wallpaper [selector|set <path>|next]

COMMAND="$1"

case "$COMMAND" in
    set)
        shift
        # Wallpaper set usually involves writing to state.json and calling swww
        nomarchy-theme-bg-set "$@"
        ;;
    next)
        nomarchy-theme-bg-next
        ;;
    selector|*)
        nomarchy-launch-walker -m menus:nomarchyBackgroundSelector --width 800 --minheight 400
        ;;
esac
