Compare commits

...

3 commits

Author SHA1 Message Date
1851311684
cargo.lock 2020-07-13 12:51:52 -05:00
1897deb33b
bump version to 0.3.4 2020-07-13 12:48:41 -05:00
ee9f00284d
use DISPLAY environment variable 2020-07-13 12:48:23 -05:00
3 changed files with 8 additions and 4 deletions

4
Cargo.lock generated
View file

@ -1,3 +1,5 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]]
name = "adler32"
version = "1.0.3"
@ -419,7 +421,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "leanshot"
version = "0.3.3"
version = "0.3.4"
dependencies = [
"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)",

View file

@ -1,10 +1,10 @@
[package]
name = "leanshot"
description = "Screenshot capture for Linux."
version = "0.3.3"
version = "0.3.4"
repository = "https://github.com/iptq/leanshot"
license-file = "LICENSE"
authors = ["Michael Zhang <failed.down@gmail.com>"]
authors = ["Michael Zhang <iptq@protonmail.com>"]
[workspace]
members = [".", "imlib2", "imlib2/imlib2-sys", "xlib"]

View file

@ -1,3 +1,5 @@
use std::env;
use imlib2::{self, Image as Image2};
use xlib::{Display, Visual, Window};
@ -12,7 +14,7 @@ pub struct GUI {
impl GUI {
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 })
}