From 34c22970f2f85c54bb63dfc9dffd82e2cfcaed22 Mon Sep 17 00:00:00 2001 From: t-bltg Date: Tue, 8 Feb 2022 23:41:12 +0100 Subject: [PATCH] UnicodePlots: update hack for `png` --- src/backends/unicodeplots.jl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/backends/unicodeplots.jl b/src/backends/unicodeplots.jl index f3528ce0..59c758ed 100644 --- a/src/backends/unicodeplots.jl +++ b/src/backends/unicodeplots.jl @@ -265,7 +265,12 @@ function png(plt::Plot{UnicodePlotsBackend}, fn::AbstractString) elseif Sys.islinux() run(`clear`) gui(plt) - run(`import -window $(ENV["WINDOWID"]) $fn`) + win = if "WINDOWID" in keys(ENV) + ENV["WINDOWID"] + else + readchomp(`xdotool getactivewindow`) + end + run(`import -window $win $fn`) return end