Custom Lutris Game Banner Images

For those using the "Thunar" file manager in Linux — I've written a small script which adds a custom action to Thunar. It uses ffmpeg to convert large screen grab images to the size required for Lutris game banners images.

For games that don't have a banner, you can screenshot your own to your Pictures/ folder when the game is open, then convert the saved images for use as game banners with this script.

How to,

  1. Open your text editor of choice and copy and paste the following,
 1#!/bin/bash
 2# Creates a folder name declared in DEST.
 3# Converts images to Lutris banner size using ffmpeg. (184:69)
 4
 5DEST="./Lutris_converted"
 6mkdir $DEST
 7
 8# Pass files through ffmpeg and scale to new size, then save to DEST output folder.
 9for file
10    do
11    if [ ! -e $file ]
12        then
13        continue
14    fi
15    to_name="$DEST/"${file%.*}".jpg"
16    ffmpeg -i "${file}" -vf scale=184:69 "${to_name}"
17done
  1. Save the file as lutris_banner_images.sh to $HOME/.scripts/ folder. If that folder doesn't exist, then simply create it.
  2. In Thunar, press "Ctrl H" to show hidden files, then locate the lutris_banner_images.sh file.
  3. Right-click on the file and select Properties > Permissions > (tick) "Allow this file to run as a program", then press close.
  4. In Thunar, go to Edit > Configure custom actions, then press the + icon on the right of the window.**
  5. In the "Basic" tab, give your new action a name, "to Lutris banner size", then enter a description.
  6. In the "Command" field, enter the location to the lutris_banner_images.sh file followed by %N

Example:

~/.scripts/lutris_banner_images.sh %N

  1. Choose an icon for the action if you wish.
  2. Click on the "Appearance" tab, set "File pattern" as * and tick the "Image Files" button. Press "OK" and "Close".

Now, when you right-click on images you'd like to create to a Lutris banner, you will see your new custom action in the menu. Convert and use as you wish. Your converted images will appear in the Lutris_converted folder.

I hope this helps. :smiley: