自定义 Linux GUI:从哪里开始?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3646273/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-03 20:24:22  来源:igfitidea点击:

Custom Linux GUI: Where to begin?

linuxuser-interface

提问by grey

I've had a long standing interest in developing an OS UI tailored to my needs and interests. When I was younger, I went crazy playing with the Stardock skinning tools for Windows. I loved developing my own window styles and layout ideas. Since then I've had an unscratchable itch.

长期以来,我一直对开发适合我的需求和兴趣的操作系统 UI 感兴趣。当我年轻的时候,我疯狂地玩 Windows 的 Stardock 皮肤工具。我喜欢开发自己的窗口样式和布局想法。从那以后,我就莫名的痒了。

  • I'm not particularly interested in fiddling with the lower level kernel operations, just the presentational aspects. I've been considering some flavor of Linux.
  • While I would love to have some basic integrated tools/applications that I create myself, I'm primarily interested in the presentations of basic windowing, toolbars, desktop, and file management.
  • I don't want to be locked out from using existing applications, if possible. I, for example, have no interest in writing my own web browser, but having the ability to work existing tools into a design would be a major plus.
  • My ideas are sometimes very visual in nature, so the ability to produce more complex transparency effects and unusual window shapes would be useful. More-or-less the ability to reproduce the graphic fidelity of current UI designs for OS X or Windows would be ideal.
  • An OS flavor and tools that lets me start with a blank screen and work from the ground up or include basics are encouraged. The idea of a "desktop" in the traditional sense shouldn't be mandatory. Flexibility to do different things is important to me.
  • 我对摆弄较低级别的内核操作并不特别感兴趣,只是对表现方面感兴趣。我一直在考虑 Linux 的某种风格。
  • 虽然我很想拥有一些我自己创建的基本集成工具/应用程序,但我主要对基本窗口、工具栏、桌面和文件管理的演示感兴趣。
  • 如果可能的话,我不想被禁止使用现有的应用程序。例如,我对编写自己的 Web 浏览器没有兴趣,但能够将现有工具用于设计将是一大优势。
  • 我的想法有时本质上是非常直观的,因此能够产生更复杂的透明效果和不寻常的窗口形状会很有用。或多或少能够重现当前 OS X 或 Windows 用户界面设计的图形保真度将是理想的。
  • 鼓励让我从空白屏幕开始并从头开始工作或包含基础知识的操作系统风格和工具。传统意义上的“桌面”概念不应该是强制性的。灵活地做不同的事情对我来说很重要。

What I'm looking for:

我在找什么:

I'm interested in what Linux/OS flavors might make sense, what tools / frameworks would be useful for accomplishing the task ( Qt seems to be a popular suggestion here ), and basic info on how / where one might start developing / testing such a UI. I'd also be interested reading about any "personal" UI's that people may have developed.

我对什么 Linux/OS 风格可能有意义、哪些工具/框架对完成任务有用(Qt 似乎是这里的一个流行建议)以及关于如何/从哪里开始开发/测试的基本信息感兴趣一个用户界面。我也有兴趣阅读人们可能开发的任何“个人”用户界面。

This is an interest far outside my normal development work, so as a disclaimer, forgive my naivete if I appear to be confused. Corrective insight welcomed.

这是我的正常开发工作之外的兴趣,所以作为免责声明,如果我看起来很困惑,请原谅我的天真。欢迎纠正见解。

I realize this is a big question, so thanks to those for taking the time to make suggestions.

我意识到这是一个很大的问题,所以感谢那些花时间提出建议的人。

采纳答案by liori

You want to build your own DE (desktop environment). Common examples are GNOME and KDE, although more of them were popular. It actually used to be very popular to build your own DE, and dedicated scripting tools were often created.

您想构建自己的 DE(桌面环境)。常见的例子是 GNOME 和 KDE,尽管其中更多是流行的。实际上,构建自己的 DE 过去非常流行,并且经常创建专用的脚本工具。

