games-on-whales / wolf

Stream virtual desktops and games running in Docker
https://games-on-whales.github.io/wolf/stable/
MIT License
652 stars 44 forks source link

Game icons #140

Open csrednicki opened 1 month ago

csrednicki commented 1 month ago

Hi, in Defining Apps section in documentation there is icon_png_path parameter. I tried to use it but it didn't work. Where this icon should be placed? I tried many different locations like folder defined in app_state_folder variable, app directory, defined path from system, path in container without any luck.

Below you can find my app config and sample icon (I've created it for test purposes as PNG 628x888).

Here's my config:

[[apps]]
title = "Steam"
start_virtual_compositor = true
icon_png_path = "sample-icon.png" 

[apps.runner]
type = "docker"
name = "WolfSteam"
image = "ghcr.io/games-on-whales/steam:edge"
mounts = []
env = [
  "PROTON_LOG=1",
  "TZ=Europe/Warsaw",
  "RUN_SWAY=true",
  "GOW_REQUIRED_DEVICES=/dev/input/* /dev/dri/* /dev/nvidia*",
]
devices = []
ports = []
base_create_json = """
{
  "HostConfig": {
    "IpcMode": "host",
    "CapAdd": ["SYS_ADMIN", "SYS_NICE", "SYS_PTRACE", "NET_RAW", "MKNOD", "NET_ADMIN"],
    "SecurityOpt": ["seccomp=unconfined", "apparmor=unconfined"],
    "Ulimits": [{"Name":"nofile", "Hard":10240, "Soft":10240}],
    "Privileged": false,
    "DeviceCgroupRules": ["c 13:* rmw", "c 244:* rmw"]
  }
}
"""

Here's icon file: sample-icon

ABeltramo commented 1 month ago

app_state_folder expects the full path to the image file and, more importantly, it has to be accessible by the Wolf container.

My advice would be to make a folder under /etc/wolf/ (or where you store your config.toml file) say icons/ and place the file there called sample-icon.png. In this case the config will be:

icon_png_path = "/etc/wolf/icons/sample-icon.png"

We should definitely improve the docs on this..

csrednicki commented 1 month ago

Thank you for quick reply. I've applied changes you proposed to config.toml

icon_png_path = "/etc/wolf/icons/sample-icon.png" 

This is screen from inside wolf container: image

As you see file is placed in proper location and is accessible with proper rights.

Unfortunately moonlight still isn't displaying this icon correctly. image

ABeltramo commented 1 month ago

This is probably due to Moonlight caching those images, I'm going to take a look back at this over the next few days since I've also found a source for some good and open licensed defaults that we could include in Wolf..

Stay tuned 😉

csrednicki commented 1 month ago

This is probably due to Moonlight caching those images,

I tried it on few different clients (android tv and windows). I also looked on windows into c:\Users\username\AppData\Local\Moonlight Game Streaming Project\Moonlight\cache\boxart\ where Moonlight is keeping its cache. Folder for this client was empty.

salty2011 commented 1 month ago

Ive been able to replicate this issue with Sunshine stream as well where Moonlight refuses to update the box art. I would suggest logging an issue with Moonlight as in my experience this problem isn't strictly related to wolf / sunshine stream and more related to the client not correctly updating its cache

csrednicki commented 3 weeks ago

In the newest wolf docker image ghcr.io/games-on-whales/wolf:stable (hash: sha256:5761b9337fb3713894d4e86b0ea8dd08939883d46d381efbcf3942acb461a8ff created 2024-10-28 21:45:36) moonlight images are now working using this line in config.toml:

icon_png_path = "/etc/wolf/icons/sample-icon.png"

I can see image for Steam application as seen below: image

There are two problems now: