Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 668092

Summary: net-im/slack-bin - add dark-theme USE
Product: Gentoo Linux Reporter: Denis Descheneaux <d.descheneaux>
Component: Current packagesAssignee: Vladimir Pavljuchenkov (SpiderX) <spiderx>
Status: RESOLVED WONTFIX    
Severity: enhancement CC: hydrapolic, jstein, mgorny, proxy-maint
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

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.