linux程序设计x11,Linux(X11)
发布日期:2021-06-24 16:43:43 浏览次数:2 分类:技术文章

本文共 5959 字,大约阅读时间需要 19 分钟。

Desktop Environment(CDE, KDE, GNOME,Unity...)

A desktop environment (DE) is an implementation of the desktop metaphor

made of a bundle of programs running on top of a computer operating system,

which share a common graphical user interface (GUI).

A desktop environment running on x window system including a window manager

(such as Mutter or KWin), a file manager (such as Files or Dolphin), a set of

graphical themes(icons/cursors/fonts), together with toolkits (such as GTK+ and Qt) and libraries

for managing the desktop

CDE(Common Desktop Environment)

KDE(K Desktop Environment, base on Qt(using xlib))

GNOME(GNU Network Object Model Environment, base on GTK(using xlib by GDK/glib))

Unity(base on GNOME2, now GNOME version is 3)

(sudo apt-get install ubuntu-desktop)

(sudo apt-get install gnome-shell)

(sudo apt-get install ubuntu-gnome-desktop)

(sudo apt-get install kbuntu-desktop)

(sudo apt-get install xfce4)

ubuntu 16.04 default: unity

ubuntu 18.04 default: gnome (gnome3)

X protocal

Communication between server and clients is done by exchanging packets  over a channel

X protocal implementation

Xorg, XFree86, XSun, XFce, Xnest, Motif...

X window system/X11/X

X Window System is a windowing system for computers with bitmap displays

X drivers

