mirror of
https://github.com/PancakeTAS/lsfg-vk.git
synced 2025-10-30 07:01:10 +00:00
feat(exe): fix comments, remove regex dependency
This commit is contained in:
parent
65541aa960
commit
a70dfc9d0c
3 changed files with 3 additions and 5 deletions
1
ui/Cargo.lock
generated
1
ui/Cargo.lock
generated
|
|
@ -690,7 +690,6 @@ dependencies = [
|
||||||
"libadwaita",
|
"libadwaita",
|
||||||
"proc-maps",
|
"proc-maps",
|
||||||
"procfs",
|
"procfs",
|
||||||
"regex",
|
|
||||||
"serde",
|
"serde",
|
||||||
"toml 0.9.2",
|
"toml 0.9.2",
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ toml = "0.9.2"
|
||||||
anyhow = "1.0"
|
anyhow = "1.0"
|
||||||
procfs = "0.17.0"
|
procfs = "0.17.0"
|
||||||
proc-maps = "0.4.0"
|
proc-maps = "0.4.0"
|
||||||
regex = "1.11.1"
|
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
glib-build-tools = "0.21.0"
|
glib-build-tools = "0.21.0"
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ pub fn find_vulkan_processes() -> ProcResult<Vec<(String, String)>> {
|
||||||
|
|
||||||
let pid = process.pid();
|
let pid = process.pid();
|
||||||
|
|
||||||
// By default, assume Linux process, and use comm
|
// By default, assume Linux process, and use /proc/self/comm
|
||||||
let mut name = process.stat()?.comm;
|
let mut name = process.stat()?.comm;
|
||||||
|
|
||||||
// Solely just for checking if it's a Proton or Wine process
|
// Solely just for checking if it's a Proton or Wine process
|
||||||
|
|
@ -35,13 +35,13 @@ pub fn find_vulkan_processes() -> ProcResult<Vec<(String, String)>> {
|
||||||
|
|
||||||
|
|
||||||
// If this is a Proton or Wine process with .exe,
|
// If this is a Proton or Wine process with .exe,
|
||||||
// then extract just the .exe name with RegEx
|
// then just get filename from /proc/self/maps
|
||||||
if cmdline.contains(".exe") {
|
if cmdline.contains(".exe") {
|
||||||
for map in &maps {
|
for map in &maps {
|
||||||
if let Some(path) = map.filename() {
|
if let Some(path) = map.filename() {
|
||||||
let path_str = path.to_string_lossy().to_lowercase();
|
let path_str = path.to_string_lossy().to_lowercase();
|
||||||
if path_str.contains(".exe") &&
|
if path_str.contains(".exe") &&
|
||||||
!path_str.contains("wine") &&
|
!path_str.contains("wine") && // Make sure .exe is not from Wine
|
||||||
path_str.contains('/') ||
|
path_str.contains('/') ||
|
||||||
path_str.contains('\\') {
|
path_str.contains('\\') {
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue