From c1214ad9196766cf8e9db0acdec810ebf0f8cb52 Mon Sep 17 00:00:00 2001 From: EmixamPP Date: Thu, 30 Jun 2022 16:55:29 +0200 Subject: [PATCH] undo device path change --- howdy-gtk/src/onboarding.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/howdy-gtk/src/onboarding.py b/howdy-gtk/src/onboarding.py index 792ad81..0dde535 100644 --- a/howdy-gtk/src/onboarding.py +++ b/howdy-gtk/src/onboarding.py @@ -1,6 +1,5 @@ import sys import os -import glob import re import time import subprocess @@ -128,18 +127,19 @@ class OnboardingWindow(gtk.Window): except Exception: self.show_error(_("Error while importing OpenCV2"), _("Try reinstalling cv2")) - device_ids = glob.glob("/dev/video*") + device_ids = os.listdir("/dev/v4l/by-path") device_rows = [] if not device_ids: self.show_error(_("No webcams found on system"), _("Please configure your camera yourself if you are sure a compatible camera is connected")) # Loop though all devices - for device_path in device_ids: + for dev in device_ids: time.sleep(.5) # The full path to the device is the default name - device_name = device_path[:] + device_path = "/dev/v4l/by-path/" + dev + device_name = dev # Get the udevadm details to try to get a better name udevadm = subprocess.check_output(["udevadm info -r --query=all -n " + device_path], shell=True).decode("utf-8")