Skip to content

Instantly share code, notes, and snippets.

@realasib
Last active August 24, 2024 13:06
Show Gist options
  • Select an option

  • Save realasib/1b3ab925d8f7be74118a2e751f658b36 to your computer and use it in GitHub Desktop.

Select an option

Save realasib/1b3ab925d8f7be74118a2e751f658b36 to your computer and use it in GitHub Desktop.

To automate the installation of the activate-linux package on a Linux system, you can create a shell script. Below is a script that installs the necessary dependencies, clones the repository, builds, and installs the package.

#!/bin/bash

# Define a function to install dependencies
install_dependencies() {
    echo "Installing dependencies..."
    sudo apt update
    sudo apt install -y \
        libconfig-dev libcairo2-dev libxi-dev libx11-dev \
        x11proto-core-dev x11proto-dev libxt-dev libxext-dev \
        libxfixes-dev libxinerama-dev libxrandr-dev libwayland-dev \
        wayland-protocols
}

# Define a function to clone the repository and build the package
build_and_install() {
    echo "Cloning the repository..."
    git clone https://github.com/MrGlockenspiel/activate-linux
    cd activate-linux || exit

    echo "Building the package..."
    make

    echo "Installing the package..."
    sudo make install
}

# Main script execution
install_dependencies
build_and_install

echo "Installation complete! You can now use activate-linux."

How to Use the Script:

  1. Save the script: Save the above code into a file, for example, install_activate_linux.sh. (Or you can just download the install_activate-linux.sh file)

  2. Make it executable: Run the following command to make the script executable:

    chmod +x install_activate_linux.sh
  3. Run the script: Execute the script with:

    ./install_activate_linux.sh

This script assumes you're using a Debian-based system (like Ubuntu). If you're using a different distribution, you'll need to adjust the dependency installation commands accordingly.

#!/bin/bash
# Define a function to install dependencies
install_dependencies() {
echo "Installing dependencies..."
sudo apt update
sudo apt install -y \
libconfig-dev libcairo2-dev libxi-dev libx11-dev \
x11proto-core-dev x11proto-dev libxt-dev libxext-dev \
libxfixes-dev libxinerama-dev libxrandr-dev libwayland-dev \
wayland-protocols
}
# Define a function to clone the repository and build the package
build_and_install() {
echo "Cloning the repository..."
git clone https://github.com/MrGlockenspiel/activate-linux
cd activate-linux || exit
echo "Building the package..."
make
echo "Installing the package..."
sudo make install
}
# Main script execution
install_dependencies
build_and_install
echo "Installation complete! You can now use activate-linux."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment