松弛变量可以为负吗_如何为松弛安装(非官方)暗模式

松弛变量可以为负吗

松弛变量可以为负吗

Slack still doesn’t have a dark mode. They have dark themes, but those only let you customize the sidebar colors, leaving the main window white. With the release of system-wide dark modes on macOS Mojave and Windows 10, Slack feels very out of place.

Slack仍然没有暗模式。 它们具有深色主题,但这些主题仅允许您自定义侧边栏颜色,而使主窗口保持白色。 随着在macOS Mojave和Windows 10上发布的系统范围内的暗模式,Slack感觉很不合适。

This method is unofficial and involves digging around in the source files for Slack. It’s fairly easy to do, but since it will be overwritten every time you update, you will have to do this multiple times.

此方法是非官方的,涉及在Slack的源文件中进行挖掘。 这很容易做到,但是由于每次更新都会被覆盖,因此您必须多次执行此操作。

下载主题 (Downloading a Theme)

Since Slack runs on Electron, a framework for developing desktop Node.js apps, you can edit the styles for it like you’d edit the CSS of a website. But the CSS files for Slack are buried in the source, so you’ll have to load your own themes.

由于Slack在Electron(用于开发桌面Node.js应用程序的框架)上运行,因此您可以像编辑网站CSS一样为其编辑样式。 但是SlackCSS文件被隐藏在源代码中,因此您必须加载自己的主题。

The most popular true dark mode theme is slack-black-theme by Widget. And since Electron shares code across platforms, this theme will work on Windows and Linux as well. We found there were some issues with the theme on macOS Mojave though, so if it doesn’t work then you can try this fork, which says it works on macOS only but may work for Windows users as well.

最受欢迎的真正黑暗模式主题是Widget的“ slack-black-theme” 。 由于Electron跨平台共享代码,因此该主题也将在Windows和Linux上运行。 我们发现macOS Mojave上的主题存在一些问题,因此,如果该主题不起作用,则可以尝试使用fork ,它说它仅适用于macOS,但也可能适用于Windows用户。

修补松弛 (Patching Slack)

This part, you’ll have to do again every time Slack updates. On macOS, you can get to Slack’s source directory by right-clicking on the app itself and selecting “Show Package Contents”. On Windows, you’ll find it at ~\AppData\Local\slack\ .

这部分,每次Slack更新时,您都必须再次执行。 在macOS上,您可以通过右键单击应用程序本身并选择“显示软件包内容”来进入Slack的源目录。 在Windows上,您可以在~\AppData\Local\slack\找到它。

Then, navigate a few folders down to resources/app.asar.unpacked/src/static/ . You’re going to want to find the ssb-interop.js file, where you’ll edit the code. Make sure Slack is closed, open that file in your favorite text editor, and scroll to the bottom:

然后,将几个文件夹导航到resources/app.asar.unpacked/src/static/ 。 您将要找到ssb-interop.js文件,您将在其中编辑代码。 确保关闭了Slack,在您喜欢的文本编辑器中打开该文件,然后滚动到底部:

Copy and paste the following code at the very end of the ssb-interop.js file:

将以下代码复制并粘贴到ssb-interop.js文件的末尾:

// First make sure the wrapper app is loaded
document.addEventListener("DOMContentLoaded", function() {
// Then get its webviews
let webviews = document.querySelectorAll(".TeamView webview");
// Fetch our CSS in parallel ahead of time
const cssPath = 'https://cdn.rawgit.com/widget-/slack-black-theme/master/custom.css';
let cssPromise = fetch(cssPath).then(response => response.text());
let customCustomCSS = `
:root {
/* Modify these to change your theme colors: */
--primary: #09F;
--text: #CCC;
--background: #080808;
--background-elevated: #222;
}
`
// Insert a style tag into the wrapper view
cssPromise.then(css => {
let s = document.createElement('style');
s.type = 'text/css';
s.innerHTML = css + customCustomCSS;
document.head.appendChild(s);
});
// Wait for each webview to load
webviews.forEach(webview => {
webview.addEventListener('ipc-message', message => {
if (message.channel == 'didFinishLoading')
// Finally add the CSS into the webview
cssPromise.then(css => {
let script = `
let s = document.createElement('style');
s.type = 'text/css';
s.id = 'slack-custom-css';
s.innerHTML = \`${css + customCustomCSS}\`;
document.head.appendChild(s);
`
webview.executeJavaScript(script);
})
});
});
});

