aboutsummarylogtreecommitdiffstats
diff options
context:
space:
mode:
authoragentcobra2018-10-24 20:42:43 +0200
committeragentcobra2018-10-24 20:42:43 +0200
commit8f6d76ee7563a5f7227b6f9c57a76fe666593a58 (patch)
tree47196f836a7a2af64e09d0cede89e868139930b4
parent3b5cef6e813e025e401b044cc1f291323a1a75e0 (diff)
downloadaur-8f6d76ee7563a5f7227b6f9c57a76fe666593a58.tar.gz
new launcher (0.8.62-BETA)
-rw-r--r--.SRCINFO11
-rw-r--r--INSTALL47
-rw-r--r--Makefile6
-rw-r--r--PKGBUILD43
-rw-r--r--report.pl106
-rw-r--r--wrapper.pl433
6 files changed, 52 insertions, 594 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 7d3361643511..dfc32f2c1665 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,14 +1,14 @@
pkgbase = shadow-beta
pkgdesc = Shadow launcher
- pkgver = 0.7.6
- pkgrel = 8
+ pkgver = 0.8.62
+ pkgrel = 1
url = http://shadow.tech
install = INSTALL
arch = x86_64
license = unknown
depends = desktop-file-utils
depends = freetype2
- depends = gcc5
+ depends = libuv
depends = gconf
depends = hicolor-icon-theme
depends = json-c
@@ -29,9 +29,10 @@ pkgbase = shadow-beta
depends = sdl
depends = gcc7-libs
depends = ttf-dejavu
+ depends = libxss
provides = shadow-beta
- source = https://macosx.update.blade-group.fr/mpl/linux/beta/bionic/shadowbeta.deb
- md5sums = 6fc188e0e818c9d3af6dbb2d51a88f91
+ source = https://macosx.update.blade-group.fr/mpl/linux/beta/bionic/shadow-alpha-bionic.zip
+ md5sums = bc290cee83021c95f2ecc2a70b12d859
pkgname = shadow-beta
diff --git a/INSTALL b/INSTALL
index 907d63ba4f27..e8576f4d9817 100644
--- a/INSTALL
+++ b/INSTALL
@@ -6,39 +6,42 @@ post_install() {
done
# Create the link to the binary
- ln -sf '/opt/Shadow Beta/shadow-wrapper.pl' '/usr/bin/shadow-beta'
+ ln -sf '/opt/shadowbeta/shadow-wrapper.pl' '/usr/bin/shadow-beta'
## Fix fonts
- # Truetype directory exists (not a symlink !)
- if [ -d /usr/share/fonts/truetype ]; then
-
- # Create TTF folder if not exists
- if [ ! -d /usr/share/fonts/TTF ]; then
- mkdir /usr/share/fonts/TTF
- fi
-
- # Move everything in the TTF folder
- mv /usr/share/fonts/truetype/* /usr/share/fonts/TTF/
- rm -R /usr/share/fonts/truetype
- fi
-
- # Create a symlink to TTF folder
- if [ ! -e /usr/share/fonts/truetype ]; then
- ln -sf "/usr/share/fonts/TTF" "/usr/share/fonts/truetype"
- fi
+ # # Truetype directory exists (not a symlink !)
+ # if [ -d /usr/share/fonts/truetype ]; then
+ #
+ # # Create TTF folder if not exists
+ # if [ ! -d /usr/share/fonts/TTF ]; then
+ # mkdir /usr/share/fonts/TTF
+ # fi
+ #
+ # # Move everything in the TTF folder
+ # mv /usr/share/fonts/truetype/* /usr/share/fonts/TTF/
+ # rm -R /usr/share/fonts/truetype
+ # fi
+ #
+ # # Create a symlink to TTF folder
+ # if [ ! -e /usr/share/fonts/truetype ]; then
+ # ln -sf "/usr/share/fonts/TTF" "/usr/share/fonts/truetype"
+ # fi
}
post_remove() {
# Remove configuration
for user in `ls /home`
do
- if [ -d /home/$user/.cache/blade ]; then
- rm -R /home/$user/.cache/blade
- fi
-
if [ -d /home/$user/.config/Shadow\ Beta ]; then
rm -R /home/$user/.config/Shadow\ Beta
fi
done
}
+pre_upgrade(){
+ rm -r "/opt/Shadow Beta"
+}
+
+post_upgrade(){
+ ln -sf '/opt/shadowbeta/shadow-wrapper.pl' '/usr/bin/shadow-beta'
+}
diff --git a/Makefile b/Makefile
index 64f01af47f0e..4b90b2b62884 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,5 @@
-version = 5259f370b41996cf2bfbf5dea47d0681466c01d9
+#version = 5259f370b41996cf2bfbf5dea47d0681466c01d9
+version = d2e044ad3a4f5d7570538438c1a8a60d4200ecb8
help:
@grep -E '(^[a-zA-Z_-]+:.*?##.*$$)|(^##)' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-10s\033[0m %s\n", $$1, $$2}' | sed -e 's/\[32m##/[33m/'
@@ -11,6 +12,7 @@ clear: ## Clear files
rm -rf ./src
rm -f ./shadowbeta.deb
rm -f ./shadow-beta-*.pkg.tar
+ rm -f shadow-alpha-bionic.zip
rm -f ./*~
install:build ## Install package with pacman
@@ -20,7 +22,7 @@ pkgsum: ## update pkgsum with updpkgsums
updpkgsums
recup: ## Get git files
- wget -O INSTALL https://raw.githubusercontent.com/NicolasGuilloux/blade-shadow-beta/${version}/Arch/AUR/INSTALL
+# wget -O INSTALL https://raw.githubusercontent.com/NicolasGuilloux/blade-shadow-beta/${version}/Arch/AUR/INSTALL
wget -O wrapper.pl https://raw.githubusercontent.com/NicolasGuilloux/blade-shadow-beta/${version}/AppImage/wrapper.pl
wget -O report.pl https://raw.githubusercontent.com/NicolasGuilloux/blade-shadow-beta/${version}/AppImage/report.pl
diff --git a/PKGBUILD b/PKGBUILD
index 8bcddaab87d5..df29b7821346 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,35 +1,41 @@
# Maintainer: agentcobra <agentcobra@free.fr>
# Contributor: Nover <novares.x@gmail.com>
+# Creator Blade <contact@blade-group.com>
+
# Made with https://github.com/NicolasGuilloux/blade-shadow-beta
pkgname=shadow-beta
-pkgver=0.7.6
-pkgrel=8
+pkgver=0.8.62
+pkgrel=1
pkgdesc="Shadow launcher"
arch=('x86_64')
url="http://shadow.tech"
license=('unknown')
-depends=('desktop-file-utils' 'freetype2' 'gcc5' 'gconf' 'hicolor-icon-theme' 'json-c' 'libappindicator-gtk2' 'libbsd' 'libcurl-gnutls' 'libdrm' 'libnotify' 'libva' 'libxtst' 'nss' 'opus' 'qt5-base' 'qt5-svg' 'sdl2' 'libappindicator' 'libcurl-compat' 'sdl' 'gcc7-libs' 'ttf-dejavu')
+depends=('desktop-file-utils' 'freetype2' 'libuv' 'gconf' 'hicolor-icon-theme' 'json-c' 'libappindicator-gtk2' 'libbsd' 'libcurl-gnutls' 'libdrm' 'libnotify' 'libva' 'libxtst' 'nss' 'opus' 'qt5-base' 'qt5-svg' 'sdl2' 'libappindicator' 'libcurl-compat' 'sdl' 'gcc7-libs' 'ttf-dejavu' 'libxss')
provides=(shadow-beta)
-source=('https://macosx.update.blade-group.fr/mpl/linux/beta/bionic/shadowbeta.deb')
-md5sums=('6fc188e0e818c9d3af6dbb2d51a88f91')
+source=('https://macosx.update.blade-group.fr/mpl/linux/beta/bionic/shadow-alpha-bionic.zip')
+md5sums=('bc290cee83021c95f2ecc2a70b12d859')
install=INSTALL
# Get the version as a datetime
pkgver() {
# Get the version of the latest Linux version
- url="https://macosx.update.blade-group.fr/mpl/linux/beta/bionic/latest-linux.yml"
- content=$(curl -s -L $url)
+# url="https://macosx.update.blade-group.fr/mpl/linux/beta/bionic/latest-linux.yml"
+# content=$(curl -s -L $url)
# Set the pkgver
- echo "$content" | grep "version" | sed -e 's,version: ,,g'
+# echo "$content" | grep "version" | sed -e 's,version: ,,g'
+echo "0.8.62"
}
# Build the package
package() {
### Extract the deb
+ ar xv shadowalpha-bionic-*.deb
+
+ ### Extract the data
bsdtar xf data.tar.xz
chmod -R g-w usr
@@ -44,33 +50,18 @@ package() {
### Move the Wrapper
chmod g-w wrapper.pl
chmod +x wrapper.pl
- mv wrapper.pl "${pkgdir}/opt/Shadow Beta/shadow-wrapper.pl"
+ mv wrapper.pl "${pkgdir}/opt/shadowbeta/shadow-wrapper.pl"
### Move the Report.pl
chmod g-w report.pl
chmod +x report.pl
- mv report.pl "${pkgdir}/opt/Shadow Beta/report.pl"
+ mv report.pl "${pkgdir}/opt/shadowbeta/report.pl"
### Edit launcher
- sed -e 's/^Exec=.*$/Exec="\/opt\/Shadow Beta\/shadow-wrapper.pl"/g' -e 's/^Categories=.*$/Categories=Games;Utility;Virtualization/g' "${pkgdir}/usr/share/applications/shadow-beta.desktop" > shadow-beta.desktop
+ sed -e 's/^Exec=.*$/Exec="\/opt\/shadowbeta\/shadow-wrapper.pl"/g' -e 's/^Categories=.*$/Categories=Games;Utility;Virtualization/g' "${pkgdir}/usr/share/applications/shadow-beta.desktop" > shadow-beta.desktop
chmod g-w shadow-beta.desktop
rm "${pkgdir}/usr/share/applications/shadow-beta.desktop"
mv shadow-beta.desktop "${pkgdir}/usr/share/applications/shadow-beta.desktop"
-
- ### Fix stuff
-
- # Create lib directory
- mkdir -p "${pkgdir}/usr/lib"
-
- # Correct Libjson-c
- if [ ! -f /usr/lib/libjson-c.so.3 ]; then
- ln -f -s -r "libjson-c.so" "${pkgdir}/usr/lib/libjson-c.so.3"
- fi
-
- # Correct Libubsan
- if [ ! -f /usr/lib/libubsan.so.0 ]; then
- ln -f -s -r "gcc/x86_64-pc-linux-gnu/7.3.1/libubsan.so.0" "${pkgdir}/usr/lib/libubsan.so.0"
- fi
}
diff --git a/report.pl b/report.pl
deleted file mode 100644
index cb7db3318357..000000000000
--- a/report.pl
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/usr/bin/perl
-
-# Autheur: Nicolas Guilloux
-# Website: https://nicolasguilloux.eu/
-# Email: novares.x@gmail.com
-
-use strict;
-use warnings;
-
-
-# Send to Hostbin
-#
-# @parem String Content
-#
-# @return String URL
-sub share {
- open(my $fh, '>', '/var/tmp/report_shadow');
- print $fh $_[0];
- close $fh;
-
- my $url = `curl -sf --data-binary "@/var/tmp/report_shadow" https://nicolasguilloux.eu/hostbin`;
-
- system('rm /var/tmp/report_shadow');
-
- return $url;
-}
-
-# ------- Check AppImage ------- #
-my $path = '/opt/Shadow Beta';
-my $isAppImg = 0;
-
-if( $#ARGV > -1 ) {
- if( $ARGV[0] eq '--appimage' ) {
- $path = './opt/Shadow Beta';
- $isAppImg = 1;
- }
-}
-
-
-my $return = "Shadow Report";
-
-if( $isAppImg ) { $return .= " (AppImage)"; }
-
-$return .= "\n";
-
-# -------- AppImage version -------- #
-if( -f 'shadow-appimage-version' ) {
-
- # Local version
- open(my $fh, '<:encoding(UTF-8)', 'shadow-appimage-version')
- or die "Could not open file 'shadow-appimage-version' $!";
- my $localVersion = <$fh>;
- chomp $localVersion;
-
- $return .= "AppImage $localVersion \n";
-}
-
-# -------- Distribution information -------- #
-$return .= "\n-------------------------------------\n\n";
-$return .= `cat /etc/*-release`;
-$return .= `uname -mrs`;
-$return .= "\n-------------------------------------\n\n";
-
-# -------- Environment -------- #
-$return .= 'Environment server: ' . `echo \$XDG_SESSION_TYPE`;
-if( index(`groups \$USER`, 'input') == -1 ) {
- $return .= '/!\ The user is not in the "input" group.';
-} else {
- $return .= 'The user is in the "input" group.';
-}
-
-# -------- Missing libraries -------- #
-$return .= "\n\n-------------------------------------\n";
-$return .= " Missing libraries\n";
-$return .= "-------------------------------------\n";
-
-$return .= `ldd -v "$path/shadow-beta" | grep "not found"`;
-$return .= `ldd -v "$path/resources/app.asar.unpacked/native/linux/ClientSDL" | grep "not found"`;
-
-# -------- VA-API check -------- #
-$return .= "\n-------------------------------------\n";
-$return .= " Vainfo\n";
-$return .= "-------------------------------------\n";
-
-if( -f '/usr/bin/vainfo' ) {
- $return .= `vainfo`;
-
-} else {
- $return .= "'vainfo' is not installed.";
-}
-
-# -------- Logs -------- #
-$return .= "\n-------------------------------------\n";
-$return .= " Logs\n";
-$return .= "-------------------------------------\n";
-
-if( -f $ENV{"HOME"} . '/.cache/blade/shadow/shadow.log' ){
- my @logs = split(/template_digit/, `cat ~/.cache/blade/shadow/shadow.log`);
- $return .= 'template_digit' . $logs[-1];
-
-} else {
- $return .= 'Logs not found.';
-}
-
-# -------- Send to Hostbin -------- #
-print share($return) . "\n";
diff --git a/wrapper.pl b/wrapper.pl
deleted file mode 100644
index a62a5726d068..000000000000
--- a/wrapper.pl
+++ /dev/null
@@ -1,433 +0,0 @@
-#!/usr/bin/perl
-
-# Autheur: Nicolas Guilloux
-# Website: https://nicolasguilloux.eu/
-# Email: novares.x@gmail.com
-
-# Thanks Kabouik for his help for the english translations
-# Thanks Brother/Ilya#0013 and TheWolf#0985 for their help for the german translations
-
-use strict;
-use warnings;
-
-use File::Basename;
-use POSIX qw(locale_h);
-use locale;
-
-use version;
-
-use Cwd 'abs_path';
-use File::Basename;
-
-# ------ Exit if the user is root ------- #
-if( $> == 0 ) {
- print "Please do not launch this application with the super administrator account.\n\n";
- exit 1;
-}
-
-# ----------- Translations ------------ #
-
-my %fr = (
- 'bypass' => "Vérification de compatibilité désactivée.",
-
- 'fake-error' => "Ceci est une fonction de debug affichant une fausse erreur pour tester les notifications. Blip.",
- 'fake-warning' => "Ceci est une fonction de debug affichant un faux avertissement pour tester les notifications. Blip.",
-
- 'lang-en' => "Langage forcé en anglais (en_US)",
- 'lang-de' => "Langage forcé en allemand (de_DE)",
- 'lang-fr' => "Langage forcé en français (fr_FR)",
-
- 'vainfo-nvidia' => "Votre carte graphique est de marque Nvidia. Ces cartes ne sont pas supportées par Shadow sur Linux. Il faut attendre une nouvelle version de l'application.",
- 'vainfo-optimus' => "Votre GPU est NVIDIA. L'application ne peut pas fonctionner sur ce GPU. Néanmoins, vous disposez de la technologie Optimus. Lancez le panneau de controle NVIDIA, allez dans la rubrique Prime profiles, choisissez le GPU Intel et relancez votre session.",
- 'vainfo-missing' => "La commande 'vainfo' n'a pas été trouvée, le support H.264 et H.265 par votre carte graphique ne peut pas être vérifié. Installez 'vainfo' (Ubuntu, Linux Mint, Debian) ou 'libva-utils' (Arch, Solus) puis relancez l'application.",
- 'vainfo-bad' => "Votre carte graphique ne supporte aucun encodage utilisé par Shadow. Vous devez changer votre carte graphique pour une compatible, ou vérifier vos drivers VA-API.",
- 'vainfo-good' => "Votre carte graphique ne supporte que le H.264. Vous ne pourrez pas utiliser le H.265 (HEVC).",
- 'vainfo-fail' => "Votre carte graphique n'est pas reconnue par la librarie VA-API. Veuillez vérifiez vos drivers VA-API avec la commande 'vainfo'.",
-
- 'input-adding' => "Ajout de l'utilisateur actuel au groupe input.",
- 'input-added' => "Le programme a tenté d'ajouter l'utilisateur courant au groupe \"input\". Si vous avez entré le mot de passe administrateur, veuillez redémarrer votre ordinateur ou votre session pour appliquer le changement.",
-
- 'xorg-fail' => "Votre environnement de bureau n'utilise pas Xorg mais est identifié comme",
- 'xorg-fail2' => "Veuillez changer l'environnement pour utiliser Xorg ou l'application ne pourra pas fonctionner.",
- 'xorg-empty' => "Impossible de vérifier si vous êtes bien sur Xorg.",
-
- 'errors' => "Les erreurs suivantes empêchent\nl'application Shadow de fonctionner",
-
- 'hotkeys' => bold("Raccourcis") . "
- • lshift-rctrl-esc: Quitter
- • lshift-rctrl-space: Activer/désactiver le mode plein écran
- • lshift-rctrl-g: Activer/désactiver la capture du clavier et de la souris
- • lshift-rctrl-h: Activer/désactiver le Shadow Mode"
-);
-
-my %en = (
- 'bypass' => "Bypassing the compatibility check.",
-
- 'fake-error' => "This is a debug feature showing a fake error to test notifications. Blip.",
- 'fake-warning' => "This is a debug feature showing a fake warning to test notifications. Blip.",
-
- 'lang-en' => "Language forced in english (en_US)",
- 'lang-de' => "Language forced in german (de_DE)",
- 'lang-fr' => "Language forced in french (fr_FR)",
-
- 'vainfo-nvidia' => "Your GPU brand is Nvidia. This brand is not supported by Shadow on Linux. You have to wait for a new release from Blade.",
- 'vainfo-optimus' => "Your currently using the NVIDIA GPU. You can't start the application with it, but your computer supports Prime. Start the NVIDIA control panel, select the Prime panel, choose the Intel GPU and restart your session.",
- 'vainfo-missing' => "'vainfo' not found, H.264 and H.265 support by your GPU could not be checked. Install 'vainfo' (Ubuntu, Linux Mint, Debian) or 'libva-utils' (Arch, Solus) and restart the application.",
- 'vainfo-bad' => "Your GPU does not support any encoding technology used by Shadow. You have to change you GPU or check your VA-API drivers to use this application.",
- 'vainfo-good' => "Your GPU supports only H.264. You will not be able to use H.265 (HEVC).",
- 'vainfo-fail' => "Your GPU is not recognized. Please check your hardware decoding drivers with the 'vainfo' command.",
-
-
- 'input-adding' => "Adding the current user to the input group.",
- 'input-added' => "The program tried to add the current user to the \"input\" group. If you entered the administrator password, please reboot or restart your session to apply the change.",
-
- 'xorg-fail' => "Your environnement is not Xorg but is identified as",
- 'xorg-fail2' => "Please switch to Xorg or you will not be able to start this application.",
- 'xorg-empty' => "Impossible to check if you are on Xorg or not.",
-
- 'errors' => "The following errors prevented the\nShadow application from running",
-
- 'hotkeys' => bold("Hotkeys") . "
- • lshift-rctrl-esc: Exit
- • lshift-rctrl-space: Toggle fullscreen or windowed
- • lshift-rctrl-g: Toggle input grab
- • lshift-rctrl-h: Toggle Shadow Mode"
-);
-
-my %de = (
- 'bypass' => "Umgehung der Kompatibilitätsprüfung.",
-
- 'fake-error' => "Dies ist eine Debug-Funktion, die einen gefälschten Fehler anzeigt, um Benachrichtigungen zu testen.",
- 'fake-warning' => "Dies ist eine Debug-Funktion, die eine gefälschte Warnung anzeigt, um Benachrichtigungen zu testen.",
-
- 'lang-en' => "Sprache erzwungen in english (en_US)",
- 'lang-de' => "Sprache erzwungen in german (de_DE)",
- 'lang-fr' => "Sprache erzwungen in french (fr_FR)",
-
- 'vainfo-nvidia' => "Ihre GPU-Marke ist Nvidia. Diese Marke wird von Shadow unter Linux nicht unterstützt. Sie müssen auf eine neue Version von Blade warten.",
- 'vainfo-optimus' => "Sie verwenden derzeit den NVIDIA Grafikprozessor. Sie können die Anwendung damit nicht starten, aber Ihr Computer unterstützt Prime. Starten Sie das NVIDIA Control Panel, wählen Sie das Prime Panel, wählen Sie den Intel Grafikprozessor und starten Sie Ihre Sitzung neu.",
- 'vainfo-missing' => "'vainfo' nicht gefunden werden, konnte die H.264- und H.265-Unterstützung durch Ihren Grafikprozessor nicht überprüft werden. Installieren Sie 'vainfo' (Ubuntu, Linux Mint, Debian) oder 'libva-utils' (Arch, Solus) und starten Sie die Anwendung neu.",
- 'vainfo-bad' => "Ihr Grafikprozessor unterstützt keine von Shadow verwendete Kodierungstechnologie. Sie müssen Ihren Grafikprozessor wechseln oder Ihre VA-API-Treiber überprüfen, um diese Anwendung nutzen zu können.",
- 'vainfo-good' => "Ihr Grafikprozessor unterstützt nur H.264. Sie können H.265 (HEVC) nicht verwenden.",
- 'vainfo-fail' => "Ihre GPU wird nicht erkannt. Bitte überprüfen Sie Ihren Hardware-Dekodierungstreiber mit dem Befehl 'vainfo'.",
-
- 'input-adding' => "Füge den aktuellen Benutzer zur Eingabengruppe hinzu.",
- 'input-added' => "Das Programm hat versucht, den aktuellen Benutzer zur Gruppe \"input\" hinzuzufügen. Wenn Sie das Administratorkennwort eingegeben haben, starten Sie Ihre Sitzung neu, um die Änderung zu übernehmen.",
-
- 'xorg-fail' => "Die Umgebung wurde nicht als Xorg identifiziert, sondern als",
- 'xorg-fail2' => "Bitte wechseln Sie auf Xorg, ansonsten kann die Anwendung nicht gestartet werden.",
- 'xorg-empty' => "Es konnte nicht geprüft werden ob Xorg verwendet wird oder nicht.",
-
- 'errors' => " Folgende Fehler haben einen \nStart von Shadow verhindert",
-
- 'hotkeys' => bold("Tastenbelegung") . "
- • lshift-rctrl-esc: Beenden
- • lshift-rctrl-space: Wechsel Vollbild / Fenster
- • lshift-rctrl-g: Eingaben fangen umschalten
- • lshift-rctrl-h: Shadowmodus umschalten"
-);
-
-my $locale = setlocale(LC_CTYPE);
-my %lang = %en;
-
-if( index($locale, 'fr') != -1 ) {
- %lang = %fr;
-
-} elsif( index($locale, 'de') != -1 ){
- %lang = %de;
-}
-
-
-# ----------- Functions ------------ #
-
-# Create a notification
-#
-# @param String Title
-# @param String Content
-# @param Bool (Optional) Question notification
-sub alert {
- if( -f "/usr/bin/notify-send" ) {
- my $command = "notify-send \"$_[0]\" \"$_[1]\" -u critical -i shadow-beta";
- exec($command);
- }
-}
-
-###
-# Display in bold
-#
-# @param Input string
-#
-# @return Bold formated string
-sub bold {
- return "\033[1m$_[0]\033[0m";
-}
-
-# ----------- Variables ------------ #
-
-# Messages variables
-my $help = "Wrapper for Shadow Beta that checks your configuration and compatibility errors.
-
-Usage: shadowbeta-linux-x86_64.AppImage [OPTIONS]
- --help Show this help
- --version Get the version of the AppImage
- --bypass-check Bypass the compatibility check and directly run the Shadow launcher
- --clientsdl Directly launch the ClientSDL renderer
-
- --force-en Force the launcher in english for people with translation issues (en_US)
- --force-de Force the launcher in german for people with translation issues (de_DE)
- --force-fr Force the launcher in french for people with translation issues (fr_FR)
-
- --error Show a fake error notification
- --warning Show a fake warning notification
- --strace Launch the application with 'strace -f' and save the result to /var/tmp/strace_shadowbeta
- --report Upload a report of the configuration";
-
-# Debug, errors and warnings
-my $debug = 0;
-my $strace = 0;
-my $langF = '';
-
-my $isAppImg = 0;
-my @errors = ();
-my @warnings = ();
-
-my $version = 'Standalone wrapper';
-
-# -------- Update -------- #
-if( -d 'opt' ) {
- # AppImage detection
- $isAppImg = 1;
- $version = 'Nightly build';
-
- if( -f 'shadow-appimage-version' ) {
-
- # Local version
- open(my $fh, '<:encoding(UTF-8)', 'shadow-appimage-version')
- or die "Could not open file 'shadow-appimage-version' $!";
- $version = <$fh>;
- chomp $version;
-
- $help = "AppImage $version. " . $help;
-
- if( substr($version, 0, 1) eq 'v' ) {
- # Distant version
- my $distantVersion = `curl https://gitlab.com/api/v4/projects/7962701/repository/tags | jq -r -c 'map(select(.release!=null))|.[0]|.["release"]|.["tag_name"]'`;
- chomp $distantVersion;
-
- # Update available
- if( version->parse($version) < version->parse($distantVersion) ) {
- print "\nNEW UPDATE AVAILABLE: $distantVersion\n";
- alert('New version of the AppImage', "\nA new version of the AppImage is available on the server ($distantVersion)\n");
- }
- }
-
- }
-}
-
-# -------- Arguments -------- #
-for(my $i=0; $i < $#ARGV+1; $i++) {
- my $arg = $ARGV[$i];
-
- # Display help and stop the program
- if( $arg eq '--help' ) {
- print "\n$help\n\n";
- exit;
- }
-
- # Get the version of the AppImage
- if( $arg eq '--version' ) {
- print "$version\n";
- exit;
- }
-
- # Bypass the check and launch
- if( $arg eq '--bypass-check' ) {
- push @warnings, $lang{'bypass'};
- goto START_SHADOW;
- }
-
- # Start directly ClientSDL and stops
- if( $arg eq '--clientsdl' ) {
- if( $isAppImg ) {
- system('./opt/Shadow\ Beta/resources/app.asar.unpacked/native/linux/ClientSDL');
- } else {
- system('/opt/Shadow\ Beta/resources/app.asar.unpacked/native/linux/ClientSDL');
- }
-
- exit 0;
- }
-
-
- # Force the launcher in english
- if( $arg eq '--force-en' ) {
- $langF = 'LANG=en_US.utf8 ';
- push @warnings, $lang{'lang-en'}
- }
-
- # Force the launcher in german
- if( $arg eq '--force-de' ) {
- $langF = 'LANG=de_DE.utf8 ';
- push @warnings, $lang{'lang-de'}
- }
-
- # Force the launcher in english
- if( $arg eq '--force-fr' ) {
- $langF = 'LANG=fr_FR.utf8 ';
- push @warnings, $lang{'lang-fr'}
- }
-
-
- # Start Shadow with Strace
- if( $arg eq '--strace' ) {
- $strace = 1;
- }
-
- # Create a false error
- if( $arg eq '--error' ) {
- push @errors, $lang{'fake-error'};
- }
-
- # Create a false warning
- if( $arg eq '--warning' ) {
- push @warnings, $lang{'fake-warning'};
- }
-
- # Upload a report of the configuration
- if( $arg eq '--report' ) {
- if( $isAppImg ) {
- system( './report.pl --appimage');
-
- } else {
- system( '"' . dirname(abs_path($0)) . '/report.pl"');
- }
-
- exit 0;
- }
-
-}
-
-
-# -------- NVIDIA check -------- #
-if( index(`lspci | grep 'VGA'`, 'NVIDIA') != -1 ) {
-
- # Intel iGPU detected
- if( index(`lspci | grep 'VGA'`, 'Intel') != -1 ) {
-
- # Currently on the NVIDIA GPU
- if( index(`nvidia-smi -L`, 'GPU ') != 1 ) {
- push @errors, $lang{'vainfo-optimus'};
- }
-
- # Only NVIDIA GPU available
- } else {
- push @errors, $lang{'vainfo-nvidia'};
- }
-}
-
-# -------- Vainfo -------- #
-if( -f '/usr/bin/vainfo' ) {
- my $vainfo = `vainfo`;
-
- if( $vainfo ne '' ) {
- # The GPU doesn't support H264.
- if( index($vainfo, 'H264') == -1 ) {
- push @errors, $lang{'vainfo-bad'};
- }
-
- if( index($vainfo, 'H265') == -1 and index($vainfo, 'HEVC') == 1 ) {
- push @warnings, $lang{'vainfo-good'};
- }
-
- } else {
- push @errors, $lang{'vainfo-fail'};
- }
-
-} else {
- push @warnings, $lang{'vainfo-missing'};
-}
-
-
-# -------- Input --------- #
-my $groups = `groups \$USER`;
-
-if( index($groups, 'input') == -1 ) {
-
- print "$lang{'input-adding'}\n";
- my $in = `pkexec gpasswd -a \$USER input`;
-
- push @errors, $lang{'input-added'};
-}
-
-
-# -------- Xorg check -------- #
-my $env = `echo \$XDG_SESSION_TYPE`;
-chomp $env;
-
-if( $env ne 'x11') {
- if( $env ne '' ) {
- push @errors, "$lang{'xorg-fail'} $env. $lang{'xorg-fail2'}";
-
- } else {
- push @warnings, $lang{'xorg-empty'}
- }
-
-}
-
-
-# -------- Kill ClientSDL ------ #
-while( `pkill -e ClientSDL` ne '' ) {}
-
-
-# -------- Start Shadow -------- #
-START_SHADOW:
-print "\n";
-
-# Warnings
-if( scalar @warnings > 0 ) {
- print bold('WARNING') . ":\n";
- foreach my $i (0 .. $#warnings) {
- print " • $warnings[$i]\n";
- }
- print "\n";
-}
-
-# Display errors
-if( scalar @errors > 0 ) {
-
- my $str = "";
- foreach my $i (0 .. $#errors) {
- $str .= " • $errors[$i]\n";
- }
-
- print bold('ERROR') . ":\n$str\n";
- alert($lang{'errors'}, "\n$str");
-
- exit 1;
-
-# Start Shadow
-} else {
- print "$lang{'hotkeys'}\n\n";
-
- my $pathExec = '/opt/Shadow\ Beta/shadow-beta';
-
- if( $isAppImg ) {
- $pathExec = './opt/Shadow\ Beta/shadow-beta.wrapper';
- }
-
- # Start Shadow with Strace
- if( $strace ) {
- system("$langF strace -f $pathExec &> /var/tmp/strace_shadowbeta");
-
- # Create the compressed archive in the user directory
- system('tar -zcvf ~/strace_shadowbeta.tar.gz /var/tmp/strace_shadowbeta');
-
- # Remove the uncompressed strace
- system('rm /var/tmp/strace_shadowbeta');
-
- # Start Shadow
- } else {
- system("$langF $pathExec");
- }
-
- exit 0;
-}