Skip to content

Commit 56e031e

Browse files
Merge branch 'main' into testing-7
2 parents fd126fb + 02b7d7c commit 56e031e

30 files changed

+1114
-72
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
# Pull Request
2-
3-
## Title
4-
<!--[Provide a succinct and descriptive title for the pull request.]-->
5-
61
## Type of Change
72
- [ ] New feature
83
- [ ] Bug fix

.github/workflows/pr-labels.yaml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
name: Manage labels based on PR body
22

33
on:
4-
pull_request:
4+
pull_request_target:
55
types: [opened, edited, reopened, synchronize]
66

77
jobs:
88
manage-labels:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Analyze PR Body and manage labels
12+
shell: bash
1213
run: |
13-
body="${{ github.event.pull_request.body }}"
14+
body=$(jq -r '.pull_request.body' "$GITHUB_EVENT_PATH")
1415
labels_to_add=()
1516
labels_to_remove=()
1617
declare -A label_checks=(
@@ -20,19 +21,23 @@ jobs:
2021
["Refactoring"]="refactor"
2122
["UI/UX improvement"]="UI/UX"
2223
)
23-
for key in "${!label_checks[@]}"; do
24-
if echo "$body" | grep -q "\- \[x\] $key"; then
25-
labels_to_add+=("${label_checks[$key]}")
24+
for pattern in "${!label_checks[@]}"; do
25+
label="${label_checks[$pattern]}"
26+
if echo "$body" | grep -Eq "\- \[x\] ($pattern)"; then
27+
labels_to_add+=("$label")
2628
else
27-
labels_to_remove+=("${label_checks[$key]}")
29+
labels_to_remove+=("$label")
2830
fi
2931
done
30-
echo "LABELS_TO_ADD=${labels_to_add[*]}" >> $GITHUB_ENV
31-
echo "LABELS_TO_REMOVE=${labels_to_remove[*]}" >> $GITHUB_ENV
32+
33+
echo "LABELS_TO_ADD=$(IFS=,; echo "${labels_to_add[*]}")" >> $GITHUB_ENV
34+
echo "LABELS_TO_REMOVE=$(IFS=,; echo "${labels_to_remove[*]}")" >> $GITHUB_ENV
35+
3236
- name: Add labels if necessary
3337
if: env.LABELS_TO_ADD != ''
3438
run: |
35-
for label in ${{ env.LABELS_TO_ADD }}; do
39+
IFS=',' read -ra labels <<< "${LABELS_TO_ADD}"
40+
for label in "${labels[@]}"; do
3641
curl -s -X POST \
3742
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
3843
-H "Accept: application/vnd.github.v3+json" \
@@ -42,9 +47,10 @@ jobs:
4247
- name: Remove labels if necessary
4348
if: env.LABELS_TO_REMOVE != ''
4449
run: |
45-
for label in ${{ env.LABELS_TO_REMOVE }}; do
50+
IFS=',' read -ra labels <<< "${LABELS_TO_REMOVE}"
51+
for label in "${labels[@]}"; do
4652
curl -s -X DELETE \
4753
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
4854
-H "Accept: application/vnd.github.v3+json" \
4955
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels/$label
50-
done
56+
done

start.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/sh -e
22

33
rc='\033[0m'
44
red='\033[0;31m'

startdev.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/sh -e
22

33
RC='\033[0m'
44
RED='\033[0;31m'
@@ -35,7 +35,7 @@ check() {
3535
local message=$2
3636

3737
if [ $exit_code -ne 0 ]; then
38-
echo -e "${RED}ERROR: $message${RC}"
38+
printf "%b\n" "${RED}ERROR: $message${RC}"
3939
exit 1
4040
fi
4141
}

tabs/applications-setup/alacritty-setup.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
. ../common-script.sh
44

