Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions i18n/cs/chwd.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ pass-profile-no-match-install = uvedený profil se neshoduje s nainstalovaným p
available = DOSTUPNÉ
installed = NAINSTALOVÁNO
device = Zařízení
no-profile-device = nebyly nalezeny žádné profily pro zařízení PCI!
no-profile-device = nebyly nalezeny žádné profily pro zařízení!

# Výstup v konzoly
invalid-profile = profil '{$invalid_profile}' je neplatný!
all-pci-profiles = Všechny PCI profily:
installed-pci-profiles = Instalované PCI profily:
all-usb-profiles = Všechny USB profily:
installed-profiles = Instalované profily:
pci-profiles-not-found = Žádné PCI profily nebyly nalezeny!
no-installed-pci-profiles = Žádné PCI profili nejsou nainstalovány!
no-installed-profile-device = žádný nainstalovaný profil pro zařízení PCI nebyl nalezen !
usb-profiles-not-found = Žádné USB profily nebyly nalezeny!
no-installed-profiles = Žádné profily nejsou nainstalovány!
no-installed-profile-device = žádný nainstalovaný profil pro zařízení nebyl nalezen!
10 changes: 6 additions & 4 deletions i18n/de/chwd.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ pass-profile-no-match-install = Das eingegebene Profil stimmt nicht mit dem inst
available = VERFÜGBAR
installed = INSTALLIERT
device = Gerät
no-profile-device = Keine Profile für PCI-Geräte gefunden!
no-profile-device = Keine Profile für Geräte gefunden!

# console writer
invalid-profile = Das Profil '{$invalid_profile}' ist ungültig!
all-pci-profiles = Alle PCI-Profile:
installed-pci-profiles = Installierte PCI-Profile:
all-usb-profiles = Alle USB-Profile:
installed-profiles = Installierte Profile:
pci-profiles-not-found = Keine PCI-Profile gefunden!
no-installed-pci-profiles = Keine installierten PCI-Profile!
no-installed-profile-device = Keine installierten Profile für PCI-Geräte gefunden!
usb-profiles-not-found = Keine USB-Profile gefunden!
no-installed-profiles = Keine installierten Profile!
no-installed-profile-device = Keine installierten Profile für Geräte gefunden!
10 changes: 6 additions & 4 deletions i18n/en/chwd.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ pass-profile-no-match-install = passed profile does not match with installed pro
available = AVAILABLE
installed = INSTALLED
device = Device
no-profile-device = no profiles for PCI devices found!
no-profile-device = no profiles for devices found!

