This commit is contained in:
2026-05-01 22:05:33 -05:00
parent 5a84a8f294
commit b7bf86aab7
34 changed files with 1224 additions and 574 deletions

View File

@@ -31,6 +31,7 @@ Item {
property bool enableToast: cfg.enableToast ?? defaults.enableToast ?? true
property string activeColorKey: cfg.activeColor ?? defaults.activeColor ?? "primary"
property string micFilterRegex: cfg.micFilterRegex ?? defaults.micFilterRegex ?? ""
property string camFilterRegex: cfg.camFilterRegex ?? defaults.camFilterRegex ?? ""
PwObjectTracker {
objects: Pipewire.ready ? Pipewire.nodes.values : []
@@ -44,8 +45,25 @@ Item {
onStreamFinished: {
var appsString = this.text.trim();
var apps = appsString.length > 0 ? appsString.split(',') : [];
root.camApps = apps;
root.camActive = apps.length > 0;
var filterRegex = null;
if (root.camFilterRegex && root.camFilterRegex.length > 0) {
try {
filterRegex = new RegExp(root.camFilterRegex);
} catch (e) {
Logger.w("PrivacyIndicator: Invalid camFilterRegex:", root.camFilterRegex);
}
}
var appNames = [];
for (var i = 0; i < apps.length; i++) {
var appName = apps[i];
if (filterRegex && appName && filterRegex.test(appName)) continue;
if (appName && appNames.indexOf(appName) === -1) appNames.push(appName);
}
root.camApps = appNames;
root.camActive = appNames.length > 0;
}
}
}
@@ -265,7 +283,7 @@ Item {
property bool oldMicActive: false
onMicActiveChanged: {
if (enableToast && micActive && !oldMicActive) {
ToastService.showNotice(pluginApi?.tr("toast.mic-on") || "Microphone is active", "", "microphone");
ToastService.showNotice(pluginApi?.tr("toast.mic-on"), "", "microphone");
}
oldMicActive = micActive
}
@@ -273,7 +291,7 @@ Item {
property bool oldCamActive: false
onCamActiveChanged: {
if (enableToast && camActive && !oldCamActive) {
ToastService.showNotice(pluginApi?.tr("toast.cam-on") || "Camera is active", "", "camera");
ToastService.showNotice(pluginApi?.tr("toast.cam-on"), "", "camera");
}
oldCamActive = camActive
}
@@ -285,7 +303,7 @@ Item {
property bool oldScrActive: false
onScrActiveChanged: {
if (enableToast && scrActive && !oldScrActive) {
ToastService.showNotice(pluginApi?.tr("toast.screen-on") || "Screen sharing is active", "", "screen-share");
ToastService.showNotice(pluginApi?.tr("toast.screen-on"), "", "screen-share");
}
oldScrActive = scrActive
}

View File

@@ -16,6 +16,7 @@ Item {
property real contentPreferredHeight: 450 * Style.uiScaleRatio
readonly property var mainInstance: pluginApi?.mainInstance
readonly property bool allowAttach: true
Rectangle {
id: panelContainer
@@ -46,7 +47,7 @@ Item {
NText {
Layout.fillWidth: true
text: pluginApi?.tr("history.title") || "Access History"
text: pluginApi?.tr("history.title")
font.weight: Style.fontWeightBold
pointSize: Style.fontSizeL
color: Color.mOnSurface
@@ -154,7 +155,7 @@ Item {
NText {
Layout.alignment: Qt.AlignHCenter
visible: (!mainInstance || mainInstance.accessHistory.length === 0)
text: pluginApi?.tr("history.empty") || "No recent access"
text: pluginApi?.tr("history.empty")
color: Qt.alpha(Color.mOnSurface, 0.5)
pointSize: Style.fontSizeM
Layout.topMargin: Style.marginL

View File

@@ -18,6 +18,7 @@ ColumnLayout {
property string activeColor: cfg.activeColor ?? defaults.activeColor ?? "primary"
property string inactiveColor: cfg.inactiveColor ?? defaults.inactiveColor ?? "none"
property string micFilterRegex: cfg.micFilterRegex ?? defaults.micFilterRegex
property string camFilterRegex: cfg.camFilterRegex ?? defaults.camFilterRegex
spacing: Style.marginL
@@ -102,12 +103,21 @@ ColumnLayout {
NTextInput {
Layout.fillWidth: true
label: pluginApi?.tr("settings.micFilterRegex.label") || "Microphone filter regex"
description: pluginApi?.tr("settings.micFilterRegex.desc") || "Regex pattern to filter out microphone applications"
label: pluginApi?.tr("settings.micFilterRegex.label")
description: pluginApi?.tr("settings.micFilterRegex.desc")
placeholderText: "effect_input.rnnoise|easyeffects"
text: root.micFilterRegex
onTextChanged: root.micFilterRegex = text
}
NTextInput {
Layout.fillWidth: true
label: pluginApi?.tr("settings.camFilterRegex.label")
description: pluginApi?.tr("settings.camFilterRegex.desc")
placeholderText: "droidcam"
text: root.camFilterRegex
onTextChanged: root.camFilterRegex = text
}
}
function saveSettings() {
@@ -123,6 +133,7 @@ ColumnLayout {
pluginApi.pluginSettings.activeColor = root.activeColor;
pluginApi.pluginSettings.inactiveColor = root.inactiveColor;
pluginApi.pluginSettings.micFilterRegex = root.micFilterRegex;
pluginApi.pluginSettings.camFilterRegex = root.camFilterRegex;
pluginApi.saveSettings();

View File

@@ -1,9 +1,24 @@
{
"menu": {
"settings": "Widget Einstellungen"
},
"settings": {
"activeColor": {
"desc": "Farbe der Symbole, wenn sie aktiv sind.",
"label": "Aktive Farbsymbol"
},
"hideInactive": {
"desc": "Mikrofon-, Kamera- und Bildschirmsymbole ausblenden, wenn sie inaktiv sind.",
"label": "Inaktive Zustände ausblenden"
},
"enableToast": {
"desc": "Zeige Toast Mitteilungen an, wenn sich einer der Zustände ändert.",
"label": "Aktiviere Toast Mitteilungen"
},
"inactiveColor": {
"desc": "Farbe der Symbole, wenn sie inaktiv sind.",
"label": "Inaktive Farbsymbol"
},
"iconSpacing": {
"desc": "Den Abstand zwischen den Symbolen festlegen.",
"label": "Symbolabstand"
@@ -12,13 +27,9 @@
"desc": "Alle äußeren Ränder des Widgets entfernen.",
"label": "Ränder entfernen"
},
"activeColor": {
"desc": "Farbe der Symbole, wenn sie aktiv sind.",
"label": "Aktive Farbsymbol"
},
"inactiveColor": {
"desc": "Farbe der Symbole, wenn sie inaktiv sind.",
"label": "Inaktive Farbsymbol"
"micFilterRegex": {
"desc": "Regex Muster zum Herausfiltern von Mikrofon-Apps. Entsprechende Apps werden vollständig von der Erkennung ausgeschlossen.",
"label": "Regex für Mikrofonfilter"
}
},
"tooltip": {
@@ -31,9 +42,6 @@
"mic-on": "Mikrofon ist aktiv",
"screen-on": "Bildschirmfreigabe ist aktiv"
},
"menu": {
"settings": "Widget-Einstellungen"
},
"history": {
"title": "Zugriffsverlauf",
"empty": "Kein kürzlicher Zugriff",

View File

@@ -30,6 +30,10 @@
"micFilterRegex": {
"desc": "Regex pattern to filter out microphone applications. Matching apps are completely excluded from detection.",
"label": "Microphone filter regex"
},
"camFilterRegex": {
"desc": "Regex pattern to filter out camera applications. Matching apps are completely excluded from detection.",
"label": "Camera filter regex"
}
},
"tooltip": {
@@ -51,4 +55,4 @@
"stopped": "Stopped"
}
}
}
}

View File

@@ -1,9 +1,24 @@
{
"menu": {
"settings": "Paramètres du widget"
},
"settings": {
"activeColor": {
"desc": "Couleur des icônes lorsqu'elles sont actives.",
"label": "Couleur d'icône active"
},
"hideInactive": {
"desc": "Masquer les icônes du micro, de la caméra et de lécran lorsquils sont inactifs.",
"label": "Masquer les états inactifs"
},
"enableToast": {
"desc": "Afficher des messages toast lorsque l'un des états change.",
"label": "Activer les notifications toast"
},
"inactiveColor": {
"desc": "Couleur des icônes lorsqu'elles sont inactives.",
"label": "Couleur d'icône inactive"
},
"iconSpacing": {
"desc": "Définir lespacement entre les icônes.",
"label": "Espacement des icônes"
@@ -12,13 +27,13 @@
"desc": "Supprime toutes les marges extérieures du widget.",
"label": "Supprimer les marges"
},
"activeColor": {
"desc": "Couleur des icônes lorsqu'elles sont actives.",
"label": "Couleur d'icône active"
"micFilterRegex": {
"desc": "Motif Regex pour filtrer les applications de microphone. Les applications correspondantes sont complètement exclues de la détection.",
"label": "Regex de filtrage du microphone"
},
"inactiveColor": {
"desc": "Couleur des icônes lorsqu'elles sont inactives.",
"label": "Couleur d'icône inactive"
"camFilterRegex": {
"desc": "Motif Regex pour filtrer les applications de caméra. Les applications correspondantes sont complètement exclues de la détection.",
"label": "Regex de filtrage de la caméra"
}
},
"tooltip": {
@@ -31,9 +46,6 @@
"mic-on": "Le microphone est actif",
"screen-on": "Le partage d'écran est actif"
},
"menu": {
"settings": "Paramètres du widget"
},
"history": {
"title": "Historique d'accès",
"empty": "Aucun accès récent",
@@ -43,4 +55,4 @@
"stopped": "Arrêté"
}
}
}
}

View File

@@ -0,0 +1,58 @@
{
"menu": {
"settings": "위젯 설정"
},
"settings": {
"activeColor": {
"desc": "활성 상태일 때 아이콘에 적용되는 색상입니다.",
"label": "활성 아이콘 색상"
},
"hideInactive": {
"desc": "비활성화된 상태의 마이크, 카메라, 화면 아이콘을 숨깁니다.",
"label": "비활성 상태 숨기기"
},
"enableToast": {
"desc": "상태가 변경될 때 토스트 알림을 표시합니다.",
"label": "토스트 알림 활성화"
},
"inactiveColor": {
"desc": "비활성 상태일 때 아이콘에 적용되는 색상입니다.",
"label": "비활성 아이콘 색상"
},
"iconSpacing": {
"desc": "아이콘 사이의 간격을 설정합니다.",
"label": "아이콘 간격"
},
"removeMargins": {
"desc": "위젯의 모든 외곽 여백을 제거합니다.",
"label": "여백 제거"
},
"micFilterRegex": {
"desc": "마이크를 사용하는 애플리케이션을 필터링하기 위한 정규식을 지정합니다. 일치하는 애플리케이션은 상태 감지에서 완전히 제외됩니다.",
"label": "마이크 필터 정규식"
},
"camFilterRegex": {
"desc": "카메라를 사용하는 애플리케이션을 필터링하기 위한 정규식을 지정합니다. 일치하는 애플리케이션은 상태 감지에서 완전히 제외됩니다.",
"label": "카메라 필터 정규식"
}
},
"tooltip": {
"cam-on": "카메라: {apps}",
"mic-on": "마이크: {apps}",
"screen-on": "화면 공유: {apps}"
},
"toast": {
"cam-on": "카메라가 활성화되었습니다.",
"mic-on": "마이크가 활성화되었습니다.",
"screen-on": "화면 공유가 활성화되었습니다."
},
"history": {
"title": "접근 기록",
"empty": "최근에 접근한 기록 없음",
"clear": "비우기",
"action": {
"started": "시작됨",
"stopped": "정지됨"
}
}
}

View File

@@ -1,7 +1,7 @@
{
"id": "privacy-indicator",
"name": "Privacy Indicator",
"version": "1.2.7",
"version": "1.2.12",
"minNoctaliaVersion": "3.6.0",
"author": "Noctalia Team",
"official": true,
@@ -30,7 +30,8 @@
"iconSpacing": 4,
"activeColor": "primary",
"inactiveColor": "none",
"micFilterRegex": ""
"micFilterRegex": "",
"camFilterRegex": ""
}
}
}