forked from michael/leanshot
Compare commits
3 commits
Author | SHA1 | Date | |
---|---|---|---|
1851311684 | |||
1897deb33b | |||
ee9f00284d |
3 changed files with 8 additions and 4 deletions
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -1,3 +1,5 @@
|
||||||
|
# This file is automatically @generated by Cargo.
|
||||||
|
# It is not intended for manual editing.
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "adler32"
|
name = "adler32"
|
||||||
version = "1.0.3"
|
version = "1.0.3"
|
||||||
|
@ -419,7 +421,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "leanshot"
|
name = "leanshot"
|
||||||
version = "0.3.3"
|
version = "0.3.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
"failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"gl 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"gl 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
[package]
|
[package]
|
||||||
name = "leanshot"
|
name = "leanshot"
|
||||||
description = "Screenshot capture for Linux."
|
description = "Screenshot capture for Linux."
|
||||||
version = "0.3.3"
|
version = "0.3.4"
|
||||||
repository = "https://github.com/iptq/leanshot"
|
repository = "https://github.com/iptq/leanshot"
|
||||||
license-file = "LICENSE"
|
license-file = "LICENSE"
|
||||||
authors = ["Michael Zhang <failed.down@gmail.com>"]
|
authors = ["Michael Zhang <iptq@protonmail.com>"]
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
members = [".", "imlib2", "imlib2/imlib2-sys", "xlib"]
|
members = [".", "imlib2", "imlib2/imlib2-sys", "xlib"]
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
use std::env;
|
||||||
|
|
||||||
use imlib2::{self, Image as Image2};
|
use imlib2::{self, Image as Image2};
|
||||||
use xlib::{Display, Visual, Window};
|
use xlib::{Display, Visual, Window};
|
||||||
|
|
||||||
|
@ -12,7 +14,7 @@ pub struct GUI {
|
||||||
|
|
||||||
impl GUI {
|
impl GUI {
|
||||||
pub fn new() -> Result<Self, ScreenshotError> {
|
pub fn new() -> Result<Self, ScreenshotError> {
|
||||||
let display = Display::connect(":0")?;
|
let display = Display::connect(env::var("DISPLAY").unwrap_or_else(|_| ":0".to_owned()))?;
|
||||||
Ok(GUI { display })
|
Ok(GUI { display })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue