Artemis-RGB / Artemis

Provides advanced unified lighting across many different brands RGB peripherals
https://artemis-rgb.com
Other
953 stars 66 forks source link

Install Steps on Mac? #825

Open eroepken opened 11 months ago

eroepken commented 11 months ago

Is it possible to get some installation instructions for Mac? When I download Artemis, I get a zip file that expands into a folder with a bunch of files in it, no readme or executable as far as I can see. And the wiki only shows install steps for Windows and Linux.

diogotr7 commented 11 months ago

Unfortunately none of us developers have access to macs so support is mostly assumed (since underlying frameworks are supposed to work with it).

The zip you mentioned should have an executable in it (Artemis.UI.MacOS) but, again, I'm not sure if Mac will like it or if we need to actually bundle this into an *.app file. I tried creating an OSX virtual machine on my server but didn't have much luck, I'll give that another try and see if I find anything interesting :)

eroepken commented 11 months ago

Ah! I was able to get it set up by adapting from the Linux script. Now I need to figure out how to run it without having to keep a terminal window open.

eroepken commented 11 months ago

Adaptation:

#!/bin/bash

# Check if wget is installed
if ! command -v wget &> /dev/null
then
    echo "wget is not installed, please install wget before running this script"
    echo "On Mac, run: brew install wget"
    exit
fi

# Check if the XDG_DATA_HOME environment variable is set
if [ -z "$XDG_DATA_HOME" ]; then
    echo "XDG_DATA_HOME is not set, defaulting to ~/.local/share"
    XDG_DATA_HOME="$HOME/.local/share"
fi

# Create a temporary directory
temp_dir=$(mktemp -d)

# Artemis installation directory (~/.local/share/bin/Artemis)
install_dir="$XDG_DATA_HOME/bin/Artemis"

# Check if the installation directory exists
if [ -d "$install_dir" ]; then
    echo "Artemis is already installed, do you want to reinstall it? (y/n)"
    read -r reinstall
    if [ "$reinstall" != "y" ]; then
        echo "Aborting installation"
        exit
    fi
fi

# Remove the installation directory if it exists
if [ -d "$install_dir" ]; then
    rm -r "$install_dir"
fi

echo "Creating install directory"
# Create the installation directory
mkdir -p "$install_dir"

# if $1 is an artifact id, use that. othewise, latest master
if [[ $1 =~ ^[0-9]+$ ]]; then
    download_link="https://updating.artemis-rgb.com/api/artifacts/$1"
else
    download_link="https://updating.artemis-rgb.com/api/artifacts/latest/master/osx"
fi

# Download the zip artifact
echo "Downloading the latest version of Artemis from $download_link"
wget -q "$download_link" -O "$temp_dir"/artemis.zip --show-progress

# Unzip the artifact
echo "Installing Artemis"
unzip -q "$temp_dir"/artemis.zip -d "$install_dir"

# Make executable
echo "Making Artemis executable"
chmod +x "$install_dir/Artemis.UI.MacOS"

# Remove the zip file
echo "Deleting the zip file"
rm "$temp_dir"/artemis.zip

# Create the desktop file
echo "Creating the desktop file"
echo "[Desktop Entry]
Name=Artemis
Exec=$install_dir/Artemis.UI.MacOS
Icon=artemis
Terminal=false
Type=Application" > "$XDG_DATA_HOME/applications/artemis.desktop"

# Copy the icons to the appropriate directories
echo "Copying the icons"
mkdir -p "$XDG_DATA_HOME/icons/hicolor"
cp -r "$install_dir/Icons/." "$XDG_DATA_HOME/icons/hicolor/"

# Remove the temporary directory
echo "Removing the temporary directory"
rm -r "$temp_dir"

echo "Artemis has been installed successfully! Press enter to exit"
read -r

Only I think the desktop icon part doesn't work on mac. I'm still trying to figure that one out.

diogotr7 commented 11 months ago

Ah cool! Expect a lot of features to be missing, for example devices will only really work through OpenRGB. Things like currently running processes or Ambilight are also not going to work since those implementations are platform-specific. Out of curiosity, are you running this on an Intel or Apple Silicon? I have no idea how dotnet handles that, or if we should switch to arm builds instead of x86.

eroepken commented 11 months ago

I'm running this on Apple Silicon (Macbook Pro with the M1 Pro chip and Mac OS Ventura 13.6.1)

That's okay. I can't seem to find any other software that works to control my RGB lighting that has been updated within the last year, so I'm happy to get anything running.

eroepken commented 11 months ago

Ah! I got it to work by double clicking! The Artemis.UI.MacOS file needs to have a .app extension to be launchable without the terminal! I'll report back with docs once I get a good workflow going.

eroepken commented 11 months ago

The following script downloads the OSX version and installs it and makes it openable in the Applications directory:

#!/bin/bash

# Check if wget is installed
if ! command -v wget &> /dev/null
then
    echo "wget is not installed, please install wget before running this script"
    echo "On Ubuntu/Debian, run: sudo apt install wget"
    exit
fi

# check if unzip is installed
if ! command -v unzip &> /dev/null
then
    echo "unzip is not installed, please install unzip before running this script"
    echo "On Ubuntu/Debian, run: sudo apt install unzip"
    exit
fi

# Check if the XDG_DATA_HOME environment variable is set
if [ -z "$XDG_DATA_HOME" ]; then
    echo "XDG_DATA_HOME is not set, defaulting to ~/.local/share"
    XDG_DATA_HOME="$HOME/.local/share"
fi

# Create a temporary directory
temp_dir=$(mktemp -d)

# Artemis installation directory (~/.local/share/bin/Artemis)
install_dir="$XDG_DATA_HOME/bin/Artemis"

# Check if the installation directory exists
if [ -d "$install_dir" ]; then
    echo "Artemis is already installed, do you want to reinstall it? (y/n)"
    read -r reinstall
    if [ "$reinstall" != "y" ]; then
        echo "Aborting installation"
        exit
    fi
fi

# Remove the installation directory if it exists
if [ -d "$install_dir" ]; then
    rm -r "$install_dir"
fi

echo "Creating install directory"
# Create the installation directory
mkdir -p "$install_dir"

# if $1 is an artifact id, use that. othewise, latest master
if [[ $1 =~ ^[0-9]+$ ]]; then
    download_link="https://updating.artemis-rgb.com/api/artifacts/$1"
else
    download_link="https://updating.artemis-rgb.com/api/artifacts/latest/master/osx"
fi

# Download the zip artifact
echo "Downloading the latest version of Artemis from $download_link"
wget -q "$download_link" -O "$temp_dir"/artemis.zip --show-progress

# Unzip the artifact
echo "Installing Artemis"
unzip -q "$temp_dir"/artemis.zip -d "$install_dir"

# Make executable
echo "Making Artemis executable"
chmod +x "$install_dir/Artemis.UI.MacOS"
mv "$install_dir/Artemis.UI.MacOS" "$install_dir/Artemis.UI.MacOS.app"
ln -s "$install_dir/Artemis.UI.MacOS.app" "/Applications/Artemis.UI.MacOS.app"

# Remove the zip file
echo "Deleting the zip file"
rm "$temp_dir"/artemis.zip

# Copy the icons to the appropriate directories
echo "Copying the icons"
mkdir -p "$XDG_DATA_HOME/icons/hicolor"
cp -r "$install_dir/Icons/." "$XDG_DATA_HOME/icons/hicolor/"

# Remove the temporary directory
echo "Removing the temporary directory"
rm -r "$temp_dir"

echo "Artemis has been installed successfully! Press enter to exit"
read -r

I hope this helps! And thank you for this project!