$ kdialog --help Usage: kdialog [Qt-options] [KDE-options] [options] [arg] KDialog can be used to show nice dialog boxes from shell scripts Generic options: --help Show help about options --help-qt Show Qt specific options --help-kde Show KDE specific options --help-all Show all options --author Show author information -v, --version Show version information --license Show license information -- End of options Options: --yesno <text> Question message box with yes/no buttons --yesnocancel <text> Question message box with yes/no/cancel buttons --warningyesno <text> Warning message box with yes/no buttons --warningcontinuecancel <text> Warning message box with continue/cancel buttons --warningyesnocancel <text> Warning message box with yes/no/cancel buttons --yes-label <text> Use text as Yes button label --no-label <text> Use text as No button label --cancel-label <text> Use text as Cancel button label --continue-label <text> Use text as Continue button label --sorry <text> 'Sorry' message box --detailedsorry <text> <details> 'Sorry' message box with expandable Details field --error <text> 'Error' message box --detailederror <text> <details> 'Error' message box with expandable Details field --msgbox <text> Message Box dialog --inputbox <text> <init> Input Box dialog --password <text> Password dialog --textbox <file> [width] [height] Text Box dialog --textinputbox <text> <init> [width] [height] Text Input Box dialog --combobox <text> item [item] [item] ... ComboBox dialog --menu <text> [tag item] [tag item] ... Menu dialog --checklist <text> [tag item status] ... Check List dialog --radiolist <text> [tag item status] ... Radio List dialog --passivepopup <text> <timeout> Passive Popup --getopenfilename [startDir] [filter] File dialog to open an existing file --getsavefilename [startDir] [filter] File dialog to save a file --getexistingdirectory [startDir] File dialog to select an existing directory --getopenurl [startDir] [filter] File dialog to open an existing URL --getsaveurl [startDir] [filter] File dialog to save a URL --geticon [group] [context] Icon chooser dialog --progressbar <text> [totalsteps] Progress bar dialog, returns a D-Bus reference for communication --getcolor Color dialog to select a color --title <text> Dialog title --default <text> Default entry to use for combobox, menu and color --multiple Allows the --getopenurl and --getopenfilename options to return multiple files --separate-output Return list items on separate lines (for checklist option and file open with --multiple) --print-winid Outputs the winId of each dialog --dontagain <file:entry> Config file and option name for saving the "do-not-show/ask-again" state --slider <text> [minvalue] [maxvalue] [step] Slider dialog box, returns selected value --calendar <text> Calendar dialog box, returns selected date --attach <winid> Makes the dialog transient for an X app specified by winid Arguments: arg Arguments - depending on main option |
$ kdialog --msgbox "Seja bem-vindo(a) à Logicus" |
$ kdialog --title "Logicus" --msgbox "Seja bem-vindo(a)\nAproveite a leitura deste paper" |
$ kdialog --title "Logicus" --dontagain arquivo:entrada --msgbox "Você está logado como usuário comum. Muitas opções podem não func ionar" |
$ kdialog --title "Logicus" --textbox /etc/passwd |
$ kdialog --title "Logicus" --textbox /etc/passwd 400 700 |
$ kdialog --sorry "Como usuário comum você não terá acesso a todas as configurações. Informações em suporte@logicus.com.br" |
$ kdialog --warningyesno "O usuário joaquim@logicus.com.br já está logado. Deseja entrar em contato com o administrador?" |
$ kdialog --title "Logicus Alerta" --warningyesnocancel "Você executou uma ação não autorizada.\nDeseja continuar?" |
Yes | 0 |
No | 1 |
Cancel | 2 |
$ kdialog --detailedsorry "Ops! Você não está matriculado neste treinamento da Logicus" "Para se matricular é preciso acessar http://logicus.com.br e preecher a ficha de matrícula :)" |
$ kdialog --error "Sua senha não confere. Por favor entrar em contato com suporte@logicus.com.br" |
$ kdialog --yesno "Você já conhecia a Logicus?" |
$ kdialog --title "Logicus" --yesno "Esta conexão não possui criptografia. O que deseja fazer?" --yes-label "Acessar mesmo assim" - -no-label "Encerrar conexão" |
$ kdialog --yesnocancel "Login na sala de aula Logicus efetuado com sucesso. Deseja continuar?" |
$ kdialog --title "Logicus" --calendar "Quando iniciar curso?" |
$ kdialog --title "Logicus" --slider "Deslize para atribuir uma nota para o treinamento" 0 100 10 |
$ kdialog --title "Logicus" --menu "Escolha um treinamento:" "1" "Linux Profissional" "2" "Lógica de Programação" "3" "LibreOffice" |
$ kdialog --title "Logicus" --checklist "Escolha mais de um treinamento:" "1" "Linux Profissional" on "2" "Lógica de Programação" off "3" "LibreOffice" on |
$ kdialog --title "Logicus" --separate-output --checklist "Escolha mais de um treinamento:" "1" "Linux Profissional" on "2" "Lógica de Programação" off "3" "LibreOffice" on |
#!/bin/bash ESCOLHA=$(kdialog --title "Logicus" \ --checklist "Escolha os serviços que deseja configurar" 1 "NTP" on 2 "SSH" off 3 "Apache" off); if [ "$?" = 0 ]; then kdialog --msgbox "$ESCOLHA"; elif [ "$?" = 1 ]; then kdialog --sorry "Você clicou cancelar"; else kdialog --error "ERROR"; fi; |
$ kdialog --title "Logicus Adm" --inputbox "Digite o fqdn completo do servidor ntp" "Exemplo florenca.logicus.local" |
$ kdialog --title "Logicus Treinamentos" --textinputbox "Avaliação final do curso" "Digite aqui o que você achou do nosso treinamento" |
$ kdialog --title "Logicus" --password "Informe a senha de acesso ao servidor" |
#!/bin/bash kdialog --title "Logicus" --password "Digite a senha do servidor" if [[ "$?" == "0" ]]; then kdialog --msgbox "Ok, você digitou uma senha" else kdialog --msgbox "Ops! Você não digitou uma senha" fi |
#!/bin/bash while true do SENHA=$(kdialog --title "Logicus" --password "Digite a senha do servidor") if [[ "$SENHA" == "segredo" ]]; then kdialog --msgbox "Ok, você digitou a senha correta" else kdialog --msgbox "Ops! Você não digitou a senha correta" fi done |
$ kdialog --title "Logicus escolha a cor da tela" --getcolor |
$ kdialog --title "Logicus" --combobox "Escolha um treinamento" "Linux Profissional" "Programação Shell Script" "Samba 4" "Python com Django" "Amazon Web Services" |
$ kdialog --title "Logicus" --radiolist "escolha" "1" "Linux Profissional" off "2" "Alta Disponibilidade" off "3" "Icinga" on |
$ mkdir /tmp/kdialog $ touch /tmp/kdialog/arquivo{1..10}.txt $ touch /tmp/kdialog/arquivo{1..10}.info $ ls /tmp/kdialog/ arquivo10.info arquivo1.txt arquivo3.info arquivo4.txt arquivo6.info arquivo7.txt arquivo9.info arquivo10.txt arquivo2.info arquivo3.txt arquivo5.info arquivo6.txt arquivo8.info arquivo9.txt arquivo1.info arquivo2.txt arquivo4.info arquivo5.txt arquivo7.info arquivo8.txt $ kdialog --getopenfilename /tmp/kdialog/ '*.info' |
$ kdialog --title "Logicus Adm" --getopenfilename :"arquivo de configuração" |
$ kdialog --title "Logicus" --passivepopup "Este aviso desaparecerá em 10 segundos" 10 |