Merge remote-tracking branch 'LCTT/master'

This commit is contained in:
Xingyu Wang 2019-08-12 11:46:20 +08:00
commit 58a6cd9db4
4 changed files with 229 additions and 238 deletions

View File

@ -0,0 +1,183 @@
[#]: collector: (lujun9972)
[#]: translator: (wxy)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-11216-1.html)
[#]: subject: (Use a drop-down terminal for fast commands in Fedora)
[#]: via: (https://fedoramagazine.org/use-a-drop-down-terminal-for-fast-commands-in-fedora/)
[#]: author: (Guilherme Schelp https://fedoramagazine.org/author/schelp/)
在 Fedora 下使用下拉式终端更快输入命令
======
![][1]
下拉式终端可以一键打开,并快速输入桌面上的任何命令。通常它会以平滑的方式创建终端,有时会带有下拉效果。本文演示了如何使用 Yakuake、Tilda、Guake 和 GNOME 扩展等下拉式终端来改善和加速日常任务。
### Yakuake
[Yakuake][2] 是一个基于 KDE Konsole 技术的下拉式终端模拟器。它以 GNU GPLv2 条款分发。它包括以下功能:
* 从屏幕顶部平滑地滚下
* 标签式界面
* 尺寸和动画速度可配置
* 换肤
* 先进的 D-Bus 接口
要安装 Yakuake请使用以下命令
```
$ sudo dnf install -y yakuake
```
#### 启动和配置
如果你运行 KDE请打开系统设置然后转到“启动和关闭”。将“yakuake”添加到“自动启动”下的程序列表中如下所示
![][3]
Yakuake 运行时很容易配置,首先在命令行启动该程序:
```
$ yakuake &
```
随后出现欢迎对话框。如果标准的快捷键和你已经使用的快捷键冲突,你可以设置一个新的。
![][4]
点击菜单按钮,出现如下帮助菜单。接着,选择“配置 Yakuake……”访问配置选项。
![][5]
你可以自定义外观选项,例如透明度、行为(例如当鼠标指针移过它们时聚焦终端)和窗口(如大小和动画)。在窗口选项中,你会发现当你使用两个或更多监视器时最有用的选项之一:“在鼠标所在的屏幕上打开”。
#### 使用 Yakuake
主要的快捷键有:
* `F12` = 打开/撤回 Yakuake
* `Ctrl+F11` = 全屏模式
* `Ctrl+)` = 上下分割
* `Ctrl+(` = 左右分割
* `Ctrl+Shift+T` = 新会话
* `Shift+Right` = 下一个会话
* `Shift+Left` = 上一个会话
* `Ctrl+Alt+S` = 重命名会话
以下是 Yakuake 像[终端多路复用器][6]一样分割会话的示例。使用此功能,你可以在一个会话中运行多个 shell。
![][7]
### Tilda
[Tilda][8] 是一个下拉式终端,可与其他流行的终端模拟器相媲美,如 GNOME 终端、KDE 的 Konsole、xterm 等等。
它具有高度可配置的界面。你甚至可以更改终端大小和动画速度等选项。Tilda 还允许你启用热键,以绑定到各种命令和操作。
要安装 Tilda请运行以下命令
```
$ sudo dnf install -y tilda
```
#### 启动和配置
大多数用户更喜欢在登录时就在后台运行一个下拉式终端。要设置此选项,请首先转到桌面上的应用启动器,搜索 Tilda然后将其打开。
接下来,打开 Tilda 配置窗口。 选择“隐藏启动 Tilda”即启动时不会立即显示终端。
![][9]
接下来,你要设置你的桌面自动启动 Tilda。如果你使用的是 KDE请转到“系统设置 > 启动与关闭 > 自动启动”并“添加一个程序”。
![][10]
如果你正在使用 GNOME则可以在终端中运行此命令
```
$ ln -s /usr/share/applications/tilda.desktop ~/.config/autostart/
```
当你第一次运行它时,会出现一个向导来设置首选项。如果需要更改设置,请右键单击终端并转到菜单中的“首选项”。
![][11]
你还可以创建多个配置文件,并绑定其他快捷键以在屏幕上的不同位置打开新终端。为此,请运行以下命令:
```
$ tilda -C
```
每次使用上述命令时Tilda 都会在名为 `~/.config/tilda/` 文件夹中创建名为 `config_0`、`config_1` 之类的新配置文件。然后,你可以映射组合键以打开具有一组特定选项的新 Tilda 终端。
#### 使用 Tilda
主要快捷键有:
* `F1` = 拉下终端 Tilda注意如果你有多个配置文件快捷方式是 F1、F2、F3 等)
* `F11` = 全屏模式
* `F12` = 切换透明模式
* `Ctrl+Shift+T` = 添加标签
* `Ctrl+Page Up` = 下一个标签
* `Ctrl+Page Down` = 上一个标签
### GNOME 扩展
Drop-down Terminal [GNOME 扩展][12]允许你在 GNOME Shell 中使用这个有用的工具。它易于安装和配置,使你可以快速访问终端会话。
#### 安装
打开浏览器并转到[此 GNOME 扩展的站点][12]。启用扩展设置为“On”如下所示
![][13]
然后选择“Install”以在系统上安装扩展。
![][14]
执行此操作后,无需设置任何自动启动选项。只要你登录 GNOME扩展程序就会自动运行
#### 配置
安装后,将打开 Drop-down Terminal 配置窗口以设置首选项。例如,可以设置终端大小、动画、透明度和使用滚动条。
![][15]
如果你将来需要更改某些首选项,请运行 `gnome-shell-extension-prefs` 命令并选择“Drop Down Terminal”。
#### 使用该扩展
快捷键很简单:
* 反尖号 (通常是 `Tab` 键上面的一个键) = 打开/撤回终端
* `F12` (可以定制) = 打开/撤回终端
--------------------------------------------------------------------------------
via: https://fedoramagazine.org/use-a-drop-down-terminal-for-fast-commands-in-fedora/
作者:[Guilherme Schelp][a]
选题:[lujun9972][b]
译者:[wxy](https://github.com/wxy)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://fedoramagazine.org/author/schelp/
[b]: https://github.com/lujun9972
[1]: https://fedoramagazine.org/wp-content/uploads/2019/07/dropdown-terminals-816x345.jpg
[2]: https://kde.org/applications/system/org.kde.yakuake
[3]: https://fedoramagazine.org/wp-content/uploads/2019/07/auto_start-1024x723.png
[4]: https://fedoramagazine.org/wp-content/uploads/2019/07/yakuake_config-1024x419.png
[5]: https://fedoramagazine.org/wp-content/uploads/2019/07/yakuake_config_01.png
[6]: https://fedoramagazine.org/4-cool-terminal-multiplexers/
[7]: https://fedoramagazine.org/wp-content/uploads/2019/07/yakuake_usage.gif
[8]: https://github.com/lanoxx/tilda
[9]: https://fedoramagazine.org/wp-content/uploads/2019/07/tilda_startup.png
[10]: https://fedoramagazine.org/wp-content/uploads/2019/07/tilda_startup_alt.png
[11]: https://fedoramagazine.org/wp-content/uploads/2019/07/tilda_config.png
[12]: https://extensions.gnome.org/extension/442/drop-down-terminal/
[13]: https://fedoramagazine.org/wp-content/uploads/2019/07/gnome-shell-install_2-1024x455.png
[14]: https://fedoramagazine.org/wp-content/uploads/2019/07/gnome-shell-install_3.png
[15]: https://fedoramagazine.org/wp-content/uploads/2019/07/gnome-shell-install_4.png

View File

@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@ -1,193 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Use a drop-down terminal for fast commands in Fedora)
[#]: via: (https://fedoramagazine.org/use-a-drop-down-terminal-for-fast-commands-in-fedora/)
[#]: author: (Guilherme Schelp https://fedoramagazine.org/author/schelp/)
Use a drop-down terminal for fast commands in Fedora
======
![][1]
A **drop-down terminal** lets you tap a key and quickly enter any command on your desktop. Often it creates a terminal in a smooth way, sometimes with effects. This article demonstrates how it helps to improve and speed up daily tasks, using drop-down terminals like Yakuake, Tilda, Guake and a GNOME extension.
### Yakuake
[Yakuake][2] is a drop-down terminal emulator based on KDE Konsole techonology. It is distributed under the terms of the GNU GPL Version 2. It includes features such as:
* Smoothly rolls down from the top of your screen
* Tabbed interface
* Configurable dimensions and animation speed
* Skinnable
* Sophisticated D-Bus interface
To install Yakuake, use the following command:
```
$ sudo dnf install -y yakuake
```
#### Startup and configuration
If youre runnign KDE, open the System Settings and go to _Startup and Shutdown_. Add _yakuake_ to the list of programs under _Autostart_, like this:
![][3]
Its easy to configure Yakuake while running the app. To begin, launch the program at the command line:
```
$ yakuake &
```
The following welcome dialog appears. You can set a new keyboard shortcut if the standard one conflicts with another keystroke you already use:
![][4]
Now click the menu button, and the following help menu appears. Next, select _Configure Yakuake…_ to access the configuration options.
![][5]
You can customize the options for appearance, such as opacity; behavior, such as focusing terminals when the mouse pointer is moved over them; and window, such as size and animation. In the window options youll find one of the most useful options is you use two or more monitors: _Open on screen: At mouse location_.
#### Using Yakuake
The main shortcuts are:
* **F12** = Open/Retract Yakuake
* **Ctrl+F11** = Full Screen Mode
* **Ctrl+)** = Split Top/Bottom
* **Ctrl+(** = Split Left/Right
* **Ctrl+Shift+T** = New Session
* **Shift+Right** = Next Session
* **Shift+Left** = Previous Session
* **Ctrl+Alt+S** = Rename Session
Below is an example of Yakuake being used to split the session like a [terminal multiplexer][6]. Using this feature, you can run several shells in one session.
![][7]
### Tilda
[Tilda][8] is a drop-down terminal that compares with other popular terminal emulators such as GNOME Terminal, KDEs Konsole, xterm, and many others.
It features a highly configurable interface. You can even change options such as the terminal size and animation speed. Tilda also lets you enable hotkeys you can bind to commands and operations.
To install Tilda, run this command:
```
$ sudo dnf install -y tilda
```
#### Startup and configuration
Most users prefer to have a drop-down terminal available behind the scenes when they login. To set this option, first go to the app launcher in your desktop, search for Tilda, and open it.
Next, open up the Tilda Config window. Select _Start Tilda hidden_, which means it will not display a terminal immediately when started.
![][9]
Next, youll set your desktop to start Tilda automatically. If youre using KDE, go to _System Settings_ > _Startup and Shutdown_ > _Autostart_ and use _Add a Program_.
![][10]
If youre using GNOME, you can run this command in a terminal:
```
$ ln -s /usr/share/applications/tilda.desktop ~/.config/autostart/
```
When you run for the first time, a wizard shows up to set your preferences. If you need to change something, right click and go to _Preferences_ in the menu.
![][11]
You can also create multiple configuration files, and bind other keys to open new terminals at different places on the screen. To do that, run this command:
```
$ tilda -C
```
Every time you use the above command, Tilda creates a new config file located in the _~/.config/tilda/_ folder called _config_0_, _config_1_, and so on. You can then map a key combination to open a new Tilda terminal with a specific set of options.
#### Using Tilda
The main shortcuts are:
* **F1** = Pull Down Terminal Tilda (Note: If you have more than one config file, the shortcuts are the same, with a diferent _open/retract_ shortcut like F1, F2, F3, and so on)
* **F11** = Full Screen Mode
* **F12** = Toggle Transparency
* **Ctrl+Shift+T** = Add Tab
* **Ctrl+Page Up** = Go to Next Tab
* **Ctrl+Page Down** = Go to Previous Tab
### GNOME Extension
The Drop-down Terminal [GNOME Extension][12] lets you use this useful tool in your GNOME Shell. It is easy to install and configure, and gives you fast access to a terminal session.
#### Installation
Open a browser and go to the [site for this GNOME extension][12]. Enable the extension setting to _On_, as shown here:
![][13]
Then select _Install_ to install the extension on your system.
![][14]
Once you do this, theres no reason to set any autostart options. The extension will automatically run whenever you login to GNOME!
#### Configuration
After install, the Drop Down Terminal configuration window opens to set your preferences. For example, you can set the size of the terminal, animation, transparency, and scrollbar use.
![][15]
If you need change some preferences in the future, run the _gnome-shell-extension-prefs_ command and choose _Drop Down Terminal_.
#### Using the extension
The shortcuts are simple:
* **`** (usually the key above **Tab**) = Open/Retract Terminal
* **F12** (customize as you prefer) = Open/Retract Terminal
* * *
--------------------------------------------------------------------------------
via: https://fedoramagazine.org/use-a-drop-down-terminal-for-fast-commands-in-fedora/
作者:[Guilherme Schelp][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://fedoramagazine.org/author/schelp/
[b]: https://github.com/lujun9972
[1]: https://fedoramagazine.org/wp-content/uploads/2019/07/dropdown-terminals-816x345.jpg
[2]: https://kde.org/applications/system/org.kde.yakuake
[3]: https://fedoramagazine.org/wp-content/uploads/2019/07/auto_start-1024x723.png
[4]: https://fedoramagazine.org/wp-content/uploads/2019/07/yakuake_config-1024x419.png
[5]: https://fedoramagazine.org/wp-content/uploads/2019/07/yakuake_config_01.png
[6]: https://fedoramagazine.org/4-cool-terminal-multiplexers/
[7]: https://fedoramagazine.org/wp-content/uploads/2019/07/yakuake_usage.gif
[8]: https://github.com/lanoxx/tilda
[9]: https://fedoramagazine.org/wp-content/uploads/2019/07/tilda_startup.png
[10]: https://fedoramagazine.org/wp-content/uploads/2019/07/tilda_startup_alt.png
[11]: https://fedoramagazine.org/wp-content/uploads/2019/07/tilda_config.png
[12]: https://extensions.gnome.org/extension/442/drop-down-terminal/
[13]: https://fedoramagazine.org/wp-content/uploads/2019/07/gnome-shell-install_2-1024x455.png
[14]: https://fedoramagazine.org/wp-content/uploads/2019/07/gnome-shell-install_3.png
[15]: https://fedoramagazine.org/wp-content/uploads/2019/07/gnome-shell-install_4.png

View File

@ -7,45 +7,46 @@
[#]: via: (https://www.ostechnix.com/how-to-set-up-time-synchronization-on-ubuntu/)
[#]: author: (sk https://www.ostechnix.com/author/sk/)
How To Set Up Time Synchronization On Ubuntu
如何在 Ubuntu 上设置时间同步
======
![Set Up Time Synchronization On Ubuntu][1]
You might have set up [**cron jobs**][2] that runs at a specific time to backup important files or perform any system related tasks. Or, you might have configured a [**log server to rotate the logs**][3] out of your system at regular interval time. If your clock is out-of-sync, these jobs will not execute at the desired time. This is why setting up a correct time zone on the Linux systems and keep the clock synchronized with Internet is important. This guide describes how to set up time synchronization on Ubuntu Linux. The steps given below have been tested on Ubuntu 18.04, however they are same for other Ubuntu-based systems that uses systemds **timesyncd** service.
你可能设置过 [**cron 任务**][2] 来在特定时间备份重要文件或执行系统相关任务。也许你配置了一个[**日志服务**][3]在特定时间间隔轮转日志。如果你的时钟不同步,这些任务将无法按时执行。这就是要在 Linux 系统上设置正确的时区并保持时钟与 Internet 同步的原因。本指南介绍如何在 Ubuntu Linux 上设置时间同步。下面的步骤已经在 Ubuntu 18.04 上进行了测试,但是对于使用 systemd 的 **timesyncd** 服务的其他基于 Ubuntu 的系统它们是相同的。
### Set Up Time Synchronization On Ubuntu
Usually, we set time zone during installation. You can however change it or set different time zone if you want to.
### 在 Ubuntu 上设置时间同步
First, let us see the current time zone in our Ubuntu system using “date” command:
通常,我们在安装时设置时区。但是,你可以根据需要更改或设置不同的时区。
首先,让我们使用 “date” 命令查看 Ubuntu 系统中的当前时区:
```
$ date
```
Sample output:
示例输出:
```
Tue Jul 30 11:47:39 UTC 2019
```
As you see in the above output, the “date” command shows the actual date as well as the current time. Here, my current time zone is **UTC** which stands for **Coordinated Universal Time**.
如上所见“date” 命令显示实际日期和当前时间。这里,我当前的时区是 **UTC**,代表**协调世界时**。
Alternatively, you can look up the **/etc/timezone** file to find the current time zone.
或者,你可以在 **/etc/timezone** 文件中查找当前时区。
```
$ cat /etc/timezone
UTC
```
Now, let us see if the clock is synchronized with Internet. To do so, simply run:
现在,让我们看看时钟是否与 Internet 同步。只需运行:
```
$ timedatectl
```
Sample output:
示例输出:
```
Local time: Tue 2019-07-30 11:53:58 UTC
@ -57,23 +58,23 @@ systemd-timesyncd.service active: yes
RTC in local TZ: no
```
As you can see, the “timedatectl” command displays the local time, universal time, time zone and whether the system clock is synchronized with Internet servers and if the **systemd-timesyncd.service** is active or inactive. In my case, the system clock is synchronizing with Internet time servers.
如你所见“timedatectl” 命令显示本地时间、世界时、时区以及系统时钟是否与 Internet 服务器同步,以及 **systemd-timesyncd.service** 是处于活动状态还是非活动状态。就我而言,系统时钟已与 Internet 时间服务器同步。
If the clock is out-of-sync, you would see **“System clock synchronized: no”** as shown in the below screenshot.
如果时钟不同步,你会看到下面截图中显示的 **“System clock synchronized: no”**。
![][4]
Time synchronization is disabled.
时间同步已禁用。
Note: The above screenshot is old one. Thats why you see the different date.
注意:上面的截图是旧截图。这就是你看到不同日期的原因。
If you see **“System clock synchronized:** value set as **no** , the timesyncd service might be inactive. So, simply restart the service and see if it helps.
如果你看到 **“System clock synchronized:** 值设置为 **no**,那么 timeyncd 服务可能处于非活动状态。因此,只需重启服务并看下是否正常。
```
$ sudo systemctl restart systemd-timesyncd.service
```
Now check the timesyncd service status:
现在检查 timesyncd 服务状态:
```
$ sudo systemctl status systemd-timesyncd.service
@ -99,50 +100,50 @@ Jul 30 10:50:35 ubuntuserver systemd-timesyncd[498]: Network configuration chang
Jul 30 10:51:06 ubuntuserver systemd-timesyncd[498]: Synchronized to time server [2001:67c:1560:800
```
If this service is enabled and active, your system clock should sync with Internet time servers.
如果此服务已启用并处于活动状态,那么系统时钟应与 Internet 时间服务器同步。
You can verify if the time synchronization is enabled or not using command:
你可以使用命令验证是否启用了时间同步:
```
$ timedatectl
```
If it still not works, run the following command to enable the time synchronization:
如果仍然不起作用,请运行以下命令以启用时间同步:
```
$ sudo timedatectl set-ntp true
```
Now your system clock will synchronize with Internet time servers.
现在,你的系统时钟将与 Internet 时间服务器同步。
##### Change time zone using Timedatectl command
##### 使用 timedatectl 命令更改时区
What if I want to use different time zone other than UTC? It is easy!
如果我想使用 UTC 以外的其他时区怎么办?这很容易!
First, list of available time zones using command:
首先,使用命令列出可用时区:
```
$ timedatectl list-timezones
```
You will see an output similar to below image.
你将看到类似于下图的输出。
![][5]
List time zones using timedatectl command
使用 timedatectl 命令列出时区
You can set the desired time zone(E.g. Asia/Kolkata) using command:
你可以使用以下命令设置所需的时区例如Asia/Kolkata
```
$ sudo timedatectl set-timezone Asia/Kolkata
```
Check again if the time zone has been really changed using “date” command:
使用 “date” 命令再次检查时区是否已真正更改:
**$ date**
Tue Jul 30 17:52:33 **IST** 2019
Or, use timedatectl command if you want the detailed output:
或者,如果需要详细输出,请使用 timedatectl 命令:
```
$ timedatectl
@ -155,31 +156,31 @@ systemd-timesyncd.service active: yes
RTC in local TZ: no
```
As you noticed, I have changed the time zone from UTC to IST (Indian standard time).
如你所见,我已将时区从 UTC 更改为 IST印度标准时间
To switch back to UTC time zone, simply run:
要切换回 UTC 时区,只需运行:
```
$ sudo timedatectl set-timezone UTC
```
##### Change time zone using Tzdata
##### 使用 tzdata 更改时区
In older Ubuntu versions, the Timedatectl command is not available. In such cases, you can use **Tzdata** (Time zone data) to set up time synchronization.
在较旧的 Ubuntu 版本中,没有 timedatectl 命令。这种情况下,你可以使用 **tzdata**Time zone data来设置时间同步。
```
$ sudo dpkg-reconfigure tzdata
```
Choose the geographic area in which you live. In my case, I chose **Asia**. Select OK and hit ENTER key.
选择你居住的地理区域。对我而言,我选择 **Asia**。选择 OK然后按回车键。
![][6]
Next, select the city or region corresponding to your time zone. Here Ive chosen **Kolkata**.
接下来,选择与你的时区对应的城市或地区。这里,我选择了 **Kolkata**
![][7]
Finally, you will see an output something like below in the Terminal.
最后,你将在终端中看到类似下面的输出。
```
Current default time zone: 'Asia/Kolkata'
@ -187,29 +188,29 @@ Local time is now: Tue Jul 30 19:29:25 IST 2019.
Universal Time is now: Tue Jul 30 13:59:25 UTC 2019.
```
##### Configure time zone in graphical mode
##### 在图形模式下配置时区
Some users may not be comfortable with CLI way. If youre one of them, you can easily change do all this from system settings panel in graphical mode.
有些用户可能对命令行方式不太满意。如果你是其中之一,那么你可以轻松地在图形模式的系统设置面板中进行设置。
Hit the **Super key** (Windows key), type **settings** in the Ubuntu dash and click on **Settings** icon.
点击**超级键**Windows 键在Ubuntu dash 中输入 **settings**,然后点击 **Settings** 图标。
![][8]
Launch Systems settings from Ubuntu dash
从 Ubuntu dash 启动系统的设置
Alternatively, click on the down arrow located at the top right corner of your Ubuntu desktop and click the Settings icon in the left corner.
或者,单击位于 Ubuntu 桌面右上角的向下箭头,然后单击左上角的 “Settings” 图标。
![][9]
Launch Systems settings from top panel
从顶部面板启动系统的设置
In the next window, choose **Details** and then Click **Date & Time** option. Turn on both **Automatic Date & Time** and **Automatic Time Zone** options.
在下一个窗口中,选择 **Details**,然后单击 **Date & Time** 选项。打开 **Automatic Date & Time****Automatic Time Zone**
![][10]
Set automatic time zone in Ubuntu
在 Ubuntu 中设置自动时区
Close the Settings window an youre done! Your system clock should now sync with Internet time servers.
关闭设置窗口就行了!你的系统始终应该与 Internet 时间服务器同步了。
--------------------------------------------------------------------------------