File: launch_vimix.sh

package info (click to toggle)
vimix 0.9.0%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 90,688 kB
  • sloc: cpp: 98,036; ansic: 34,427; makefile: 373; objc: 97; xml: 95; sh: 49; python: 20
file content (24 lines) | stat: -rw-r--r-- 805 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
which vimix >/dev/null || { echo "vimix not found"; exit 1; }
# test if there is an nvidia GPU
gpu=$(lspci | grep -i '.* vga .* nvidia .*')
shopt -s nocasematch
if [[ $gpu == *' nvidia '* ]]; then
    # with nvidia, request Wayland render offload
    printf 'NVidia GPU present:  %s\n' "$gpu"
    # Test if running under wayland
    if [ -z "$WAYLAND_DISPLAY" ]; then
        # not Wayland
        printf 'Launching vimix with NVIDIA under X11\n' 
        __GLX_VENDOR_LIBRARY_NAME=nvidia vimix "$@"
    else
        # Wayland: 
        printf 'Launching vimix with NVIDIA offload support under Wayland\n'
        __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia DISPLAY=:0 vimix "$@"
    fi
else
    # otherwise, nothing special
    printf 'Launching vimix\n' 
    vimix "$@"
fi