# vim: set ft=make : # Install an appimage file from a local file or URL _install_appimage_file $APPIMAGE_SRC $filename="": #!/usr/bin/bash set -eo pipefail DOWNLOAD_DIR="{{ cache_directory() }}/ujust/appimages" mkdir -p "$DOWNLOAD_DIR" trap "rm -rf $DOWNLOAD_DIR" EXIT appimage_file="$DOWNLOAD_DIR/${filename:-${APPIMAGE_SRC##*/}}" if ! grep -q 'it.mijorus.gearlever' < <(flatpak list --columns application); then flatpak install --system -y flathub it.mijorus.gearlever <&- fi if [[ $APPIMAGE_SRC =~ ^https?:// ]]; then echo "Downloading $APPIMAGE_SRC to $appimage_file" wget -nv "$APPIMAGE_SRC" -O "$appimage_file" && echo "Download complete" else cp "$APPIMAGE_SRC" "$appimage_file" fi chmod +x "$appimage_file" echo "Click {{ BOLD }}Unlock{{ NORMAL }} then {{ BLUE + BOLD }}Move to the app menu{{ NORMAL }} and close window to finish installation." sleep 3 LC_ALL=C flatpak run it.mijorus.gearlever "$appimage_file" <&- # Install CoolerControl, a GUI for viewing all your system's sensors and for creating custom fan and pump profiles based on any available temperature sensor28 [group("apps")] install-coolercontrol: #!/usr/bin/env bash set -eo pipefail cat <<'EOF' {{ YELLOW }}This recipe will proceed to {{ BOLD }}layer{{ NORMAL }} {{ YELLOW }}CoolerControl{{ NORMAL }}. {{ YELLOW }}If updates start to fail, please use "{{ BOLD }}rpm-ostree reset{{ NORMAL }}" {{ YELLOW }}See https://docs.bazzite.gg/Installing_and_Managing_Software/rpm-ostree/#major-caveats-using-rpm-ostree{{ NORMAL }} EOF layered() { local pkg="$1" rpm-ostree status --json | jq -e ".deployments[] | select(.booted == true) | .packages | index(\"$pkg\")" > /dev/null } packages=() for pkg in liquidctl coolercontrol; do if layered "$pkg"; then echo "$pkg is already layered, skipping." else packages+=("$pkg") fi done if [ ${#packages[@]} -gt 0 ]; then repo_path="/etc/yum.repos.d/terra.repo" if ( ! grep -q "enabled=0" "$repo_path" ); then # if not matches found echo 'Terra Repository is already enabled, skipping.' else echo 'Enabling Terra Repository.' sudo sed -i 's@enabled=0@enabled=1@g' "$repo_path" fi echo "Installing: ${packages[*]}" rpm-ostree install -y "${packages[@]}" echo 'Complete, please reboot to apply changes.' else echo "No changes were made." fi # Install Displaylink, Needed for some laptop docks to output video [group("apps")] install-displaylink: #!/usr/bin/env bash set -eo pipefail cat <<'EOF' {{ YELLOW }}This recipe will proceed to {{ BOLD }}layer{{ NORMAL }} {{ YELLOW }}Displaylink{{ NORMAL }}. {{ YELLOW }}If updates start to fail, please use "{{ BOLD }}rpm-ostree reset{{ NORMAL }}" {{ YELLOW }}See https://docs.bazzite.gg/Installing_and_Managing_Software/rpm-ostree/#major-caveats-using-rpm-ostree{{ NORMAL }} EOF layered() { local pkg="$1" rpm-ostree status --json | jq -e ".deployments[] | select(.booted == true) | .packages | index(\"$pkg\")" > /dev/null } packages=() for pkg in displaylink; do if layered "$pkg"; then echo "$pkg is already layered, skipping." else packages+=("$pkg") fi done if [ ${#packages[@]} -gt 0 ]; then repo_path="/etc/yum.repos.d/negativo17-fedora-multimedia.repo" if ( ! grep -q "enabled=0" "$repo_path" ); then # if not matches found echo 'Negativo17 Multimedia Repository is already enabled, skipping.' else echo 'Enabling Negativo17 Multimedia Repository.' sudo sed -i 's@enabled=0@enabled=1@g' "$repo_path" fi echo "Installing: ${packages[*]}" rpm-ostree install -y "${packages[@]}" echo 'Complete, please reboot to apply changes.' else echo "No changes were made." fi # Install JetBrains Toolbox | https://www.jetbrains.com/toolbox-app/ [group("apps")] install-jetbrains-toolbox: #!/usr/bin/env bash set -euo pipefail # Ensure Homebrew is available in non-interactive shells if ! command -v brew >/dev/null 2>&1 && [ -x /home/linuxbrew/.linuxbrew/bin/brew ]; then eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" fi brew tap ublue-os/tap brew install --cask jetbrains-toolbox-linux if ! command -v jetbrains-toolbox >/dev/null 2>&1; then echo "jetbrains-toolbox was not found on PATH after installation. You may need to restart your shell or ensure Homebrew's bin directory is on your PATH." >&2 exit 1 fi jetbrains-toolbox &> /dev/null & # Install SteamCMD (https://developer.valvesoftware.com/wiki/SteamCMD). Options: status | install | uninstall [group("gaming")] get-steamcmd ACTION="": #!/usr/bin/bash get_status_token() { if [[ -f "$HOME/.steam/steamcmd.sh" ]] || [[ -f "$HOME/.local/bin/steamcmd" ]]; then echo "install" else echo "uninstall" fi } get_current_status() { if [[ "$(get_status_token)" == "install" ]]; then echo "Installed" else echo "Not Installed" fi } install_steamcmd() { if [[ $UID -eq 0 ]]; then echo >&2 "This ujust should not be run as root." exit 1 fi echo 'Installing SteamCMD...' wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz -O /tmp/steamcmd.tar.gz mkdir -p ~/.steam tar -xvzf /tmp/steamcmd.tar.gz -C ~/.steam rm /tmp/steamcmd.tar.gz if [[ -f ~/.steam/steamcmd.sh ]]; then mkdir -p ~/.local/bin rm -f ~/.local/bin/steamcmd printf '#!/usr/bin/bash\nexec ~/.steam/steamcmd.sh "$@"\n' > ~/.local/bin/steamcmd chmod +x ~/.local/bin/steamcmd fi } uninstall_steamcmd() { rm -f "$HOME/.local/bin/steamcmd" rm -f "$HOME/.steam/steamcmd.sh" echo "SteamCMD has been uninstalled." } OPTION="{{ ACTION }}" if [[ "$OPTION" == "help" ]]; then echo "Usage: ujust get-steamcmd