changed the working directory for the shortcuts

This commit is contained in:
Faugus 2024-03-24 12:37:04 -03:00
parent d78234c7a1
commit fe1e8770bb
3 changed files with 15 additions and 12 deletions

View file

@ -1,7 +1,7 @@
pkgbase = faugus-launcher
pkgdesc = Simple and Lightweight Proton Games Launcher
pkgver = 1.0
pkgrel = 9
pkgrel = 10
arch = x86_64
license = GPL
depends = python
@ -13,7 +13,7 @@ pkgbase = faugus-launcher
source = faugus-launcher.py
source = faugus-launcher.desktop
source = faugus-launcher.png
sha256sums = 5c4e9a5faeb3108683e1c2cc55600fc1f35dd92568d38d7acf74258fd5591cec
sha256sums = 34eb8ce9c7c72ad2e0715b97e7a791483b809f94a8c59af3baa2d1b9bf48c5d0
sha256sums = 7ee643017060562d27ad3f0960911bf7e5299df8d526863dd428f84a4765aa67
sha256sums = 36ca089b98e4169f17572dde833bd1039f8f5484a40ca307e6871de3814ea159

View file

@ -1,6 +1,6 @@
pkgname=faugus-launcher
pkgver=1.0
pkgrel=9
pkgrel=10
pkgdesc="Simple and Lightweight Proton Games Launcher"
arch=('x86_64')
license=('GPL')
@ -9,7 +9,7 @@ provides=('faugus-launcher')
conflicts=('faugus-launcher')
source=("faugus-launcher.py" "faugus-launcher.desktop" "faugus-launcher.png")
sha256sums=('5c4e9a5faeb3108683e1c2cc55600fc1f35dd92568d38d7acf74258fd5591cec'
sha256sums=('34eb8ce9c7c72ad2e0715b97e7a791483b809f94a8c59af3baa2d1b9bf48c5d0'
'7ee643017060562d27ad3f0960911bf7e5299df8d526863dd428f84a4765aa67'
'36ca089b98e4169f17572dde833bd1039f8f5484a40ca307e6871de3814ea159')

View file

@ -380,6 +380,9 @@ class Main(Gtk.Window):
if game.gamemode:
gamemode = "gamemoderun"
# Execute wrestool command to extract icon
os.system(f'wrestool -x -t14 "{path}" > ~/.config/faugus-launcher/icons/{title_formatted}.ico')
command = (f'{mangohud} '
f'WINEPREFIX={prefix} '
f'GAMEID={title_formatted} '
@ -390,12 +393,13 @@ class Main(Gtk.Window):
# Create a .desktop file
desktop_file_content = f"""[Desktop Entry]
Name={game.title}
Exec=sh -c '{command}'
Icon={os.path.expanduser("~/.config/faugus-launcher/icons/")}{title_formatted}.ico
Type=Application
Categories=Game;
"""
Name={game.title}
Exec=sh -c '{command}'
Icon={os.path.expanduser("~/.config/faugus-launcher/icons/")}{title_formatted}.ico
Type=Application
Categories=Game;
Path={os.path.expanduser("~/.config/faugus-launcher/")}
"""
# Check if the destination directory exists and create if it doesn't
desktop_directory = os.path.expanduser("~/.local/share/applications/")
@ -419,8 +423,7 @@ class Main(Gtk.Window):
if not os.path.exists(icon_directory):
os.makedirs(icon_directory)
# Execute wrestool command to extract icon
os.system(f'wrestool -x -t14 "{path}" > ~/.config/faugus-launcher/icons/{title_formatted}.ico')
def remove_shortcut(self, game):
# Remove existing shortcut if it exists