12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- #!/bin/bash
- # while-menu-dialog: a menu driven system information program
- DIALOG_CANCEL=1
- DIALOG_ESC=255
- HEIGHT=0
- WIDTH=0
- display_result() {
- dialog --title "$1" \
- --no-collapse \
- --msgbox "$result" 0 0
- }
- while true; do
- exec 3>&1
- selection=$(dialog \
- --backtitle "Dotfiles master v1.1" \
- --title "Menu" \
- --clear \
- --cancel-label "Exit" \
- --menu "Please select:" $HEIGHT $WIDTH 4 \
- "1" "Inspect" \
- "2" "Backup" \
- "3" "Install" \
- 2>&1 1>&3)
- exit_status=$?
- exec 3>&-
- case $exit_status in
- $DIALOG_CANCEL)
- clear
- echo "Program terminated."
- exit
- ;;
- $DIALOG_ESC)
- clear
- echo "Program aborted." >&2
- exit 1
- ;;
- esac
- case $selection in
- 1 )
- vim dotfiles
- ;;
- 2 )
- cp ~/.bashrc ./
- cp ~/.conkyrc ./
- cp ~/.gtkrc-2.0 ./
- cp ~/.xinitrc ./
- cp ~/.Xresources ./
- cp -r ~/.config/ ./
- ;;
- 3 )
- cp .bashrc ~/
- cp .conkyrc ~/
- cp .gtkrc-2.0 ~/
- cp .xinitrc ~/
- cp .Xresources ~/
- cp -r .config/ ~/
- ;;
- esac
- done
|