Merge pull request #9886 from geekpi/master

translated
This commit is contained in:
Xingyu.Wang 2018-08-20 08:52:52 +08:00 committed by GitHub
commit bc473a1af0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 76 additions and 77 deletions

View File

@ -1,77 +0,0 @@
translating---geekpi
Automatically Switch To Light / Dark Gtk Themes Based On Sunrise And Sunset Times With AutomaThemely
======
If you're looking for an easy way of automatically changing the Gtk theme based on sunrise and sunset times, give [AutomaThemely][3] a try.
![](https://4.bp.blogspot.com/-LS0XNNflbp0/W2q8zAwhUdI/AAAAAAAABUY/l8fVbjt-tHExYxPHsyVv74iUhV4O9UXLwCLcBGAs/s640/automathemely-settings.png)
**AutomaThemely is a Python application that automatically changes Gnome themes according to light and dark hours, useful if you want to use a dark Gtk theme at night and a light Gtk theme during the day.**
**While the application is made for the Gnome desktop, it also works with Unity**. AutomaThemely does not support changing the Gtk theme for desktop environments that don't make use of the `org.gnome.desktop.interface Gsettings` , like Cinnamon, or changing the icon theme, at least not yet. It also doesn't support setting the Gnome Shell theme.
Besides automatically changing the Gtk3 theme, **AutomaThemely can also automatically switch between dark and light themes for Atom editor and VSCode, as well as between light and dark syntax highlighting for Atom editor.** This is obviously also done based the time of day.
[![AutomaThemely Atom VSCode][1]][2]
AutomaThemely Atom and VSCode theme / syntax settings
The application uses your IP address to determine your location in order to retrieve the sunrise and sunset times, and requires a working Internet connection for this. However, you can disable automatic location from the application user interface, and enter your location manually.
From the AutomaThemely user interface you can also enter a time offset (in minutes) for the sunrise and sunset times, and enable or disable notifications on theme changes.
### Downloading / installing AutomaThemely
**Ubuntu 18.04** : using the link above, download the Python 3.6 DEB which includes dependencies (python3.6-automathemely_1.2_all.deb).
**Ubuntu 16.04:** you'll need to download and install the AutomaThemely Python 3.5 DEB which DOES NOT include dependencies (python3.5-no_deps-automathemely_1.2_all.deb), and install the dependencies (`requests` , `astral` , `pytz` , `tzlocal` and `schedule`) separately, using PIP3:
```
sudo apt install python3-pip
python3 -m pip install --user requests astral pytz tzlocal schedule
```
The AutomaThemely download page also includes RPM packages for Python 3.5 or 3.6, with and without dependencies. Install the package appropriate for your Python version. If you download the package that includes dependencies and they are not available on your system, grab the "no_deps" package and install the Python3 dependencies using PIP3, as explained above.
### Using AutomaThemely to change to light / dark Gtk themes based on Sun times
Once installed, run AutomaThemely once to generate the configuration file. Either click on the AutomaThemely menu entry or run this in a terminal:
```
automathemely
```
This doesn't run any GUI, it only generates the configuration file.
Using AutomaThemely is a bit counter intuitive. You'll get an AutomaThemely icon in your menu but clicking it does not open any window / GUI. If you use Gnome or some other Gnome-based desktop that supports jumplists / quicklists, you can right click the AutomaThemely icon in the menu (or you can pin it to Dash / dock and right click it there) and select Manage Settings to launch the GUI:
![](https://2.bp.blogspot.com/-7YWj07q0-M0/W2rACrCyO_I/AAAAAAAABUs/iaN_LEyRSG8YGM0NB6Aw9PLKmRU4NxzMACLcBGAs/s320/automathemely-jumplists.png)
You can also launch the AutomaThemely GUI from the command line, using:
```
automathemely --manage
```
**Once you configure the themes you want to use, you'll need to update the Sun times and restart the AutomaThemely scheduler**. You can do this by right clicking on the AutomaThemely icon (should work in Unity / Gnome) and selecting `Update sun times` , and then `Restart the scheduler` . You can also do this from a terminal, using these commands:
```
automathemely --update
automathemely --restart
```
--------------------------------------------------------------------------------
via: https://www.linuxuprising.com/2018/08/automatically-switch-to-light-dark-gtk.html
作者:[Logix][a]
选题:[lujun9972](https://github.com/lujun9972)
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://plus.google.com/118280394805678839070
[1]:https://4.bp.blogspot.com/-K2-1K_MIWv0/W2q9GEWYA6I/AAAAAAAABUg/-z_gTMSHlxgN-ZXDvUGIeTQ8I72WrRq0ACLcBGAs/s640/automathemely-settings_2.png (AutomaThemely Atom VSCode)
[2]:https://4.bp.blogspot.com/-K2-1K_MIWv0/W2q9GEWYA6I/AAAAAAAABUg/-z_gTMSHlxgN-ZXDvUGIeTQ8I72WrRq0ACLcBGAs/s1600/automathemely-settings_2.png
[3]:https://github.com/C2N14/AutomaThemely

View File

@ -0,0 +1,76 @@
使用 AutomaThemely 基于日出和日落时间自动切换到明/暗 Gtk 主题
======
如果你在寻找一种基于日出和日落时间自动更改 Gtk 主题的简单方法,请尝试一下 [AutomaThemely][3]。
![](https://4.bp.blogspot.com/-LS0XNNflbp0/W2q8zAwhUdI/AAAAAAAABUY/l8fVbjt-tHExYxPHsyVv74iUhV4O9UXLwCLcBGAs/s640/automathemely-settings.png)
**AutomaThemely 是一个 Python 程序,它可以根据光亮和黑暗时间自动更改 Gnome 主题,如果你想在夜间使用黑暗的 Gtk 主题并在白天使用明亮的 Gtk 主题,那么它非常有用。**
**虽然该程序是为 Gnome 桌面制作的,但它也适用于 Unity**。AutomaThemely 不支持不使用 “org.gnome.desktop.interface Gsettings” 的桌面环境,如 Cinnamon的 Gtk 主题,或者更改图标主题,至少现在还不行。它也不支持设置 Gnome Shell 主题。
除了自动更改 Gtk3 主题外,**AutomaThemely 还可以自动切换 Atom 编辑器和 VSCode 的明暗主题,以及 Atom 编辑器的明暗语法高亮。**这显然也是基于一天中的时间完成的。
[![AutomaThemely Atom VSCode][1]][2]
AutomaThemely Atom 和 VSCode 主题/语法设置
程序使用你的 IP 地址来确定你的位置,以便检索日出和日落时间,并且需要有可用的 Internet 连接。但是,你可以从程序用户界面禁用自动定位,并手动输入你的位置。
在 AutomaThemely 用户界面中,你还可以输入日出和日落时间的偏移(以分钟为单位),并启用或禁用主题更改的通知。
### 下载/安装 AutomaThemely
**Ubuntu 18.04**:使用上面的链接,下载包含依赖项的 Python 3.6 DEBpython3.6-automathemely_1.2_all.deb
**Ubuntu 16.04**:你需要下载并安装 AutomaThemely Python 3.5 DEB它不包含依赖项python3.5-no_deps-automathemely_1.2_all.deb并使用 PIP3 分别安装依赖项(`requests`、`astral `、`pytz`、`tzlocal` 和 `schedule`
```
sudo apt install python3-pip
python3 -m pip install --user requests astral pytz tzlocal schedule
```
AutomaThemely 下载页面还包含 Python 3.5 或 3.6 的 RPM 包,有包含和不包含依赖项。安装适合你的 Python 版本的软件包。如果你下载了包含依赖项的包但无法在你的系统上使用,请下载 “no_deps” 包并如上所述使用 PIP3 安装 Python3 依赖项。
### 使用 AutomaThemely 根据太阳时间更改明亮/黑暗 Gtk 主题
安装完成后,运行 AutomaThemely 一次以生成配置文件。单击 AutomaThemely 菜单条目或在终端中运行:
```
automathemely
```
这不会运行任何 GUI它只生成配置文件。
使用 AutomaThemely 有点反直觉。你将在菜单中看到 AutomaThemely 图标,但单击它不会打开任何窗口/GUI。如果你使用支持列表跳转/快捷列表的 Gnome 或其他基于 Gnome 的桌面,你可以右键单击菜单中的 AutomaThemely 图标(或者你可以将其固定为 Dash/dock 并在那里右键单击它)并选择 Manage Settings 启动GUI
![](https://2.bp.blogspot.com/-7YWj07q0-M0/W2rACrCyO_I/AAAAAAAABUs/iaN_LEyRSG8YGM0NB6Aw9PLKmRU4NxzMACLcBGAs/s320/automathemely-jumplists.png)
你还可以使用以下命令从命令行启动 AutomaThemely GUI
```
automathemely --manage
```
**配置要使用的主题后,你需要更新太阳的时间并重新启动 AutomaThemely 调度器**。你可以通过右键单击 AutomaThemely 图标(应该在 Unity/Gnome 中可用)并选择 `Update sun times`,然后选择 `Restart the scheduler` 来完成此操作。你也可以使用以下命令从终端执行此操作:
```
automathemely --update
automathemely --restart
```
--------------------------------------------------------------------------------
via: https://www.linuxuprising.com/2018/08/automatically-switch-to-light-dark-gtk.html
作者:[Logix][a]
选题:[lujun9972](https://github.com/lujun9972)
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://plus.google.com/118280394805678839070
[1]:https://4.bp.blogspot.com/-K2-1K_MIWv0/W2q9GEWYA6I/AAAAAAAABUg/-z_gTMSHlxgN-ZXDvUGIeTQ8I72WrRq0ACLcBGAs/s640/automathemely-settings_2.png (AutomaThemely Atom VSCode)
[2]:https://4.bp.blogspot.com/-K2-1K_MIWv0/W2q9GEWYA6I/AAAAAAAABUg/-z_gTMSHlxgN-ZXDvUGIeTQ8I72WrRq0ACLcBGAs/s1600/automathemely-settings_2.png
[3]:https://github.com/C2N14/AutomaThemely