0
0
mirror of https://github.com/cucumber-sp/yandex-music-linux.git synced 2024-12-23 22:22:59 +03:00
yandex-music-linux/templates/yandex-music.sh
Yury Shvedov d1984db95c [nix] Fix configuration
Reuse common shell for nix package. Add options for nix-way
configuration of yandex music.

Change-Id: I71a209a8ca8b5e3c5c08349b8da5ba91182a919e
2024-05-22 16:16:49 +03:00

28 lines
697 B
Bash

#!/bin/bash
set -e
CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
CONFIG_FILE="${YANDEX_MUSIC_CONFIG:-$CONFIG_HOME/yandex-music.conf}"
echo "Using config file: ${CONFIG_FILE}"
if [ ! -f "$CONFIG_FILE" ]; then
echo "Config file not found, copying default"
mkdir -p "$(dirname "$CONFIG_FILE")"
cp /usr/lib/yandex-music/default.conf "$CONFIG_FILE"
fi
source "$CONFIG_FILE"
WAYLAND_FLAGS=""
if [ "$XDG_SESSION_TYPE" == "wayland" ]; then
WAYLAND_FLAGS="--enable-features=UseOzonePlatform --ozone-platform=wayland"
fi
ELECTRON_BIN=${ELECTRON_CUSTOM_BIN:-%electron_path%}
export TRAY_ENABLED=${TRAY_ENABLED:-0}
exec "${ELECTRON_BIN}" "%asar_path%" $ELECTRON_ARGS $WAYLAND_FLAGS