Skip to content

Commit 0f287ac

Browse files
Save changes at: 1741863950
1 parent 6bd99fe commit 0f287ac

File tree

2 files changed

+84
-14
lines changed

2 files changed

+84
-14
lines changed

packages.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ function yay_install() {
4646
function devops() {
4747
echo "--> Install packages for devops."
4848
sudo pacman -S --noconfirm --needed \
49+
alacritty \
4950
bat \
5051
fd \
5152
ffmpeg \
5253
helm \
5354
imagemagick \
5455
jq \
55-
kitty \
5656
kubectl \
5757
lsd \
5858
minikube \
@@ -66,6 +66,7 @@ function devops() {
6666
ttf-nerd-fonts-symbols \
6767
virtualbox \
6868
yazi \
69+
zellij \
6970
zoxide \
7071
&> /dev/null
7172

profile.sh

+82-13
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,46 @@
22
# set -eu
33

44
function main() {
5-
configure_profile
5+
configure_alacritty
66
configure_git
77
configure_gpg
88
configure_kde
9-
configure_vim
9+
configure_profile
1010
configure_tmux
11-
configure_vscode
1211
configure_udev
12+
configure_vim
13+
configure_vscode
14+
configure_zellij
1315
finish
1416
}
1517

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+
1645
function configure_profile() {
1746
echo "--> Configure profile."
1847

@@ -273,6 +302,37 @@ aws-uset() {
273302
unset AWS_PROFILE
274303
}
275304
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+
276336
aws-get-secret() {
277337
if [ -z "$1" ]; then
278338
echo "No argument supplied."
@@ -291,7 +351,8 @@ aws-get-secret() {
291351
--compact-output \
292352
--raw-output \
293353
--monochrome-output \
294-
"to_entries|map(\"\(.key)=\(.value|tostring)\") | .[]"
354+
"to_entries|map(\"\(.key)=\(.value|tostring)\") | .[]" \
355+
2> /dev/null
295356
)
296357
297358
for KEY in $KEYS; do
@@ -302,15 +363,6 @@ aws-get-secret() {
302363
EOF
303364

304365
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-
314366
extract () {
315367
if [ -f $1 ] ; then
316368
case $1 in
@@ -509,6 +561,17 @@ redpanda(){
509561
redpanda-help() {
510562
echo "rp topic consume <topic_name> -v -o end -n 1 -g TEST_<user_name>"
511563
}
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+
}
512575
EOF
513576
}
514577

@@ -631,6 +694,12 @@ function configure_vscode() {
631694
EOF
632695
}
633696

697+
function configure_zellij() {
698+
echo "--> Configure zellij."
699+
700+
701+
}
702+
634703
function configure_udev() {
635704
echo "--> Configure udev rules."
636705

0 commit comments

Comments
 (0)