2
2
# set -eu
3
3
4
4
function main() {
5
- configure_profile
5
+ configure_alacritty
6
6
configure_git
7
7
configure_gpg
8
8
configure_kde
9
- configure_vim
9
+ configure_profile
10
10
configure_tmux
11
- configure_vscode
12
11
configure_udev
12
+ configure_vim
13
+ configure_vscode
14
+ configure_zellij
13
15
finish
14
16
}
15
17
18
+ configure_alacritty () {
19
+ echo " --> Configure Alacritty."
20
+
21
+ mkdir -p " $HOME " /.config/alacritty/
22
+ cat > " $HOME " /.config/alacritty/alacritty.toml << 'EOF '
23
+ [terminal]
24
+ shell = { program = "/bin/bash", args = ["-l", "-c", "zellij"] }
25
+
26
+ [bell]
27
+ duration = 0
28
+
29
+ [cursor.style]
30
+ blinking = "Always"
31
+ shape = "Underline"
32
+
33
+ [selection]
34
+ save_to_clipboard = true
35
+
36
+ [mouse]
37
+ bindings = [{mouse = "Right", action = "Paste"}]
38
+
39
+ [window]
40
+ opacity = 1.0
41
+ startup_mode = "Maximized"
42
+ EOF
43
+ }
44
+
16
45
function configure_profile() {
17
46
echo " --> Configure profile."
18
47
@@ -273,6 +302,37 @@ aws-uset() {
273
302
unset AWS_PROFILE
274
303
}
275
304
305
+ aws-get-secrets() {
306
+ aws secretsmanager list-secrets --profile=$AWS_PROFILE | jq -r '.SecretList[] | .Name'
307
+ }
308
+
309
+ aws-get-secrets-values() {
310
+ SECRETS=$(
311
+ aws secretsmanager list-secrets --profile=$AWS_PROFILE | jq -r '.SecretList[] | .Name'
312
+ )
313
+
314
+ for SECRET in $SECRETS; do
315
+ KEYS=$(
316
+ aws secretsmanager get-secret-value \
317
+ --profile=$AWS_PROFILE \
318
+ --secret-id "${SECRET}" \
319
+ --query SecretString \
320
+ --output text | \
321
+ tr -d '\n\t\r ' | \
322
+ jq \
323
+ --compact-output \
324
+ --raw-output \
325
+ --monochrome-output \
326
+ "to_entries|map(\"\(.key)=\(.value|tostring)\") | .[]" \
327
+ 2> /dev/null
328
+ )
329
+
330
+ for KEY in $KEYS; do
331
+ echo "${SECRET} ${KEY}"
332
+ done
333
+ done
334
+ }
335
+
276
336
aws-get-secret() {
277
337
if [ -z "$1" ]; then
278
338
echo "No argument supplied."
@@ -291,7 +351,8 @@ aws-get-secret() {
291
351
--compact-output \
292
352
--raw-output \
293
353
--monochrome-output \
294
- "to_entries|map(\"\(.key)=\(.value|tostring)\") | .[]"
354
+ "to_entries|map(\"\(.key)=\(.value|tostring)\") | .[]" \
355
+ 2> /dev/null
295
356
)
296
357
297
358
for KEY in $KEYS; do
@@ -302,15 +363,6 @@ aws-get-secret() {
302
363
EOF
303
364
304
365
cat > " $HOME " /.bashrc.d/functions/general.sh << 'EOF '
305
- append_path () {
306
- case ":$PATH:" in
307
- *:"$1":*)
308
- ;;
309
- *)
310
- PATH="${PATH:+$PATH:}$1"
311
- esac
312
- }
313
-
314
366
extract () {
315
367
if [ -f $1 ] ; then
316
368
case $1 in
@@ -509,6 +561,17 @@ redpanda(){
509
561
redpanda-help() {
510
562
echo "rp topic consume <topic_name> -v -o end -n 1 -g TEST_<user_name>"
511
563
}
564
+ EOF
565
+
566
+ cat << EOF | sudo tee /etc/profile.d/common.sh &> /dev/null
567
+ append_path () {
568
+ case ":$PATH :" in
569
+ *:"$1 ":*)
570
+ ;;
571
+ *)
572
+ PATH="${PATH: +$PATH : } $1 "
573
+ esac
574
+ }
512
575
EOF
513
576
}
514
577
@@ -631,6 +694,12 @@ function configure_vscode() {
631
694
EOF
632
695
}
633
696
697
+ function configure_zellij() {
698
+ echo " --> Configure zellij."
699
+
700
+
701
+ }
702
+
634
703
function configure_udev() {
635
704
echo " --> Configure udev rules."
636
705
0 commit comments