You will usually need to combine multiple tools: a window manager, a toolbar program, a desktop manager (icons), session manager, possibly more. Out of that only a window manager is a required part (it usually doesn't make any sense not to run any WM inside X server), and others are optional. You will usually not write these tools from scratch (it is a lot of work), but use already available components.

您通常需要组合多个工具:窗口管理器、工具栏程序、桌面管理器(图标)、会话管理器,可能还有更多。其中,只有窗口管理器是必需的部分(在 X 服务器中不运行任何 WM 通常没有任何意义),而其他部分是可选的。您通常不会从头开始编写这些工具(需要大量工作),而是使用已经可用的组件。

Note that both GNOME and KDE actually consists of these elements (well integrated). For example GNOME consists of a window manager (metacity), toolbars (gnome-panel), desktop manager (nautilus) and so on. You can change one element into another if you want: it used to be popular to use sawfishas a window manager instead of metacity, keeping all the other elements intact. Now it is popular to use compizinstead of metacity.

请注意,GNOME 和 KDE 实际上都包含这些元素(集成良好)。例如,GNOME 由窗口管理器 ( metacity)、工具栏 ( gnome-panel)、桌面管理器 ( nautilus) 等组成。如果需要,您可以将一个元素更改为另一个元素:它曾经流行sawfish用作窗口管理器而不是metacity,从而保持所有其他元素完整无缺。现在流行使用compiz而不是metacity.

I used to use FVWM, which is a window manager with an additional (quite good) scripting capabilities that could be used to create toolbars, menus and other things. One of nice examples is FVWM-Crystal, which is a complete DE built on FVWM and few other tools, written in a mix of FVWM scripting and Python. You could actually change any kind of behaviour at runtime by just opening FVWM's scripting console and typing commands. FVWM-Crystal can be a good starting point if you want to start from something already usable; bare FVWM is good if you want to build your DE from scratch.

我曾经使用FVWM,它是一个窗口管理器,具有额外的(非常好的)脚本功能,可用于创建工具栏、菜单和其他东西。一个很好的例子是FVWM-Crystal,它是一个完整的 DE,建立在 FVWM 和少数其他工具上,用 FVWM 脚本和 Python 混合编写。您实际上可以通过打开 FVWM 的脚本控制台并输入命令来在运行时更改任何类型的行为。如果你想从已经可用的东西开始,FVWM-Crystal 可能是一个很好的起点;如果你想从头开始构建你的 DE,裸 FVWM 是很好的。

[UPDATE: it seems that gnome-shellis very similar in this regard to FVWM. Most of its behavior is scripted using JavaScript (instead of a custom language in FVWM), and is very easy to change. It is also very actively developed, as it is an important part of GNOME3, with very good support for composition. It's a hacker's heaven ;-)]

[更新:看来gnome-shell在这方面与FVWM. 它的大部分行为都是使用 JavaScript(而不是 FVWM 中的自定义语言)编写的,并且非常容易更改。它也得到了非常积极的开发,因为它是 GNOME3 的重要组成部分,对组合有很好的支持。这是黑客的天堂;-)]

[UPDATE2: so it seems I was right on gnome-shell. There's a Cinnamon, which uses the same framework (mutterwindow manager) as gnome-shell, yet builds a desktop which works in a different way than gnome-shell.]

[更新2:所以看来我在 gnome-shell 上是对的。有一个Cinnamon,它使用与 相同的框架(mutter窗口管理器)gnome-shell,但构建的桌面的工作方式与 不同gnome-shell。]

There was a website that was a good source of ideas to implement: lynucs.org. It is down for two years now, but it got archived.

有一个网站是一个很好的想法来源:lynucs.org。它现在已经关闭了两年,但它已存档

Warning: lots of these components are not maintained any more, especially since GNOME/KDE started to become actually usable. Development in this area is usually driven more by specific requirements of embedded devices: phonesor netbooks.

警告:许多这些组件不再维护,尤其是在 GNOME/KDE 开始变得实际可用之后。该领域的发展通常更多地由嵌入式设备的特定要求驱动:电话上网本

Now, to answer your actual questions:

现在,回答您的实际问题:

  • Linux/OS flaver: anything easily customizable: Debian, Arch, Gentoo, LFS...
  • Tools/frameworks: it depends on what do you want to achieve. If you want to write a custom toolbar you might just use some scripting languages (like FVWM's), custom tools like adesklets, or write your own in Qt (if most of your other components is in Qt) or GTK (if most of your other components is in GTK).
  • Personal UIs: there were lots of them, and sites like lynucs.org was a nice compilation of them (lynucs listed components used in each desktop).
  • Complex transparency effects: older tools usually do not handle it natively, or do a simple things like just reusing part of desktop wallpaper as its own background (so-called fake transparency). Most probably you'll need to write your own code, f.e. as a plugin to compiz.
  • Linux/OS flaver:任何易于定制的东西:Debian、Arch、Gentoo、LFS...
  • 工具/框架:这取决于您想要实现的目标。如果您想编写自定义工具栏,您可能只使用一些脚本语言(如 FVWM)、自定义工具(如adesklets ),或者用 Qt 编写自己的工具(如果您的其他大部分组件都在 Qt 中)或 GTK(如果您的其他大部分组件都在组件在 GTK 中)。
  • 个人用户界面:有很多,像 lynucs.org 这样的网站是它们的一个很好的汇编(lynucs 列出了每个桌面中使用的组件)。
  • 复杂的透明效果:较旧的工具通常不会在本地处理它,或者做一些简单的事情,例如仅将桌面墙纸的一部分重新用作自己的背景(所谓的假透明)。您很可能需要编写自己的代码,例如作为compiz.

回答by Oli

I'd probably start with an Ubuntu install and the OpenBoxwindow manager and build up from there.

我可能会从 Ubuntu 安装和OpenBox窗口管理器开始,然后从那里开始构建。

OpenBox is veryminimal but you can add applications (eg Docky, Awn, etc) to provide desktop interface elements or write your own.

OpenBox非常小,但您可以添加应用程序(例如 Docky、Awn 等)来提供桌面界面元素或编写您自己的应用程序。

回答by Ashish

If you fast and cool UI I would suggest to look into Enlightenment. Its older than Gnome and I found it extreme fast and low resource consuming option.

如果您的 UI 又快又酷,我建议您研究Enlightenment。它比 Gnome 更老,我发现它是极快且低资源消耗的选择。