tidal-hifi icon indicating copy to clipboard operation
tidal-hifi copied to clipboard

tidal-hifi-flags.conf

Open nekinie opened this issue 2 years ago • 11 comments

I happily use this project (thank you) on sway (wayland) by executing the following command tidal-hifi -enable-features=UseOzonePlatform,WebRTCPipeWireCapturer --ozone-platform=wayland. Most electron based projects support a electron15-flags.conf or chrome-flags.conf file to configure these flags, it would make my ergonomics a little easier this project could follow the same convention.

nekinie avatar May 03 '22 23:05 nekinie

Hey @nekinie,

I don't know how that works but I'll check it out this weekend 😄

Mastermindzh avatar May 04 '22 06:05 Mastermindzh

@nekinie, Got any links for me?

Can't seem to find too much 🤔.

Mastermindzh avatar May 07 '22 14:05 Mastermindzh

I did some research into how this is handled in the systems electron package and this is what I found:

#!/usr/bin/bash

set -euo pipefail

name=electron
flags_file="${XDG_CONFIG_HOME:-$HOME/.config}/${name}-flags.conf"

declare -a flags

if [[ -f "${flags_file}" ]]; then
    mapfile -t < "${flags_file}"
fi

for line in "${MAPFILE[@]}"; do
    if [[ ! "${line}" =~ ^[[:space:]]*#.* ]]; then
        flags+=("${line}")
    fi
done

exec /usr/lib/${name}/electron "$@" "${flags[@]}"

This looks to be packaging related rather than a code change, we can close this issue and I will reach out to the package maintainer. Sorry for the bother.

nekinie avatar May 08 '22 16:05 nekinie

I have decided to add it in later down the road but on another note I am surprised it even is working with wayland due to https://github.com/electron/electron/issues/32487

Mar0xy avatar May 08 '22 21:05 Mar0xy

Oh I see, just a bash script to add flags from a config file then.

I'll keep this open and possibly add advanced flag handling inside tidal-hifi itself, might be useful regardless.

Mastermindzh avatar May 08 '22 21:05 Mastermindzh

Oh I see, just a bash script to add flags from a config file then.

I'll keep this open and possibly add advanced flag handling inside tidal-hifi itself, might be useful regardless.

Yeah, afaik some electron apps actually add that into their app(Discord and a few others) instead of doing it through bash scripts.

Mar0xy avatar May 08 '22 23:05 Mar0xy

Yeah, seems cleaner to do it in the app so I'll eventually just do that :)

Mastermindzh avatar May 12 '22 13:05 Mastermindzh

Any updates?

cold-nagai avatar Jul 12 '23 22:07 cold-nagai

We've been adding flags straight into the application for now. Do you need advanced flag handling or just a specific flag :) ?

Mastermindzh avatar Jul 13 '23 08:07 Mastermindzh

We've been adding flags straight into the application for now. Do you need advanced flag handling or just a specific flag :) ?

I was hoping tidal-hifi would respect ~/.config/electron-flags.conf or at least implement a workaround:

I'll keep this open and possibly add advanced flag handling inside tidal-hifi itself, might be useful regardless.

For now i have to update tidal-hifi.desktop with proper flags via hook every time a new AUR update comes. Janky!

cold-nagai avatar Jul 13 '23 22:07 cold-nagai

I understand that tidal-hifi bundles its own version of electron, rather than using the system installed one, so it may not make sense to respect ~/.config/electron-flags.conf since its internal electron version may not be the same as the system electron version.

For now i have to update tidal-hifi.desktop with proper flags via hook every time a new AUR update comes. Janky!

You could keep your own copy in $XDG_DATA_HOME/applications (~/.local/share/applications), which will override the system entry.

jthvai avatar Jul 14 '23 09:07 jthvai