5-
setupAlacritty() {
6-
printf "%b\n" "${YELLOW}Install Alacritty if not already installed...${RC}"
5+
installAlacritty() {
6+
echo "Installing Alacritty..."
77
if ! command_exists alacritty; then
88
case ${PACKAGER} in
99
pacman)
@@ -31,5 +31,5 @@ setupAlacrittyConfig() {
3131

3232
checkEnv
3333
checkEscalationTool
34-
setupAlacritty
34+
installAlacritty
3535
setupAlacrittyConfig

tabs/applications-setup/dwmtitus-setup.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -143,27 +143,30 @@ clone_config_folders() {
143143
}
144144

145145
configure_backgrounds() {
146+
# Set the variable PIC_DIR which stores the path for images
147+
PIC_DIR="$HOME/Pictures"
148+
146149
# Set the variable BG_DIR to the path where backgrounds will be stored
147-
BG_DIR="$HOME/Pictures/backgrounds"
150+
BG_DIR="$PIC_DIR/backgrounds"
148151

149152
# Check if the ~/Pictures directory exists
150-
if [ ! -d "~/Pictures" ]; then
153+
if [ ! -d "$PIC_DIR" ]; then
151154
# If it doesn't exist, print an error message and return with a status of 1 (indicating failure)
152155
printf "%b\n" "${RED}Pictures directory does not exist${RC}"
153156
mkdir ~/Pictures
154157
printf "%b\n" "${GREEN}Directory was created in Home folder${RC}"
155158
fi
156-
159+
157160
# Check if the backgrounds directory (BG_DIR) exists
158161
if [ ! -d "$BG_DIR" ]; then
159162
# If the backgrounds directory doesn't exist, attempt to clone a repository containing backgrounds
160-
if ! git clone https://github.com/ChrisTitusTech/nord-background.git ~/Pictures; then
163+
if ! git clone https://github.com/ChrisTitusTech/nord-background.git "$PIC_DIR/nord-background"; then
161164
# If the git clone command fails, print an error message and return with a status of 1
162165
printf "%b\n" "${RED}Failed to clone the repository${RC}"
163166
return 1
164167
fi
165168
# Rename the cloned directory to 'backgrounds'
166-
mv ~/Pictures/nord-background ~/Pictures/backgrounds
169+
mv "$PIC_DIR/nord-background" "$PIC_DIR/backgrounds"
167170
# Print a success message indicating that the backgrounds have been downloaded
168171
printf "%b\n" "${GREEN}Downloaded desktop backgrounds to $BG_DIR${RC}"
169172
else
@@ -261,9 +264,6 @@ setupDisplayManager() {
261264
;;
262265
esac
263266
fi
264-
265-
266-
267267
}
268268

269269
install_slstatus() {

tabs/applications-setup/fastfetch-setup.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
. ../common-script.sh
44

5-
setupFastfetch() {
5+
installFastfetch() {
66
printf "%b\n" "${YELLOW}Installing Fastfetch if not already installed...${RC}"
7+
78
if ! command_exists fastfetch; then
89
case ${PACKAGER} in
910
pacman)
@@ -29,5 +30,5 @@ setupFastfetchConfig() {
2930

3031
checkEnv
3132
checkEscalationTool
32-
setupFastfetch
33+
installFastfetch
3334
setupFastfetchConfig

tabs/applications-setup/kitty-setup.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
. ../common-script.sh
44

5-
setupKitty() {
5+
installKitty() {
66
printf "%b\n" "${YELLOW}Install Kitty if not already installed...${RC}"
77
if ! command_exists kitty; then
88
case ${PACKAGER} in
@@ -19,7 +19,7 @@ setupKitty() {
1919
}
2020

2121
setupKittyConfig() {
22-
printf "%b\n" "${YELLOW}Copy Kitty config files${RC}"
22+
printf "%b\n" "${YELLOW}Copying Kitty configuration files...${RC}"
2323
if [ -d "${HOME}/.config/kitty" ] && [ ! -d "${HOME}/.config/kitty-bak" ]; then
2424
cp -r "${HOME}/.config/kitty" "${HOME}/.config/kitty-bak"
2525
fi
@@ -30,5 +30,5 @@ setupKittyConfig() {
3030

3131
checkEnv
3232
checkEscalationTool
33-
setupKitty
33+
installKitty
3434
setupKittyConfig

tabs/applications-setup/mybash-setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ cloneMyBash() {
1414
}
1515

1616
installDepend() {
17-
printf "%b\n" "${YELLOW}Install mybash if not already installed${RC}"
17+
printf "%b\n" "${YELLOW}Installing Bash...${RC}"
1818
case "$PACKAGER" in
1919
pacman)
2020
$ESCALATION_TOOL "$PACKAGER" -S --needed --noconfirm bash bash-completion tar bat tree unzip fontconfig

tabs/applications-setup/neovim-setup.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ cloneNeovim() {
1313
cd "$HOME" && git clone https://github.com/ChrisTitusTech/neovim.git "$HOME/.local/share/neovim"
1414
}
1515

16-
setupNeovim() {
17-
printf "%b\n" "${YELLOW}Install Neovim if not already installed${RC}"
16+
installNeovim() {
17+
printf "%b\n" "${YELLOW}Installing Neovim...${RC}"
1818
case "$PACKAGER" in
1919
pacman)
2020
$ESCALATION_TOOL "$PACKAGER" -S --needed --noconfirm neovim ripgrep fzf python-virtualenv luarocks go shellcheck
@@ -36,20 +36,22 @@ setupNeovim() {
3636
}
3737

3838
backupNeovimConfig() {
39+
printf "%b\n" "${YELLOW}Backing up existing configuration files...${RC}"
3940
if [ -d "$HOME/.config/nvim" ] && [ ! -d "$HOME/.config/nvim-backup" ]; then
4041
cp -r "$HOME/.config/nvim" "$HOME/.config/nvim-backup"
4142
fi
4243
rm -rf "$HOME/.config/nvim"
4344
}
4445

4546
linkNeovimConfig() {
47+
printf "%b\n" "${YELLOW}Linking Neovim configuration files...${RC}"
4648
mkdir -p "$HOME/.config/nvim"
4749
ln -s "$gitpath/titus-kickstart/"* "$HOME/.config/nvim/" # Wild card is used here to link all contents of titus-kickstart.
4850
}
4951

5052
checkEnv
5153
checkEscalationTool
5254
cloneNeovim
53-
setupNeovim
55+
installNeovim
5456
backupNeovimConfig
5557
linkNeovimConfig

0 commit comments

Comments
 (0)