From cfda931a2168419caa55ecce8f4b129e4ba6d6a0 Mon Sep 17 00:00:00 2001 From: Aurelien Navarre Date: Wed, 12 Jun 2024 13:41:36 +0200 Subject: [PATCH] Add Shellcheck support via GitHub Actions. Fixes all violations. --- .github/workflows/shellcheck.yml | 26 ++++++++++++++++++++++++++ ascii.sh | 2 ++ install.sh | 5 ++++- install/a-shell.sh | 13 ++++++++----- install/app-alacritty.sh | 2 ++ install/app-chrome.sh | 6 ++++-- install/app-fastfetch.sh | 2 ++ install/app-flameshot.sh | 2 ++ install/app-github-cli.sh | 2 ++ install/app-gnome-tweak-tool.sh | 2 ++ install/app-gum.sh | 6 ++++-- install/app-lazydocker.sh | 6 ++++-- install/app-lazygit.sh | 6 ++++-- install/app-localsend.sh | 6 ++++-- install/app-neovim.sh | 8 +++++--- install/app-pinta.sh | 2 ++ install/app-signal.sh | 3 +++ install/app-typora.sh | 2 ++ install/app-vlc.sh | 2 ++ install/app-vscode.sh | 10 ++++++---- install/app-xournalpp.sh | 2 ++ install/app-zellij.sh | 12 +++++++----- install/apps-terminal.sh | 2 ++ install/apps-web.sh | 5 ++++- install/docker.sh | 5 ++++- install/fonts.sh | 10 ++++++---- install/libraries.sh | 2 ++ install/mise.sh | 2 ++ install/optional/app-1password.sh | 6 ++++-- install/optional/app-dropbox.sh | 2 ++ install/optional/app-spotify.sh | 2 ++ install/optional/app-virtualbox.sh | 4 +++- install/optional/app-zoom.sh | 6 ++++-- install/select-dev-env.sh | 4 ++++ install/select-optional-apps.sh | 4 ++++ install/set-dock.sh | 2 ++ install/set-emojis.sh | 4 +++- install/set-framework-text-scaling.sh | 3 +++ install/set-git.sh | 2 ++ install/set-gnome-extensions.sh | 10 ++++++---- install/set-gnome-hotkeys.sh | 2 ++ install/set-theme.sh | 5 ++++- install/ulauncher.sh | 6 ++++-- themes/gnome/_set-gnome-theme.sh | 8 +++++--- themes/gnome/catppuccin.sh | 4 +++- themes/gnome/everforest.sh | 4 +++- themes/gnome/gruvbox.sh | 4 +++- themes/gnome/kanagawa.sh | 4 +++- themes/gnome/nord.sh | 4 +++- themes/gnome/rose-pine.sh | 4 +++- themes/gnome/tokyo-night.sh | 4 +++- uninstall/app-1password.sh | 2 ++ uninstall/app-fastfetch.sh | 2 ++ uninstall/app-flameshot.sh | 2 ++ uninstall/app-github-cli.sh | 2 ++ uninstall/app-localsend.sh | 2 ++ uninstall/app-pinta.sh | 2 ++ uninstall/app-spotify.sh | 2 ++ uninstall/app-typora.sh | 4 +++- uninstall/app-vlc.sh | 2 ++ uninstall/app-xournalpp.sh | 2 ++ uninstall/app-zoom.sh | 2 ++ uninstall/apps-web.sh | 8 +++++--- uninstall/docker.sh | 2 ++ web-apps/Basecamp.sh | 2 ++ web-apps/HEY.sh | 2 ++ web-apps/WhatsApp.sh | 2 ++ 67 files changed, 230 insertions(+), 61 deletions(-) create mode 100644 .github/workflows/shellcheck.yml diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml new file mode 100644 index 00000000..cc38be6e --- /dev/null +++ b/.github/workflows/shellcheck.yml @@ -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 diff --git a/ascii.sh b/ascii.sh index 8ae500e8..68ec9c60 100644 --- a/ascii.sh +++ b/ascii.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + ascii_art=' ________ __ ___. \_____ \ _____ _____ | | ____ _\_ |__ diff --git a/install.sh b/install.sh index 8ef492f0..593ccc33 100644 --- a/install.sh +++ b/install.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + # Exit immediately if a command exits with a non-zero status set -e @@ -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 diff --git a/install/a-shell.sh b/install/a-shell.sh index 32c6eb8e..ae1da4e5 100644 --- a/install/a-shell.sh +++ b/install/a-shell.sh @@ -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" diff --git a/install/app-alacritty.sh b/install/app-alacritty.sh index f3133800..04a30049 100644 --- a/install/app-alacritty.sh +++ b/install/app-alacritty.sh @@ -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 diff --git a/install/app-chrome.sh b/install/app-chrome.sh index 8775da93..875b6f15 100644 --- a/install/app-chrome.sh +++ b/install/app-chrome.sh @@ -1,5 +1,7 @@ -cd /tmp +#!/usr/bin/env bash + +cd ~/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 -cd - +cd - || exit \ No newline at end of file diff --git a/install/app-fastfetch.sh b/install/app-fastfetch.sh index 2bf9d6a7..1a2a2bf9 100644 --- a/install/app-fastfetch.sh +++ b/install/app-fastfetch.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + sudo add-apt-repository ppa:zhangsongcui3371/fastfetch sudo apt update sudo apt install -y fastfetch diff --git a/install/app-flameshot.sh b/install/app-flameshot.sh index ee6e6100..0c6e0c79 100644 --- a/install/app-flameshot.sh +++ b/install/app-flameshot.sh @@ -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 diff --git a/install/app-github-cli.sh b/install/app-github-cli.sh index c73d7ded..6786833c 100644 --- a/install/app-github-cli.sh +++ b/install/app-github-cli.sh @@ -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 && diff --git a/install/app-gnome-tweak-tool.sh b/install/app-gnome-tweak-tool.sh index ee7979b5..cecf9618 100644 --- a/install/app-gnome-tweak-tool.sh +++ b/install/app-gnome-tweak-tool.sh @@ -1 +1,3 @@ +#!/usr/bin/env bash + sudo apt install -y gnome-tweak-tool diff --git a/install/app-gum.sh b/install/app-gum.sh index 71632595..543db97f 100644 --- a/install/app-gum.sh +++ b/install/app-gum.sh @@ -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 diff --git a/install/app-lazydocker.sh b/install/app-lazydocker.sh index 6f62afbb..dbf945f9 100644 --- a/install/app-lazydocker.sh +++ b/install/app-lazydocker.sh @@ -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 diff --git a/install/app-lazygit.sh b/install/app-lazygit.sh index 70f90fe5..e7f8973d 100644 --- a/install/app-lazygit.sh +++ b/install/app-lazygit.sh @@ -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 diff --git a/install/app-localsend.sh b/install/app-localsend.sh index 56b571ec..dfb07827 100644 --- a/install/app-localsend.sh +++ b/install/app-localsend.sh @@ -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 diff --git a/install/app-neovim.sh b/install/app-neovim.sh index 1548e636..262d6dcf 100644 --- a/install/app-neovim.sh +++ b/install/app-neovim.sh @@ -1,11 +1,13 @@ +#!/usr/bin/env bash + sudo apt install -y neovim if [ ! -d "$HOME/.config/nvim" ]; then git clone https://github.com/LazyVim/starter ~/.config/nvim 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 diff --git a/install/app-pinta.sh b/install/app-pinta.sh index 2894c001..3e68a763 100644 --- a/install/app-pinta.sh +++ b/install/app-pinta.sh @@ -1,2 +1,4 @@ +#!/usr/bin/env bash + # FIXME: Get this out of snap sudo snap install pinta diff --git a/install/app-signal.sh b/install/app-signal.sh index c35b7894..583ef2a2 100644 --- a/install/app-signal.sh +++ b/install/app-signal.sh @@ -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 diff --git a/install/app-typora.sh b/install/app-typora.sh index f61cf8b8..b72d1106 100644 --- a/install/app-typora.sh +++ b/install/app-typora.sh @@ -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 diff --git a/install/app-vlc.sh b/install/app-vlc.sh index 440def4e..49527085 100644 --- a/install/app-vlc.sh +++ b/install/app-vlc.sh @@ -1 +1,3 @@ +#!/usr/bin/env bash + sudo apt install -y vlc diff --git a/install/app-vscode.sh b/install/app-vscode.sh index b1a39d72..b94387d1 100644 --- a/install/app-vscode.sh +++ b/install/app-vscode.sh @@ -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 diff --git a/install/app-xournalpp.sh b/install/app-xournalpp.sh index fe7e66f0..417928ca 100644 --- a/install/app-xournalpp.sh +++ b/install/app-xournalpp.sh @@ -1 +1,3 @@ +#!/usr/bin/env bash + sudo apt install -y xournalpp diff --git a/install/app-zellij.sh b/install/app-zellij.sh index fbae982c..da2b995c 100644 --- a/install/app-zellij.sh +++ b/install/app-zellij.sh @@ -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" diff --git a/install/apps-terminal.sh b/install/apps-terminal.sh index 1dabba24..d50064d8 100644 --- a/install/apps-terminal.sh +++ b/install/apps-terminal.sh @@ -1 +1,3 @@ +#!/usr/bin/env bash + sudo apt install -y fzf ripgrep bat eza zoxide plocate btop apache2-utils diff --git a/install/apps-web.sh b/install/apps-web.sh index e44fc85f..25127de4 100644 --- a/install/apps-web.sh +++ b/install/apps-web.sh @@ -1 +1,4 @@ -for script in ~/.local/share/omakub/web-apps/*.sh; do source $script; done +#!/usr/bin/env bash + +# shellcheck disable=SC1090 +for script in ~/.local/share/omakub/web-apps/*.sh; do source "$script"; done diff --git a/install/docker.sh b/install/docker.sh index f97889a5..866b07a5 100644 --- a/install/docker.sh +++ b/install/docker.sh @@ -1,7 +1,10 @@ +#!/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 @@ -9,7 +12,7 @@ sudo apt update 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 diff --git a/install/fonts.sh b/install/fonts.sh index 035f331d..40752edd 100644 --- a/install/fonts.sh +++ b/install/fonts.sh @@ -1,6 +1,8 @@ -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 @@ -8,8 +10,8 @@ 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 diff --git a/install/libraries.sh b/install/libraries.sh index 74b4c9c4..f014064c 100644 --- a/install/libraries.sh +++ b/install/libraries.sh @@ -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 \ diff --git a/install/mise.sh b/install/mise.sh index 9a7e3ebd..30f62d4e 100644 --- a/install/mise.sh +++ b/install/mise.sh @@ -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 diff --git a/install/optional/app-1password.sh b/install/optional/app-1password.sh index 2a8fbf3d..16e9c0b5 100644 --- a/install/optional/app-1password.sh +++ b/install/optional/app-1password.sh @@ -1,5 +1,7 @@ -cd /tmp +#!/usr/bin/env bash + +cd /tmp || exit wget https://downloads.1password.com/linux/debian/amd64/stable/1password-latest.deb sudo apt install -y ./1password-latest.deb rm 1password-latest.deb -cd - +cd - || exit diff --git a/install/optional/app-dropbox.sh b/install/optional/app-dropbox.sh index ed356b47..f24a44ca 100644 --- a/install/optional/app-dropbox.sh +++ b/install/optional/app-dropbox.sh @@ -1,2 +1,4 @@ +#!/usr/bin/env bash + sudo apt install -y nautilus-dropbox gtk-launch dropbox.desktop diff --git a/install/optional/app-spotify.sh b/install/optional/app-spotify.sh index 662416cc..fe950a90 100644 --- a/install/optional/app-spotify.sh +++ b/install/optional/app-spotify.sh @@ -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 diff --git a/install/optional/app-virtualbox.sh b/install/optional/app-virtualbox.sh index ff4ecfe6..e67ab743 100644 --- a/install/optional/app-virtualbox.sh +++ b/install/optional/app-virtualbox.sh @@ -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}" diff --git a/install/optional/app-zoom.sh b/install/optional/app-zoom.sh index 73bbe2a4..09d9086f 100644 --- a/install/optional/app-zoom.sh +++ b/install/optional/app-zoom.sh @@ -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 diff --git a/install/select-dev-env.sh b/install/select-dev-env.sh index 1049e773..9e9c1b0f 100644 --- a/install/select-dev-env.sh +++ b/install/select-dev-env.sh @@ -1,4 +1,7 @@ +#!/usr/bin/env bash + # Install default programming languages +# shellcheck disable=SC2140 languages=$(gum choose "Ruby" "Node.js" "Go" "Python" "Java" --no-limit --selected "Ruby","Node.js" --height 7 --header "Select programming languages") for language in $languages; do @@ -22,6 +25,7 @@ for language in $languages; do done # Install default databases +# shellcheck disable=SC2140 dbs=$(gum choose "MySQL" "Redis" "PostgreSQL" --no-limit --selected "MySQL","Redis" --height 5 --header "Select databases (runs in Docker)") for db in $dbs; do diff --git a/install/select-optional-apps.sh b/install/select-optional-apps.sh index b18dc1db..cc9e28b4 100644 --- a/install/select-optional-apps.sh +++ b/install/select-optional-apps.sh @@ -1,6 +1,10 @@ +#!/usr/bin/env bash + # Install optional apps +# shellcheck disable=SC2140 apps=$(gum choose "1password" "Spotify" "Zoom" "Dropbox" "VirtualBox" --no-limit --selected "1password","Spotify","Zoom" --height 7 --header "Select commercial apps") for app in $apps; do + # shellcheck disable=SC1090 source "$OMAKUB_PATH/install/optional/app-${app,,}.sh" done diff --git a/install/set-dock.sh b/install/set-dock.sh index ed5b1cc1..aedaa8ca 100644 --- a/install/set-dock.sh +++ b/install/set-dock.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + # Favorite apps for dock apps=( "google-chrome.desktop" diff --git a/install/set-emojis.sh b/install/set-emojis.sh index 0091df16..aed9783d 100644 --- a/install/set-emojis.sh +++ b/install/set-emojis.sh @@ -1,3 +1,5 @@ -cp ~/.local/share/omakub/configs/xcompose ~/.XCompose +#!/usr/bin/env bash + +cp "$HOME/.local/share/omakub/configs/xcompose" ~/.XCompose ibus restart gsettings set org.gnome.desktop.input-sources xkb-options "['compose:caps']" diff --git a/install/set-framework-text-scaling.sh b/install/set-framework-text-scaling.sh index f4261f33..f542f7d9 100644 --- a/install/set-framework-text-scaling.sh +++ b/install/set-framework-text-scaling.sh @@ -1,4 +1,7 @@ +#!/usr/bin/env bash + COMPUTER_MAKER=$(sudo dmidecode -t system | grep 'Manufacturer:' | awk '{print $2}') +# shellcheck disable=SC2063 SCREEN_RESOLUTION=$(xrandr | grep '*+' | awk '{print $1}') if [ "$COMPUTER_MAKER" == "Framework" ] && [ "$SCREEN_RESOLUTION" == "2256x1504" ]; then diff --git a/install/set-git.sh b/install/set-git.sh index baa13eb1..128f0953 100644 --- a/install/set-git.sh +++ b/install/set-git.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + # Set common git aliases git config --global alias.co checkout git config --global alias.br branch diff --git a/install/set-gnome-extensions.sh b/install/set-gnome-extensions.sh index dc6663a8..c3dd9545 100644 --- a/install/set-gnome-extensions.sh +++ b/install/set-gnome-extensions.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + sudo apt install -y gnome-shell-extension-manager pipx pipx install gnome-extensions-cli --system-site-packages @@ -18,10 +20,10 @@ gext install space-bar@luchrioh gext install undecorate@sun.wxg@gmail.com # Compile gsettings schemas in order to be able to set them -sudo cp ~/.local/share/gnome-shell/extensions/tactile@lundal.io/schemas/org.gnome.shell.extensions.tactile.gschema.xml /usr/share/glib-2.0/schemas/ -sudo cp ~/.local/share/gnome-shell/extensions/just-perfection-desktop\@just-perfection/schemas/org.gnome.shell.extensions.just-perfection.gschema.xml /usr/share/glib-2.0/schemas/ -sudo cp ~/.local/share/gnome-shell/extensions/blur-my-shell\@aunetx/schemas/org.gnome.shell.extensions.blur-my-shell.gschema.xml /usr/share/glib-2.0/schemas/ -sudo cp ~/.local/share/gnome-shell/extensions/space-bar\@luchrioh/schemas/org.gnome.shell.extensions.space-bar.gschema.xml /usr/share/glib-2.0/schemas/ +sudo cp "$HOME/.local/share/gnome-shell/extensions/tactile@lundal.io/schemas/org.gnome.shell.extensions.tactile.gschema.xml" /usr/share/glib-2.0/schemas/ +sudo cp "$HOME/.local/share/gnome-shell/extensions/just-perfection-desktop\@just-perfection/schemas/org.gnome.shell.extensions.just-perfection.gschema.xml" /usr/share/glib-2.0/schemas/ +sudo cp "$HOME/.local/share/gnome-shell/extensions/blur-my-shell\@aunetx/schemas/org.gnome.shell.extensions.blur-my-shell.gschema.xml" /usr/share/glib-2.0/schemas/ +sudo cp "$HOME/.local/share/gnome-shell/extensions/space-bar\@luchrioh/schemas/org.gnome.shell.extensions.space-bar.gschema.xml" /usr/share/glib-2.0/schemas/ sudo glib-compile-schemas /usr/share/glib-2.0/schemas/ # Configure Tactile diff --git a/install/set-gnome-hotkeys.sh b/install/set-gnome-hotkeys.sh index 02e3569f..7dd3fc79 100644 --- a/install/set-gnome-hotkeys.sh +++ b/install/set-gnome-hotkeys.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + # Alt+F4 is very cumbersome gsettings set org.gnome.desktop.wm.keybindings close "['w']" diff --git a/install/set-theme.sh b/install/set-theme.sh index 157a11a7..88c5ac3f 100644 --- a/install/set-theme.sh +++ b/install/set-theme.sh @@ -1,2 +1,5 @@ +#!/usr/bin/env bash + # Setup default theme -source ~/.local/share/omakub/themes/gnome/tokyo-night.sh +# shellcheck disable=SC1091 +source "$HOME/.local/share/omakub/themes/gnome/tokyo-night.sh" diff --git a/install/ulauncher.sh b/install/ulauncher.sh index 6093fb29..fb83fd1d 100644 --- a/install/ulauncher.sh +++ b/install/ulauncher.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + sudo add-apt-repository universe -y sudo add-apt-repository ppa:agornostal/ulauncher -y sudo apt update -y @@ -5,7 +7,7 @@ sudo apt install -y ulauncher # Start ulauncher to have it populate config before we overwrite mkdir -p ~/.config/autostart/ -cp ~/.local/share/omakub/configs/ulauncher.desktop ~/.config/autostart/ulauncher.desktop +cp "$HOME/.local/share/omakub/configs/ulauncher.desktop" "$HOME/.config/autostart/ulauncher.desktop" gtk-launch ulauncher.desktop >/dev/null 2>&1 sleep 2 # ensure enough time for ulauncher to set defaults -cp ~/.local/share/omakub/configs/ulauncher.json ~/.config/ulauncher/settings.json +cp "$HOME/.local/share/omakub/configs/ulauncher.json" "$HOME/.config/ulauncher/settings.json" diff --git a/themes/gnome/_set-gnome-theme.sh b/themes/gnome/_set-gnome-theme.sh index 59a97fd6..43d30ac8 100644 --- a/themes/gnome/_set-gnome-theme.sh +++ b/themes/gnome/_set-gnome-theme.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark' gsettings set org.gnome.desktop.interface cursor-theme 'Yaru' gsettings set org.gnome.desktop.interface gtk-theme "Yaru-$OMAKUB_THEME_COLOR-dark" @@ -9,7 +11,7 @@ BACKGROUND_DEST_PATH="$BACKGROUND_DEST_DIR/$OMAKUB_THEME_BACKGROUND" if [ ! -d "$BACKGROUND_DEST_DIR" ]; then mkdir -p "$BACKGROUND_DEST_DIR"; fi -[ ! -f $BACKGROUND_DEST_PATH ] && cp $BACKGROUND_ORG_PATH $BACKGROUND_DEST_PATH -gsettings set org.gnome.desktop.background picture-uri $BACKGROUND_DEST_PATH -gsettings set org.gnome.desktop.background picture-uri-dark $BACKGROUND_DEST_PATH +[ ! -f "$BACKGROUND_DEST_PATH" ] && cp "$BACKGROUND_ORG_PATH" "$BACKGROUND_DEST_PATH" +gsettings set org.gnome.desktop.background picture-uri "$BACKGROUND_DEST_PATH" +gsettings set org.gnome.desktop.background picture-uri-dark "$BACKGROUND_DEST_PATH" gsettings set org.gnome.desktop.background picture-options 'zoom' diff --git a/themes/gnome/catppuccin.sh b/themes/gnome/catppuccin.sh index 7408bfbf..ad8a6fb9 100644 --- a/themes/gnome/catppuccin.sh +++ b/themes/gnome/catppuccin.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + OMAKUB_THEME_COLOR="magenta" OMAKUB_THEME_BACKGROUND="catppuccintotoro.png" -source $OMAKUB_PATH/themes/gnome/_set-gnome-theme.sh +source "$OMAKUB_PATH/themes/gnome/_set-gnome-theme.sh" diff --git a/themes/gnome/everforest.sh b/themes/gnome/everforest.sh index b3715726..a47bdf4b 100644 --- a/themes/gnome/everforest.sh +++ b/themes/gnome/everforest.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + OMAKUB_THEME_COLOR="bark" OMAKUB_THEME_BACKGROUND="fog_forest_2.jpg" -source $OMAKUB_PATH/themes/gnome/_set-gnome-theme.sh +source "$OMAKUB_PATH/themes/gnome/_set-gnome-theme.sh" diff --git a/themes/gnome/gruvbox.sh b/themes/gnome/gruvbox.sh index b9ecdf50..3b88913f 100644 --- a/themes/gnome/gruvbox.sh +++ b/themes/gnome/gruvbox.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + OMAKUB_THEME_COLOR="sage" OMAKUB_THEME_BACKGROUND="ferns-green.jpg" -source $OMAKUB_PATH/themes/gnome/_set-gnome-theme.sh +source "$OMAKUB_PATH/themes/gnome/_set-gnome-theme.sh" diff --git a/themes/gnome/kanagawa.sh b/themes/gnome/kanagawa.sh index 029180ff..c1f42799 100644 --- a/themes/gnome/kanagawa.sh +++ b/themes/gnome/kanagawa.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + OMAKUB_THEME_COLOR="purple" OMAKUB_THEME_BACKGROUND="kanagawa.jpg" -source $OMAKUB_PATH/themes/gnome/_set-gnome-theme.sh +source "$OMAKUB_PATH/themes/gnome/_set-gnome-theme.sh" diff --git a/themes/gnome/nord.sh b/themes/gnome/nord.sh index 5daf98c9..bad13b1a 100644 --- a/themes/gnome/nord.sh +++ b/themes/gnome/nord.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + OMAKUB_THEME_COLOR="blue" OMAKUB_THEME_BACKGROUND="nord_scenary.png" -source $OMAKUB_PATH/themes/gnome/_set-gnome-theme.sh +source "$OMAKUB_PATH/themes/gnome/_set-gnome-theme.sh" diff --git a/themes/gnome/rose-pine.sh b/themes/gnome/rose-pine.sh index f00cc888..a99d6360 100644 --- a/themes/gnome/rose-pine.sh +++ b/themes/gnome/rose-pine.sh @@ -1,4 +1,6 @@ +#!/usr/bin/env bash + OMAKUB_THEME_COLOR="red" OMAKUB_THEME_BACKGROUND="simple-pastel-by-triarts-from-freepik.jpg" -source $OMAKUB_PATH/themes/gnome/_set-gnome-theme.sh +source "$OMAKUB_PATH/themes/gnome/_set-gnome-theme.sh" gsettings set org.gnome.desktop.interface color-scheme 'prefer-light' diff --git a/themes/gnome/tokyo-night.sh b/themes/gnome/tokyo-night.sh index a26eb262..28d0fdea 100644 --- a/themes/gnome/tokyo-night.sh +++ b/themes/gnome/tokyo-night.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + OMAKUB_THEME_COLOR="purple" OMAKUB_THEME_BACKGROUND="80s-retro-tropical-sunset-by-freepik.jpg" -source $OMAKUB_PATH/themes/gnome/_set-gnome-theme.sh +source "$OMAKUB_PATH/themes/gnome/_set-gnome-theme.sh" diff --git a/uninstall/app-1password.sh b/uninstall/app-1password.sh index d033c51f..e43bc3c7 100644 --- a/uninstall/app-1password.sh +++ b/uninstall/app-1password.sh @@ -1 +1,3 @@ +#!/usr/bin/env bash + sudo apt remove -y 1password diff --git a/uninstall/app-fastfetch.sh b/uninstall/app-fastfetch.sh index c1623514..5eaccda6 100644 --- a/uninstall/app-fastfetch.sh +++ b/uninstall/app-fastfetch.sh @@ -1 +1,3 @@ +#!/usr/bin/env bash + sudo apt remove -y fastfetch diff --git a/uninstall/app-flameshot.sh b/uninstall/app-flameshot.sh index 47db99c5..ef8dcd19 100644 --- a/uninstall/app-flameshot.sh +++ b/uninstall/app-flameshot.sh @@ -1 +1,3 @@ +#!/usr/bin/env bash + sudo apt remove -y flameshot diff --git a/uninstall/app-github-cli.sh b/uninstall/app-github-cli.sh index 18ee29ae..b5d3bb06 100644 --- a/uninstall/app-github-cli.sh +++ b/uninstall/app-github-cli.sh @@ -1 +1,3 @@ +#!/usr/bin/env bash + sudo apt remove -y gh diff --git a/uninstall/app-localsend.sh b/uninstall/app-localsend.sh index 4a5f3caa..6551c097 100644 --- a/uninstall/app-localsend.sh +++ b/uninstall/app-localsend.sh @@ -1 +1,3 @@ +#!/usr/bin/env bash + sudo apt remove -y localsend diff --git a/uninstall/app-pinta.sh b/uninstall/app-pinta.sh index 66053836..375dcd68 100644 --- a/uninstall/app-pinta.sh +++ b/uninstall/app-pinta.sh @@ -1 +1,3 @@ +#!/usr/bin/env bash + sudo snap remove pinta diff --git a/uninstall/app-spotify.sh b/uninstall/app-spotify.sh index 923340f6..e414b178 100644 --- a/uninstall/app-spotify.sh +++ b/uninstall/app-spotify.sh @@ -1 +1,3 @@ +#!/usr/bin/env bash + sudo apt remove -y spotify-client diff --git a/uninstall/app-typora.sh b/uninstall/app-typora.sh index 05bc0456..9fc6d11f 100644 --- a/uninstall/app-typora.sh +++ b/uninstall/app-typora.sh @@ -1,2 +1,4 @@ +#!/usr/bin/env bash + sudo apt remove typora -rm ~/.config/Typora +rm "$HOME/.config/Typora" diff --git a/uninstall/app-vlc.sh b/uninstall/app-vlc.sh index 16c8b579..472026d3 100644 --- a/uninstall/app-vlc.sh +++ b/uninstall/app-vlc.sh @@ -1 +1,3 @@ +#!/usr/bin/env bash + sudo apt remove -y vlc diff --git a/uninstall/app-xournalpp.sh b/uninstall/app-xournalpp.sh index aee4fdff..54e43ccd 100644 --- a/uninstall/app-xournalpp.sh +++ b/uninstall/app-xournalpp.sh @@ -1 +1,3 @@ +#!/usr/bin/env bash + sudo apt remove -y xournalpp diff --git a/uninstall/app-zoom.sh b/uninstall/app-zoom.sh index db3c6409..8e83d8f3 100644 --- a/uninstall/app-zoom.sh +++ b/uninstall/app-zoom.sh @@ -1 +1,3 @@ +#!/usr/bin/env bash + sudo apt remove -y zoom diff --git a/uninstall/apps-web.sh b/uninstall/apps-web.sh index 2d9000ee..0dccd10d 100644 --- a/uninstall/apps-web.sh +++ b/uninstall/apps-web.sh @@ -1,3 +1,5 @@ -rm ~/.local/share/applications/WhatsApp.desktop -rm ~/.local/share/applications/Basecamp.desktop -rm ~/.local/share/applications/HEY.desktop +#!/usr/bin/env bash + +rm "$HOME/.local/share/applications/WhatsApp.desktop" +rm "$HOME/.local/share/applications/Basecamp.desktop" +rm "$HOME/.local/share/applications/HEY.desktop" diff --git a/uninstall/docker.sh b/uninstall/docker.sh index f0218875..28e20e5f 100644 --- a/uninstall/docker.sh +++ b/uninstall/docker.sh @@ -1,2 +1,4 @@ +#!/usr/bin/env bash + sudo apt purge --auto-remove docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras sudo groupdel docker diff --git a/web-apps/Basecamp.sh b/web-apps/Basecamp.sh index 9f51a0e3..43f7d135 100644 --- a/web-apps/Basecamp.sh +++ b/web-apps/Basecamp.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + cat < ~/.local/share/applications/Basecamp.desktop [Desktop Entry] Version=1.0 diff --git a/web-apps/HEY.sh b/web-apps/HEY.sh index 2c99be09..d0e28250 100644 --- a/web-apps/HEY.sh +++ b/web-apps/HEY.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + cat <~/.local/share/applications/HEY.desktop [Desktop Entry] Version=1.0 diff --git a/web-apps/WhatsApp.sh b/web-apps/WhatsApp.sh index af413a78..06dc8592 100644 --- a/web-apps/WhatsApp.sh +++ b/web-apps/WhatsApp.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + cat < ~/.local/share/applications/WhatsApp.desktop [Desktop Entry] Version=1.0