如何使用Xmonad,Linux的平铺窗口管理器

image

Tiling window managers make your life easier by automatically arranging windows on the screen for you. Xmonad is a minimal one that’s easy to get started with — all you have to do is learn a few keyboard shortcuts.

平铺窗口管理器通过自动在屏幕上排列窗口来简化您的生活。 Xmonad是一个简单易用的最小版本-您要做的就是学习一些键盘快捷键。

Xmonad is also highly configurable. In spite of this, you don’t have to touch the configuration file if you don’t want to – it works out of the box.

Xmonad也是高度可配置的。 尽管如此,如果您不想的话,也不必触摸配置文件-它可以直接使用。

安装 (Installation)

Xmonad doesn’t include an application launcher by default. You’ll probably also want dmenu, a basic application launcher that works with xmonad. To install both on Ubuntu, run the following command:

Xmonad默认情况下不包括应用程序启动器。 您可能还需要dmenu,它是与xmonad一起使用的基本应用程序启动器。 要在Ubuntu上同时安装两者,请运行以下命令:

sudo apt-get install xmonad suckless-tools

sudo apt-get install xmonad suckless-tools

image

Omit suckless-tools from the command if you’d rather not install dmenu. This package contains dmenu – if you’re using an older version of Ubuntu, you may have to install dwm-tools instead.

如果您不想安装dmenu,请从命令中忽略suckless-tools 。 该软件包包含dmenu –如果您使用的是旧版Ubuntu,则可能必须安装dwm-tools

If you’re using another Linux distribution, you should find xmonad and dmenu in its repositories, too.

如果您使用的是其他Linux发行版,则还应该在其存储库中找到xmonad和dmenu。

After installing xmonad, log out of your Ubuntu system, click the icon next to your name on the login screen, and select XMonad before logging back in.

安装xmonad之后,注销您的Ubuntu系统,在登录屏幕上单击您的名称旁边的图标,然后选择XMonad,然后再登录。

image

入门 (Getting Started)

This is what you’ll see when you start xmonad:

这是启动xmonad时会看到的内容:

image

Don’t worry, it didn’t fail to load — it just starts with an empty screen. Press Alt+Shift+Enter to launch a terminal.

不用担心,它并非没有加载-它只是从一个空白屏幕开始。 按Alt + Shift + Enter启动终端。

image

To launch additional terminals, press the Alt+Shift+Enter shortcut again. Xmonad automatically resizes and arranges the windows on screen, tiling them. This is what a “tiling window manager” does.

要启动其他终端,请再次按Alt + Shift + Enter快捷键。 Xmonad会自动调整大小并在屏幕上排列窗口,并将它们平铺。 这就是“平铺窗口管理器”的作用。

image

To move the focus using the keyboard, use the Alt+J or Alt+K keyboard shortcuts. The focus also follows the mouse, so all you have to do is hover your cursor over a window to focus it.

要使用键盘移动焦点,请使用Alt + JAlt + K键盘快捷键。 焦点也跟随鼠标,因此您所要做的就是将光标悬停在窗口上以使其聚焦。

Use the Alt+Space keyboard shortcut to switch between the different tiling modes. One of the modes shows only one window on the screen at a time.

使用Alt + Space键盘快捷键可以在不同的拼贴模式之间切换。 其中一种模式一次仅在屏幕上显示一个窗口。

image

If you installed dmenu, you can press Alt+P to pull it up. Type the first few letters of an application’s name, and then press Enter to launch it.

如果安装了dmenu,则可以按Alt + P将其向上拉。 键入应用程序名称的前几个字母,然后按Enter启动它。

image

Graphical applications like Firefox appear tiled, just like the terminal windows.

像Firefox一样,图形应用程序也像终端窗口一样平铺显示。

image

Here are some other important keyboard shortcuts to get you started:

以下是一些其他重要的键盘快捷键可以帮助您入门:

  • Alt+Shift+C – Close the focused window.

    Alt + Shift + C –关闭焦点窗口。

  • Alt+. & Alt+, – Control the number of windows displayed in the master pane on the left.

    Alt +。Alt +, –控制左侧主窗格中显示的窗口数。

  • Alt+Enter – Move the focused window to the master pane on the left.

    Alt + Enter –将聚焦的窗口移到左侧的主窗格中。

  • Alt+Shift+J & Alt+Shift+K – Swap the focused window with an adjacent window.

    Alt + Shift + JAlt + Shift + K –将聚焦的窗口与相邻的窗口交换。

  • Alt+H & Alt+L – Resize the border between the master and secondary panes.

    Alt + HAlt + L –调整主窗格和辅助窗格之间的边框大小。

  • Alt+Shift+Q – Log out.

    Alt + Shift + Q –注销。

Xmonad supports workspaces, too. For example, to switch to workspace two, use the Alt+2 keyboard shortcut. To move the currently focused window to workspace three, use the Alt+Shift+3 keyboard shortcut. Each workspace can have its own tiling mode settings.

Xmonad也支持工作区。 例如,要切换到两个工作区,请使用Alt + 2键盘快捷键。 要将当前聚焦的窗口移至工作区3,请使用Alt + Shift + 3键盘快捷键。 每个工作空间可以具有自己的拼贴模式设置。

配置Xmonad (Configuring Xmonad)

Xmonad is extremely configurable, if you’re willing to get your hands dirty. Xmonad itself is written in Haskell, and its configuration file format uses Haskell, too. Xmonad’s configuration file is located at ~/.xmonad/xmonad.hs (that is, /home/YOU/.xmonad/xmonad.hs). This file doesn’t exist by default – you’ll have to create it yourself.

如果您愿意动手,Xmonad的配置能力非常好。 Xmonad本身是用Haskell编写的,其配置文件格式也使用Haskell。 Xmonad的配置文件位于〜/ .xmonad / xmonad.hs (即/home/YOU/.xmonad/xmonad.hs )。 该文件默认情况下不存在-您必须自己创建。

To get started configuring xmonad, you may want to start with a template file. For more advanced configuration, check out this list of configuration tips on the official wiki.

要开始配置xmonad,您可能需要从模板文件开始 。 有关更高级的配置,请在官方Wiki上查看此配置提示列表

After modifying the configuration, use the Alt+Q keyboard shortcut to reload your configuration. You can also change the default modifier key in the configuration file – if you do, use your custom modifer key in place of every Alt in this post.

修改配置后,使用Alt + Q键盘快捷键重新加载配置。 您还可以在配置文件中更改默认的修饰键-如果这样做,请使用自定义修饰键代替本文中的每个Alt



What do you think of xmonad? Do you prefer a different tiling window manager? Leave a comment and let us know.

您如何看待xmonad? 您是否希望使用其他平铺窗口管理器? 发表评论,让我们知道。

翻译自: https://www.howtogeek.com/114728/how-to-use-xmonad-a-tiling-window-manager-for-linux/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值