├── .envrc ├── .gitignore ├── resources ├── closeup.png ├── overflow.png ├── sample.png └── Roboto[wdth,wght].ttf ├── Cargo.toml ├── default.nix ├── README.md ├── src ├── main.rs ├── x11.rs └── wayland.rs ├── flake.nix ├── flake.lock └── Cargo.lock /.envrc: -------------------------------------------------------------------------------- 1 | use flake 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | .direnv 3 | result 4 | -------------------------------------------------------------------------------- /resources/closeup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kaisia-Estrel/activate-linux/HEAD/resources/closeup.png -------------------------------------------------------------------------------- /resources/overflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kaisia-Estrel/activate-linux/HEAD/resources/overflow.png -------------------------------------------------------------------------------- /resources/sample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kaisia-Estrel/activate-linux/HEAD/resources/sample.png -------------------------------------------------------------------------------- /resources/Roboto[wdth,wght].ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kaisia-Estrel/activate-linux/HEAD/resources/Roboto[wdth,wght].ttf -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "activate-linux" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | smithay-client-toolkit = "0.19.2" 8 | wayland-client = "0.31.7" 9 | env_logger = "0.11.5" 10 | fontdue = "0.9.2" 11 | x11rb = { version = "0.13.1", features = ["xfixes", "image"] } 12 | tracing-subscriber = { version = "0.3.18", features = ["env-filter"] } 13 | -------------------------------------------------------------------------------- /default.nix: -------------------------------------------------------------------------------- 1 | { lib, rustPlatform, libxkbcommon, pkg-config }: 2 | rustPlatform.buildRustPackage { 3 | pname = "activate-linux"; 4 | version = "0.1.0"; 5 | src = ./.; 6 | cargoHash = "sha256-E9jYdvjXlOi+PNvpYaLHDfdQsouBY2Pxj0WDdBEvHjc="; 7 | buildInputs = [ libxkbcommon ]; 8 | nativeBuildInputs = [ pkg-config ]; 9 | 10 | meta = with lib; { 11 | description = ''Windows' "Active Windows" watermark for Linux ''; 12 | homepage = "https://github.com/Perigord-Kleisli/activate-linux"; 13 | mainProgram = "activate-linux"; 14 | platforms = platforms.linux; 15 | license = licenses.mit; 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Activate-Linux 2 | 3 | A stupid little joke program for Linux 4 | 5 | ![Fullscreen view, showing Activate-Linux on the corner](./resources/sample.png) 6 | ![Closeup view of Activate-Linux](./resources/closeup.png) 7 | 8 | ## Running 9 | 10 | Ensure libxkbcommon and pkg-config are installed, then simply `cargo run`. 11 | 12 | The repo can also be ran as a flake: 13 | ``` 14 | nix run github:Kaisia-Estrel/activate-linux 15 | ``` 16 | 17 | specify `--header` and `--caption` to change the text of the overlay, however this doesnt 18 | check the actual length of the text so it may draw over itself if it's too long. 19 | 20 | ``` 21 | activate-linux --header "Activate Nixos" --caption "1 2 3 4 5 6 7 8 9 10 q w e r t y u i o p a s d f g h j k l z x c v" 22 | ``` 23 | ![Overflowing text](./resources/overflow.png) 24 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | mod wayland; 2 | mod x11; 3 | 4 | fn main() { 5 | let mut header: Option = None; 6 | let mut caption: Option = None; 7 | let mut args = std::env::args(); 8 | while let Some(arg) = args.next() { 9 | if arg == "--header" || arg == "-H" { 10 | header = args.next() 11 | } 12 | 13 | if arg == "--caption" || arg == "-c" { 14 | caption = args.next() 15 | } 16 | 17 | if arg == "--help" || arg == "-h" { 18 | println!("Usage: activate-linux [options]"); 19 | println!( 20 | "\t -H '{{}}' or --header '{{}}' to set the header (Default: \"Activate Linux\")" 21 | ); 22 | println!("\t -c '{{}}' or --caption '{{}}' to set the caption (Default: \"Go to Settings to activate Linux.\")"); 23 | println!("\t -h or --help to show this message"); 24 | return; 25 | } 26 | } 27 | match std::env::var("WAYLAND_DISPLAY") { 28 | Ok(_) => { 29 | wayland::wayland_main(header, caption); 30 | } 31 | Err(_) => { 32 | x11::x11_main(header, caption).unwrap(); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | inputs = { 3 | fenix = { 4 | url = "github:nix-community/fenix"; 5 | inputs.nixpkgs.follows = "nixpkgs"; 6 | }; 7 | nixpkgs.url = "nixpkgs/nixos-unstable"; 8 | }; 9 | 10 | outputs = { fenix, nixpkgs, ... }: 11 | let 12 | system = "x86_64-linux"; 13 | pkgs = import nixpkgs { 14 | inherit system; 15 | overlays = [ fenix.overlays.default ]; 16 | }; 17 | dependencies = with pkgs; [ libxkbcommon ]; 18 | 19 | devDependencies = with pkgs; [ pkg-config ]; 20 | in { 21 | packages.${system}.default = pkgs.callPackage ./. { }; 22 | devShells.${system}.default = pkgs.mkShell { 23 | LD_LIBRARY_PATH = pkgs.lib.strings.makeLibraryPath dependencies; 24 | packages = with pkgs; 25 | [ 26 | (fenix.packages.${system}.complete.withComponents [ 27 | "cargo" 28 | "clippy" 29 | "rust-src" 30 | "rustc" 31 | "rustfmt" 32 | ]) 33 | bacon 34 | lldb 35 | rust-analyzer-nightly 36 | vscode-extensions.vadimcn.vscode-lldb.adapter 37 | ] ++ dependencies ++ devDependencies; 38 | }; 39 | }; 40 | } 41 | -------------------------------------------------------------------------------- /flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "fenix": { 4 | "inputs": { 5 | "nixpkgs": [ 6 | "nixpkgs" 7 | ], 8 | "rust-analyzer-src": "rust-analyzer-src" 9 | }, 10 | "locked": { 11 | "lastModified": 1729751566, 12 | "narHash": "sha256-99u/hrgBdi8bxSXZc9ZbNkR5EL1htrkbd3lsbKzS60g=", 13 | "owner": "nix-community", 14 | "repo": "fenix", 15 | "rev": "f32a2d484091a6dc98220b1f4a2c2d60b7c97c64", 16 | "type": "github" 17 | }, 18 | "original": { 19 | "owner": "nix-community", 20 | "repo": "fenix", 21 | "type": "github" 22 | } 23 | }, 24 | "nixpkgs": { 25 | "locked": { 26 | "lastModified": 1729665710, 27 | "narHash": "sha256-AlcmCXJZPIlO5dmFzV3V2XF6x/OpNWUV8Y/FMPGd8Z4=", 28 | "owner": "NixOS", 29 | "repo": "nixpkgs", 30 | "rev": "2768c7d042a37de65bb1b5b3268fc987e534c49d", 31 | "type": "github" 32 | }, 33 | "original": { 34 | "id": "nixpkgs", 35 | "ref": "nixos-unstable", 36 | "type": "indirect" 37 | } 38 | }, 39 | "root": { 40 | "inputs": { 41 | "fenix": "fenix", 42 | "nixpkgs": "nixpkgs" 43 | } 44 | }, 45 | "rust-analyzer-src": { 46 | "flake": false, 47 | "locked": { 48 | "lastModified": 1729715509, 49 | "narHash": "sha256-jUDN4e1kObbksb4sc+57NEeujBEDRdLCOu9wiE3RZdM=", 50 | "owner": "rust-lang", 51 | "repo": "rust-analyzer", 52 | "rev": "40492e15d49b89cf409e2c5536444131fac49429", 53 | "type": "github" 54 | }, 55 | "original": { 56 | "owner": "rust-lang", 57 | "ref": "nightly", 58 | "repo": "rust-analyzer", 59 | "type": "github" 60 | } 61 | } 62 | }, 63 | "root": "root", 64 | "version": 7 65 | } 66 | -------------------------------------------------------------------------------- /src/x11.rs: -------------------------------------------------------------------------------- 1 | use x11rb::connection::Connection; 2 | use x11rb::errors::{ReplyError, ReplyOrIdError}; 3 | use x11rb::image::Image; 4 | use x11rb::protocol::render::{self, ConnectionExt as _, PictType}; 5 | use x11rb::protocol::shape::SK; 6 | use x11rb::protocol::xfixes::ConnectionExt as _; 7 | use x11rb::protocol::xproto::Window; 8 | use x11rb::protocol::xproto::{AtomEnum, ColormapAlloc}; 9 | use x11rb::protocol::xproto::{ConfigureWindowAux, Visualtype}; 10 | use x11rb::protocol::xproto::{ConnectionExt, StackMode}; 11 | use x11rb::protocol::xproto::{CreateGCAux, Visualid}; 12 | use x11rb::protocol::xproto::{CreateWindowAux, WindowClass}; 13 | use x11rb::protocol::xproto::{EventMask, PropMode}; 14 | use x11rb::rust_connection::RustConnection; 15 | use x11rb::wrapper::ConnectionExt as _; 16 | 17 | use crate::wayland; 18 | 19 | x11rb::atom_manager! { 20 | pub AtomCollection: AtomCollectionCookie { 21 | WM_PROTOCOLS, 22 | WM_DELETE_WINDOW, 23 | _NET_WM_NAME, 24 | _NET_WM_STATE, 25 | _NET_WM_STATE_ABOVE, 26 | _NET_WM_WINDOW_TYPE, 27 | _NET_WM_WINDOW_TYPE_DIALOG, 28 | UTF8_STRING, 29 | } 30 | } 31 | 32 | fn init_tracing() { 33 | use tracing_subscriber::prelude::*; 34 | 35 | tracing_subscriber::registry() 36 | .with(tracing_subscriber::fmt::layer()) 37 | .with(tracing_subscriber::EnvFilter::from_default_env()) 38 | .init(); 39 | } 40 | 41 | /// A rust version of XCB's `xcb_visualtype_t` struct. This is used in a FFI-way. 42 | #[derive(Debug, Clone, Copy)] 43 | #[repr(C)] 44 | pub struct XcbVisualtypeT { 45 | pub visual_id: u32, 46 | pub class: u8, 47 | pub bits_per_rgb_value: u8, 48 | pub colormap_entries: u16, 49 | pub red_mask: u32, 50 | pub green_mask: u32, 51 | pub blue_mask: u32, 52 | pub pad0: [u8; 4], 53 | } 54 | 55 | impl From for XcbVisualtypeT { 56 | fn from(value: Visualtype) -> XcbVisualtypeT { 57 | XcbVisualtypeT { 58 | visual_id: value.visual_id, 59 | class: value.class.into(), 60 | bits_per_rgb_value: value.bits_per_rgb_value, 61 | colormap_entries: value.colormap_entries, 62 | red_mask: value.red_mask, 63 | green_mask: value.green_mask, 64 | blue_mask: value.blue_mask, 65 | pad0: [0; 4], 66 | } 67 | } 68 | } 69 | 70 | fn choose_visual(conn: &impl Connection, screen_num: usize) -> Result<(u8, Visualid), ReplyError> { 71 | let depth = 32; 72 | let screen = &conn.setup().roots[screen_num]; 73 | 74 | // Try to use XRender to find a visual with alpha support 75 | let has_render = conn 76 | .extension_information(render::X11_EXTENSION_NAME)? 77 | .is_some(); 78 | if has_render { 79 | let formats = conn.render_query_pict_formats()?.reply()?; 80 | // Find the ARGB32 format that must be supported. 81 | let format = formats 82 | .formats 83 | .iter() 84 | .filter(|info| (info.type_, info.depth) == (PictType::DIRECT, depth)) 85 | .filter(|info| { 86 | let d = info.direct; 87 | (d.red_mask, d.green_mask, d.blue_mask, d.alpha_mask) == (0xff, 0xff, 0xff, 0xff) 88 | }) 89 | .find(|info| { 90 | let d = info.direct; 91 | (d.red_shift, d.green_shift, d.blue_shift, d.alpha_shift) == (16, 8, 0, 24) 92 | }); 93 | if let Some(format) = format { 94 | // Now we need to find the visual that corresponds to this format 95 | if let Some(visual) = formats.screens[screen_num] 96 | .depths 97 | .iter() 98 | .flat_map(|d| &d.visuals) 99 | .find(|v| v.format == format.id) 100 | { 101 | return Ok((format.depth, visual.visual)); 102 | } 103 | } 104 | } 105 | Ok((screen.root_depth, screen.root_visual)) 106 | } 107 | 108 | fn composite_manager_running( 109 | conn: &impl Connection, 110 | screen_num: usize, 111 | ) -> Result { 112 | let atom = format!("_NET_WM_CM_S{}", screen_num); 113 | let atom = conn.intern_atom(false, atom.as_bytes())?.reply()?.atom; 114 | let owner = conn.get_selection_owner(atom)?.reply()?; 115 | Ok(owner.owner != x11rb::NONE) 116 | } 117 | 118 | fn create_window( 119 | conn: &C, 120 | screen: &x11rb::protocol::xproto::Screen, 121 | atoms: &AtomCollection, 122 | (width, height): (u16, u16), 123 | depth: u8, 124 | visual_id: Visualid, 125 | ) -> Result 126 | where 127 | C: Connection, 128 | { 129 | let x = (screen.width_in_pixels - width) as i16; 130 | let y = (screen.height_in_pixels - height) as i16; 131 | let window = conn.generate_id()?; 132 | let colormap = conn.generate_id()?; 133 | conn.create_colormap(ColormapAlloc::NONE, colormap, screen.root, visual_id)?; 134 | let win_aux = CreateWindowAux::new() 135 | .override_redirect(1) 136 | .event_mask(EventMask::EXPOSURE | EventMask::STRUCTURE_NOTIFY) 137 | .background_pixel(x11rb::NONE) 138 | .border_pixel(screen.black_pixel) 139 | .colormap(colormap); 140 | conn.create_window( 141 | depth, 142 | window, 143 | screen.root, 144 | x, 145 | y, 146 | width, 147 | height, 148 | 0, 149 | WindowClass::INPUT_OUTPUT, 150 | visual_id, 151 | &win_aux, 152 | )?; 153 | 154 | conn.change_property32( 155 | PropMode::REPLACE, 156 | window, 157 | atoms.WM_PROTOCOLS, 158 | AtomEnum::ATOM, 159 | &[atoms.WM_DELETE_WINDOW], 160 | )?; 161 | 162 | conn.change_property32( 163 | PropMode::REPLACE, 164 | window, 165 | atoms._NET_WM_STATE, 166 | AtomEnum::ATOM, 167 | &[atoms._NET_WM_STATE_ABOVE], 168 | )?; 169 | 170 | conn.change_property32( 171 | PropMode::REPLACE, 172 | window, 173 | atoms._NET_WM_WINDOW_TYPE, 174 | AtomEnum::ATOM, 175 | &[atoms._NET_WM_WINDOW_TYPE_DIALOG], 176 | )?; 177 | 178 | conn.map_window(window)?; 179 | Ok(window) 180 | } 181 | 182 | pub fn x11_main( 183 | header: Option, 184 | caption: Option, 185 | ) -> Result<(), Box> { 186 | init_tracing(); 187 | let (conn, screen_num) = RustConnection::connect(None)?; 188 | 189 | conn.xfixes_query_version(5, 0)?; 190 | 191 | let screen = &conn.setup().roots[screen_num]; 192 | 193 | let width: u16 = 335; 194 | let height: u16 = 110; 195 | 196 | let (depth, visualid) = choose_visual(&conn, screen_num)?; 197 | println!("Using visual {:#x} with depth {}", visualid, depth); 198 | 199 | let transparency = composite_manager_running(&conn, screen_num)?; 200 | println!( 201 | "Composite manager running / working transparency: {:?}", 202 | transparency 203 | ); 204 | let atoms = AtomCollection::new(&conn)?.reply()?; 205 | let window = create_window(&conn, screen, &atoms, (width, height), depth, visualid)?; 206 | 207 | let region = conn.generate_id()?; 208 | conn.xfixes_create_region(region, &[])?; 209 | conn.xfixes_set_window_shape_region(window, SK::INPUT, 0, 0, region)?; 210 | conn.xfixes_destroy_region(region)?; 211 | 212 | conn.configure_window( 213 | window, 214 | &ConfigureWindowAux::new().stack_mode(StackMode::ABOVE), 215 | )?; 216 | 217 | let gc = conn.generate_id()?; 218 | conn.create_gc( 219 | gc, 220 | window, 221 | &CreateGCAux::default().foreground(screen.white_pixel), 222 | )?; 223 | 224 | let (mut image, _) = Image::get(&conn, window, 0, 0, width, height)?; 225 | 226 | let image_width = image.width() as usize; 227 | let data = image.data_mut(); 228 | 229 | let font = fontdue::Font::from_bytes( 230 | include_bytes!("../resources/Roboto[wdth,wght].ttf") as &[u8], 231 | fontdue::FontSettings::default(), 232 | ) 233 | .unwrap(); 234 | 235 | wayland::rasterize_string( 236 | &font, 237 | header.as_deref().unwrap_or("Activate Linux"), 238 | 28.0, 239 | 0, 240 | data, 241 | image_width, 242 | ); 243 | wayland::rasterize_string( 244 | &font, 245 | caption 246 | .as_deref() 247 | .unwrap_or("Go to Settings to activate Linux."), 248 | 16.0, 249 | 32, 250 | data, 251 | image_width, 252 | ); 253 | 254 | image.put(&conn, window, gc, 0, 0)?; 255 | 256 | conn.flush()?; 257 | loop { 258 | match conn.wait_for_event() { 259 | Ok(e) => { 260 | println!("Event: {e:?}") 261 | } 262 | Err(e) => eprintln!("{e:?}"), 263 | } 264 | } 265 | } 266 | -------------------------------------------------------------------------------- /src/wayland.rs: -------------------------------------------------------------------------------- 1 | use fontdue::{ 2 | layout::{CoordinateSystem, Layout, TextStyle}, 3 | Font, 4 | }; 5 | use smithay_client_toolkit::{ 6 | compositor::{CompositorHandler, CompositorState, Region}, 7 | delegate_compositor, delegate_layer, delegate_output, delegate_registry, delegate_shm, 8 | output::{OutputHandler, OutputState}, 9 | registry::{ProvidesRegistryState, RegistryState}, 10 | registry_handlers, 11 | shell::{ 12 | wlr_layer::{ 13 | Anchor, Layer, LayerShell, LayerShellHandler, LayerSurface, LayerSurfaceConfigure, 14 | }, 15 | WaylandSurface, 16 | }, 17 | shm::{slot::SlotPool, Shm, ShmHandler}, 18 | }; 19 | use wayland_client::{ 20 | globals::registry_queue_init, 21 | protocol::{wl_output, wl_shm, wl_surface}, 22 | Connection, QueueHandle, 23 | }; 24 | 25 | struct SimpleLayer { 26 | registry_state: RegistryState, 27 | output_state: OutputState, 28 | shm: Shm, 29 | pool: SlotPool, 30 | width: u32, 31 | height: u32, 32 | layer: LayerSurface, 33 | font: fontdue::Font, 34 | header: Option, 35 | caption: Option, 36 | } 37 | 38 | impl CompositorHandler for SimpleLayer { 39 | fn scale_factor_changed( 40 | &mut self, 41 | _conn: &Connection, 42 | _qh: &QueueHandle, 43 | _surface: &wl_surface::WlSurface, 44 | _new_factor: i32, 45 | ) { 46 | // Not needed for this example. 47 | } 48 | 49 | fn transform_changed( 50 | &mut self, 51 | _conn: &Connection, 52 | _qh: &QueueHandle, 53 | _surface: &wl_surface::WlSurface, 54 | _new_transform: wl_output::Transform, 55 | ) { 56 | // Not needed for this example. 57 | } 58 | 59 | fn frame( 60 | &mut self, 61 | _conn: &Connection, 62 | _qh: &QueueHandle, 63 | _surface: &wl_surface::WlSurface, 64 | _time: u32, 65 | ) { 66 | } 67 | 68 | fn surface_enter( 69 | &mut self, 70 | _conn: &Connection, 71 | qh: &QueueHandle, 72 | _surface: &wl_surface::WlSurface, 73 | _output: &wl_output::WlOutput, 74 | ) { 75 | self.draw(qh); 76 | } 77 | 78 | fn surface_leave( 79 | &mut self, 80 | _conn: &Connection, 81 | _qh: &QueueHandle, 82 | _surface: &wl_surface::WlSurface, 83 | _output: &wl_output::WlOutput, 84 | ) { 85 | // Not needed for this example. 86 | } 87 | } 88 | 89 | impl OutputHandler for SimpleLayer { 90 | fn output_state(&mut self) -> &mut OutputState { 91 | &mut self.output_state 92 | } 93 | 94 | fn new_output( 95 | &mut self, 96 | _conn: &Connection, 97 | _qh: &QueueHandle, 98 | _output: wl_output::WlOutput, 99 | ) { 100 | } 101 | 102 | fn update_output( 103 | &mut self, 104 | _conn: &Connection, 105 | _qh: &QueueHandle, 106 | _output: wl_output::WlOutput, 107 | ) { 108 | } 109 | 110 | fn output_destroyed( 111 | &mut self, 112 | _conn: &Connection, 113 | _qh: &QueueHandle, 114 | _output: wl_output::WlOutput, 115 | ) { 116 | } 117 | } 118 | 119 | impl LayerShellHandler for SimpleLayer { 120 | fn closed(&mut self, _conn: &Connection, _qh: &QueueHandle, _layer: &LayerSurface) {} 121 | 122 | fn configure( 123 | &mut self, 124 | _conn: &Connection, 125 | qh: &QueueHandle, 126 | _layer: &LayerSurface, 127 | configure: LayerSurfaceConfigure, 128 | _serial: u32, 129 | ) { 130 | if configure.new_size.0 == 0 || configure.new_size.1 == 0 { 131 | self.width = 256; 132 | self.height = 256; 133 | } else { 134 | self.width = configure.new_size.0; 135 | self.height = configure.new_size.1; 136 | } 137 | self.draw(qh); 138 | } 139 | } 140 | 141 | impl ShmHandler for SimpleLayer { 142 | fn shm_state(&mut self) -> &mut Shm { 143 | &mut self.shm 144 | } 145 | } 146 | 147 | pub fn rasterize_string( 148 | font: &Font, 149 | text: &str, 150 | px: f32, 151 | y_pos: usize, 152 | canvas: &mut [u8], 153 | canvas_stride: usize, 154 | ) { 155 | let mut layout = Layout::new(CoordinateSystem::PositiveYDown); 156 | layout.append(&[font], &TextStyle::new(text, px, 0)); 157 | 158 | let bottom_alignment_y = layout 159 | .glyphs() 160 | .iter() 161 | .map(|g| font.horizontal_line_metrics(g.key.px).unwrap().ascent - g.y) 162 | .max_by(|a, b| a.partial_cmp(b).unwrap()) 163 | .unwrap(); 164 | 165 | for glyph in layout.glyphs() { 166 | let glyph_x = glyph.x.round() as usize; 167 | let glyph_y = bottom_alignment_y 168 | - (font.horizontal_line_metrics(glyph.key.px).unwrap().ascent - glyph.y); 169 | let glyph_y = glyph_y.round() as usize; 170 | 171 | let (_, coverage) = font.rasterize(glyph.parent, px); 172 | for x in 0..glyph.width { 173 | for y in 0..glyph.height { 174 | let canvas_idx = (x + glyph_x) * 4 + (y + y_pos + glyph_y) * canvas_stride * 4; 175 | let glyph_pixel = coverage[x + y * glyph.width] / 2; 176 | canvas[canvas_idx] = glyph_pixel; 177 | canvas[canvas_idx + 1] = glyph_pixel; 178 | canvas[canvas_idx + 2] = glyph_pixel; 179 | canvas[canvas_idx + 3] = glyph_pixel; 180 | } 181 | } 182 | } 183 | } 184 | 185 | impl SimpleLayer { 186 | pub fn draw(&mut self, qh: &QueueHandle) { 187 | let width = self.width; 188 | let height = self.height; 189 | let stride = self.width as i32 * 4; 190 | 191 | let (buffer, canvas) = self 192 | .pool 193 | .create_buffer( 194 | width as i32, 195 | height as i32, 196 | stride, 197 | wl_shm::Format::Argb8888, 198 | ) 199 | .expect("create buffer"); 200 | 201 | rasterize_string( 202 | &self.font, 203 | self.header.as_deref().unwrap_or("Activate Linux"), 204 | 28.0, 205 | 0, 206 | canvas, 207 | self.width as usize, 208 | ); 209 | 210 | rasterize_string( 211 | &self.font, 212 | self.caption 213 | .as_deref() 214 | .unwrap_or("Go to Settings to activate Linux."), 215 | 16.0, 216 | 32, 217 | canvas, 218 | self.width as usize, 219 | ); 220 | 221 | self.layer 222 | .wl_surface() 223 | .damage_buffer(0, 0, width as i32, height as i32); 224 | 225 | self.layer 226 | .wl_surface() 227 | .frame(qh, self.layer.wl_surface().clone()); 228 | 229 | buffer 230 | .attach_to(self.layer.wl_surface()) 231 | .expect("buffer attach"); 232 | self.layer.commit(); 233 | } 234 | } 235 | 236 | delegate_compositor!(SimpleLayer); 237 | delegate_output!(SimpleLayer); 238 | delegate_shm!(SimpleLayer); 239 | delegate_layer!(SimpleLayer); 240 | delegate_registry!(SimpleLayer); 241 | 242 | impl ProvidesRegistryState for SimpleLayer { 243 | fn registry(&mut self) -> &mut RegistryState { 244 | &mut self.registry_state 245 | } 246 | registry_handlers![OutputState]; 247 | } 248 | 249 | pub fn wayland_main(header: Option, caption: Option) { 250 | env_logger::init(); 251 | 252 | let conn = Connection::connect_to_env().unwrap(); 253 | let (globals, mut event_queue) = registry_queue_init(&conn).unwrap(); 254 | let qh = event_queue.handle(); 255 | let compositor = CompositorState::bind(&globals, &qh).expect("wl_compositor is not available"); 256 | let layer_shell = LayerShell::bind(&globals, &qh).expect("layer shell is not available"); 257 | let shm = Shm::bind(&globals, &qh).expect("wl_shm is not available"); 258 | 259 | let region = Region::new(&compositor).unwrap(); 260 | let surface = compositor.create_surface(&qh); 261 | surface.set_input_region(Some(region.wl_region())); 262 | region.wl_region().destroy(); 263 | 264 | let width = 335; 265 | let height = 110; 266 | 267 | let layer = 268 | layer_shell.create_layer_surface(&qh, surface, Layer::Overlay, None::, None); 269 | layer.set_anchor(Anchor::BOTTOM | Anchor::RIGHT); 270 | layer.set_size(width, height); 271 | layer.commit(); 272 | let pool = SlotPool::new((width * height * 4) as usize, &shm).expect("Failed to create pool"); 273 | 274 | let font = fontdue::Font::from_bytes( 275 | include_bytes!("../resources/Roboto[wdth,wght].ttf") as &[u8], 276 | fontdue::FontSettings::default(), 277 | ) 278 | .unwrap(); 279 | 280 | let mut simple_layer = SimpleLayer { 281 | registry_state: RegistryState::new(&globals), 282 | output_state: OutputState::new(&globals, &qh), 283 | shm, 284 | font, 285 | pool, 286 | width, 287 | height, 288 | layer, 289 | header, 290 | caption, 291 | }; 292 | 293 | loop { 294 | event_queue.blocking_dispatch(&mut simple_layer).unwrap(); 295 | } 296 | } 297 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 4 4 | 5 | [[package]] 6 | name = "activate-linux" 7 | version = "0.1.0" 8 | dependencies = [ 9 | "env_logger", 10 | "fontdue", 11 | "smithay-client-toolkit", 12 | "tracing-subscriber", 13 | "wayland-client", 14 | "x11rb", 15 | ] 16 | 17 | [[package]] 18 | name = "ahash" 19 | version = "0.8.11" 20 | source = "registry+https://github.com/rust-lang/crates.io-index" 21 | checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" 22 | dependencies = [ 23 | "cfg-if", 24 | "once_cell", 25 | "version_check", 26 | "zerocopy", 27 | ] 28 | 29 | [[package]] 30 | name = "aho-corasick" 31 | version = "1.1.3" 32 | source = "registry+https://github.com/rust-lang/crates.io-index" 33 | checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" 34 | dependencies = [ 35 | "memchr", 36 | ] 37 | 38 | [[package]] 39 | name = "allocator-api2" 40 | version = "0.2.18" 41 | source = "registry+https://github.com/rust-lang/crates.io-index" 42 | checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" 43 | 44 | [[package]] 45 | name = "anstream" 46 | version = "0.6.17" 47 | source = "registry+https://github.com/rust-lang/crates.io-index" 48 | checksum = "23a1e53f0f5d86382dafe1cf314783b2044280f406e7e1506368220ad11b1338" 49 | dependencies = [ 50 | "anstyle", 51 | "anstyle-parse", 52 | "anstyle-query", 53 | "anstyle-wincon", 54 | "colorchoice", 55 | "is_terminal_polyfill", 56 | "utf8parse", 57 | ] 58 | 59 | [[package]] 60 | name = "anstyle" 61 | version = "1.0.9" 62 | source = "registry+https://github.com/rust-lang/crates.io-index" 63 | checksum = "8365de52b16c035ff4fcafe0092ba9390540e3e352870ac09933bebcaa2c8c56" 64 | 65 | [[package]] 66 | name = "anstyle-parse" 67 | version = "0.2.6" 68 | source = "registry+https://github.com/rust-lang/crates.io-index" 69 | checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" 70 | dependencies = [ 71 | "utf8parse", 72 | ] 73 | 74 | [[package]] 75 | name = "anstyle-query" 76 | version = "1.1.2" 77 | source = "registry+https://github.com/rust-lang/crates.io-index" 78 | checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" 79 | dependencies = [ 80 | "windows-sys 0.59.0", 81 | ] 82 | 83 | [[package]] 84 | name = "anstyle-wincon" 85 | version = "3.0.6" 86 | source = "registry+https://github.com/rust-lang/crates.io-index" 87 | checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" 88 | dependencies = [ 89 | "anstyle", 90 | "windows-sys 0.59.0", 91 | ] 92 | 93 | [[package]] 94 | name = "autocfg" 95 | version = "1.4.0" 96 | source = "registry+https://github.com/rust-lang/crates.io-index" 97 | checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" 98 | 99 | [[package]] 100 | name = "bitflags" 101 | version = "2.6.0" 102 | source = "registry+https://github.com/rust-lang/crates.io-index" 103 | checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" 104 | 105 | [[package]] 106 | name = "bytemuck" 107 | version = "1.19.0" 108 | source = "registry+https://github.com/rust-lang/crates.io-index" 109 | checksum = "8334215b81e418a0a7bdb8ef0849474f40bb10c8b71f1c4ed315cff49f32494d" 110 | dependencies = [ 111 | "bytemuck_derive", 112 | ] 113 | 114 | [[package]] 115 | name = "bytemuck_derive" 116 | version = "1.8.0" 117 | source = "registry+https://github.com/rust-lang/crates.io-index" 118 | checksum = "bcfcc3cd946cb52f0bbfdbbcfa2f4e24f75ebb6c0e1002f7c25904fada18b9ec" 119 | dependencies = [ 120 | "proc-macro2", 121 | "quote", 122 | "syn", 123 | ] 124 | 125 | [[package]] 126 | name = "calloop" 127 | version = "0.13.0" 128 | source = "registry+https://github.com/rust-lang/crates.io-index" 129 | checksum = "b99da2f8558ca23c71f4fd15dc57c906239752dd27ff3c00a1d56b685b7cbfec" 130 | dependencies = [ 131 | "bitflags", 132 | "log", 133 | "polling", 134 | "rustix", 135 | "slab", 136 | "thiserror", 137 | ] 138 | 139 | [[package]] 140 | name = "calloop-wayland-source" 141 | version = "0.3.0" 142 | source = "registry+https://github.com/rust-lang/crates.io-index" 143 | checksum = "95a66a987056935f7efce4ab5668920b5d0dac4a7c99991a67395f13702ddd20" 144 | dependencies = [ 145 | "calloop", 146 | "rustix", 147 | "wayland-backend", 148 | "wayland-client", 149 | ] 150 | 151 | [[package]] 152 | name = "cc" 153 | version = "1.1.31" 154 | source = "registry+https://github.com/rust-lang/crates.io-index" 155 | checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f" 156 | dependencies = [ 157 | "shlex", 158 | ] 159 | 160 | [[package]] 161 | name = "cfg-if" 162 | version = "1.0.0" 163 | source = "registry+https://github.com/rust-lang/crates.io-index" 164 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 165 | 166 | [[package]] 167 | name = "colorchoice" 168 | version = "1.0.3" 169 | source = "registry+https://github.com/rust-lang/crates.io-index" 170 | checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" 171 | 172 | [[package]] 173 | name = "concurrent-queue" 174 | version = "2.5.0" 175 | source = "registry+https://github.com/rust-lang/crates.io-index" 176 | checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" 177 | dependencies = [ 178 | "crossbeam-utils", 179 | ] 180 | 181 | [[package]] 182 | name = "crossbeam-utils" 183 | version = "0.8.20" 184 | source = "registry+https://github.com/rust-lang/crates.io-index" 185 | checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" 186 | 187 | [[package]] 188 | name = "cursor-icon" 189 | version = "1.1.0" 190 | source = "registry+https://github.com/rust-lang/crates.io-index" 191 | checksum = "96a6ac251f4a2aca6b3f91340350eab87ae57c3f127ffeb585e92bd336717991" 192 | 193 | [[package]] 194 | name = "dlib" 195 | version = "0.5.2" 196 | source = "registry+https://github.com/rust-lang/crates.io-index" 197 | checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" 198 | dependencies = [ 199 | "libloading", 200 | ] 201 | 202 | [[package]] 203 | name = "downcast-rs" 204 | version = "1.2.1" 205 | source = "registry+https://github.com/rust-lang/crates.io-index" 206 | checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" 207 | 208 | [[package]] 209 | name = "env_filter" 210 | version = "0.1.2" 211 | source = "registry+https://github.com/rust-lang/crates.io-index" 212 | checksum = "4f2c92ceda6ceec50f43169f9ee8424fe2db276791afde7b2cd8bc084cb376ab" 213 | dependencies = [ 214 | "log", 215 | "regex", 216 | ] 217 | 218 | [[package]] 219 | name = "env_logger" 220 | version = "0.11.5" 221 | source = "registry+https://github.com/rust-lang/crates.io-index" 222 | checksum = "e13fa619b91fb2381732789fc5de83b45675e882f66623b7d8cb4f643017018d" 223 | dependencies = [ 224 | "anstream", 225 | "anstyle", 226 | "env_filter", 227 | "humantime", 228 | "log", 229 | ] 230 | 231 | [[package]] 232 | name = "errno" 233 | version = "0.3.9" 234 | source = "registry+https://github.com/rust-lang/crates.io-index" 235 | checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" 236 | dependencies = [ 237 | "libc", 238 | "windows-sys 0.52.0", 239 | ] 240 | 241 | [[package]] 242 | name = "fontdue" 243 | version = "0.9.2" 244 | source = "registry+https://github.com/rust-lang/crates.io-index" 245 | checksum = "efe23d02309319171d00d794c9ff48d4f903c0e481375b1b04b017470838af04" 246 | dependencies = [ 247 | "hashbrown", 248 | "ttf-parser", 249 | ] 250 | 251 | [[package]] 252 | name = "gethostname" 253 | version = "0.4.3" 254 | source = "registry+https://github.com/rust-lang/crates.io-index" 255 | checksum = "0176e0459c2e4a1fe232f984bca6890e681076abb9934f6cea7c326f3fc47818" 256 | dependencies = [ 257 | "libc", 258 | "windows-targets 0.48.5", 259 | ] 260 | 261 | [[package]] 262 | name = "hashbrown" 263 | version = "0.14.5" 264 | source = "registry+https://github.com/rust-lang/crates.io-index" 265 | checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" 266 | dependencies = [ 267 | "ahash", 268 | "allocator-api2", 269 | ] 270 | 271 | [[package]] 272 | name = "hermit-abi" 273 | version = "0.4.0" 274 | source = "registry+https://github.com/rust-lang/crates.io-index" 275 | checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" 276 | 277 | [[package]] 278 | name = "humantime" 279 | version = "2.1.0" 280 | source = "registry+https://github.com/rust-lang/crates.io-index" 281 | checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" 282 | 283 | [[package]] 284 | name = "is_terminal_polyfill" 285 | version = "1.70.1" 286 | source = "registry+https://github.com/rust-lang/crates.io-index" 287 | checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" 288 | 289 | [[package]] 290 | name = "lazy_static" 291 | version = "1.5.0" 292 | source = "registry+https://github.com/rust-lang/crates.io-index" 293 | checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" 294 | 295 | [[package]] 296 | name = "libc" 297 | version = "0.2.161" 298 | source = "registry+https://github.com/rust-lang/crates.io-index" 299 | checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" 300 | 301 | [[package]] 302 | name = "libloading" 303 | version = "0.8.5" 304 | source = "registry+https://github.com/rust-lang/crates.io-index" 305 | checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" 306 | dependencies = [ 307 | "cfg-if", 308 | "windows-targets 0.52.6", 309 | ] 310 | 311 | [[package]] 312 | name = "linux-raw-sys" 313 | version = "0.4.14" 314 | source = "registry+https://github.com/rust-lang/crates.io-index" 315 | checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" 316 | 317 | [[package]] 318 | name = "log" 319 | version = "0.4.22" 320 | source = "registry+https://github.com/rust-lang/crates.io-index" 321 | checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" 322 | 323 | [[package]] 324 | name = "matchers" 325 | version = "0.1.0" 326 | source = "registry+https://github.com/rust-lang/crates.io-index" 327 | checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" 328 | dependencies = [ 329 | "regex-automata 0.1.10", 330 | ] 331 | 332 | [[package]] 333 | name = "memchr" 334 | version = "2.7.4" 335 | source = "registry+https://github.com/rust-lang/crates.io-index" 336 | checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" 337 | 338 | [[package]] 339 | name = "memmap2" 340 | version = "0.8.0" 341 | source = "registry+https://github.com/rust-lang/crates.io-index" 342 | checksum = "43a5a03cefb0d953ec0be133036f14e109412fa594edc2f77227249db66cc3ed" 343 | dependencies = [ 344 | "libc", 345 | ] 346 | 347 | [[package]] 348 | name = "memmap2" 349 | version = "0.9.5" 350 | source = "registry+https://github.com/rust-lang/crates.io-index" 351 | checksum = "fd3f7eed9d3848f8b98834af67102b720745c4ec028fcd0aa0239277e7de374f" 352 | dependencies = [ 353 | "libc", 354 | ] 355 | 356 | [[package]] 357 | name = "nu-ansi-term" 358 | version = "0.46.0" 359 | source = "registry+https://github.com/rust-lang/crates.io-index" 360 | checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" 361 | dependencies = [ 362 | "overload", 363 | "winapi", 364 | ] 365 | 366 | [[package]] 367 | name = "once_cell" 368 | version = "1.20.2" 369 | source = "registry+https://github.com/rust-lang/crates.io-index" 370 | checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" 371 | 372 | [[package]] 373 | name = "overload" 374 | version = "0.1.1" 375 | source = "registry+https://github.com/rust-lang/crates.io-index" 376 | checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" 377 | 378 | [[package]] 379 | name = "pin-project-lite" 380 | version = "0.2.15" 381 | source = "registry+https://github.com/rust-lang/crates.io-index" 382 | checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" 383 | 384 | [[package]] 385 | name = "pkg-config" 386 | version = "0.3.31" 387 | source = "registry+https://github.com/rust-lang/crates.io-index" 388 | checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" 389 | 390 | [[package]] 391 | name = "polling" 392 | version = "3.7.3" 393 | source = "registry+https://github.com/rust-lang/crates.io-index" 394 | checksum = "cc2790cd301dec6cd3b7a025e4815cf825724a51c98dccfe6a3e55f05ffb6511" 395 | dependencies = [ 396 | "cfg-if", 397 | "concurrent-queue", 398 | "hermit-abi", 399 | "pin-project-lite", 400 | "rustix", 401 | "tracing", 402 | "windows-sys 0.59.0", 403 | ] 404 | 405 | [[package]] 406 | name = "proc-macro2" 407 | version = "1.0.89" 408 | source = "registry+https://github.com/rust-lang/crates.io-index" 409 | checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" 410 | dependencies = [ 411 | "unicode-ident", 412 | ] 413 | 414 | [[package]] 415 | name = "quick-xml" 416 | version = "0.36.2" 417 | source = "registry+https://github.com/rust-lang/crates.io-index" 418 | checksum = "f7649a7b4df05aed9ea7ec6f628c67c9953a43869b8bc50929569b2999d443fe" 419 | dependencies = [ 420 | "memchr", 421 | ] 422 | 423 | [[package]] 424 | name = "quote" 425 | version = "1.0.37" 426 | source = "registry+https://github.com/rust-lang/crates.io-index" 427 | checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" 428 | dependencies = [ 429 | "proc-macro2", 430 | ] 431 | 432 | [[package]] 433 | name = "regex" 434 | version = "1.11.1" 435 | source = "registry+https://github.com/rust-lang/crates.io-index" 436 | checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" 437 | dependencies = [ 438 | "aho-corasick", 439 | "memchr", 440 | "regex-automata 0.4.8", 441 | "regex-syntax 0.8.5", 442 | ] 443 | 444 | [[package]] 445 | name = "regex-automata" 446 | version = "0.1.10" 447 | source = "registry+https://github.com/rust-lang/crates.io-index" 448 | checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" 449 | dependencies = [ 450 | "regex-syntax 0.6.29", 451 | ] 452 | 453 | [[package]] 454 | name = "regex-automata" 455 | version = "0.4.8" 456 | source = "registry+https://github.com/rust-lang/crates.io-index" 457 | checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" 458 | dependencies = [ 459 | "aho-corasick", 460 | "memchr", 461 | "regex-syntax 0.8.5", 462 | ] 463 | 464 | [[package]] 465 | name = "regex-syntax" 466 | version = "0.6.29" 467 | source = "registry+https://github.com/rust-lang/crates.io-index" 468 | checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" 469 | 470 | [[package]] 471 | name = "regex-syntax" 472 | version = "0.8.5" 473 | source = "registry+https://github.com/rust-lang/crates.io-index" 474 | checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" 475 | 476 | [[package]] 477 | name = "rustix" 478 | version = "0.38.37" 479 | source = "registry+https://github.com/rust-lang/crates.io-index" 480 | checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" 481 | dependencies = [ 482 | "bitflags", 483 | "errno", 484 | "libc", 485 | "linux-raw-sys", 486 | "windows-sys 0.52.0", 487 | ] 488 | 489 | [[package]] 490 | name = "scoped-tls" 491 | version = "1.0.1" 492 | source = "registry+https://github.com/rust-lang/crates.io-index" 493 | checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" 494 | 495 | [[package]] 496 | name = "sharded-slab" 497 | version = "0.1.7" 498 | source = "registry+https://github.com/rust-lang/crates.io-index" 499 | checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" 500 | dependencies = [ 501 | "lazy_static", 502 | ] 503 | 504 | [[package]] 505 | name = "shlex" 506 | version = "1.3.0" 507 | source = "registry+https://github.com/rust-lang/crates.io-index" 508 | checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" 509 | 510 | [[package]] 511 | name = "slab" 512 | version = "0.4.9" 513 | source = "registry+https://github.com/rust-lang/crates.io-index" 514 | checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" 515 | dependencies = [ 516 | "autocfg", 517 | ] 518 | 519 | [[package]] 520 | name = "smallvec" 521 | version = "1.13.2" 522 | source = "registry+https://github.com/rust-lang/crates.io-index" 523 | checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" 524 | 525 | [[package]] 526 | name = "smithay-client-toolkit" 527 | version = "0.19.2" 528 | source = "registry+https://github.com/rust-lang/crates.io-index" 529 | checksum = "3457dea1f0eb631b4034d61d4d8c32074caa6cd1ab2d59f2327bd8461e2c0016" 530 | dependencies = [ 531 | "bitflags", 532 | "bytemuck", 533 | "calloop", 534 | "calloop-wayland-source", 535 | "cursor-icon", 536 | "libc", 537 | "log", 538 | "memmap2 0.9.5", 539 | "pkg-config", 540 | "rustix", 541 | "thiserror", 542 | "wayland-backend", 543 | "wayland-client", 544 | "wayland-csd-frame", 545 | "wayland-cursor", 546 | "wayland-protocols", 547 | "wayland-protocols-wlr", 548 | "wayland-scanner", 549 | "xkbcommon", 550 | "xkeysym", 551 | ] 552 | 553 | [[package]] 554 | name = "syn" 555 | version = "2.0.85" 556 | source = "registry+https://github.com/rust-lang/crates.io-index" 557 | checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56" 558 | dependencies = [ 559 | "proc-macro2", 560 | "quote", 561 | "unicode-ident", 562 | ] 563 | 564 | [[package]] 565 | name = "thiserror" 566 | version = "1.0.65" 567 | source = "registry+https://github.com/rust-lang/crates.io-index" 568 | checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" 569 | dependencies = [ 570 | "thiserror-impl", 571 | ] 572 | 573 | [[package]] 574 | name = "thiserror-impl" 575 | version = "1.0.65" 576 | source = "registry+https://github.com/rust-lang/crates.io-index" 577 | checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" 578 | dependencies = [ 579 | "proc-macro2", 580 | "quote", 581 | "syn", 582 | ] 583 | 584 | [[package]] 585 | name = "thread_local" 586 | version = "1.1.8" 587 | source = "registry+https://github.com/rust-lang/crates.io-index" 588 | checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" 589 | dependencies = [ 590 | "cfg-if", 591 | "once_cell", 592 | ] 593 | 594 | [[package]] 595 | name = "tracing" 596 | version = "0.1.40" 597 | source = "registry+https://github.com/rust-lang/crates.io-index" 598 | checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" 599 | dependencies = [ 600 | "pin-project-lite", 601 | "tracing-core", 602 | ] 603 | 604 | [[package]] 605 | name = "tracing-core" 606 | version = "0.1.32" 607 | source = "registry+https://github.com/rust-lang/crates.io-index" 608 | checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" 609 | dependencies = [ 610 | "once_cell", 611 | "valuable", 612 | ] 613 | 614 | [[package]] 615 | name = "tracing-log" 616 | version = "0.2.0" 617 | source = "registry+https://github.com/rust-lang/crates.io-index" 618 | checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" 619 | dependencies = [ 620 | "log", 621 | "once_cell", 622 | "tracing-core", 623 | ] 624 | 625 | [[package]] 626 | name = "tracing-subscriber" 627 | version = "0.3.18" 628 | source = "registry+https://github.com/rust-lang/crates.io-index" 629 | checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" 630 | dependencies = [ 631 | "matchers", 632 | "nu-ansi-term", 633 | "once_cell", 634 | "regex", 635 | "sharded-slab", 636 | "smallvec", 637 | "thread_local", 638 | "tracing", 639 | "tracing-core", 640 | "tracing-log", 641 | ] 642 | 643 | [[package]] 644 | name = "ttf-parser" 645 | version = "0.21.1" 646 | source = "registry+https://github.com/rust-lang/crates.io-index" 647 | checksum = "2c591d83f69777866b9126b24c6dd9a18351f177e49d625920d19f989fd31cf8" 648 | 649 | [[package]] 650 | name = "unicode-ident" 651 | version = "1.0.13" 652 | source = "registry+https://github.com/rust-lang/crates.io-index" 653 | checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" 654 | 655 | [[package]] 656 | name = "utf8parse" 657 | version = "0.2.2" 658 | source = "registry+https://github.com/rust-lang/crates.io-index" 659 | checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" 660 | 661 | [[package]] 662 | name = "valuable" 663 | version = "0.1.0" 664 | source = "registry+https://github.com/rust-lang/crates.io-index" 665 | checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" 666 | 667 | [[package]] 668 | name = "version_check" 669 | version = "0.9.5" 670 | source = "registry+https://github.com/rust-lang/crates.io-index" 671 | checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" 672 | 673 | [[package]] 674 | name = "wayland-backend" 675 | version = "0.3.7" 676 | source = "registry+https://github.com/rust-lang/crates.io-index" 677 | checksum = "056535ced7a150d45159d3a8dc30f91a2e2d588ca0b23f70e56033622b8016f6" 678 | dependencies = [ 679 | "cc", 680 | "downcast-rs", 681 | "rustix", 682 | "scoped-tls", 683 | "smallvec", 684 | "wayland-sys", 685 | ] 686 | 687 | [[package]] 688 | name = "wayland-client" 689 | version = "0.31.7" 690 | source = "registry+https://github.com/rust-lang/crates.io-index" 691 | checksum = "b66249d3fc69f76fd74c82cc319300faa554e9d865dab1f7cd66cc20db10b280" 692 | dependencies = [ 693 | "bitflags", 694 | "rustix", 695 | "wayland-backend", 696 | "wayland-scanner", 697 | ] 698 | 699 | [[package]] 700 | name = "wayland-csd-frame" 701 | version = "0.3.0" 702 | source = "registry+https://github.com/rust-lang/crates.io-index" 703 | checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e" 704 | dependencies = [ 705 | "bitflags", 706 | "cursor-icon", 707 | "wayland-backend", 708 | ] 709 | 710 | [[package]] 711 | name = "wayland-cursor" 712 | version = "0.31.7" 713 | source = "registry+https://github.com/rust-lang/crates.io-index" 714 | checksum = "32b08bc3aafdb0035e7fe0fdf17ba0c09c268732707dca4ae098f60cb28c9e4c" 715 | dependencies = [ 716 | "rustix", 717 | "wayland-client", 718 | "xcursor", 719 | ] 720 | 721 | [[package]] 722 | name = "wayland-protocols" 723 | version = "0.32.5" 724 | source = "registry+https://github.com/rust-lang/crates.io-index" 725 | checksum = "7cd0ade57c4e6e9a8952741325c30bf82f4246885dca8bf561898b86d0c1f58e" 726 | dependencies = [ 727 | "bitflags", 728 | "wayland-backend", 729 | "wayland-client", 730 | "wayland-scanner", 731 | ] 732 | 733 | [[package]] 734 | name = "wayland-protocols-wlr" 735 | version = "0.3.5" 736 | source = "registry+https://github.com/rust-lang/crates.io-index" 737 | checksum = "782e12f6cd923c3c316130d56205ebab53f55d6666b7faddfad36cecaeeb4022" 738 | dependencies = [ 739 | "bitflags", 740 | "wayland-backend", 741 | "wayland-client", 742 | "wayland-protocols", 743 | "wayland-scanner", 744 | ] 745 | 746 | [[package]] 747 | name = "wayland-scanner" 748 | version = "0.31.5" 749 | source = "registry+https://github.com/rust-lang/crates.io-index" 750 | checksum = "597f2001b2e5fc1121e3d5b9791d3e78f05ba6bfa4641053846248e3a13661c3" 751 | dependencies = [ 752 | "proc-macro2", 753 | "quick-xml", 754 | "quote", 755 | ] 756 | 757 | [[package]] 758 | name = "wayland-sys" 759 | version = "0.31.5" 760 | source = "registry+https://github.com/rust-lang/crates.io-index" 761 | checksum = "efa8ac0d8e8ed3e3b5c9fc92c7881406a268e11555abe36493efabe649a29e09" 762 | dependencies = [ 763 | "dlib", 764 | "log", 765 | "pkg-config", 766 | ] 767 | 768 | [[package]] 769 | name = "winapi" 770 | version = "0.3.9" 771 | source = "registry+https://github.com/rust-lang/crates.io-index" 772 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 773 | dependencies = [ 774 | "winapi-i686-pc-windows-gnu", 775 | "winapi-x86_64-pc-windows-gnu", 776 | ] 777 | 778 | [[package]] 779 | name = "winapi-i686-pc-windows-gnu" 780 | version = "0.4.0" 781 | source = "registry+https://github.com/rust-lang/crates.io-index" 782 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 783 | 784 | [[package]] 785 | name = "winapi-x86_64-pc-windows-gnu" 786 | version = "0.4.0" 787 | source = "registry+https://github.com/rust-lang/crates.io-index" 788 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 789 | 790 | [[package]] 791 | name = "windows-sys" 792 | version = "0.52.0" 793 | source = "registry+https://github.com/rust-lang/crates.io-index" 794 | checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" 795 | dependencies = [ 796 | "windows-targets 0.52.6", 797 | ] 798 | 799 | [[package]] 800 | name = "windows-sys" 801 | version = "0.59.0" 802 | source = "registry+https://github.com/rust-lang/crates.io-index" 803 | checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" 804 | dependencies = [ 805 | "windows-targets 0.52.6", 806 | ] 807 | 808 | [[package]] 809 | name = "windows-targets" 810 | version = "0.48.5" 811 | source = "registry+https://github.com/rust-lang/crates.io-index" 812 | checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" 813 | dependencies = [ 814 | "windows_aarch64_gnullvm 0.48.5", 815 | "windows_aarch64_msvc 0.48.5", 816 | "windows_i686_gnu 0.48.5", 817 | "windows_i686_msvc 0.48.5", 818 | "windows_x86_64_gnu 0.48.5", 819 | "windows_x86_64_gnullvm 0.48.5", 820 | "windows_x86_64_msvc 0.48.5", 821 | ] 822 | 823 | [[package]] 824 | name = "windows-targets" 825 | version = "0.52.6" 826 | source = "registry+https://github.com/rust-lang/crates.io-index" 827 | checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" 828 | dependencies = [ 829 | "windows_aarch64_gnullvm 0.52.6", 830 | "windows_aarch64_msvc 0.52.6", 831 | "windows_i686_gnu 0.52.6", 832 | "windows_i686_gnullvm", 833 | "windows_i686_msvc 0.52.6", 834 | "windows_x86_64_gnu 0.52.6", 835 | "windows_x86_64_gnullvm 0.52.6", 836 | "windows_x86_64_msvc 0.52.6", 837 | ] 838 | 839 | [[package]] 840 | name = "windows_aarch64_gnullvm" 841 | version = "0.48.5" 842 | source = "registry+https://github.com/rust-lang/crates.io-index" 843 | checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" 844 | 845 | [[package]] 846 | name = "windows_aarch64_gnullvm" 847 | version = "0.52.6" 848 | source = "registry+https://github.com/rust-lang/crates.io-index" 849 | checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" 850 | 851 | [[package]] 852 | name = "windows_aarch64_msvc" 853 | version = "0.48.5" 854 | source = "registry+https://github.com/rust-lang/crates.io-index" 855 | checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" 856 | 857 | [[package]] 858 | name = "windows_aarch64_msvc" 859 | version = "0.52.6" 860 | source = "registry+https://github.com/rust-lang/crates.io-index" 861 | checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" 862 | 863 | [[package]] 864 | name = "windows_i686_gnu" 865 | version = "0.48.5" 866 | source = "registry+https://github.com/rust-lang/crates.io-index" 867 | checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" 868 | 869 | [[package]] 870 | name = "windows_i686_gnu" 871 | version = "0.52.6" 872 | source = "registry+https://github.com/rust-lang/crates.io-index" 873 | checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" 874 | 875 | [[package]] 876 | name = "windows_i686_gnullvm" 877 | version = "0.52.6" 878 | source = "registry+https://github.com/rust-lang/crates.io-index" 879 | checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" 880 | 881 | [[package]] 882 | name = "windows_i686_msvc" 883 | version = "0.48.5" 884 | source = "registry+https://github.com/rust-lang/crates.io-index" 885 | checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" 886 | 887 | [[package]] 888 | name = "windows_i686_msvc" 889 | version = "0.52.6" 890 | source = "registry+https://github.com/rust-lang/crates.io-index" 891 | checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" 892 | 893 | [[package]] 894 | name = "windows_x86_64_gnu" 895 | version = "0.48.5" 896 | source = "registry+https://github.com/rust-lang/crates.io-index" 897 | checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" 898 | 899 | [[package]] 900 | name = "windows_x86_64_gnu" 901 | version = "0.52.6" 902 | source = "registry+https://github.com/rust-lang/crates.io-index" 903 | checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" 904 | 905 | [[package]] 906 | name = "windows_x86_64_gnullvm" 907 | version = "0.48.5" 908 | source = "registry+https://github.com/rust-lang/crates.io-index" 909 | checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" 910 | 911 | [[package]] 912 | name = "windows_x86_64_gnullvm" 913 | version = "0.52.6" 914 | source = "registry+https://github.com/rust-lang/crates.io-index" 915 | checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" 916 | 917 | [[package]] 918 | name = "windows_x86_64_msvc" 919 | version = "0.48.5" 920 | source = "registry+https://github.com/rust-lang/crates.io-index" 921 | checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" 922 | 923 | [[package]] 924 | name = "windows_x86_64_msvc" 925 | version = "0.52.6" 926 | source = "registry+https://github.com/rust-lang/crates.io-index" 927 | checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" 928 | 929 | [[package]] 930 | name = "x11rb" 931 | version = "0.13.1" 932 | source = "registry+https://github.com/rust-lang/crates.io-index" 933 | checksum = "5d91ffca73ee7f68ce055750bf9f6eca0780b8c85eff9bc046a3b0da41755e12" 934 | dependencies = [ 935 | "gethostname", 936 | "rustix", 937 | "x11rb-protocol", 938 | ] 939 | 940 | [[package]] 941 | name = "x11rb-protocol" 942 | version = "0.13.1" 943 | source = "registry+https://github.com/rust-lang/crates.io-index" 944 | checksum = "ec107c4503ea0b4a98ef47356329af139c0a4f7750e621cf2973cd3385ebcb3d" 945 | 946 | [[package]] 947 | name = "xcursor" 948 | version = "0.3.8" 949 | source = "registry+https://github.com/rust-lang/crates.io-index" 950 | checksum = "0ef33da6b1660b4ddbfb3aef0ade110c8b8a781a3b6382fa5f2b5b040fd55f61" 951 | 952 | [[package]] 953 | name = "xkbcommon" 954 | version = "0.7.0" 955 | source = "registry+https://github.com/rust-lang/crates.io-index" 956 | checksum = "13867d259930edc7091a6c41b4ce6eee464328c6ff9659b7e4c668ca20d4c91e" 957 | dependencies = [ 958 | "libc", 959 | "memmap2 0.8.0", 960 | "xkeysym", 961 | ] 962 | 963 | [[package]] 964 | name = "xkeysym" 965 | version = "0.2.1" 966 | source = "registry+https://github.com/rust-lang/crates.io-index" 967 | checksum = "b9cc00251562a284751c9973bace760d86c0276c471b4be569fe6b068ee97a56" 968 | dependencies = [ 969 | "bytemuck", 970 | ] 971 | 972 | [[package]] 973 | name = "zerocopy" 974 | version = "0.7.35" 975 | source = "registry+https://github.com/rust-lang/crates.io-index" 976 | checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" 977 | dependencies = [ 978 | "zerocopy-derive", 979 | ] 980 | 981 | [[package]] 982 | name = "zerocopy-derive" 983 | version = "0.7.35" 984 | source = "registry+https://github.com/rust-lang/crates.io-index" 985 | checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" 986 | dependencies = [ 987 | "proc-macro2", 988 | "quote", 989 | "syn", 990 | ] 991 | --------------------------------------------------------------------------------