You’ll probably want to duplicate this file and save it in a different location, so you don’t have to edit the code every time. This way, you can just drag it into the directory to overwrite the newest version:

您可能需要复制此文件并将其保存在其他位置,因此您不必每次都编辑代码。 这样,您可以将其拖到目录中以覆盖最新版本:

After you’re done, reopen Slack, and after a few seconds the dark mode should kick in. The loading screen will still be white, but the main app window will blend in much better with the rest of your system:

完成后,重新打开Slack,几秒钟后,将进入黑暗模式。加载屏幕仍为白色,但主应用程序窗口将与系统的其余部分更好地融合在一起:

添加自己的主题 (Adding Your Own Themes)

If you don’t like the look of it, you can edit the CSS with any styles you want. All this code does is load custom styles from https://cdn.rawgit.com/widget-/slack-black-theme/master/custom.css; you can download that file, edit it with your changes, and replace the URL with your own code. Save, relaunch Slack, and your changes will be visible. If you don’t know CSS, or just want to make a minor change, there are four color variables defined before loading the CSS, so you can just edit those with your own colors.

如果您不喜欢它的外观,则可以使用所需的任何样式来编辑CSS。 这些代码所做的只是从https://cdn.rawgit.com/widget-/slack-black-theme/master/custom.css加载自定义样式; 您可以下载该文件,进行更改后进行编辑,然后将URL替换为自己的代码。 保存并重新启动Slack,您的更改将可见。 如果您不了解CSS,或者只是想作一些小的更改,则在加载CSS之前定义了四个颜色变量,因此您可以使用自己的颜色进行编辑。

翻译自: https://www.howtogeek.com/368976/how-to-install-the-unofficial-dark-mode-for-slack/

松弛变量可以为负吗

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/279138.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

如何使用系统自带的日志转储功能logroate.存放应用日志

Linux日志服务介绍 1. 在Linux系统,大部分日志都是由syslog日志服务驱动和管理的 syslog服务由两个重要的配置文件控制管理,分别是/etc/syslog.conf主配置文件和/etc/sysconfig/syslog辅助 配置文件, /etc/init.d/syslog是启动脚本…

shell 多行注释

:<<BLOCK 中间为要注释的内容 BLOCK转载于:https://www.cnblogs.com/S--S/p/9817660.html

natcat for mysql_用Navicat for mysql连接mysql报错1251-解决办法

