스크립트를 실행하면 아래쪽 화면터럼 날짜 선택 창이 뜨고 그걸 변수로 받아서 결과를 보여준 예제 입니다.
오늘 날짜를 음력으로 변환해보는 ㅋㅋ
#!/data/data/com.termux/files/usr/bin/sh
result=$(termux-dialog date -d "yyyy-MM-dd" -t 'SELECT Date' | tr -d '\n' | cut -d'"' -f6 );
echo 'DATE : ' $result;
lunar=$(sqlite3 calendar.db "select lunar from cal where solar = '$result' ;")
echo -n "LUNAR : " $lunar
echo
termux-clipboard-set $lunar
termux-tts-speak $lunar
exit
첫줄에서 팝업창이 뜨게합니다.
셋째줄에서 db 에서 음력을 찾아서 변수로 저장합니다.
마지막부분 클립보드셋으며 클립보드로 복사해주고
tts-speak 로 읽어주기 까지.....
termux 이넘 정말이지..... ㅋㅋㅋ
다양한 종류의 팝업창이 존재하네요.
테크박스 라디오버튼 등등 아주아주....
Show dialog widget for user input.
Usage
termux-dialog widget [options]
Output is returned in json format.
Options
-l, list List all widgets and their options
-t, title Set title of input dialog (optional)
Widget-specific options
confirm - Show confirmation dialog
[-i hint] text hint (optional)
[-t title] set title of dialog (optional)
checkbox - Select multiple values using checkboxes
[-v ",,,"] comma delim values to use (required)
[-t title] set title of dialog (optional)
counter - Pick a number in specified range
[-r min,max,start] comma delim of (3) numbers to use (optional)
[-t title] set title of dialog (optional)
date - Pick a date
[-t title] set title of dialog (optional)
[-d "dd-MM-yyyy k:m:s"] SimpleDateFormat Pattern for date widget output (optional)
radio - Pick a single value from radio buttons
[-v ",,,"] comma delim values to use (required)
[-t title] set title of dialog (optional)
sheet - Pick a value from sliding bottom sheet
[-v ",,,"] comma delim values to use (required)
[-t title] set title of dialog (optional)
spinner - Pick a single value from a dropdown spinner
[-v ",,,"] comma delim values to use (required)
[-t title] set title of dialog (optional)
speech - Obtain speech using device microphone
[-i hint] text hint (optional)
[-t title] set title of dialog (optional)
text - Input text (default if no widget specified)
[-i hint] text hint (optional)
[-m] multiple lines instead of single (optional)*
[-n] enter input as numbers (optional)*
[-p] enter input as password (optional)
[-t title] set title of dialog (optional)
* cannot use [-m] with [-n]
time - Pick a time value
[-t title] set title of dialog (optional)