From 37aa2a3b9bc329327b3ff4befee00ca0e449bc16 Mon Sep 17 00:00:00 2001 From: Scoopta Date: Thu, 21 May 2020 15:06:54 -0700 Subject: [PATCH] Added support for the PrefersNonDefaultGPU desktop entry flag --- modes/drun.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modes/drun.c b/modes/drun.c index 82cb870..5bc2127 100644 --- a/modes/drun.c +++ b/modes/drun.c @@ -412,6 +412,10 @@ void wofi_drun_exec(const gchar* cmd) { printf("%s\n", g_app_info_get_commandline(G_APP_INFO(info))); exit(0); } else { + bool dri_prime = g_desktop_app_info_get_boolean(info, "PrefersNonDefaultGPU"); + if(dri_prime) { + setenv("DRI_PRIME", "1", true); + } g_app_info_launch_uris_async(G_APP_INFO(info), NULL, NULL, NULL, launch_done, (gchar*) cmd); } } else if(strrchr(cmd, ' ') != NULL) {