alpha
Login
or
Join now
lass.pds.lassul.us
/
superconfig
Star
0
Fork
1
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
This repository has no description
Star
0
Fork
1
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
1
Pipelines
tools.pi: fix permission sound patch
author
lassulus
date
8 months ago
(Feb 17, 2026, 11:30 PM CET)
commit
2fef8005
2fef8005d197486d8f2dfb62985fa1f412665228
parent
e3218579
e3218579cc22967ff27b7521c65f6dc71e85d72d
+5
-4
1 changed file
Expand all
Collapse all
Unified
Split
tools
pi
patch-permission-sound.py
+5
-4
tools/pi/patch-permission-sound.py
View file
Reviewed
···
8
8
9
9
src = open(ts_file).read()
10
10
11
11
-
replacement = """function playPermissionSound(): void {
11
11
+
# Use a lambda for replacement to avoid re.sub interpreting backslash sequences
12
12
+
replacement = r"""function playPermissionSound(): void {
12
13
const isMac = process.platform === "darwin";
13
14
if (isMac) {
14
15
exec('afplay /System/Library/Sounds/Funk.aiff 2>/dev/null', (err) => {
15
15
-
if (err) process.stdout.write("\\x07");
16
16
+
if (err) process.stdout.write("\x07");
16
17
});
17
18
} else {
18
19
const n = Math.floor(Math.random() * 4) + 1;
19
19
-
exec(`""" + pw_play + """ "$HOME/src/sounds/games/Warcraft III/Units/Orc/Peon/PeonWhat${n}.wav"`, () => {});
20
20
+
exec(`""" + pw_play + r""" "$HOME/src/sounds/games/Warcraft III/Units/Orc/Peon/PeonWhat${n}.wav"`, () => {});
20
21
}
21
22
}"""
22
23
23
24
result = re.sub(
24
25
r'function playPermissionSound\(\): void \{.*?\n\}',
25
25
-
replacement,
26
26
+
lambda m: replacement,
26
27
src,
27
28
flags=re.DOTALL,
28
29
)