signal-styler 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,120 @@
1
+ # signal-styler 🎨✨
2
+
3
+ Make theming Signal Desktop easy!
4
+
5
+ Adds custom CSS to **Signal Desktop**.
6
+
7
+ > ⚠️ This tool modifies the `app.asar` of Signal Desktop.
8
+ > Use at your own risk. Restart Signal after styling.
9
+
10
+ ---
11
+
12
+ ## πŸ“¦ Installation
13
+
14
+ ### Option 1: Install using **npm**
15
+
16
+ This works for most platforms. Install Node.js and run:
17
+
18
+ ```bash
19
+ npm install -g signal-styler
20
+ ```
21
+
22
+ ### Option 2: Install using **AUR**
23
+
24
+ If you use an Arch Linux (btw) based distro, you can install it from the official [Arch User Repository](https://aur.archlinux.org/packages/signal-styler/) package.
25
+
26
+ Using an AUR helper like paru, yay or trizen:
27
+
28
+ ```bash
29
+ paru -S signal-styler
30
+ ```
31
+
32
+ Or manually:
33
+
34
+ ```bash
35
+ git clone https://aur.archlinux.org/signal-styler.git
36
+ cd signal-styler
37
+ makepkg -si
38
+ ```
39
+
40
+ ---
41
+
42
+ ## πŸš€ Usage
43
+
44
+ ```bash
45
+ signal-styler [options] custom.css
46
+ ```
47
+
48
+ ### Arguments
49
+
50
+ - `custom.css`
51
+ Path to your custom stylesheet.
52
+
53
+ ### Options
54
+
55
+ - `-a, --asar <path>`
56
+ Path to Signal Desktop’s `app.asar` to patch.
57
+ By default, the tool will try to locate it automatically.
58
+ Useful if Signal is installed via **Flatpak**.
59
+
60
+ - `-v, --version`
61
+ Show the version number.
62
+
63
+ ---
64
+
65
+ ## πŸ”§ Examples
66
+
67
+ Apply `my-theme.css` with auto-detected Signal path:
68
+
69
+ ```bash
70
+ signal-styler my-theme.css
71
+ ```
72
+
73
+ Specify the `asar` path explicitly, for example for Signal installed in userspace:
74
+
75
+ ```bash
76
+ signal-styler -a ~/.var/app/org.signal.Signal/files/Signal/resources/app.asar my-style.css
77
+ ```
78
+
79
+ If you get permission errors, run with `sudo`:
80
+
81
+ ```bash
82
+ sudo signal-styler custom.css
83
+ ```
84
+
85
+ ---
86
+
87
+ ## πŸ“ Notes
88
+
89
+ - Only tested on **Linux** for now. It could work on Windows and macOS too, but I haven't tested it.
90
+ - File a [GitHub issue](https://github.com/m-obeid/signal-styler/issues) if you run into any issues.
91
+ - The script expects Signal Desktop on Linux to be installed via **Flatpak**, if not you likely need to use `--asar` or `-a` to point to the right file.
92
+ - You can safely re-run the tool with new CSS β€” it will overwrite the existing stylesheet.
93
+ - Every time Signal updates, you will need to run the tool again to update the stylesheet.
94
+
95
+ ---
96
+
97
+ ## 🎨 Themes
98
+
99
+ signal-styler does not include any themes by default other than purple.css from the GitHub repo, which needs to be downloaded separately.
100
+
101
+ Here are some that could work (didn't test):
102
+
103
+ - [Catppuccin for Signal Desktop](https://github.com/CalfMoon/signal-desktop)
104
+ - [DDLC Yuri (wife) / Zero Two Theme](https://github.com/Foxunderground0/Signal-Themes)
105
+ - [WhatsApp Theme (why)](https://github.com/CapnSparrow/signal-desktop-themes)
106
+
107
+ To get one, you just need the CSS file, which might be named `manifest.css` or something like that.
108
+ Do not report theme issues to me, but the original author of the theme.
109
+
110
+ ---
111
+
112
+ ## πŸ‘¨β€πŸ’» Author
113
+
114
+ Made with ❀️ by [POCOGuy / m-obeid](https://github.com/m-obeid)
115
+
116
+ ---
117
+
118
+ ## πŸ“œ License
119
+
120
+ [GPL-3.0-only](LICENSE)
package/index.js ADDED
@@ -0,0 +1,99 @@
1
+ #!/usr/bin/env node
2
+
3
+ // signal-styler
4
+ // Add custom CSS to Signal Desktop (Linux only for now)
5
+ // https://github.com/m-obeid/signal-styler
6
+
7
+ const { ArgumentParser } = require("argparse");
8
+ const package = require("./package.json");
9
+ const utils = require("./utils");
10
+
11
+ const parser = new ArgumentParser({
12
+ description: package.description,
13
+ });
14
+
15
+ parser.add_argument("-v", "--version", {
16
+ action: "version",
17
+ version: package.version,
18
+ });
19
+
20
+ parser.add_argument("-a", "--asar", {
21
+ type: String,
22
+ help: "path to Signal Desktop asar to patch",
23
+ });
24
+
25
+ parser.add_argument("custom.css", {
26
+ type: String,
27
+ help: "path to custom stylesheet",
28
+ });
29
+
30
+ const args = parser.parse_args();
31
+
32
+ utils.asarPath = args["asar"] || utils.assumeAsarPath();
33
+
34
+ console.log(
35
+ `\x1b[34msignal-styler\x1b[0m \x1b[32mv${package.version}\x1b[0m - made by \x1b[35mPOCOGuy/m-obeid\x1b[0m`
36
+ );
37
+ console.log("");
38
+
39
+ if (!utils.validateAsarPath()) {
40
+ console.error(
41
+ `\x1b[31mError\x1b[0m: Signal Desktop asar not found automatically.\x1b[0m`
42
+ );
43
+
44
+ if (!args["asar"]) {
45
+ if (process.platform === "win32" || process.platform === "darwin")
46
+ console.info(
47
+ "Is Signal installed in the default location? You can specify a custom asar path with the \x1b[35m-a\x1b[0m flag."
48
+ );
49
+ else
50
+ console.info(
51
+ "Is Signal installed via Flatpak? You can specify a custom asar path with the \x1b[35m-a\x1b[0m flag."
52
+ );
53
+ } else console.info("Is the path you specified correct?");
54
+ process.exit(1);
55
+ }
56
+
57
+ if (utils.checkNeedsSudo() && process.getuid() !== 0) {
58
+ console.error(
59
+ `\x1b[31mError\x1b[0m: You need to run signal-styler using \x1b[35msudo\x1b[0m or as root because Signal Desktop asar is installed to a protected directory.`
60
+ );
61
+ console.info(
62
+ "Run \x1b[35msudo signal-styler -h\x1b[0m for more information."
63
+ );
64
+ process.exit(1);
65
+ }
66
+
67
+ // create a temporary patchDir and buildDir
68
+ utils.createTempDirs();
69
+
70
+ console.log("\n1. Checking Signal Desktop asar ...");
71
+
72
+ const manifest = utils.getManifest();
73
+
74
+ if (!utils.isManifestModified(manifest)) {
75
+ console.log("\n2. \x1b[32mEnabling\x1b[0m Signal-Styler ...");
76
+
77
+ utils.patchManifest(manifest);
78
+ } else
79
+ console.log("\n2. Signal-Styler already \x1b[32menabled\x1b[0m, continue ...");
80
+
81
+ console.log("\n3. Installing custom CSS ...");
82
+
83
+ // copy custom.css to patchDir
84
+ utils.setStylesheet(args["custom.css"]);
85
+
86
+ console.log("\n4. Building Signal Desktop asar ...");
87
+
88
+ utils.build().then(() => {
89
+ utils.install();
90
+
91
+ // clean up
92
+ console.log("\n5. Cleaning up ...");
93
+ utils.cleanup();
94
+
95
+ console.log(
96
+ `\n\x1b[32mDone\x1b[0m! Restart Signal to see your beautiful new styles. \x1b[33m\u{1F3A8}\x1b[0m\x1b[33m\u{2728}\x1b[0m`
97
+ );
98
+ });
99
+
package/package.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "signal-styler",
3
+ "version": "1.0.0",
4
+ "description": "Add custom CSS to Signal Desktop (Linux only for now)",
5
+ "main": "index.js",
6
+ "bin": {
7
+ "signal-styler": "./index.js"
8
+ },
9
+ "keywords": [],
10
+ "author": "POCOGuy",
11
+ "license": "GPL-3.0-only",
12
+ "dependencies": {
13
+ "@electron/asar": "^4.0.1",
14
+ "argparse": "^2.0.1"
15
+ },
16
+ "scripts": {
17
+ "start": "node ."
18
+ }
19
+ }
package/purple.css ADDED
@@ -0,0 +1,334 @@
1
+ /*
2
+ _ _ ____
3
+ | \ | | __ ___ __ | __ ) __ _ _ __ ___
4
+ | \| |/ _` \ \ / / | _ \ / _` | '__/ __|
5
+ | |\ | (_| |\ V / | |_) | (_| | | \__ \
6
+ |_| \_|\__,_| \_/ |____/ \__,_|_| |___/
7
+ */
8
+
9
+ /* left most bar */
10
+ .NavTabs {
11
+ background-color: #231D33 !important;
12
+ }
13
+
14
+ .NavTabs__ItemButton:hover {
15
+ background-color: #3D3144 !important;
16
+ }
17
+
18
+ .NavTabs__Item[aria-selected="true"] > span > .NavTabs__ItemButton {
19
+ background-color: #51455A !important;
20
+ }
21
+
22
+ /* buttons in qr and link section of personal user profile */
23
+ .UsernameLinkModalBody__actions__save,
24
+ .UsernameLinkModalBody__actions__color {
25
+ background-color: #51455A !important;
26
+ }
27
+
28
+ /* second to left bar */
29
+ .NavSidebar {
30
+ background-color: #231D33 !important;
31
+ }
32
+
33
+ /* view archive button when clicking on ... */
34
+ .ContextMenu__popper--single-item {
35
+ background-color: #3D3144 !important;
36
+ }
37
+
38
+ .module-conversation-list__item--contact-or-conversation--is-selected {
39
+ background-color: #51455A !important;
40
+ }
41
+
42
+ /* no archived chat text */
43
+ .module-left-pane__archive-helper-text {
44
+ background-color: #3D3144 !important;
45
+ }
46
+
47
+ .module-conversation-list__item--contact-or-conversation:hover,
48
+ .module-conversation-list__item--contact-or-conversation:focus,
49
+ .module-conversation-list__item--archive-button:hover,
50
+ .module-conversation-list__item--archive-button:focus {
51
+ background-color: #3D3144 !important;
52
+ }
53
+
54
+ /*
55
+ _ _ ____
56
+ | | | | ___ _ __ ___ ___ | _ \ __ _ __ _ ___
57
+ | |_| |/ _ \| '_ ` _ \ / _ \ | |_) / _` |/ _` |/ _ \
58
+ | _ | (_) | | | | | | __/ | __/ (_| | (_| | __/
59
+ |_| |_|\___/|_| |_| |_|\___| |_| \__,_|\__, |\___|
60
+ |___/
61
+ */
62
+
63
+ .Inbox__no-conversation-open {
64
+ background-color: #221D32 !important;
65
+ }
66
+
67
+ /*
68
+ _____ _ _ _
69
+ |_ _|____ _| |_(_)_ __ __ _ / \ _ __ ___ __ _
70
+ | |/ _ \ \/ / __| | '_ \ / _` | / _ \ | '__/ _ \/ _` |
71
+ | | __/> <| |_| | | | | (_| | / ___ \| | | __/ (_| |
72
+ |_|\___/_/\_\\__|_|_| |_|\__, | /_/ \_\_| \___|\__,_|
73
+ |___/
74
+ */
75
+
76
+ /* the bar at the top containing your contact name */
77
+ .module-ConversationHeader {
78
+ background-color: #221D33 !important;
79
+ }
80
+
81
+ /* call, search, etc button present at conversation header */
82
+ .module-ConversationHeader__button:hover,
83
+ .module-ConversationHeader__button:focus {
84
+ background-color: #3D3144 !important;
85
+ }
86
+
87
+ /* ... menu at conversation header */
88
+ .react-contextmenu {
89
+ background-color: #3D3144 !important;
90
+ }
91
+
92
+ /* ... menu hover */
93
+ .react-contextmenu-item--selected {
94
+ background-color: #51455A !important;
95
+ }
96
+
97
+ /* the vm player that appears at top */
98
+ .MiniPlayer {
99
+ background-color: #51455A !important;
100
+ }
101
+
102
+ /* conversation area */
103
+ .module-timeline {
104
+ background-color: #221D32 !important;
105
+ }
106
+
107
+ /* messages */
108
+ .module-message__container--incoming {
109
+ background-color: #3D3144 !important;
110
+ }
111
+
112
+ /* replying box */
113
+ .module-quote--incoming > .module-quote__primary,
114
+ .module-quote--incoming > .module-quote__icon-container {
115
+ background-color: #51455A !important;
116
+ border: 0px !important;
117
+ }
118
+
119
+ /* call again button */
120
+ .module-Button--system-message {
121
+ background-color: #51455A !important;
122
+ }
123
+
124
+ /* the area where you write message, attach file, send vm, etc. */
125
+ .CompositionArea {
126
+ background-color: #221D33 !important;
127
+ }
128
+
129
+ /* the actual typing box */
130
+ .module-composition-input__input {
131
+ background-color: #3D3144 !important;
132
+ }
133
+
134
+ /* the today or yesterday thing that appears when you scroll up */
135
+ .TimelineDateHeader--floating {
136
+ background-color: #3D3144 !important;
137
+ }
138
+
139
+ .TimelineFloatingHeader__spinner-container {
140
+ background-color: #3D3144 !important;
141
+ }
142
+
143
+ .ScrollDownButton {
144
+ background-color: #3D3144 !important;
145
+ }
146
+
147
+ /*
148
+ ____ _ _ _ _
149
+ / ___|__ _| | (_)_ __ __ _ / \ _ __ ___ __ _
150
+ | | / _` | | | | '_ \ / _` | / _ \ | '__/ _ \/ _` |
151
+ | |__| (_| | | | | | | | (_| | / ___ \| | | __/ (_| |
152
+ \____\__,_|_|_|_|_| |_|\__, | /_/ \_\_| \___|\__,_|
153
+ |___/
154
+ */
155
+
156
+ /* background when contact isn't selected */
157
+ .CallsTab__EmptyState {
158
+ background-color: #221D32 !important;
159
+ }
160
+
161
+ /* background when contact is selected */
162
+ .CallsTab__ConversationCallDetails {
163
+ background-color: #221D32 !important;
164
+ }
165
+
166
+ /* contact list sidebar item */
167
+ .CallsList__ItemTile:hover {
168
+ background-color: #3D3144 !important;
169
+ }
170
+
171
+ .CallsList__ItemTile[aria-selected="true"] {
172
+ background-color: #51455A !important;
173
+ }
174
+
175
+ .CallsNewCall_ItemActionButton {
176
+ background-color: #685870 !important;
177
+ }
178
+
179
+ /*
180
+ ____ _ _
181
+ / ___|| |_ ___ _ __ _ _ / \ _ __ ___ __ _
182
+ \___ \| __/ _ \| '__| | | | / _ \ | '__/ _ \/ _` |
183
+ ___) | || (_) | | | |_| | / ___ \| | | __/ (_| |
184
+ |____/ \__\___/|_| \__, | /_/ \_\_| \___|\__,_|
185
+ |___/
186
+ */
187
+
188
+ .Stories__placeholder {
189
+ background-color: #221D32 !important;
190
+ }
191
+
192
+ /*
193
+ _ _ ____ __ _ _
194
+ | | | |___ ___ _ __ | _ \ _ __ ___ / _(_) | ___
195
+ | | | / __|/ _ \ '__| | |_) | '__/ _ \| |_| | |/ _ \
196
+ | |_| \__ \ __/ | | __/| | | (_) | _| | | __/
197
+ \___/|___/\___|_| |_| |_| \___/|_| |_|_|\___|
198
+ */
199
+
200
+ /* background of user details panel */
201
+ .ConversationPanel,
202
+ .ConversationPanel__header {
203
+ background-color: #221D32 !important;
204
+ }
205
+
206
+ /* disappering message timer */
207
+ .module-select > select {
208
+ background-color: #3D3144 !important;
209
+ }
210
+
211
+ /* nickname, chatcolor, add to group and other button */
212
+ .ConversationDetails-panel-row__root--button:hover {
213
+ background-color: #3D3144 !important;
214
+ }
215
+
216
+ /* nickname edit menu*/
217
+ .Input__container {
218
+ background-color: #3D3144 !important;
219
+ border-color: #9399b2 !important;
220
+ }
221
+
222
+ /* add to group button background color */
223
+ .ConversationDetails-groups__add-to-group-icon {
224
+ background-color: #3D3144 !important;
225
+ }
226
+
227
+ /* the user profile, signal connection and safety number popup */
228
+ .module-Modal {
229
+ background-color: #221D32 !important;
230
+ }
231
+
232
+ /* mark as varified or clear verification button */
233
+ .module-SafetyNumberViewer__button > button {
234
+ background-color: #51455A !important;
235
+ }
236
+
237
+ /*
238
+ _
239
+ _ __ ___ (_)___ ___
240
+ | '_ ` _ \| / __|/ __|
241
+ | | | | | | \__ \ (__
242
+ |_| |_| |_|_|___/\___|
243
+ */
244
+
245
+ /* background when viewing image */
246
+ .Lightbox__animated {
247
+ background-color: #221D32 !important;
248
+ }
249
+
250
+ /* many of the buttons */
251
+ .module-Button {
252
+ background-color: #51455A !important;
253
+ }
254
+
255
+ .module-Button:hover {
256
+ background-color: #3D3144 !important;
257
+ }
258
+
259
+ /*
260
+ ____ _ _ _
261
+ / ___| ___| |_| |_(_)_ __ __ _ ___
262
+ \___ \ / _ \ __| __| | '_ \ / _` / __|
263
+ ___) | __/ |_| |_| | | | | (_| \__ \
264
+ |____/ \___|\__|\__|_|_| |_|\__, |___/
265
+ |___/
266
+ */
267
+
268
+ /* side pannel of settings */
269
+ .Preferences__page-selector {
270
+ background-color: #221D33 !important;
271
+ }
272
+
273
+ /* main settings pannel */
274
+ .Preferences, .Preferences__settings-pane {
275
+ background-color: #221D33 !important;
276
+ }
277
+
278
+ /* page selector selected background */
279
+ .Preferences__button--selected, .Preferences__profile-chip--selected {
280
+ background-color: #51455A !important;
281
+ }
282
+
283
+ .Preferences__profile-chip:focus, .Preferences__button:focus {
284
+ background-color: #3D3144 !important;
285
+ }
286
+
287
+ .Preferences__profile-chip:hover, .Preferences__button:hover {
288
+ background-color: #342C3A !important;
289
+ }
290
+
291
+ /* language and chat color button */
292
+ .Preferences__control--clickable:hover {
293
+ background-color: #3D3144 !important;
294
+ }
295
+
296
+ .module-Button--secondary--destructive {
297
+ color: #f38ba8 !important;
298
+ }
299
+
300
+ .AvatarEditor__button {
301
+ background-color: #51455A !important;
302
+ }
303
+
304
+ /*
305
+ ____ _ _
306
+ / ___|__ _| | |
307
+ | | / _` | | |
308
+ | |__| (_| | | |
309
+ \____\__,_|_|_|
310
+ */
311
+
312
+ .module-calling__container {
313
+ background-color: #221D32 !important;
314
+ }
315
+
316
+ /* cancel and settings button */
317
+ .CallSettingsButton__Button {
318
+ background-color: #3D3144 !important;
319
+ }
320
+
321
+ /* the bar at the bottom during calls */
322
+ .CallControls {
323
+ background-color: #3D3144 !important;
324
+ }
325
+
326
+ /* mike and camera button */
327
+ .CallingButton__icon {
328
+ background-color: #685870 !important;
329
+ }
330
+
331
+ /* your pfp box during call */
332
+ .module-calling__background {
333
+ background-color: #3D3144 !important;
334
+ }