gnuastro-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnuastro-commits] master 25636d97: fits-view: only using resolution of


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 25636d97: fits-view: only using resolution of primary image
Date: Sat, 26 Feb 2022 21:08:00 -0500 (EST)

branch: master
commit 25636d97bf2f73b0fa7039727350dfefeeeed46a
Author: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>

    fits-view: only using resolution of primary image
    
    Until now, 'astscript-fits-view' would simply read all the active screen
    resolutions (those with a '*'). However, when more than one display is
    connected to the computer, there will be multiple lines with a '*' in the
    output of 'xrandr'!
    
    With this commit, only the first line with a '*' is used (which is the
    primary display).
---
 bin/script/fits-view.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/script/fits-view.in b/bin/script/fits-view.in
index fe646576..c1deaf3a 100755
--- a/bin/script/fits-view.in
+++ b/bin/script/fits-view.in
@@ -212,7 +212,7 @@ if [ x"$ds9geometry" = x ]; then
         geosize=$(xrandr \
                       | grep '*' \
                       | sed 's/x/ /' \
-                      | awk '{w=0.75*$2; printf "%dx%d\n", w, $2}')
+                      | awk 'NR==1{w=0.75*$2; printf "%dx%d\n", w, $2}')
         ds9geoopt="-geometry $geosize"
 
     fi



reply via email to

[Prev in Thread] Current Thread [Next in Thread]