--center: Place window on center of screen.

496 views
Skip to first unread message

Paul

unread,
Mar 9, 2016, 8:36:22 AM3/9/16
to yad-common
Dear all, I have problem with option --center - when I using yad, it is sometimes work and place my window to center of screen and sometimes not (mainly it is not working). It is normal?

Thank you for sharing your experience.

Paul.

serge gabellon

unread,
Mar 9, 2016, 9:01:48 AM3/9/16
to yad-common
Hi.
for me with
my wm
I have a bug if I use center and fixed
together.
I solve the problem with xrandr and --geometry
a example:
largeurecran=$(xrandr -q | grep -w Screen | sed 's/.*current //;s/,.*//' | awk '{print $1}')
hauteurecran
=$(xrandr -q | grep -w Screen | sed 's/.*current //;s/,.*//' | awk '{print $3}')
pointXbuilder
=$(echo $(((($largeurecran-($largeurecran/10)*7)/2))))
pointYbuilder
=$(echo $(((($hauteurecran-($hauteurecran/10)*7)/2))))
largeurbuilder
=$(echo $((($largeurecran/10)*7)))
hauteurbuilder
=$(echo $((($hauteurecran/10)*7)))
geometriebuilder
="$largeurbuilder"x"$hauteurbuilder"+"$pointXbuilder"+"$pointYbuilder"
yad
--title="Enregister dans un fichier texte." --geometry="$geometriebuilder"


Victor Ananjevsky

unread,
Mar 9, 2016, 9:10:26 AM3/9/16
to yad-c...@googlegroups.com
this is highly depends on your window manager.
yad just asking wm for appropriate placing.

В Wed, 9 Mar 2016 05:36:22 -0800 (PST)
Paul <bbro...@gmail.com> писал:
> --
> You received this message because you are subscribed to the Google Groups "yad-common" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to yad-common+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.


--
Victor Ananjevsky <anan...@gmail.com>

Paul

unread,
Mar 9, 2016, 11:09:22 AM3/9/16
to yad-common
Thank you so much Serge. But your solution still does not work with --fixed isnt it?

Paul

unread,
Mar 9, 2016, 11:11:11 AM3/9/16
to yad-common
Thank you Viktor. So is there any solution how to use --center and --fixed together. I am using Ubuntu. Serge showed me some his very elegant solution, but is does not work with --fixed option.

Paul.

serge gabellon

unread,
Mar 9, 2016, 6:30:21 PM3/9/16
to yad-common
yes it works
give it a size
#size window = 500x500

largeurecran
=$(xrandr -q | grep -w Screen | sed 's/.*current //;s/,.*//' | awk '{print $1}')
hauteurecran
=$(xrandr -q | grep -w Screen | sed 's/.*current //;s/,.*//' | awk '{print $3}')

pointX
=$(echo $((($largeurecran-500)/2)))
pointY
=$(echo $((($hauteurecran-500)/2)))
yad
--width=500 --height=500 --fixed --geometry="+$pointX+$pointY"


Reply all
Reply to author
Forward
0 new messages