Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 668092 - net-im/slack-bin - add dark-theme USE
Summary: net-im/slack-bin - add dark-theme USE
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement with 1 vote (vote)
Assignee: Vladimir Pavljuchenkov (SpiderX)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-08 20:43 UTC by Denis Descheneaux
Modified: 2018-10-11 20:35 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Denis Descheneaux 2018-10-08 20:43:45 UTC
To add a choice from bright white normal and dark theme if wanted

editing the ebuild

-IUSE="plasma"
+IUSE="plasma dark-theme"

and 

src_prepare() {
	rm etc/cron.daily/slack \
	   usr/lib/slack/LICENSE
+	if use dark-theme; then
+		eapply "${FILESDIR}"/slack-dark-theme.patch
+	fi
	eapply_user
}


and patch for files/ folder:
slack-dark-theme.patch

--- /usr/lib/slack/resources/app.asar.unpacked/src/static/ssb-interop.js
+++ /usr/lib/slack/resources/app.asar.unpacked/src/static/ssb-interop.js
@@ -96,4 +96,14 @@
   const isDevMode = loadSettings.devMode && isPrebuilt();
 
   init(resourcePath, mainModule, !isDevMode);
+
+document.addEventListener('DOMContentLoaded', function() {
+ $.ajax({
+  url: 'https://raw.githubusercontent.com/laCour/slack-night-mode/master/css/raw/black.css',
+  success: function(css) {
+   $("<style></style>").appendTo('head').html(css);
+  }
+ });
+});
+
 }
Comment 1 Tomáš Mózes 2018-10-09 04:26:13 UTC
Are you sure adding an official use flag for something downloaded from non-maintainer github account from the master branch is also good from the security perspective?
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-10-11 20:35:47 UTC
This is something that normally belongs in configuration, and not in conditional patching.  Furthermore, patching software to implicitly load remote resources without any verification is a horrible idea from security PoV.