#!/bin/zsh

function desktop() {
  declare hide
  declare show

  zparseopts -D -E -K -- \
    {h,-hide}=hide \
    {s,-show}=show

  if [ -n "$hide" ]; then
    defaults write com.apple.finder CreateDesktop false && killall Finder
    return 0
  fi

  if [ -n "$show" ]; then
    defaults write com.apple.finder CreateDesktop true && killall Finder
    return 0
  fi

  echo "Please pass in --hide | --show"
  return 1
}
