#!/usr/bin/env bash

XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}

install() {
	log "	Ensure clipse data directory exists, and start clipse."
	mkdir -p "$XDG_DATA_HOME/clipse" &>/dev/null
	setsid uwsm app -- clipse -listen
}

uninstall() {
	log "	Removing clipse data directory."
	rm -rf "$XDG_DATA_HOME/clipse"
}

arg=${1:-""}
[[ $arg == "install" ]] && install && exit $?
[[ $arg == "uninstall" ]] && uninstall && exit $?
