Rust Examples Ex

format

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
println!("hello");


println!("{:?}", 1.0/2.0);

let a: i32 = 3;
let b:u32 = 3;
let i: i32 = 2;

println!("{:?}, {}", a.pow(b), a.pow(i as u32));
hello

binary, hex

1
println!("ob{:b}, ox{:X}", 16, 15);
ob10000, oxF

Wayland

应用

  • 原生支持

    • emacs-pgtk (emacs-wayland on arch linux)
    • firefox
  • vscode

    • code --ozone-platform=wayland

Xorg

Xorg 简介

参考:

Xorg 是 X window system 的一种实现

Xephyr 设置第二个 x server

使用步骤:

  1. 使用 Xephyr 启动一个 x server

    • Xephyr -screen 1600x900 :1
  2. 启动 gui 程序

    • DISPLAY=:1 gvim

在 ssh x11 forward 时使用 Xephyr

  1. ssh -X remote
  2. 在 remote 上启动 Xephyr
  3. 在 remote 上启动 gui 程序