# shellcheck shell=dash

xrc:mod:lib     mac     _desktop/finder/hidden
___x_cmd_mac_finder(){
    [ "$#" -gt 0 ] || set -- --help

    local op="$1";  shift
    case "$op" in
        -h|--help)  ___x_cmd help -m mac finder ;;
        hidden|desktop|status)
            ___x_cmd_mac_finder_"$op" "$@"
            ;;
    esac
}

___x_cmd_mac_finder_hidden(){
    ___x_cmd_mac_hidden "$@"
}

___x_cmd_mac_finder_desktop(){
    local op="$1";  shift
    case "$op" in
        -h|--help)
            ___x_cmd help -m mac finder desktop
            return ;;
        show)
            ___x_cmd_mac___cmd defaults write com.apple.finder CreateDesktop -bool true    ;;
        hide)
            ___x_cmd_mac___cmd defaults write com.apple.finder CreateDesktop -bool false   ;;
    esac
    ___x_cmd_mac___cmd killall Finder
}

___x_cmd_mac_finder_status(){
    local op="$1";  shift
    case "$op" in
        -h|--help)
            ___x_cmd help -m mac finder status
            return ;;
        show)
            ___x_cmd_mac___cmd defaults write com.apple.finder ShowStatusBar -bool true   ;;
        hide)
            ___x_cmd_mac___cmd defaults write com.apple.finder ShowStatusBar -bool false  ;;
    esac
    ___x_cmd_mac___cmd killall Finder
}

# Show file extensions
# defaults write NSGlobalDomain AppleShowAllExtensions -bool true

# The Finder window displays the full file path at the top
# defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