x graphics driver and x input driver (X11 doesn't manage any audio input/output support. )

内核和驱动包

linux-generic

xserver-xorg-core xserver

xserver-xorg-input-all input driver

xserver-xorg-video-all video/graphics driver

xserver-xorg-dev developent files

针对ubuntu 16.04硬件启用堆栈(linux-generic-hwe-16.04 and xserver-xorg-hwe-16.04)

xserver-xorg-core-hwe-16.04

xserver-xorg-input-all-hwe-16.04

xserver-xorg-video-all-hwe-16.04

xserver-xorg-dev-hwe-16.04

X video/graphics driver (/usr/lib/xorg/modules/drivers)

VESA(Video Electronics Standards Association)

VGA (Video Graphics Array)

fbdev (FrameBuffer Device)

VESA,VGA ,fbdev等是针对不同模式显卡的驱动程序, 这些都是不同的显卡标准,不过这些标准都已经

很老了.现在的显卡都兼容这几种模式.

framebuffer模式的显卡本身不具有任何运算数据的能力,他好比是一个暂时存放水的水池.CPU将运

算后的结果放到这个水池,水池再将结果流到显示器.中间不会对数据做处理.所有显示任务都有CPU完成,

CPU负担很重. Linux内核中有framebuffer机制,摹仿framebuffer显卡的这种功能.好处是把显卡的

硬件结构抽象掉,把所有的显卡都当做一个"水池"来用.应用程序也可以直接读取这个水池的内容.

framebuffer的设备名是 /dev/fb

命令:

清空屏幕#dd if=/dev/zero of=/dev/fb

将fb中的内容保存下来:#dd if=/dev/fb of=fbfile

可以重新写回屏幕:#dd if=fbfile of=/dev/fb

开源通用驱动

xserver-xorg-video-fbdev framebuffer

xserver-xorg-video-vesa vesa

开源专用驱动

xserver-xorg-video-nouveau nvidia

xserver-xorg-video-ati ati

xserver-xorg-video-amdgpu amd/ati

xserver-xorg-video-intel intel

开源其他驱动

xserver-xorg-video-radeon amd/radeon,同ati

xserver-xorg-video-vmware vmvare vm

xserver-xorg-video-qxl kvm,qemu vm

闭源专用驱动

AMDGPU-PRO/fglrx

Nvidia

X input driver

常用的输入驱动 evdev on Linux systems, kbd and mousedrv on other platforms

X server/X display server

a X server is a display server (X11/Unix,Wayland/Tizen, SurfaceFlinger/Android, Mir/none)that runs on a computer with a graphical display and communicates with various client programs

#启动一个x server

xinit

or

startx

or

Xorg -core :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch

or

sudo service lightdm restart #重启display manager会自动重启display server

X display manager/login manager(cli or gui: xdm, sddm, unity/lightdm, gnome/lightdm,gnome/gdm3, kde/kdm...)

a display manager keeps the X server process alive on the X server machine,

connecting it to a physical screen and serving a login prompt on this screen

when there are no clients running. Always run with/as  x session manager

(dm= getty(local tty+login) + telnet(remote tty+login))

lightdm --show-config    #显示display的配置

lightdm --session-child 12 19 #启动一个display manager

X session manager(xsm, kde/ksmserver, unity/gnome-session, gnome/gnome-session...)

A session manager saves and restores the state of session(running desktop/windows)

gnome-session

X window manager/(xwm, unity/compiz, gnome/mutter, kde/kwin openbox...)

An X window manager is software that manages windows on a screen

compiz

X client/X app

X applications or  Xwindows applications

X lib

for X clients/apps to operates X protocol

X log

/var/log/Xorg.0.log  and /var/log/lightdm/x-0.log and /var/log/gpu-manager.log

X config

/etc/X11/xorg.conf and /usr/share/X11/xorg.conf.d

X tools

xinit #启动x server

startx #启动x server, 同时启动一个x window manager (lightDM or XDM or sddm)

xrandr --dpi 144 #设置分辨率

xprop -root #查看显示属性

xkill #杀死一个xclient进程

其他

检查系统识别的显卡: sudo lspci -vnn | grep VGA -A 12     or inxi -G

检查当前使用的显卡: sudo lshw -numeric -C display

检查主板: sudo dmidecode -t baseboard        or inxi -M

检查pci-e接口: sudo dmidecode -t slot

检查当前显卡使用的驱动: sudo lshw -numeric -C display

检查当前显卡(渲染设备)/OpenGL驱动 : glxinfo | grep OpenGL

检查当前显卡(渲染设备)/OpenGL驱动的性能: glxgears

检查显卡温度: sensors

检查显卡加速与否: vainfo

检查显卡工作模式: aticonfig --pxl

切换到独立显卡(discrete):    sudo aticonfig --px-dgpu

切换到独立显卡(integration): sudo aticonfig --px-igpu

Xorg Server配置/etc/X11/*

xorg.conf文件保存有X Window的各种信息,它由数个Section/EndSecion

的区块组成,格式如下:

Section “Section名称”

选项名称 “选项值”

选项名称 “选项值”

……

EndSection

典型的区块有ServerLayout, ServerFlags, Extentions, Files, Module, InputDevice, InputClass,

VideoAdaptor, Modes, Monitor, Device, Screen(sub section:Display), Dri, Vendor...

其中显示设置方面,以下三个区块似乎缺一不可

monitor 设置显示器

device 设置显卡

screen 设置屏幕, 即显示器与显卡的结合,也就是最终的显示

# module段中指定载入/挂载的扩展module/driver(大部分module/driver在系统启动时已经载入/挂载)

Section "Module"

Load "dbe"

Load "extmod"

Load "fbdev"

Load "glx"

Load "record"

Load "freetype"

Load "type1"

Load "dri"

EndSection

#检查当前工作显卡

#aticonfig --pxl

#切换当前工作显卡

#sudo aticonfig --px-dgpu

#sudo reboot

Section "Device"

Identifier "Device0"

Driver     "radeon"

Option     "ZaphodHeads" "VGA-0"

VendorName "ATI"

BusID      "PCI:1:0:0"

Screen 0

EndSection

#检查当前显示器分辨率

#xdpyinfo | grep -B2 resolution

#设置当前显示器分辨率

#xrandr --dpi 144

Section "Monitor"

Identifier  "Monitor0"

DisplaySize 286 179    # In millimeters

Option      "DPI" "96 x 96"

EndSection

ubuntu 18.04: 官方版本不再使用unity桌面,回归使用gnome桌面(gnome3)。

xserver同时使用Xwayland和Xorg (Xwayland for login, Xorg for apps)

桌面环境是gnome3

显示管理器是gdm3

会话管理器gnome-session

窗口管理器gnome-shell (改进版mutter, 即改进版metacity-cluter)

转载地址:https://blog.csdn.net/weixin_33917663/article/details/116672663 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:linux编译动态库未定义,GCC链接库的一个坑:动态库存在却提示未定义动态库的函数...
下一篇:linux升级apache版本,Apache HTTP Server 2.4.39发布,附更新介绍,建议升级到新版本

发表评论

最新留言

网站不错 人气很旺了 加油
[***.192.178.218]2024年04月11日 06时14分13秒

关于作者

    喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!

推荐文章

Github生成ssh 密钥和怎样向gitHub上传文件(详细教程) 2019-04-28
cmd更换默认编码 2019-04-28
MySQL 之使用uuid_short 报错 Out of range value for column 'id' at row 1 问题 2019-04-28
Could not initialize class sun.awt.X11GraphicsEnvironment异常处理 2019-04-28
redis缓存雪崩、穿透、击穿概念、布隆过滤器小结及解决办法 2019-04-28
用idea新建maven项目,创建Scala项目--做个记录 2019-04-28
【pom.xml 依赖】使用net.sf.json-lib-2.4-jdk15.jar所需要的其他依赖架包 以及其一直在pom.xml报错的问题 2019-04-28
Mybatis异常There is no getter for property named 'XXX' in 'class java.lang.String' 2019-04-28
Eclipse中通过Tomcat运行JavaWeb项目报错:java.lang.OutOfMemoryError: PermGen space 错误的解决方案 2019-04-28
Tomcat运行 报错:Error configuring application listener of class org.springframework.web.cont 2019-04-28
struts2框架总结:(二) 2019-04-28
struts2框架总结:(三) 2019-04-28
关于hibernate查询数据时报错java.lang.StringIndexOutOfBoundsException: String index out of range: 0 2019-04-28
[cn.itheima.web.action.CustomerAction] not found - action 的解决办法 2019-04-28
struts2框架总结:(四) 2019-04-28
谈一谈JUnit神奇的报错 java.lang.Exception:No tests found matching 2019-04-28
@PreDestroy 为什么不执行 2019-04-28
eclipse 中提示tomcat 的端口被占用了 后的最快捷解决方法 2019-04-28
eclipse自动提示设置以及问题:去除变量自动提示(图文详解) 2019-04-28
十七、自己动手实现排序算法(5)-------- “ Shell Sort 希尔排序 ” 2019-04-28