Qtile 无法启动

Qtile 无法启动

我正在使用 Ubuntu 20.04,我正在考虑尝试一个用于编程和日常使用的窗口管理器。我实际上并不是计算机专家,但我开始学习一些编程语言(尤其是 Python)和一些数据分析软件(如用于统计的 R)的基础知识,所以我喜欢以最佳方式组织我的工作区和窗口的想法。我认为对我来说最好的选择是 Qtile:使用 Python 编程,我可以提高我的编程技能,同时配置 WM。然而,Qtile 似乎仍然不存在于焦点存储库中,所以我不得不按照网站(qtile.org)的指南从源代码安装它。但是,在此过程结束时,我仍然无法在登录窗口中看到 Qtile 选项,当我尝试运行主文件夹中的 setup.py 文件时,我收到很多错误,如下所示:

mattia@HAL9000:~/qtile$ sudo python setup.py
Failed to find pulseaudio headers. PulseVolume widget will be unavailable
/usr/lib/python2.7/dist-packages/cffi/cparser.py:153: UserWarning: String literal found in cdef() or type source. String literals are ignored here, but you should remove them anyway because some character sequences confuse pre-parsing.
  warnings.warn("String literal found in cdef() or type source. "
/usr/lib/python2.7/dist-packages/cffi/cparser.py:164: UserWarning: Global variable 'CAIRO_TAG_DEST' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern')
  "(usually 'extern')" % (decl.name,))
/usr/lib/python2.7/dist-packages/cffi/cparser.py:164: UserWarning: Global variable 'CAIRO_TAG_LINK' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern')
  "(usually 'extern')" % (decl.name,))
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

error: no commands supplied

我完全不懂其中的意思,甚至不确定我是否应该运行该文件,但我认为我的问题可能与我的默认 Python 版本仍为 2.7 有关。最终结果是我无法使用 Qtile。您认为这可能是什么原因造成的?如果它真的与 Python2.7 有关,我该如何更新我的 Python 版本而不导致一半的应用程序崩溃?(我是根据过去的经验这么说的,但我不知道现在情况是否发生了变化,应用程序是否应该可以使用不同的 Python 版本)。我很确定我遗漏了一些非常基本和简单的东西……

答案1

通常调用setup.py需要install参数 - sudo python setup.py install。你也可能想阅读官方 Qtile 文档


您也可以从 18.04 LTS 存储库手动下载 Qtile 0.10.7 并通过以下方式安装:

cd ~/Downloads
wget http://archive.ubuntu.com/ubuntu/pool/universe/q/qtile/python3-qtile_0.10.7-2ubuntu2_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/q/qtile/qtile_0.10.7-2ubuntu2_all.deb

sudo apt-get install ./qtile_0.10.7-2ubuntu2_all.deb ./python3-qtile_0.10.7-2ubuntu2_amd64.deb

并按计划使用。

答案2

我曾尝试在 Linux Mint 上运行 qtile。以下是我让它运行的方法:

我从当前存储库安装了 python 和 pip(默认安装 python3,您还需要 python3-pip 包,它依赖于 python3-setuptools 和 python3-wheel)

sudo apt install python3-setuptools python3-wheel python3-pip

然后我按照 qtile 文档安装 qtile 依赖项,使用python3而不是pythonpip3而不是pip。我还以 root 身份运行了以下命令:

sudo pip3 install xcffib

sudo pip3 install --no-cache-dir cairocffi

sudo apt install libpangocairo-1.0-0 python-dbus python-gobject

然后我从 pip 安装了 qtile,以使 qtile 更容易更新:

pip3 install qtile

然后,在ofefo 在 qtile 的 github 页面上的帖子(仍然有点新手),我创建了该文件qtile.desktop/usr/share/xsessions/在该文件中添加了以下几行:

[Desktop Entry]
Name=Qtile
Comment=Qtile Session
Exec=python3 /usr/local/bin/qtile
Type=Application
Keywords=wm;tiling

笔记:您的 qtile 安装路径可能不是/usr/local/bin/qtile。要查找您的安装路径,请运行which python3

现在您要做的就是注销并在会话选择器中选择 qtile!

希望这能有所帮助:D

PS 我暂时无法发表评论,因此针对日志问题,我的 qtile 错误日志位于~/.xsession-errors.old

相关内容