Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Shellcheck support via GitHub Actions. Fixes all violations. #101

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Run ShellCheck

on:
push:
branches:
- '*' # Run on all branches
pull_request:
branches:
- '*' # Run on all branches

jobs:
shellcheck:
name: Run ShellCheck
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install ShellCheck
run: sudo apt-get install -y shellcheck

- name: Run ShellCheck
run: |
# Find all shell scripts and run shellcheck
find . -name "*.sh" -print0 | xargs -0 shellcheck
3 changes: 3 additions & 0 deletions applications/Basecamp.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/usr/bin/env bash

cat <<EOF >~/.local/share/applications/Basecamp.desktop

[Desktop Entry]
Version=1.0
Name=Basecamp
Expand Down
2 changes: 2 additions & 0 deletions applications/HEY.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env bash

cat <<EOF >~/.local/share/applications/HEY.desktop
[Desktop Entry]
Version=1.0
Expand Down
2 changes: 2 additions & 0 deletions applications/Omakub.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env bash

cat <<EOF >~/.local/share/applications/Omakub.desktop
[Desktop Entry]
Version=1.0
Expand Down
3 changes: 3 additions & 0 deletions applications/WhatsApp.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/usr/bin/env bash

cat <<EOF >~/.local/share/applications/WhatsApp.desktop

[Desktop Entry]
Version=1.0
Name=WhatsApp
Expand Down
2 changes: 2 additions & 0 deletions ascii.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env bash

ascii_art='
________ __ ___.
\_____ \ _____ _____ | | ____ _\_ |__
Expand Down
5 changes: 4 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env bash

# Exit immediately if a command exits with a non-zero status
set -e

Expand All @@ -10,7 +12,8 @@ gsettings set org.gnome.desktop.screensaver lock-enabled false
gsettings set org.gnome.desktop.session idle-delay 0

