목차

, , , , ,

dialog configuration

dialog의 runtime configuration file 작성, 적용 순서, 안전한 생성·검증 방법을 정리한다.

Summary

File Location

위치 또는 변수 의미
$HOME/.dialogrc 기본 사용자 설정 file이다.
DIALOGRC 기본 경로 대신 읽을 설정 file을 지정한다.

system-wide 위치와 compile-time 기능은 배포판 build에 따라 다를 수 있다. 현재 적용 file을 명확하게 제어해야 할 때는 DIALOGRC를 command 범위에만 지정한다.

Authoring

먼저 현재 설치본이 지원하는 template을 임시 file에 생성해 검토한다.

tmp_rc=$(mktemp)
dialog --create-rc "$tmp_rc"
less "$tmp_rc"

검토 후 사용자 설정으로 복사한다. 기존 설정이 있으면 덮어쓰기 전에 backup과 diff를 확인한다.

test -e "$HOME/.dialogrc" && cp "$HOME/.dialogrc" "$HOME/.dialogrc.bak"
cp "$tmp_rc" "$HOME/.dialogrc"
rm -f "$tmp_rc"
release나 build option에 따라 지원 key가 달라질 수 있다. 다른 host에서 생성한 file을 그대로 배포하기보다 대상 host의 –create-rc 결과와 비교한다.

Common Fields

생성된 template에는 일반적으로 shadow 사용 여부, aspect ratio, 각 widget 영역의 foreground/background color와 text attribute가 포함된다.

Precedence

  1. command에 DIALOGRC가 설정되어 있으면 해당 file을 사용한다.
  2. 그렇지 않으면 기본 사용자 file $HOME/.dialogrc를 확인한다.
  3. command-line common option은 해당 invocation의 표시 동작을 조정한다.

정확한 precedence와 compile-time 기본값은 사용 중인 dialog(1) manual 및 생성 template을 기준으로 한다.

Validation

별도 설정을 command 하나에만 적용해 test한다.

DIALOGRC="$HOME/.dialogrc.test" dialog --msgbox "설정 시험" 8 40

terminal 크기와 색상 수를 함께 확인한다.

dialog --print-maxsize
tput colors
printf 'TERM=%s\n' "$TERM"

Troubleshooting

설정이 적용되지 않음

색상이 읽기 어려움

See Also

History