Keybindings.sh eos_yad geometry - cant alter floating window height

Hi,

I have customised the content of the script /home/leigh/.config/i3/scripts/keyhint.sh to include my custom keybinds etc

All works well, except that I now have more entries in the table and I am trying to make the window higher/longer so that I dont have to scroll to see the last entries

I looked up the --geometry option and it should be:
--geometry Width x Height X-posn Y-posn

Sure enough, I can move the window around with the last two arguments and widen it with the first (Width).

But the second (Edit: I did initially write ‘fourth’ here in this post, sorry) (Height) makes no difference, (neither after mod + shift + r nor after a full reboot)

What am I missing, please?

--geometry=400xhight-15-400
so second not 4.

p.e. --geometry=400x600-15-400

Option --geometry is working here.
Instead of that you can use:

--posx
--posy
--width
--height

See man yad.

Thanks very much for the replies, sorry, that was a Typo - when I wrote ‘Fourth’ I meant ‘Second’ :blush:

And, sorry for answering my own question, but the act of asking the question sparked my brain into finding the answer :blush:

  1. I had put this in my .config, which was restricting the floating window height:
# Constrain floating min and max x by y sizes (-1 is unconstrained)	
floating_minimum_size 75 x 50
floating_maximum_size 500x500

Once I changed it to the size of my (smaller) laptop screen, I could lengthen the window:

floating_maximum_size 1366x768

Right, next (related) problem!

putting the below makes the window appear centrally horizontally and vertically (i.e. centre of window in centre of screen) on the bigger external monitor and centrally horizontally and a tiny bit below centrally vertically on the smaller laptop monitor

--geometry=300x768+0+0

I was expecting this to put the window top left corner at the top left corner of the monitor

I have this in my monitor.sh script:


xrandr --output eDP1 --primary --mode 1366x768 --pos 277x1080 --rotate normal --output DP1 --off --output HDMI1 --mode 1920x1080 --pos 0x0 --rotate normal --output VIRTUAL1 --off

Also, changing the X & Y in the --geometry option does move the window around, but not as I expect (e.g. changing X seems to change Y as well

I’m confused

I thought +0+0 was put window top left and -0-0 put it at bottom right and so on …

-1-1 puts it to lower right.

Thanks!

So +0+0 is centred I guess

Could someone direct me to a link with the definitions of the coordinate system please, to stop me asking more silly questions?

what is eos_yad vs yad, by the way?

Also, the window positioning isnt the same on both monitors (the floating window appears on the screen where I have the focus I think)

Could someone explain that please?

And how do I make all floating windows only appear on the large monitor?

Thanks for your patience !

Some sources of information about yad:

eos_yad is a slightly modified version of yad. Yad code was patched to fix the height problem with some yad windows. Additionally, eos_yad (which is a bash function by the way) adds the EndeavourOS icon to the upper left corner.

I have only one monitor, so unfortunately can’t explain multi-monitor features.
You can try to ask for help at the source code page of yad, see above.

Thanks,
I did look at man yad but it says,


--geometry=WIDTHxHEIGHT+X+Y
              Use standard X Window geometry notation for placing dialog.  When this option is used, width, height, posx, posy, mouse and center options are ignored.

But I just cant find what ‘standard X Window geometry notation’ is

Anyway in the end I have got more or less what I want by trial and error with:


#        eos_yad --title="EndeavourOS i3-wm keybindings:" --no-buttons --geometry=300x760-70+160 --list
#        --column=key: --column=description:
        eos_yad --title="EndeavourOS i3-wm keybindings:" --no-buttons --width=300 --height=760 --posx=-70 --posy=160 --list
        --column=key: --column=description:

Both the above give the same result

1 Like

For future reference - I found these:

From http://sites.science.oregonstate.edu/~landaur/nacphy/coping-with-unix/node126.html

In ‘CreateWindow’
The coordinate system has the X axis horizontal and the Y axis vertical with the origin [0, 0] at the
upper-left corner. Coordinates are integral, in terms of pixels, and coincide with pixel centers. Each
window and pixmap has its own coordinate system. For a window, the origin is inside the border at the
inside, upper-left corner.

The x and y coordinates for the window are relative to the parent’s origin and specify the position of the
upper-left outer corner of the window (not the origin). The width and height specify the inside size (not
including the border) and must be nonzero (or a Value error results). The border-width for an
InputOnly window must be zero (or a Match error results).

(Glossary) Coordinate system

The coordinate system has the X axis horizontal and the Y axis vertical, with the origin [0, 0] at the 
upper left. Coordinates are integral, in terms of pixels, and coincide with pixel centers. Each 
window and pixmap has its own coordinate system. For a window, the origin is inside the border at 
the inside upper left. 

This is helpful too http://sites.science.oregonstate.edu/~landaur/nacphy/coping-with-unix/node126.html

OK, I got exactly what I wanted:

in .config to make window appear on external monitor HDMI1 and stick it to glass:

# Move keyhints window to external monitor & have it stay on screen even if you switch to another workspace 
for_window [title="EndeavourOS i3-wm keybindings:"] move window to output HDMI1
for_window [title="EndeavourOS i3-wm keybindings:"] sticky enable

In keyhints.sh:

        eos_yad --title="EndeavourOS i3-wm keybindings:" --no-buttons --geometry=300x760-6-774 --list
        --column=key: --column=description:

the xposn of -6 is 6 in from the RHS since I have gaps of 6

the yposn of -774 (768+6) is because I have the 1366x768 laptop monitor below the external monitor in my monitor.sh, and again gaps of 6 so it looks homogenous.

Now the keybind hints window pops up nicely at the bottom RH side of my larger terminal no matter where the focus is

This is fun!

Sorry if its bad form to put your own post as solution!

1 Like

Solution is the solution! :wink: :smile:

i do currently use a script from here:

used by a rofi menu… the script reads from config directly so no need to change the hints manually…

Thanks, I had seen that but in the end I prefer this

yes i have the “gui” too rofi menu if i need some i do not remind as it has a search function…

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.