Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XParseGeometry docs and xmenu docs causes ambiguity for positioning #58

Open
Avinash-Bhat opened this issue Jul 13, 2024 · 0 comments
Open

Comments

@Avinash-Bhat
Copy link

Avinash-Bhat commented Jul 13, 2024

According to the xmenu documentation, XParseGeometry is used for parsing the (first part of) -p option.

The XParseGeometry documentation says the format should be:

[=][<width>{xX}<height>][{+-}<xoffset>{+-}<yoffset>]

But when invoking xmenu using xmenu -p 0x0 it shows at position 0,0 (top-left) of the monitor. If I'm not wrong here, following the documentation of XParseGeometry, we should be invoking xmenu -p '+0+0' instead for the same behavior. This causes some ambiguity in positioning the menus.

On the same note, using xmenu -p '-0-0' should theoretically place it at the bottom right of the monitor which would be a good use-case to considering the user is left to do xrandr math in shell.

I'm sure that there are other users who would want to do the same.

personal note:

I ran into this weirdness when I was creating a power menu using xmenu.

#!/bin/sh
POSITION=$(xrandr --query |awk -F '[ x+]' '/\<primary\>/{print $4-(8*2)"x"$5-(95*2)}')
echo $POSITION
xmenu -p ${POSITION}:cursor <<EOF | sh &
Shutdown			systemctl poweroff
Reboot				systemctl reboot
Hibernate			loginctl lock-session $XDG_SESSION_ID && systemctl hibernate
Sleep				loginctl lock-session $XDG_SESSION_ID && systemctl suspend
Logout				i3-msg exit
Lock				loginctl lock-session $XDG_SESSION_ID
EOF

whenever I added a new item to the menu I have to adjust the y-position using awk as the height of the menu changes.

I hope you see that this is a bit awkward to work with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant