Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/typos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
# yamllint disable rule:line-length
name: check_typos

on: # yamllint disable-line rule:truthy
push:
pull_request:
branches:
- '**'

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: typos-action
uses: crate-ci/typos@v1.30.1
2 changes: 1 addition & 1 deletion libwayshot/examples/waymirror-egl/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub fn load_shader(shader_type: GLenum, src: String) -> Result<GLuint> {
gl::GetShaderiv(shader, gl::COMPILE_STATUS, &mut status as *mut i32);

if status > 0 {
tracing::event!(tracing::Level::INFO, "Shader compile successfull!",);
tracing::event!(tracing::Level::INFO, "Shader compile successful!",);
} else {
return Err(WaylandEGLStateError::GLShaderCompileFailed);
}
Expand Down
6 changes: 3 additions & 3 deletions libwayshot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ impl WayshotConnection {
/// - `output`: Reference to the `WlOutput` from which the frame is to be captured.
/// - `capture_region`: Optional region specifying a sub-area of the output to capture. If `None`, the entire output is captured.
/// # Returns
/// - If the function was found and called, an OK(()), note that this does not neccesarily mean that binding was successful, only that the function was called.
/// - If the function was found and called, an OK(()), note that this does not necessarily mean that binding was successful, only that the function was called.
/// The caller may check for any OpenGL errors using the standard routes.
/// - If the function was not found, [`Error::EGLImageToTexProcNotFoundError`] is returned
pub unsafe fn bind_output_frame_to_gl_texture(
Expand Down Expand Up @@ -507,7 +507,7 @@ impl WayshotConnection {
};

// Empty internal event buffer until buffer_done is set to true which is when the Buffer done
// event is fired, aka the capture from the compositor is succesful.
// event is fired, aka the capture from the compositor is successful.
while !state.buffer_done.load(Ordering::SeqCst) {
event_queue.blocking_dispatch(&mut state)?;
}
Expand Down Expand Up @@ -597,7 +597,7 @@ impl WayshotConnection {
};

// Empty internal event buffer until buffer_done is set to true which is when the Buffer done
// event is fired, aka the capture from the compositor is succesful.
// event is fired, aka the capture from the compositor is successful.
while !state.buffer_done.load(Ordering::SeqCst) {
event_queue.blocking_dispatch(&mut state)?;
}
Expand Down
4 changes: 2 additions & 2 deletions libwayshot/src/screencopy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ pub fn create_shm_fd() -> std::io::Result<OwnedFd> {
// Only try memfd on linux and freebsd.
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
loop {
// Create a file that closes on succesful execution and seal it's operations.
// Create a file that closes on successful execution and seal it's operations.
match fs::memfd_create(
CString::new("libwayshot")?.as_c_str(),
fs::MemfdFlags::CLOEXEC | fs::MemfdFlags::ALLOW_SEALING,
Expand Down Expand Up @@ -189,7 +189,7 @@ pub fn create_shm_fd() -> std::io::Result<OwnedFd> {
// O_CREAT = Create file if does not exist.
// O_EXCL = Error if create and file exists.
// O_RDWR = Open for reading and writing.
// O_CLOEXEC = Close on succesful execution.
// O_CLOEXEC = Close on successful execution.
// S_IRUSR = Set user read permission bit .
// S_IWUSR = Set user write permission bit.
match open_result {
Expand Down
4 changes: 2 additions & 2 deletions wayshot/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ impl FromStr for EncodingFormat {

pub fn get_default_file_name(extension: EncodingFormat) -> PathBuf {
let current_datetime: DateTime<Local> = Local::now();
let formated_time = format!("{}", current_datetime.format("%Y_%m_%d-%H_%M_%S"));
let formatted_time = format!("{}", current_datetime.format("%Y_%m_%d-%H_%M_%S"));

format!("wayshot-{formated_time}.{extension}").into()
format!("wayshot-{formatted_time}.{extension}").into()
}
6 changes: 3 additions & 3 deletions wayshot/src/wayshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ use wl_clipboard_rs::copy::{MimeType, Options, Source};

use rustix::runtime::{self, Fork};

fn select_ouput<T>(ouputs: &[T]) -> Option<usize>
fn select_output<T>(outputs: &[T]) -> Option<usize>
where
T: ToString,
{
let Ok(selection) = FuzzySelect::with_theme(&ColorfulTheme::default())
.with_prompt("Choose Screen")
.default(0)
.items(ouputs)
.items(outputs)
.interact()
else {
return None;
Expand Down Expand Up @@ -95,7 +95,7 @@ fn main() -> Result<()> {
.iter()
.map(|display| display.name.as_str())
.collect();
if let Some(index) = select_ouput(&output_names) {
if let Some(index) = select_output(&output_names) {
wayshot_conn.screenshot_single_output(&outputs[index], cli.cursor)?
} else {
bail!("No output found!");
Expand Down