Skip to content

Commit 7257002

Browse files
committed
snapshot
1 parent c6ac60f commit 7257002

7 files changed

Lines changed: 103 additions & 14 deletions

File tree

home/base/tui/editors/packages.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@
225225
nodePackages.prettier # common code formatter
226226
fzf
227227
gdu # disk usage analyzer, required by AstroNvim
228+
nix-du
228229
bottom # graphical process/system monitor, required by AstroNvim
229230
(ripgrep.override { withPCRE2 = true; }) # recursively searches directories for a regex pattern
230231
]

home/linux/gui/base/noctalia/config/plugins/privacy-indicator/Main.qml

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Item {
1010
property var pluginApi: null
1111

1212
// --- Logic extracted from BarWidget.qml ---
13-
13+
1414
property bool micActive: false
1515
property bool camActive: false
1616
property bool scrActive: false
@@ -19,7 +19,7 @@ Item {
1919
property var scrApps: []
2020

2121
property var accessHistory: []
22-
22+
2323
// Previous states for history tracking
2424
property var _prevMicApps: []
2525
property var _prevCamApps: []
@@ -30,6 +30,7 @@ Item {
3030
property var defaults: pluginApi?.manifest?.metadata?.defaultSettings || ({})
3131
property bool enableToast: cfg.enableToast ?? defaults.enableToast ?? true
3232
property string activeColorKey: cfg.activeColor ?? defaults.activeColor ?? "primary"
33+
property string micFilterRegex: cfg.micFilterRegex ?? defaults.micFilterRegex ?? ""
3334

3435
PwObjectTracker {
3536
objects: Pipewire.ready ? Pipewire.nodes.values : []
@@ -73,15 +74,28 @@ Item {
7374
function updateMicrophoneState(nodes, links) {
7475
var appNames = [];
7576
var isActive = false;
77+
78+
var filterRegex = null;
79+
if (root.micFilterRegex && root.micFilterRegex.length > 0) {
80+
try {
81+
filterRegex = new RegExp(root.micFilterRegex);
82+
} catch (e) {
83+
Logger.w("PrivacyIndicator: Invalid micFilterRegex:", root.micFilterRegex);
84+
}
85+
}
86+
7687
for (var i = 0; i < nodes.length; i++) {
7788
var node = nodes[i];
7889
if (!node || !node.isStream || !node.audio || node.isSink) continue;
7990
if (!hasNodeLinks(node, links) || !node.properties) continue;
8091
var mediaClass = node.properties["media.class"] || "";
8192
if (mediaClass === "Stream/Input/Audio") {
8293
if (node.properties["stream.capture.sink"] === "true") continue;
83-
isActive = true;
94+
8495
var appName = getAppName(node);
96+
if (filterRegex && appName && filterRegex.test(appName)) continue;
97+
98+
isActive = true;
8599
if (appName && appNames.indexOf(appName) === -1) appNames.push(appName);
86100
}
87101
}
@@ -133,7 +147,7 @@ Item {
133147
}
134148

135149
// --- History Persistence ---
136-
150+
137151
property string stateFile: ""
138152
property bool isLoaded: false
139153

@@ -164,7 +178,7 @@ Item {
164178
root.accessHistory = adapter.history;
165179
}
166180
}
167-
181+
168182
onLoadFailed: error => {
169183
// If file doesn't exist (error 2), we are ready to save new data
170184
if (error === 2) {
@@ -178,9 +192,9 @@ Item {
178192

179193
function saveHistory() {
180194
if (!stateFile || !isLoaded) return;
181-
195+
182196
adapter.history = root.accessHistory;
183-
197+
184198
// Ensure cache directory exists and save
185199
try {
186200
Quickshell.execDetached(["mkdir", "-p", Settings.cacheDir]);
@@ -220,7 +234,7 @@ Item {
220234

221235
function checkAppChanges(newApps, oldApps, type, icon, colorKey) {
222236
if (!newApps && !oldApps) return;
223-
237+
224238
// Check for new apps (Started)
225239
if (newApps) {
226240
for (var i = 0; i < newApps.length; i++) {
@@ -230,7 +244,7 @@ Item {
230244
}
231245
}
232246
}
233-
247+
234248
// Check for removed apps (Stopped)
235249
if (oldApps) {
236250
for (var j = 0; j < oldApps.length; j++) {
@@ -279,6 +293,6 @@ Item {
279293
checkAppChanges(scrApps, _prevScrApps, "Screen", "screen-share", activeColorKey);
280294
_prevScrApps = scrApps;
281295
}
282-
296+
283297

284298
}

home/linux/gui/base/noctalia/config/plugins/privacy-indicator/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,12 @@ Access the plugin settings in Noctalia to configure the following options:
2020

2121
- **Hide Inactive States**: If enabled, microphone, camera, and screen icons are hidden whenever
2222
they are inactive. Only active states are shown.
23-
- **RemoveMargins**: If enabled, removes all outer margins of the widget.
23+
- **Remove Margins**: If enabled, removes all outer margins of the widget.
2424
- **Icon Spacing**: Controls the horizontal/vertical spacing between the icons.
25+
- **Active/Inactive Icon Color**: Customize the colors for active and inactive states.
26+
- **Microphone Filter Regex**: Regex pattern to filter out specific microphone applications.
27+
Matching apps are completely excluded from detection (they won't trigger the indicator or appear
28+
in tooltips). Use `|` to specify multiple patterns, e.g., `effect_input.rnnoise|easyeffects`.
2529

2630
## Usage
2731

home/linux/gui/base/noctalia/config/plugins/privacy-indicator/Settings.qml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ ColumnLayout {
1717
property int iconSpacing: cfg.iconSpacing ?? defaults.iconSpacing ?? 4
1818
property string activeColor: cfg.activeColor ?? defaults.activeColor ?? "primary"
1919
property string inactiveColor: cfg.inactiveColor ?? defaults.inactiveColor ?? "none"
20+
property string micFilterRegex: cfg.micFilterRegex ?? defaults.micFilterRegex
2021

2122
spacing: Style.marginL
2223

@@ -46,7 +47,7 @@ ColumnLayout {
4647
onToggled: checked => {
4748
root.enableToast = checked;
4849
}
49-
}
50+
}
5051

5152
NToggle {
5253
label: pluginApi?.tr("settings.removeMargins.label")
@@ -98,6 +99,15 @@ ColumnLayout {
9899
currentKey: root.iconSpacing.toFixed(0)
99100
onSelected: key => root.iconSpacing = key
100101
}
102+
103+
NTextInput {
104+
Layout.fillWidth: true
105+
label: pluginApi?.tr("settings.micFilterRegex.label") || "Microphone filter regex"
106+
description: pluginApi?.tr("settings.micFilterRegex.desc") || "Regex pattern to filter out microphone applications"
107+
placeholderText: "effect_input.rnnoise|easyeffects"
108+
text: root.micFilterRegex
109+
onTextChanged: root.micFilterRegex = text
110+
}
101111
}
102112

103113
function saveSettings() {
@@ -112,6 +122,7 @@ ColumnLayout {
112122
pluginApi.pluginSettings.removeMargins = root.removeMargins;
113123
pluginApi.pluginSettings.activeColor = root.activeColor;
114124
pluginApi.pluginSettings.inactiveColor = root.inactiveColor;
125+
pluginApi.pluginSettings.micFilterRegex = root.micFilterRegex;
115126

116127
pluginApi.saveSettings();
117128

home/linux/gui/base/noctalia/config/plugins/privacy-indicator/i18n/en.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
"removeMargins": {
2727
"desc": "Remove all outer margins of the widget.",
2828
"label": "Remove margins"
29+
},
30+
"micFilterRegex": {
31+
"desc": "Regex pattern to filter out microphone applications. Matching apps are completely excluded from detection.",
32+
"label": "Microphone filter regex"
2933
}
3034
},
3135
"tooltip": {
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"menu": {
3+
"settings": "Cài đặt tiện ích"
4+
},
5+
"settings": {
6+
"activeColor": {
7+
"desc": "Màu của biểu tượng khi đang hoạt động.",
8+
"label": "Màu biểu tượng khi hoạt động"
9+
},
10+
"hideInactive": {
11+
"desc": "Ẩn biểu tượng micro, camera và màn hình khi không hoạt động.",
12+
"label": "Ẩn trạng thái không hoạt động"
13+
},
14+
"enableToast": {
15+
"desc": "Hiển thị thông báo khi một trạng thái thay đổi.",
16+
"label": "Bật thông báo"
17+
},
18+
"inactiveColor": {
19+
"desc": "Màu của biểu tượng khi không hoạt động.",
20+
"label": "Màu biểu tượng khi không hoạt động"
21+
},
22+
"iconSpacing": {
23+
"desc": "Thiết lập khoảng cách giữa các biểu tượng.",
24+
"label": "Khoảng cách biểu tượng"
25+
},
26+
"removeMargins": {
27+
"desc": "Loại bỏ toàn bộ lề ngoài của widget.",
28+
"label": "Xóa lề"
29+
},
30+
"micFilterRegex": {
31+
"desc": "Biểu thức chính quy để lọc các ứng dụng sử dụng micro. Các ứng dụng khớp sẽ bị loại khỏi việc phát hiện.",
32+
"label": "Regex lọc micro"
33+
}
34+
},
35+
"tooltip": {
36+
"cam-on": "Camera: {apps}",
37+
"mic-on": "Micro: {apps}",
38+
"screen-on": "Chia sẻ màn hình: {apps}"
39+
},
40+
"toast": {
41+
"cam-on": "Camera đang hoạt động",
42+
"mic-on": "Micro đang hoạt động",
43+
"screen-on": "Chia sẻ màn hình đang hoạt động"
44+
},
45+
"history": {
46+
"title": "Lịch sử truy cập",
47+
"empty": "Không có truy cập gần đây",
48+
"clear": "Xóa",
49+
"action": {
50+
"started": "Bắt đầu",
51+
"stopped": "Dừng"
52+
}
53+
}
54+
}

home/linux/gui/base/noctalia/config/plugins/privacy-indicator/manifest.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "privacy-indicator",
33
"name": "Privacy Indicator",
4-
"version": "1.2.5",
4+
"version": "1.2.6",
55
"minNoctaliaVersion": "3.6.0",
66
"author": "Noctalia Team",
77
"official": true,
@@ -25,7 +25,8 @@
2525
"removeMargins": false,
2626
"iconSpacing": 4,
2727
"activeColor": "primary",
28-
"inactiveColor": "none"
28+
"inactiveColor": "none",
29+
"micFilterRegex": ""
2930
}
3031
}
3132
}

0 commit comments

Comments
 (0)