TP框架连接mongodb报错及解决办法mongodb版本3.4.7 1.认证错误:Failed to connect to: localhost:27017: Authentication failed on database test ...Loadrunner参数化连接oracle、mysql数据源报错及解决办法Loadrunner参数化连接oracle.mysql数据源报错及解决办法 (本人系统是…

如何在Mac上设置FaceTime

FaceTime is Apple’s built-in video and audio calling app. It pairs with your iPhone and allows you to make phone calls on macOS. FaceTime是Apple的内置视频和音频通话应用程序。 它可以与iPhone配对使用&#xff0c;并允许您在macOS上拨打电话。 You don’t need an…

移动视频技术

在语音通信已得到教育、医疗、社交、电子商务等多个领域的移动应用和充分发展的今天&#xff0c;人们已不满足于仅依靠语音电话来传达信息。开发者都需要结合自身业务场景在其产品中嵌入语音聊天、视频通话、语音对讲等实时通话功能。但较高的技术门槛和开发成本成为普通开发者…

hashlib 模块用来进行hash

hashlib的基本概述&#xff1a; python中的 hashlib 模块用来进行hash 或者md5加密&#xff0c;而且这种加密是不可逆的&#xff0c;所以这种算法又被称为摘要算法&#xff0c; 其支持Opennssl库提供的所有算法&#xff0c;包括 md5、sha1、sha224、sha256、sha512 等。 hash是…

在Ubuntu 11.10中将窗口按钮移回右侧

As of Ubuntu 10.04, the minimize, maximize, and close buttons on all windows were moved to the left side and the system menu was removed. Prior to version 11.10, you could use several methods to restore the original button arrangement. 从Ubuntu 10.04开始&a…

java测试开发_测试开发系类之Java常用知识点

测试需要的两门语言&#xff1a;Java&#xff0c;Python测试开发&#xff1a;开发测试脚本->开发测试框架Java需要掌握内容&#xff1a;基础语法、Java面向对象相关概念、Java常用类、基础测试框架Java常用类&#xff1a;IO相关类&#xff0c;包括&#xff1a;字节流InputSt…

kafka 服务端消费者和生产者的配置

在kafka的安装目录下&#xff0c;config目录下有个名字叫做producer.properties的配置文件 #指定kafka节点列表&#xff0c;用于获取metadata&#xff0c;不必全部指定 #需要kafka的服务器地址&#xff0c;来获取每一个topic的分片数等元数据信息。 metadata.broker.listkafka0…

如何在Windows 10上使用触摸板手势

If you’ve used a touchpad in Windows 10, you’re no doubt aware of the basic single-finger tapping and two-finger scrolling gestures. Windows 10 also packs in some additional gestures you might not have tried. 如果您在Windows 10中使用了触摸板&#xff0c;那…

java全栈开发工程师_谈谈我对Java(J2EE)全栈工程师的理解

很多刚从事Java开发的同学都有一个疑问&#xff0c;到底是向全栈式程序员方向发展还是做精通某种技术的专才&#xff1f;对于这个问题也是见仁见智。 在给出我的观点之前&#xff0c;我们先来分析一下全栈工程师的种类和专才的种类 &#xff0c;之后关于这个问题的答案就很清楚…

多网卡命名规则

使用iptables做nat路由&#xff0c;需要几张网卡&#xff0c;以下命令很有用 1.首先你要先确认你系统加载的网卡&#xff0c;lspci|grep -i eth,如果出现unknow情况或者未识别&#xff0c;最好换网卡&#xff0c;或者是驱动没有加载&#xff0c;需要到/lib/modules的子目录driv…

相机模拟光圈_我的相机应该使用什么光圈?

相机模拟光圈Aperture, along with shutter speed and ISO, is one of the three most important settings you control when you take a photo. It affects both the amount of light that hits your camera sensor and the depth of field of your images. Let’s look at ho…

2018-2019-1 20165234 《信息安全系统设计基础》第四周学习总结

一、学习目标 了解ISA抽象的作用 掌握ISA&#xff0c;并能举一反三学习其他体系结构 了解流水线和实现方式二、学习内容 Y86-64指令 movq指令 irmovq rrmovq mrmovq rmmovq四个整数操指令 addq,subq,andq,xorq只对寄存器数据进行操作7个跳转指令 cmovle cmovl cmove cmovne cmo…

python数据库实例_Python3.6简单的操作Mysql数据库的三个实例

安装pymysql参考&#xff1a;https://github.com/PyMySQL/PyMySQL/pip install pymsql实例一import pymysql# 创建连接# 参数依次对应服务器地址&#xff0c;用户名&#xff0c;密码&#xff0c;数据库conn pymysql.connect(host127.0.0.1, userroot, passwd123456, dbdemo)# …

Python之钉钉机器人推送天气预报

通过Python脚本结合钉钉机器人&#xff0c;定时向钉钉群推送天气预报 #!/usr/bin/python # -*- coding: utf-8 -*- # Author: aikergdedu.ml # My blog http://m51cto.51cto.blog.com import requests import re import urllib2 import json import sys import osheaders {Co…

google +按钮_如何禁用或改善Google的Google+集成

google 按钮If you’ve used Google lately, you’ve probably seen Google taking over Google’s search results. You don’t have to put up with it — you can disable the integration, show better social-networking pages or hide those pesky Google notifications.…

P2680 运输计划

传送门 十分显然完成工作的时间和航耗时最长的运输计划有关 所以题目意思就是要求最大值最小 所以可以想到二分 把所有大于mid时间的航线打上标记&#xff0c;显然删边只能在所有这些航线的公共路径上 要如何快速打标记是个问题 二分已经有一个log&#xff0c;所以只能承受O(n)…

java 集合读写同步_JAVA多线程学习十六 - 同步集合类的应用

1.引言在多线程的环境中&#xff0c;如果想要使用容器类&#xff0c;就需要注意所使用的容器类是否是线程安全的。在最早开始&#xff0c;人们一般都在使用同步容器(Vector,HashTable),其基本的原理&#xff0c;就是针对容器的每一个操作&#xff0c;都添加synchronized来进行同…

Linux下的parted工具的使用 GPT分区安装系统

安装系统是安装前时候ctrlatlF2 fdisk -l parted select /dev/sdb mklabel msdos # 将GPT磁盘格式化为MBR磁盘 对大硬盘进行分区 xfs 和 ntfs Linux下的parted工具的使用也很简单&#xff0c;具体操作如下&#xff1a; rootme:/mnt# parted /dev/sda Using /dev/sda Welcome to…