#!/usr/bin/env bash set -euo pipefail position="left" tilesize=48 magnification=1 show_recents=0 apply=0 assume_yes=0 while [[ $# -gt 0 ]]; do case "$1" in --position) position="${2:?нужно left, bottom или right}" shift 2 ;; --size) tilesize="${2:?нужно число}" shift 2 ;; --no-magnification) magnification=0 shift ;; --show-recents) show_recents=1 shift ;; --apply) apply=1 shift ;; --yes) assume_yes=1 shift ;; -h|--help) echo "Использование: dock_settings.sh [--position left|bottom|right] [--size N] [--apply] [--yes]" exit 0 ;; *) echo "Неизвестный аргумент: $1" >&2 exit 2 ;; esac done case "$position" in left|bottom|right) ;; *) echo "Положение должно быть left, bottom или right." >&2 exit 2 ;; esac if [[ ! "$tilesize" =~ ^[0-9]+$ ]] || [[ "$tilesize" -lt 24 ]] || [[ "$tilesize" -gt 128 ]]; then echo "Размер Dock должен быть от 24 до 128." >&2 exit 2 fi read_key() { defaults read com.apple.dock "$1" 2>/dev/null || echo "не задано" } echo "Текущие настройки Dock:" echo " autohide: $(read_key autohide)" echo " tilesize: $(read_key tilesize)" echo " magnification: $(read_key magnification)" echo " orientation: $(read_key orientation)" echo " mineffect: $(read_key mineffect)" echo " show-recents: $(read_key show-recents)" if [[ "$apply" -eq 0 ]]; then cat </dev/null || true echo "Настройки Dock обновлены, Dock перезапущен."