fix pixels on inverts

This commit is contained in:
Vinzenz Schroeter 2025-02-13 20:05:28 +01:00
parent 542bd19ace
commit 5777d7d47d
2 changed files with 11 additions and 5 deletions

View file

@ -94,11 +94,17 @@ pub enum StreamCommand {
about = "Pipe text to the display, example: `journalctl | servicepoint-cli stream stdin`" about = "Pipe text to the display, example: `journalctl | servicepoint-cli stream stdin`"
)] )]
Stdin { Stdin {
#[arg(long, short, default_value_t = false)] #[arg(
long,
short,
default_value_t = false,
help = "Wait for a short amount of time before sending the next line"
)]
slow: bool, slow: bool,
}, },
#[clap(about = "Stream the default source to the display. \ #[clap(about = "Stream the default source to the display. \
On Linux Wayland, this pops up a screen or window chooser, but it also may directly start streaming your main screen.")] On Linux Wayland, this pops up a screen or window chooser, \
but it also may directly start streaming your main screen.")]
Screen { Screen {
#[command(flatten)] #[command(flatten)]
options: StreamScreenOptions, options: StreamScreenOptions,
@ -107,7 +113,7 @@ pub enum StreamCommand {
#[derive(clap::Parser, std::fmt::Debug, Clone)] #[derive(clap::Parser, std::fmt::Debug, Clone)]
pub struct StreamScreenOptions { pub struct StreamScreenOptions {
#[arg(long, short, default_value_t = false, help = "Disable dithering")] #[arg(long, short, default_value_t = false, help = "Disable dithering - improves performance")]
pub no_dither: bool, pub no_dither: bool,
#[arg( #[arg(

View file

@ -23,14 +23,14 @@ fn pixels(connection: &Connection, pixel_command: PixelCommand) {
match pixel_command { match pixel_command {
PixelCommand::Off => pixels_reset(connection), PixelCommand::Off => pixels_reset(connection),
PixelCommand::Invert => pixels_invert(connection), PixelCommand::Invert => pixels_invert(connection),
PixelCommand::On => pixels_on(connection) PixelCommand::On => pixels_on(connection),
} }
} }
fn pixels_on(connection: &Connection) { fn pixels_on(connection: &Connection) {
let mask = BitVec::repeat(true, PIXEL_COUNT); let mask = BitVec::repeat(true, PIXEL_COUNT);
connection connection
.send(Command::BitmapLinearXor(0, mask, CompressionCode::Lzma)) .send(Command::BitmapLinear(0, mask, CompressionCode::Lzma))
.expect("could not send command") .expect("could not send command")
} }