# Run installers
for script in ~/.local/share/omakub/install/*.sh; do source $script; done
# shellcheck disable=SC1090
for script in "$HOME"/.local/share/omakub/install/*.sh; do source "$script"; done

# Upgrade everything that might ask for a reboot last
sudo apt upgrade -y
Expand Down
13 changes: 8 additions & 5 deletions install/a-shell.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
[ -f "~/.bashrc" ] && mv ~/.bashrc ~/.bashrc.bak
cp ~/.local/share/omakub/configs/bashrc ~/.bashrc
source ~/.local/share/omakub/defaults/bash/shell
#!/usr/bin/env bash

[ -f "~/.inputrc" ] && mv ~/.inputrc ~/.inputrc.bak
cp ~/.local/share/omakub/configs/inputrc ~/.inputrc
[ -f "$HOME/.bashrc" ] && mv ~/.bashrc ~/.bashrc.bak
cp "$HOME/.local/share/omakub/configs/bashrc" ~/.bashrc
# shellcheck disable=SC1091
source "$HOME/.local/share/omakub/defaults/bash/shell"

[ -f "$HOME/.inputrc" ] && mv ~/.inputrc ~/.inputrc.bak
cp "$HOME/.local/share/omakub/configs/inputrc" "$HOME/.inputrc"
2 changes: 2 additions & 0 deletions install/app-alacritty.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env bash

sudo apt install -y alacritty
mkdir -p ~/.config/alacritty
cp ~/.local/share/omakub/configs/alacritty.toml ~/.config/alacritty/alacritty.toml
Expand Down
7 changes: 5 additions & 2 deletions install/app-chrome.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
cd /tmp
#!/usr/bin/env bash

cd "$HOME/Downloads" || exit

wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install -y ./google-chrome-stable_current_amd64.deb
rm google-chrome-stable_current_amd64.deb
xdg-settings set default-web-browser google-chrome.desktop
cd -
cd - || exit
2 changes: 2 additions & 0 deletions install/app-fastfetch.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env bash

sudo add-apt-repository -y ppa:zhangsongcui3371/fastfetch
sudo apt update -y
sudo apt install -y fastfetch
2 changes: 2 additions & 0 deletions install/app-flameshot.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
#!/usr/bin/env bash

# Flameshot is a nice step-up over the default Gnome screenshot tool
sudo apt install -y flameshot
2 changes: 2 additions & 0 deletions install/app-github-cli.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env bash

curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg &&
sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg &&
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list >/dev/null &&
Expand Down
2 changes: 2 additions & 0 deletions install/app-gnome-tweak-tool.sh
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
#!/usr/bin/env bash

sudo apt install -y gnome-tweak-tool
6 changes: 4 additions & 2 deletions install/app-gum.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/usr/bin/env bash

# Gum is used for the Omakub commands for tailoring Omakub after the initial install
cd /tmp
cd /tmp || exit
GUM_VERSION="0.14.1" # Use known good version
wget -O gum.deb "https://github.com/charmbracelet/gum/releases/latest/download/gum_${GUM_VERSION}_amd64.deb"
sudo apt install -y ./gum.deb
rm gum.deb
cd -
cd - || exit
6 changes: 4 additions & 2 deletions install/app-lazydocker.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
cd /tmp
#!/usr/bin/env bash

cd /tmp || exit
LAZYDOCKER_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazydocker/releases/latest" | grep -Po '"tag_name": "v\K[^"]*')
curl -sLo lazydocker.tar.gz "https://github.com/jesseduffield/lazydocker/releases/latest/download/lazydocker_${LAZYDOCKER_VERSION}_Linux_x86_64.tar.gz"
tar -xf lazydocker.tar.gz lazydocker
sudo install lazydocker /usr/local/bin
rm lazydocker.tar.gz lazydocker
cd -
cd - || exit
6 changes: 4 additions & 2 deletions install/app-lazygit.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
cd /tmp
#!/usr/bin/env bash

cd /tmp || exit
LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | grep -Po '"tag_name": "v\K[^"]*')
curl -sLo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz"
tar -xf lazygit.tar.gz lazygit
sudo install lazygit /usr/local/bin
rm lazygit.tar.gz lazygit
cd -
cd - || exit
6 changes: 4 additions & 2 deletions install/app-localsend.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
cd /tmp
#!/usr/bin/env bash

cd /tmp || exit
LOCALSEND_VERSION=$(curl -s "https://api.github.com/repos/localsend/localsend/releases/latest" | grep -Po '"tag_name": "v\K[^"]*')
wget -O localsend.deb "https://github.com/localsend/localsend/releases/latest/download/LocalSend-${LOCALSEND_VERSION}-linux-x86-64.deb"
sudo apt install -y ./localsend.deb
rm localsend.deb
cd -
cd - || exit
12 changes: 7 additions & 5 deletions install/app-neovim.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
cd /tmp
#!/usr/bin/env bash

cd /tmp || exit
wget -O nvim.tar.gz "https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz"
tar -xf nvim.tar.gz
sudo install nvim-linux64/bin/nvim /usr/local/bin/nvim
rm -rf nvim-linux64 nvim.tar.gz
cd -
cd - || exit

if [ ! -d "$HOME/.config/nvim" ]; then
git clone https://github.com/LazyVim/starter ~/.config/nvim
# Disable update notification popup in starter config
sed -i 's/checker = { enabled = true }/checker = { enabled = true, notify = false }/g' ~/.config/nvim/lua/config/lazy.lua
mkdir -p ~/.config/nvim/plugin/after
cp ~/.local/share/omakub/configs/neovim/transparency.lua ~/.config/nvim/plugin/after/
cp ~/.local/share/omakub/themes/neovim/tokyo-night.lua ~/.config/nvim/lua/plugins/theme.lua
cp "$HOME/.local/share/omakub/configs/neovim/transparency.lua" "$HOME/.config/nvim/plugin/after/"
cp "$HOME/.local/share/omakub/themes/neovim/tokyo-night.lua" "$HOME/.config/nvim/lua/plugins/theme.lua"

# Enable default extras
cp ~/.local/share/omakub/configs/neovim/lazyvim.json ~/.config/nvim/lazyvim.json
cp "$HOME/.local/share/omakub/configs/neovim/lazyvim.json" "$HOME/.config/nvim/lazyvim.json"
fi
2 changes: 2 additions & 0 deletions install/app-pinta.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
#!/usr/bin/env bash

# FIXME: Get this out of snap
sudo snap install pinta
3 changes: 3 additions & 0 deletions install/app-signal.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/usr/bin/env bash

wget -qO- https://updates.signal.org/desktop/apt/keys.asc | gpg --dearmor >signal-desktop-keyring.gpg
# shellcheck disable=SC2002
cat signal-desktop-keyring.gpg | sudo tee /usr/share/keyrings/signal-desktop-keyring.gpg >/dev/null
echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/signal-desktop-keyring.gpg] https://updates.signal.org/desktop/apt xenial main' |
sudo tee /etc/apt/sources.list.d/signal-xenial.list
Expand Down
2 changes: 2 additions & 0 deletions install/app-typora.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env bash

wget -qO - https://typora.io/linux/public-key.asc | sudo tee /etc/apt/trusted.gpg.d/typora.asc
sudo add-apt-repository -y 'deb https://typora.io/linux ./'
sudo apt update
Expand Down
2 changes: 2 additions & 0 deletions install/app-vlc.sh
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
#!/usr/bin/env bash

sudo apt install -y vlc
10 changes: 6 additions & 4 deletions install/app-vscode.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
cd /tmp
#!/usr/bin/env bash

cd /tmp || exit
wget -O code.deb 'https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-x64'
sudo apt install -y ./code.deb
rm code.deb
cd -
cd - || exit

mkdir -p ~/.config/Code/User
cp ~/.local/share/omakub/configs/vscode.json ~/.config/Code/User/settings.json
mkdir -p "$HOME/.config/Code/User"
cp "$HOME/.local/share/omakub/configs/vscode.json" "$HOME/.config/Code/User/settings.json"

# Install default supported themes
code --install-extension enkia.tokyo-night
2 changes: 2 additions & 0 deletions install/app-xournalpp.sh
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
#!/usr/bin/env bash

sudo apt install -y xournalpp
12 changes: 7 additions & 5 deletions install/app-zellij.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
cd /tmp
#!/usr/bin/env bash

cd /tmp || exit
wget -O zellij.tar.gz "https://github.com/zellij-org/zellij/releases/latest/download/zellij-x86_64-unknown-linux-musl.tar.gz"
tar -xf zellij.tar.gz zellij
sudo install zellij /usr/local/bin
rm zellij.tar.gz zellij
cd -
cd - || exit

mkdir -p ~/.config/zellij/
[ ! -f "$HOME/.config/zellij/config.kdl" ] && cp ~/.local/share/omakub/configs/zellij.kdl ~/.config/zellij/config.kdl
[ ! -L "$HOME/.config/zellij/themes" ] && ln -s ~/.local/share/omakub/themes/zellij ~/.config/zellij/themes
mkdir -p "$HOME/.config/zellij/"
[ ! -f "$HOME/.config/zellij/config.kdl" ] && cp "$HOME/.local/share/omakub/configs/zellij.kdl" "$HOME/.config/zellij/config.kdl"
[ ! -L "$HOME/.config/zellij/themes" ] && ln -s "$HOME/.local/share/omakub/themes/zellij" "$HOME/.config/zellij/themes"
5 changes: 4 additions & 1 deletion install/apps-desktop.sh
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
for script in ~/.local/share/omakub/applications/*.sh; do source $script; done
#!/usr/bin/env bash

# shellcheck disable=SC1090
for script in ~/.local/share/omakub/applications/*.sh; do source "$script"; done
2 changes: 2 additions & 0 deletions install/apps-terminal.sh
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
#!/usr/bin/env bash

sudo apt install -y fzf ripgrep bat eza zoxide plocate btop apache2-utils fd-find
4 changes: 4 additions & 0 deletions install/apps-web.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash

# shellcheck disable=SC1090
for script in ~/.local/share/omakub/web-apps/*.sh; do source "$script"; done
5 changes: 4 additions & 1 deletion install/docker.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
#!/usr/bin/env bash

# Add the official Docker repo
sudo install -m 0755 -d /etc/apt/keyrings
sudo wget -qO /etc/apt/keyrings/docker.asc https://download.docker.com/linux/ubuntu/gpg
sudo chmod a+r /etc/apt/keyrings/docker.asc
# shellcheck disable=SC1091
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update

# Install Docker engine and standard plugins
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras

# Give this user privileged Docker access
sudo usermod -aG docker ${USER}
sudo usermod -aG docker "${USER}"

# Use local logging driver - it's more efficient and uses compression by default.
echo '{"log-driver":"local","log-opts":{"max-size":"10m","max-file":"5"}}' | sudo tee /etc/docker/daemon.json > /dev/null
2 changes: 2 additions & 0 deletions install/flatpak.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env bash

sudo apt install -y flatpak
sudo apt install -y gnome-software-plugin-flatpak
sudo flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
10 changes: 6 additions & 4 deletions install/fonts.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
mkdir -p ~/.local/share/fonts
#!/usr/bin/env bash

cd /tmp
mkdir -p "$HOME/.local/share/fonts"

cd /tmp || exit
wget https://github.com/ryanoasis/nerd-fonts/releases/latest/download/CascadiaMono.zip
unzip CascadiaMono.zip -d CascadiaFont
cp CascadiaFont/*.ttf ~/.local/share/fonts
rm -rf CascadiaMono.zip CascadiaFont

wget -O iafonts.zip https://github.com/iaolo/iA-Fonts/archive/refs/heads/master.zip
unzip iafonts.zip -d iaFonts
cp iaFonts/iA-Fonts-master/iA\ Writer\ Mono/Static/iAWriterMonoS-*.ttf ~/.local/share/fonts
cp iaFonts/iA-Fonts-master/iA\ Writer\ Mono/Static/iAWriterMonoS-*.ttf "$HOME/.local/share/fonts"
rm -rf iafonts.zip iaFonts

fc-cache
cd -
cd - || exit
2 changes: 2 additions & 0 deletions install/libraries.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env bash

sudo apt install -y \
build-essential pkg-config autoconf bison rustc cargo clang \
libssl-dev libreadline-dev zlib1g-dev libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev libjemalloc2 \
Expand Down
2 changes: 2 additions & 0 deletions install/mise.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env bash

# Install mise for managing multiple versions of languages. See https://mise.jdx.dev/
sudo apt update -y && sudo apt install -y gpg sudo wget curl
sudo install -dm 755 /etc/apt/keyrings
Expand Down
4 changes: 3 additions & 1 deletion install/optional/app-1password.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env bash

# Install 1password and 1password-cli single script
curl -sS https://downloads.1password.com/linux/keys/1password.asc | \
sudo gpg --dearmor --output /usr/share/keyrings/1password-archive-keyring.gpg
Expand All @@ -15,4 +17,4 @@ curl -sS https://downloads.1password.com/linux/keys/1password.asc | \
sudo gpg --dearmor --output /usr/share/debsig/keyrings/AC2D62742012EA22/debsig.gpg

# Install 1Password & 1password-cli
sudo apt install -y 1password 1password-cli
sudo apt install -y 1password 1password-cli
2 changes: 2 additions & 0 deletions install/optional/app-dropbox.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
#!/usr/bin/env bash

sudo apt install -y nautilus-dropbox
gtk-launch dropbox.desktop
2 changes: 2 additions & 0 deletions install/optional/app-spotify.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env bash

curl -sS https://download.spotify.com/debian/pubkey_6224F9941A8AA6D1.gpg | sudo gpg --dearmor --yes -o /etc/apt/trusted.gpg.d/spotify.gpg
echo "deb [signed-by=/etc/apt/trusted.gpg.d/spotify.gpg] http://repository.spotify.com stable non-free" | sudo tee /etc/apt/sources.list.d/spotify.list
sudo apt update
Expand Down
6 changes: 4 additions & 2 deletions install/optional/app-steam.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
cd /tmp
#!/usr/bin/env bash

cd /tmp || exit
wget https://cdn.akamai.steamstatic.com/client/installer/steam.deb
sudo apt install -y ./steam.deb
sudo apt-get install --no-remove -oAPT::Get::AutomaticRemove=false libc6:amd64 libc6:i386 libegl1:amd64 libegl1:i386 libgbm1:amd64 libgbm1:i386 libgl1-mesa-dri:amd64 libgl1-mesa-dri:i386 libgl1:amd64 libgl1:i386 steam-libs-amd64:amd64
rm steam.deb
cd -
cd - || exit
4 changes: 3 additions & 1 deletion install/optional/app-virtualbox.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

# Virtualbox allows you to run VMs for other flavors of Linux or even Windows
# See https://ubuntu.com/tutorials/how-to-run-ubuntu-desktop-on-a-virtual-machine-using-virtualbox#1-overview
# for a guide on how to run Ubuntu inside it.
sudo apt install -y virtualbox virtualbox-ext-pack
sudo usermod -aG vboxusers ${USER}
sudo usermod -aG vboxusers "${USER}"
6 changes: 4 additions & 2 deletions install/optional/app-zoom.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
cd /tmp
#!/usr/bin/env bash

cd /tmp || exit
wget https://zoom.us/client/latest/zoom_amd64.deb
sudo apt install -y ./zoom_amd64.deb
rm zoom_amd64.deb
cd -
cd - || exit
Loading