diff --git a/faugus-launcher.py b/faugus-launcher.py index 782a735..30e968b 100644 --- a/faugus-launcher.py +++ b/faugus-launcher.py @@ -24,6 +24,7 @@ icons_dir = f'{faugus_launcher_dir}/icons' config_file_dir = f'{faugus_launcher_dir}/config.ini' share_dir = os.getenv('XDG_DATA_HOME', os.path.expanduser('~/.local/share')) app_dir = f'{share_dir}/applications' +faugus_png = "/usr/share/icons/faugus-launcher.png" def get_desktop_dir(): try: @@ -48,6 +49,7 @@ class Main(Gtk.Window): Gtk.Window.__init__(self, title="Faugus Launcher") self.set_default_size(400, 620) self.set_resizable(False) + self.set_icon_from_file(faugus_png) self.game_running = None @@ -240,7 +242,7 @@ class Main(Gtk.Window): if os.path.isfile(game_icon): pass else: - game_icon = "/usr/share/icons/faugus-launcher.png" + game_icon = faugus_png pixbuf = GdkPixbuf.Pixbuf.new_from_file(game_icon) scaled_pixbuf = pixbuf.scale_simple(40, 40, GdkPixbuf.InterpType.BILINEAR) @@ -325,6 +327,7 @@ class Main(Gtk.Window): buttons=Gtk.ButtonsType.OK, parent=self) dialog.set_resizable(False) dialog.set_modal(True) + dialog.set_icon_from_file(faugus_png) dialog.run() dialog.destroy() @@ -359,6 +362,7 @@ class Main(Gtk.Window): buttons=Gtk.ButtonsType.OK, parent=self) dialog.set_resizable(False) dialog.set_modal(True) + dialog.set_icon_from_file(faugus_png) dialog.run() dialog.destroy() else: @@ -619,7 +623,7 @@ class Main(Gtk.Window): if os.path.exists(icon_path): shutil.copy(icon_path, icon_temp) if not os.path.exists(icon_path): - icon_temp = "/usr/share/icons/faugus-launcher.png" + icon_temp = faugus_png pixbuf = GdkPixbuf.Pixbuf.new_from_file(icon_temp) scaled_pixbuf = pixbuf.scale_simple(50, 50, GdkPixbuf.InterpType.BILINEAR) @@ -830,7 +834,7 @@ class Main(Gtk.Window): icons_path = icons_dir new_icon_path = f"{icons_dir}/{title_formatted}.ico" if not os.path.exists(new_icon_path): - new_icon_path = "/usr/share/icons/faugus-launcher.png" + new_icon_path = faugus_png # Get the directory containing the executable game_directory = os.path.dirname(path) @@ -1007,6 +1011,7 @@ class Main(Gtk.Window): # Show a warning message dialog dialog = Gtk.MessageDialog(transient_for=self, flags=0, message_type=Gtk.MessageType.WARNING, buttons=Gtk.ButtonsType.OK, text=message, ) + dialog.set_icon_from_file(faugus_png) dialog.run() dialog.destroy() @@ -1050,6 +1055,7 @@ class Settings(Gtk.Dialog): self.set_resizable(False) self.set_modal(True) self.parent = parent + self.set_icon_from_file(faugus_png) css_provider = Gtk.CssProvider() css = """ @@ -1624,6 +1630,7 @@ class ConfirmationDialog(Gtk.Dialog): def __init__(self, parent, title): # Initialize the ConfirmationDialog Gtk.Dialog.__init__(self, title=f"Delete {title}", parent=parent, modal=True) + self.set_icon_from_file(faugus_png) # Configure dialog properties self.set_resizable(False) @@ -1680,6 +1687,7 @@ class AddGame(Gtk.Dialog): self.set_resizable(False) self.set_modal(True) self.parent_window = parent + self.set_icon_from_file(faugus_png) self.icon_directory = f"{icons_dir}/icon_temp/" @@ -2144,7 +2152,7 @@ class AddGame(Gtk.Dialog): def set_image_shortcut_icon(self): - image_path = "/usr/share/icons/faugus-launcher.png" + image_path = faugus_png shutil.copy(image_path, self.icon_temp) pixbuf = GdkPixbuf.Pixbuf.new_from_file(self.icon_temp) @@ -2545,6 +2553,7 @@ class CreateShortcut(Gtk.Window): super().__init__(title="Faugus Launcher") self.file_path = file_path self.set_resizable(False) + self.set_icon_from_file(faugus_png) game_title = os.path.basename(file_path) self.set_title(game_title) @@ -2883,7 +2892,7 @@ class CreateShortcut(Gtk.Window): icons_path = icons_dir new_icon_path = f"{icons_dir}/{title_formatted}.ico" if not os.path.exists(new_icon_path): - new_icon_path = "/usr/share/icons/faugus-launcher.png" + new_icon_path = faugus_png protonfix = self.entry_protonfix.get_text() launch_arguments = self.entry_launch_arguments.get_text() @@ -2968,7 +2977,7 @@ class CreateShortcut(Gtk.Window): entry.get_style_context().remove_class("entry") def set_image_shortcut_icon(self): - image_path = "/usr/share/icons/faugus-launcher.png" + image_path = faugus_png pixbuf = GdkPixbuf.Pixbuf.new_from_file(image_path) scaled_pixbuf = pixbuf.scale_simple(50, 50, GdkPixbuf.InterpType.BILINEAR) diff --git a/faugus-proton-manager.py b/faugus-proton-manager.py index 0ce83ec..148dc32 100644 --- a/faugus-proton-manager.py +++ b/faugus-proton-manager.py @@ -12,11 +12,14 @@ from gi.repository import Gtk GITHUB_API_URL = "https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases" STEAM_COMPATIBILITY_PATH = os.path.expanduser("~/.local/share/Steam/compatibilitytools.d") +faugus_png = "/usr/share/icons/faugus-launcher.png" + class ProtonDownloader(Gtk.Window): def __init__(self): super().__init__(title="Faugus GE-Proton Manager") self.set_resizable(False) self.set_modal(True) + self.set_icon_from_file(faugus_png) self.set_border_width(10) self.set_default_size(400, 395) diff --git a/faugus-run.py b/faugus-run.py index 1b6d2ab..0484605 100644 --- a/faugus-run.py +++ b/faugus-run.py @@ -17,7 +17,7 @@ faugus_launcher_dir = f'{config_dir}/faugus-launcher' prefixes_dir = f'{faugus_launcher_dir}/prefixes' config_file_dir = f'{faugus_launcher_dir}/config.ini' share_dir = os.getenv('XDG_DATA_HOME', os.path.expanduser('~/.local/share')) - +faugus_png = "/usr/share/icons/faugus-launcher.png" def remove_ansi_escape(text): ansi_escape = re.compile(r'\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])') @@ -42,6 +42,7 @@ class FaugusRun: buttons=Gtk.ButtonsType.CLOSE, text=f"{protonpath} was not found", ) + dialog.set_icon_from_file(faugus_png) dialog.format_secondary_text("Please install it or use another Proton version.") dialog.run() dialog.destroy() @@ -153,6 +154,7 @@ class FaugusRun: self.warning_dialog.set_decorated(False) self.warning_dialog.set_resizable(False) self.warning_dialog.set_default_size(280, -1) + self.warning_dialog.set_icon_from_file(faugus_png) frame = Gtk.Frame() frame.set_label_align(0.5, 0.5) @@ -163,7 +165,7 @@ class FaugusRun: grid.set_valign(Gtk.Align.CENTER) frame.add(grid) - image_path = "/usr/share/icons/faugus-launcher.png" + image_path = faugus_png pixbuf = GdkPixbuf.Pixbuf.new_from_file(image_path) pixbuf = pixbuf.scale_simple(75, 75, GdkPixbuf.InterpType.BILINEAR) @@ -203,6 +205,7 @@ class FaugusRun: def show_log_window(self): self.log_window = Gtk.Window(title="Winetricks Logs") self.log_window.set_default_size(600, 400) + self.log_window.set_icon_from_file(faugus_png) scrolled_window = Gtk.ScrolledWindow() scrolled_window.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) @@ -290,6 +293,7 @@ class FaugusRun: if last_part.endswith(".reg"): dialog = Gtk.Dialog(title="Faugus Launcher", modal=True) dialog.set_resizable(False) + dialog.set_icon_from_file(faugus_png) self.grid = Gtk.Grid() self.grid.set_row_spacing(20)