# console writer
invalid-profile = profile '{$invalid_profile}' is invalid!
all-pci-profiles = All PCI profiles:
installed-pci-profiles = Installed PCI profiles:
all-usb-profiles = All USB profiles:
installed-profiles = Installed profiles:
pci-profiles-not-found = No PCI profiles found!
no-installed-pci-profiles = No installed PCI profiles!
no-installed-profile-device = no installed profile for PCI devices found!
usb-profiles-not-found = No USB profiles found!
no-installed-profiles = No installed profiles!
no-installed-profile-device = no installed profile for devices found!
Comment on lines 24 to +31
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New/renamed Fluent message IDs were introduced here (e.g., installed-profiles, no-installed-profiles, all-usb-profiles, usb-profiles-not-found). Other locale files under i18n/* still only define the old PCI-specific keys, so non-English locales will fall back to English for these messages. Consider updating other translations (or adding backward-compatible aliases) to keep localization coverage complete.

Copilot uses AI. Check for mistakes.
10 changes: 6 additions & 4 deletions i18n/ja/chwd.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ pass-profile-no-match-install = 入力されたプロファイルはインスト
available = 利用可
installed = インストール済
device = デバイス
no-profile-device = PCI デバイスのプロファイルが見つかりません。
no-profile-device = デバイスのプロファイルが見つかりません。

# console writer
invalid-profile = プロファイル "{$invalid_profile}" は不正です。
all-pci-profiles = 全 PCI プロファイル:
installed-pci-profiles = インストール済みの PCI プロファイル
all-usb-profiles = 全 USB プロファイル:
installed-profiles = インストール済みのプロファイル:
pci-profiles-not-found = PCI プロファイルが見つかりません。
no-installed-pci-profiles = PCI プロファイルはインストールされていません。
no-installed-profile-device = PCI デバイス用のインストール済みプロファイルが見つかりません。
usb-profiles-not-found = USB プロファイルが見つかりません。
no-installed-profiles = インストール済みのプロファイルがありません。
no-installed-profile-device = デバイス用のインストール済みプロファイルが見つかりません。
10 changes: 6 additions & 4 deletions i18n/ka/chwd.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ pass-profile-no-match-install = გადმოცემული პროფ
available = ხელმისაწვდომია
installed = დაყენებულია
device = მოწყობილობა
no-profile-device = PCI მოწყობილობისთვის პროფილები აღმოჩენილი არაა!
no-profile-device = მოწყობილობებისთვის პროფილები აღმოჩენილი არაა!

# console writer
invalid-profile = პროფილი '{$invalid_profile}' არასწორია!
all-pci-profiles = ყველა PCI-ის პროფილი:
installed-pci-profiles = დაყენებული PCI-ის პროფილები:
all-usb-profiles = ყველა USB-ის პროფილი:
installed-profiles = დაყენებული პროფილები:
pci-profiles-not-found = PCI-ის პროფილები დაყენებული არაა!
no-installed-pci-profiles = დაყენებული PCI-ის პროფილების გარეშე!
no-installed-profile-device = PCI მოწყობილობებისთვის დაყენებული პროფილი აღმოჩენილი არაა!
usb-profiles-not-found = USB-ის პროფილები აღმოჩენილი არაა!
no-installed-profiles = დაყენებული პროფილები არ არის!
no-installed-profile-device = მოწყობილობებისთვის დაყენებული პროფილი აღმოჩენილი არაა!
10 changes: 6 additions & 4 deletions i18n/pt-BR/chwd.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ pass-profile-no-match-install = O perfil informado não corresponde ao perfil in
available = DISPONÍVEL
installed = INSTALADO
device = Dispositivo
no-profile-device = Nenhum perfil para dispositivos PCI foi encontrado!
no-profile-device = Nenhum perfil para dispositivos foi encontrado!

# console writer
invalid-profile = O perfil '{$invalid_profile}' é inválido!
all-pci-profiles = Todos os perfis PCI:
installed-pci-profiles = Perfis PCI instalados:
all-usb-profiles = Todos os perfis USB:
installed-profiles = Perfis instalados:
pci-profiles-not-found = Nenhum perfil PCI foi encontrado!
no-installed-pci-profiles = Nenhum perfil PCI está instalado!
no-installed-profile-device = Nenhum perfil instalado para dispositivos PCI foi encontrado!
usb-profiles-not-found = Nenhum perfil USB foi encontrado!
no-installed-profiles = Nenhum perfil está instalado!
no-installed-profile-device = Nenhum perfil instalado para dispositivos foi encontrado!
10 changes: 6 additions & 4 deletions i18n/ru/chwd.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ pass-profile-no-match-install = переданный профиль не сов
available = ДОСТУПНО
installed = УСТАНОВЛЕНО
device = Устройство
no-profile-device = профили для устройств PCI не найдены!
no-profile-device = профили для устройств не найдены!

# console writer
invalid-profile = профиль '{$invalid_profile}' недействительный!
all-pci-profiles = Все PCI профили:
installed-pci-profiles = Установленные PCI профили:
all-usb-profiles = Все USB профили:
installed-profiles = Установленные профили:
pci-profiles-not-found = PCI профили не найдены!
no-installed-pci-profiles = Нет установленных PCI профилей!
no-installed-profile-device = не найдено ни одного установленного профиля для устройств PCI!
usb-profiles-not-found = USB профили не найдены!
no-installed-profiles = Нет установленных профилей!
no-installed-profile-device = не найдено ни одного установленного профиля для устройств!
10 changes: 6 additions & 4 deletions i18n/sk/chwd.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ pass-profile-no-match-install = uvedený profil sa nezhoduje s nainštalovaným
available = DOSTUPNÉ
installed = NAINŠTALOVANÉ
device = Zariadenie
no-profile-device = neboli nájdené žiadne profily pre zariadenia PCI!
no-profile-device = neboli nájdené žiadne profily pre zariadenia!

# Výstup v konzoly
invalid-profile = profil '{$invalid_profile}' je neplatný!
all-pci-profiles = Všetky PCI profily:
installed-pci-profiles = Inštalované PCI profily:
all-usb-profiles = Všetky USB profily:
installed-profiles = Inštalované profily:
pci-profiles-not-found = Žiadne PCI profily neboli nájdené!
no-installed-pci-profiles = Žiadne PCI profily nie sú nainštalované!
no-installed-profile-device = žiadny nainštalovaný profil pre zariadenie PCI nebol nájdený !
usb-profiles-not-found = Žiadne USB profily neboli nájdené!
no-installed-profiles = Žiadne profily nie sú nainštalované!
no-installed-profile-device = žiadny nainštalovaný profil pre zariadenia nebol nájdený!
10 changes: 6 additions & 4 deletions i18n/sv/chwd.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ pass-profile-no-match-install = angiven profil matchar inte med installerad prof
available = TILLGÄNGLIG
installed = INSTALLERAD
device = Enhet
no-profile-device = inga profiler för PCI-enheter hittades!
no-profile-device = inga profiler för enheter hittades!

# console writer
invalid-profile = profilen '{$invalid_profile}' är ogiltig!
all-pci-profiles = Alla PCI-profiler:
installed-pci-profiles = Installerade PCI-profiler:
all-usb-profiles = Alla USB-profiler:
installed-profiles = Installerade profiler:
pci-profiles-not-found = Inga PCI-profiler hittades!
no-installed-pci-profiles = Inga installerade PCI-profiler!
no-installed-profile-device = ingen installerad profil för PCI-enheter hittades!
usb-profiles-not-found = Inga USB-profiler hittades!
no-installed-profiles = Inga installerade profiler!
no-installed-profile-device = ingen installerad profil för enheter hittades!
11 changes: 6 additions & 5 deletions i18n/uk/chwd.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ pass-profile-no-match-install = вказаний профіль не відпо
available = ДОСТУПНО
installed = ВСТАНОВЛЕНО
device = Пристрій
no-profile-device = профілі для PCI-пристроїв не знайдено!
no-profile-device = профілі для пристроїв не знайдено!

# console writer
invalid-profile = профіль '{$invalid_profile}' недійсний!
all-pci-profiles = Усі PCI-профілі:
installed-pci-profiles = Встановлені PCI-профілі:
all-usb-profiles = Усі USB-профілі:
installed-profiles = Встановлені профілі:
pci-profiles-not-found = PCI-профілі не знайдено!
no-installed-pci-profiles = Немає встановлених PCI-профілів!
no-installed-profile-device = не знайдено встановлених профілів для PCI-пристроїв!
usb-profiles-not-found = USB-профілі не знайдено!
no-installed-profiles = Немає встановлених профілів!
no-installed-profile-device = не знайдено встановлених профілів для пристроїв!
68 changes: 68 additions & 0 deletions ids/fprint.ids
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Fingerprint reader USB product IDs supported by libfprint
# Source: https://fprint.freedesktop.org/supported-devices.html

# 045e - Microsoft (fingerprint sensors in Surface devices)
00bb 00bc 00bd 00ca

# 0483 - STMicroelectronics / UPEK
2015 2016 2017

# 04f3 - Elan Microelectronics
0903 0907
0c01 0c02 0c03 0c04 0c05 0c06 0c07 0c08 0c09 0c0a 0c0b 0c0c 0c0d 0c0e 0c0f
0c10 0c11 0c12 0c13 0c14 0c15 0c16 0c17 0c18 0c19 0c1a 0c1b 0c1c 0c1d 0c1e 0c1f
0c20 0c21 0c22 0c23 0c24 0c25 0c26 0c27 0c28 0c29 0c2a 0c2b 0c2c 0c2d 0c2e 0c2f
0c30 0c31 0c32 0c33
0c3d 0c42 0c4b 0c4d 0c4f 0c58 0c63 0c6e
0c7d 0c7e 0c7f 0c80 0c81 0c82 0c83 0c84 0c85 0c86 0c87 0c88 0c89 0c8a 0c8b 0c8c
0c8d 0c8e 0c8f 0c90 0c91 0c92 0c93 0c94 0c95 0c96 0c97 0c98 0c99
0c9d 0c9f 0ca3 0ca7 0ca8 0cb0

# 05ba - Digital Persona
0007 0008 000a

# 06cb - Synaptics
00bd 00c2 00c4 00c6 00df 00e9 00f0 00f9 00fc
0100 0103 0104 0106 0107 0108 0109 010a
0123 0124 0126 0129
015f 0168 0169 016c 0173 0174
019d 019f 01a0

# 08ff - AuthenTec
1600 1660
1680 1681 1682 1683 1684 1685 1686 1687 1688 1689
168a 168b 168c 168d 168e 168f
2500 2550 2580 2660
2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 268a 268b 268c 268d 268e 268f
2690 2691
2810 5501 5731

# 0bda - Realtek
5813 5816

# 10a5 - FPC (Fingerprint Cards)
9524 9544 a305 a306 c844 d205 d805 da04 ffe0

# 138a - Validity Sensors (Synaptics)
0001 0005 0008 0010 0011 0015 0017 0018 0050 0091

# 147e - UPEK
1000 1001 2016 2020 3001

# 1c7a - LighTuning / Egis Technology
0570 0571 0582 0583 0584 0585 0586 0587 0588 05a1 0603

# 2541 - Realtek
fa03

# 27c6 - Goodix Technology
5840 6014 6092 6094 609a 609c 60a2 60a4 60bc 60c2
6304 631c 633c 634c 6384 639c 63ac 63bc 63cc
6496 650a 650c 6512 6582 6584 658c 6592 6594 659a 659c
66a9 689a 6a94

# 2808 - FocalTech
077a 079a 1579 9e48 a27a a57a a78a a959 a99a d979

# 298d - Next Biometrics
1010
40 changes: 40 additions & 0 deletions profiles/usb/fprint/profiles.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[fprint]
desc = "Fingerprint reader support (fprintd)"
# Vendor IDs of known fingerprint sensor manufacturers supported by libfprint.
# Source: https://fprint.freedesktop.org/supported-devices.html
# 045e Microsoft (fingerprint sensors in Surface devices)
# 0483 STMicroelectronics / UPEK
# 04f3 Elan Microelectronics
# 05ba Digital Persona
# 06cb Synaptics
# 08ff AuthenTec
# 0bda Realtek
# 10a5 FPC (Fingerprint Cards)
# 138a Validity Sensors (Synaptics)
# 147e UPEK
# 1c7a LighTuning / Egis Technology
# 2541 Realtek
# 27c6 Goodix Technology
# 2808 FocalTech
# 298d Next Biometrics
vendor_ids = "045e 0483 04f3 05ba 06cb 08ff 0bda 10a5 138a 147e 1c7a 2541 27c6 2808 298d"
device_ids = '>/var/lib/chwd/ids/fprint.ids'
class_ids = "*"
priority = 5
packages = "fprintd"
post_install = """
systemctl enable fprintd.service
mkdir -p /etc/pam.d/sudo.d
cat > /etc/pam.d/sudo.d/50-fprintd.conf <<'EOF'
# Managed by chwd - DO NOT EDIT
auth sufficient pam_fprintd.so
EOF
"""
post_remove = """
if grep -q 'Managed by chwd' /etc/pam.d/sudo.d/50-fprintd.conf 2>/dev/null; then
rm -f /etc/pam.d/sudo.d/50-fprintd.conf
fi
if ! systemctl list-dependencies --reverse fprintd.service 2>/dev/null | grep -q .; then
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The post_remove check for disabling fprintd.service is effectively always false: systemctl list-dependencies --reverse fprintd.service | grep -q . will typically match at least one line (often the unit itself), so the service won’t be disabled even when nothing depends on it. Consider a more precise check (e.g., filter out the unit itself / header lines, or use systemctl is-enabled and disable unconditionally if you enabled it).

Suggested change
if ! systemctl list-dependencies --reverse fprintd.service 2>/dev/null | grep -q .; then
if systemctl is-enabled --quiet fprintd.service 2>/dev/null; then

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guess we dont even need to enable service. It should do automatically

systemctl disable fprintd.service
fi
"""
42 changes: 34 additions & 8 deletions src/console_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,31 +31,39 @@ pub fn handle_arguments_listing(data: &Data, args: &crate::args::Args) {

// List all profiles
if args.list_all {
let all_profiles = &data.all_profiles;
if all_profiles.is_empty() {
let all_pci_profiles = &data.all_pci_profiles;
let all_usb_profiles = &data.all_usb_profiles;
if all_pci_profiles.is_empty() {
print_warn_msg!("pci-profiles-not-found");
} else {
list_profiles(all_profiles, &fl!("all-pci-profiles"));
list_profiles(all_pci_profiles, &fl!("all-pci-profiles"));
}
if all_usb_profiles.is_empty() {
print_warn_msg!("usb-profiles-not-found");
} else {
list_profiles(all_usb_profiles, &fl!("all-usb-profiles"));
}
}

// List installed profiles
if args.list_installed {
let installed_profiles = &data.installed_profiles;
let installed_profiles = data.installed_profiles();
if args.detail {
print_installed_profiles(installed_profiles);
print_installed_profiles(&installed_profiles);
} else if !installed_profiles.is_empty() {
list_profiles(installed_profiles, &fl!("installed-pci-profiles"));
list_profiles(&installed_profiles, &fl!("installed-profiles"));
} else {
print_warn_msg!("no-installed-pci-profiles");
print_warn_msg!("no-installed-profiles");
}
}

// List available profiles
if args.list_available {
let pci_devices = &data.pci_devices;
let usb_devices = &data.usb_devices;
if args.detail {
crate::device_misc::print_available_profiles_in_detail(pci_devices);
crate::device_misc::print_available_profiles_in_detail("PCI", pci_devices);
crate::device_misc::print_available_profiles_in_detail("USB", usb_devices);
} else {
for pci_device in pci_devices {
let available_profiles = &pci_device.get_available_profiles();
Expand All @@ -76,6 +84,24 @@ pub fn handle_arguments_listing(data: &Data, args: &crate::args::Args) {
),
);
}
for usb_device in usb_devices {
let available_profiles = &usb_device.get_available_profiles();
if available_profiles.is_empty() {
continue;
}

list_profiles(
available_profiles,
&format!(
"{} ({}:{}) {} {}:",
usb_device.sysfs_busid,
usb_device.vendor_id,
usb_device.device_id,
usb_device.vendor_name,
usb_device.device_name
),
);
}
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
pub const CHWD_CONFIG_FILE: &str = "profiles.toml";
pub const CHWD_PCI_CONFIG_DIR: &str = "/var/lib/chwd/db/pci/";
pub const CHWD_PCI_DATABASE_DIR: &str = "/var/lib/chwd/local/pci/";
pub const CHWD_USB_CONFIG_DIR: &str = "/var/lib/chwd/db/usb/";
pub const CHWD_USB_DATABASE_DIR: &str = "/var/lib/chwd/local/usb/";
pub const CHWD_SCRIPT_PATH: &str = "/var/lib/chwd/scripts/chwd";

pub const CHWD_PM_CACHE_DIR: &str = "/var/cache/pacman/pkg";
Expand Down
Loading
Loading