Linux 如何创建一个简单的桌面环境?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4001892/
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
How to create a simple desktop environment?
提问by Squall
I want to know how to create a simple desktop environment, such as KDE, Gnome and LXDE, for Linux, or specifically, Ubuntu/Kubuntu, but I do not know how to begin and how complex it is.
我想知道如何创建一个简单的桌面环境,例如 KDE、Gnome 和 LXDE,适用于 Linux,或者具体来说是 Ubuntu/Kubuntu,但我不知道如何开始以及它有多复杂。
I want to create a simple, efficient and lightweight desktop and to reproduce some good features from KDE, Gnome and Windows XP. I do not want to reinvent the wheel, I want to design the graphical interface and main dialogs.
我想创建一个简单、高效和轻量级的桌面,并从 KDE、Gnome 和 Windows XP 中复制一些好的功能。我不想重新发明轮子,我想设计图形界面和主对话框。
I could use C++ with Qt, or maybe with X11 calls. A simple desktop like TWM would be the first step, then I could add taskbar, start menu, new features and play with new ideas.
我可以将 C++ 与 Qt 一起使用,或者与 X11 调用一起使用。像 TWM 这样的简单桌面将是第一步,然后我可以添加任务栏、开始菜单、新功能并尝试新想法。
Thanks.
谢谢。
Edit
编辑
I have installed icewm and I think it is what I need to begin. On the login screen, I can choose if I use KDE (desktop environment) or icewm (window manager). I do not understand what a window manager actually is.
我已经安装了 icewm,我认为这是我需要开始的。在登录界面,我可以选择是使用KDE(桌面环境)还是icewm(窗口管理器)。我不明白窗口管理器实际上是什么。
I have downloaded icewm source code and I am confused. There are some concepts that I have to understand, such as, what happens after the login screen when the desktop is loaded, how a window works, etc.
我已经下载了icewm源代码,我很困惑。有一些概念我必须要了解,例如,加载桌面时登录屏幕后会发生什么,窗口是如何工作的等等。
Edit 2
编辑 2
I think I need a good tutorial. I have to understand how a Window Manager or Desktop Environment work. There are some concepts that I have to know.
我想我需要一个很好的教程。我必须了解窗口管理器或桌面环境的工作原理。有一些概念我必须知道。
回答by Marcelo Cantos
These are all open source projects, so I suggest you grab one of the simpler window managers and rummage around in its source code. I should warn you, though: this kind of project is not for the faint-hearted, and the likelihood of your little toy project becoming a mainstream desktop is low, so don't go into this imagining it's going to be anything more than a learning exercise (and if it does become something more, you'll be pleasantly surprised).
这些都是开源项目,所以我建议你抓住一个更简单的窗口管理器并在它的源代码中翻找。不过我应该警告你:这种项目不适合胆小的人,而且你的小玩具项目成为主流桌面的可能性很低,所以不要想象它不仅仅是一个学习锻炼(如果它真的变得更重要,你会感到惊喜)。
Strategically, your best bet is to fork an existing WM, rather than trying to build a brand new one from scratch.
从战略上讲,最好的办法是分叉现有的 WM,而不是尝试从头开始构建一个全新的 WM。
One final point: Qt is a windowing framework for C++ that sits on top of a window manager. It isn't a window manager, per se, like Gnome/TWM/etc. are. And, as @ptomato rightly points out, Gnome is actually a desktop environment that itself sits on top of a window manager, which is selectable, but defaults to Metacity.
最后一点:Qt 是 C++ 的窗口框架,它位于窗口管理器之上。它不是一个窗口管理器,本身像侏儒/ TWM /等。是。而且,正如@ptomato 正确指出的那样,Gnome 实际上是一个桌面环境,它本身位于一个窗口管理器之上,它是可选的,但默认为 Metacity。
回答by Jonas S?derstr?m
This is no simple feat but by no means impossible.
这绝非易事,但绝非不可能。
Other people have done it, there are plenty of DE or WM out there so there is no reason that you, with patient, skill and lots coffee couldn't do something great.
其他人已经做到了,那里有很多 DE 或 WM,所以没有理由让你有耐心、技巧和大量的咖啡不能做一些伟大的事情。
Learn the difference between DE and WM.
http://www.ghacks.net/2008/12/09/get-to-know-linux-desktop-environment-vs-window-manager/
了解 DE 和 WM 之间的区别。
http://www.ghacks.net/2008/12/09/get-to-know-linux-desktop-environment-vs-window-manager/
Test different DE and WM, maybe one does exactly what you want it to do?
http://www.engadget.com/2012/11/30/how-to-pick-a-desktop-environment-in-linux/http://www.gilesorr.com/wm/table.html
测试不同的 DE 和 WM,也许一个完全符合您的要求?
http://www.engadget.com/2012/11/30/how-to-pick-a-desktop-environment-in-linux/ http://www.gilesorr.com/wm/table.html
Make your own custom DE
Here is a guide to get you started creating your own custom DE
http://maketecheasier.com/easily-create-a-custom-lightweight-desktop-environment/2010/08/10
制作您自己的自定义 DE
这里是一个指南,可让您开始创建您自己的自定义 DE
http://maketecheasier.com/easily-create-a-custom-lightweight-desktop-environment/2010/08/10
After doing all this you should be better equipped to figure out what you actually want to do.
完成所有这些之后,您应该能够更好地弄清楚您真正想要做什么。
Fork a project and get started changing it!
Fork 一个项目并开始改变它!
Good luck
祝你好运
回答by jgh fun-run
I would use X calls and learn how to boot to a CLI (command line interface). Booting to a CLI allows you to switch between window managers / desktop environments. Then I would design a window manager. And finally finish off with a desktop environment.
我会使用 X 调用并学习如何引导到 CLI(命令行界面)。引导到 CLI 允许您在窗口管理器/桌面环境之间切换。然后我会设计一个窗口管理器。最后以桌面环境结束。
It starts with frame buffers. These are how 80's graphics worked.
它从帧缓冲区开始。这些是 80 年代图形的工作原理。
Then you have the X window system. This however doesn't show you multiple windows at once. Only one at a time.
然后你就有了 X 窗口系统。但是,这不会一次向您显示多个窗口。一次只有一个。
A window manager is the program that controls where your windows go. This allows for multiple X windows to take up one screen.
窗口管理器是控制窗口位置的程序。这允许多个 X 窗口占据一个屏幕。
A desktop environment then builds on that to add things like a task bar, start menu and desktop icons.
然后在此基础上构建桌面环境以添加诸如任务栏、开始菜单和桌面图标之类的内容。