-
Notifications
You must be signed in to change notification settings - Fork 0
/
dotfiles
executable file
·63 lines (59 loc) · 1.08 KB
/
dotfiles
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/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