-
Notifications
You must be signed in to change notification settings - Fork 962
Flatpak Support #737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
same here, it would be handy for the steamdeck! |
There are 3 competitor apps on Flathub already.
However this is my favorite YouTube Music desktop app and I wish it was there as well. |
I created a request for this app in the Flathub forums: https://discourse.flathub.org/t/th-ch-youtube-music/4527 |
There is also https://github.com/vixalien/muzika coming up to flathub soonish, just for your list. |
Is there anyone interested in doing this task? |
I strongly believe that for the sake of cross compatibility across all desktop Linux distros, flatpak should be a supported method of installation. But also one thing to be careful of is ensuring plugins like Discord works. |
Also adding this link for reference to support using Discord Flatpak, although that's something more for users using the Discord Flatpak to worry about: https://github.com/flathub/com.discordapp.Discord/wiki/Rich-Precense-(discord-rpc) |
Github action for building flatpak https://github.com/flatpak/flatpak-github-actions |
You actually should use https://github.com/flathub-infra/flatpak-github-actions for flathub - but getting the flatpak building is the first step |
I see that this project uses electron-builder for releases. They have a Flatpak build target too, but that doesn't support publishing to Flathub. It would probably be pretty easy to add that build target, though, so that Flatpak users on stuff like immutable Linux distributions would have at least some way of installing. |
Currently, ytmdesktop (first link) seems no longer maintained on FlatHub. But doesn't matter cuz I like th-ch/youtube-music more |
Is anybody working on this currently? Otherwise, I could probably do it lol: https://www.electron.build/configuration/flatpak.html |
I've just opened a PR to add Flatpak support at #2047 |
any news? |
Has this been added to the flathub yet? If not, how do I install the flatpak? |
|
Partially implemented at b668730 (flatpak single bundle) |
Would be nice if this was on flathub. Maybe I can work towards that... |
Dropping in to say that I'm on an immutable distro, flatpak is basically my package manager, love this app and a flatpak bundle would be lovely |
For now I wrote this script for my personal usage: #!/bin/env bash
DOWNLOAD_DIR="$HOME/.local/share/youtube-music-updater"
mkdir -p "$DOWNLOAD_DIR"
latest=$(wget 'https://github.com/th-ch/youtube-music/releases/latest/download/latest-linux.yml' -q -O -)
version=$(echo "$latest" | grep 'version' | awk '{ print $2 }')
echo "Downloading YouTube Music version $version"
wget "https://github.com/th-ch/youtube-music/releases/latest/download/YouTube-Music-$version-x86_64.flatpak" \
-q --show-progress \
-O "$DOWNLOAD_DIR/YouTube-Music-$version-x86_64.flatpak"
flatpak remove --user --assumeyes --noninteractive com.github.th_ch.youtube_music
flatpak install --user --assumeyes --noninteractive "$DOWNLOAD_DIR/YouTube-Music-$version-x86_64.flatpak" feel free to improve it |
I made some AI-aided improvements (using aria2 for downloading since wget was slow, and adding an option of putting it on a daily timer):
|
Currently there is only x86_64. It would be great if aarch64 can be supported |
Since the flatpak bundle does not contain version information, it is seemingly impossible to compare the local version with the latest version from a shell script. BUT I did find a messy workaround 🤣
-- I'll soon update my script |
New script: #!/bin/env amber
import { env_const_get, printf, styled } from "std/env"
import { file_download } from "std/http"
fun info(message: Text): Null {
const BOLD = 1
const FG_WHITE = 37
const BG_BLACK = 40
const tag = styled("info", BOLD, FG_WHITE, BG_BLACK)
printf("[{tag}]: %s\n", [message])
}
fun error(message: Text): Null {
const BOLD = 1
const FG_RED = 31
const BG_BLACK = 40
const tag = styled("error", BOLD, FG_RED, BG_BLACK)
printf("[{tag}]: %s\n", [message])
exit 1
}
const download_dir = trust env_const_get("HOME") + "/.local/share/youtube-music-updater"
$ mkdir -p "{download_dir}" $ failed {
error("Failed to create download directory: {download_dir}")
}
fun remote_version() {
info("Fetching latest release info from GitHub...")
const latest_release = "https://github.com/th-ch/youtube-music/releases/latest/download/latest-linux.yml"
const latest_yaml_path = "{download_dir}/latest-linux.yml"
if not silent file_download(latest_release, latest_yaml_path) {
error("Failed to download latest release info from {latest_release}")
}
return trust $ yq '.version' "{latest_yaml_path}" -r $
}
fun local_version() {
info("Fetching local version info...")
const strings = $ strings ~/.local/share/flatpak/app/com.github.th_ch.youtube_music/current/active/files/lib/com.github.th_ch.youtube_music/resources/app.asar $ failed {
error("Failed to read local version info")
}
const package_json = $ echo "{strings}" | rg -o -U '"name":\s*"youtube-music"(?:.|\n)+"version":\s*"(.+)"' $ failed {
error("Failed to find local version info")
}
const version = $ echo "{package_json}" | rg -o -U '"version":\s*"(.+)"' | rg -o '\d+\.\d+\.\d+' $ failed {
error("Failed to extract local version info")
}
return version
}
const version = remote_version()
if version == local_version() {
info("YouTube Music is up to date.")
exit
}
info("Downloading YouTube Music version {version}...")
const download_path = "{download_dir}/YouTube-Music-{version}-x86_64.flatpak"
if not file_download("https://github.com/th-ch/youtube-music/releases/latest/download/YouTube-Music-{version}-x86_64.flatpak", download_path) {
error("Failed to download YouTube Music version {version}")
}
$ flatpak remove --user --assumeyes --noninteractive com.github.th_ch.youtube_music $ failed {
error("Failed to remove old version of YouTube Music")
}
$ flatpak install --user --assumeyes --noninteractive "{download_path}" $ failed {
error("Failed to install YouTube Music version {version}")
} It is written using Amber, and is much more verbose yet more elegant and safe. script dependencies:
|
only if you have and amber is also in a very early stage so i'd advise against using it for now, unless you're fine with rewriting your code to update to the next version |
well, I meant "safe" as in "safe from programmer mistakes", just like typescript isn't safe if you are not honest with it |
What does it take to get the flatpak onto flathub? |
When this app will be on flatpak? |
There's a flatpak in the latest releases page It's not on Flathub tho |
The current flatpak we have does not allow incremental updates, and I don't think it will be accepted by flathub. |
if the app is not in flathub or somewhere like this it is not reliable to install that as it will be not updated i have to do this manually. |
I simply have a systemd service that runs this script when my user logs in. |
Would prefer a flatpak distribution option be supported
The text was updated successfully, but these errors were encountered: