File tree 5 files changed +36
-18
lines changed
5 files changed +36
-18
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ show_help() {
18
18
echo " Color scheme to be used (will be asked otherwise)"
19
19
echo " -p profile, --profile profile, --profile profile"
20
20
echo " Gnome Terminal profile to overwrite (will be asked otherwise)"
21
+ echo " --install-dircolors, --skip-dircolors"
22
+ echo " Do or skip the dircolors installation in a non interactive mode"
21
23
}
22
24
23
25
validate_scheme () {
145
147
profile=$2
146
148
shift
147
149
;;
150
+ --install-dircolors )
151
+ install_dircolors=true
152
+ ;;
153
+ --skip-dircolors )
154
+ install_dircolors=false
155
+ ;;
148
156
esac
149
157
shift
150
158
done
@@ -174,4 +182,11 @@ else
174
182
fi
175
183
176
184
set_profile_colors $profile $scheme
177
- check_dircolors || warning_message_dircolors
185
+
186
+ if [ -n " $install_dircolors " ]
187
+ then if " $install_dircolors "
188
+ then copy_dircolors
189
+ fi
190
+ else
191
+ check_dircolors || warning_message_dircolors
192
+ fi
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
3
dir=` dirname " $0 " `
4
- source $dir /src/set_theme_default_profile.sh dark $1
4
+ source $dir /src/set_theme_default_profile.sh dark $*
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
3
dir=` dirname " $0 " `
4
- source $dir /src/set_theme_default_profile.sh light $1
4
+ source $dir /src/set_theme_default_profile.sh light $*
Original file line number Diff line number Diff line change @@ -20,21 +20,19 @@ dl_dircolors() {
20
20
return 0
21
21
}
22
22
23
- copy_dicolors () {
24
- if [ " $1 " != 1 ]
25
- then return
26
- else
27
- eval dl_dircolors
28
- dl_ok=$?
29
- if [ $dl_ok ]
30
- then if [ -f " $DIRCOLORS_DIR /dircolors" ]
31
- then mv " $DIRCOLORS_DIR /dircolors" " $DIRCOLORS_DIR /dircolors.old"
32
- echo -e " $DIRCOLORS_DIR /dircolors already exists, renaming it to"
33
- echo " dircolors.old"
34
- fi
23
+ copy_dircolors () {
24
+ eval dl_dircolors
25
+ dl_ok=$?
26
+ if [ $dl_ok ]
27
+ then if [ -f " $DIRCOLORS_DIR /dircolors" ]
28
+ then mv " $DIRCOLORS_DIR /dircolors" " $DIRCOLORS_DIR /dircolors.old"
29
+ echo -e " $DIRCOLORS_DIR /dircolors already exists, renaming it to"
30
+ echo " dircolors.old"
35
31
fi
36
32
fi
33
+
37
34
cp " $DIRCOLORS_SOLARIZED /dircolors" " $DIRCOLORS_DIR /dircolors"
35
+
38
36
echo
39
37
echo " The new dircolors have been installed to $DIRCOLORS_DIR /dircolors."
40
38
echo
@@ -89,15 +87,18 @@ interactive_dircolors() {
89
87
read -p " Enter your choice : [2] " selection
90
88
selection=${selection:- 2}
91
89
92
- if [ " $selection " -gt 2 -o " $selection " -lt 1 ]
90
+ if [[ " $selection " -gt 2 || " $selection " -lt 1 ] ]
93
91
then echo " $selection is not a valid entry. Please Restart"
94
92
echo
95
93
noselect=true
96
94
else
97
95
noselect=false
98
96
fi
99
97
done
100
- copy_dicolors $selection
98
+
99
+ if [ " $selection " == 1 ]
100
+ then copy_dircolors
101
+ fi
101
102
}
102
103
103
104
check_dircolors () {
Original file line number Diff line number Diff line change @@ -16,5 +16,7 @@ get_default_profile() {
16
16
echo $profile_name
17
17
}
18
18
19
+ SCHEME=$1
19
20
PROFILE=${2:- " $( get_default_profile) " }
20
- $dir /install.sh -s $1 -p " $PROFILE "
21
+ shift ; shift
22
+ $dir /install.sh -s " $SCHEME " -p " $PROFILE " $*
You can’t perform that action at this time.
0 commit comments