Skip to content

Conversation

@x71c9
Copy link

@x71c9 x71c9 commented Jul 3, 2025

This pull request introduces a new feature that allows users to align the authentication window to the top-left corner of the screen.

Description

A new environment variable, XSECURELOCK_TOP_LEFT, has been added. When set to x:y coordinates (e.g., 10:10), it positions the authentication window at that specific top-left corner. If the variable is not set, the window remains centered, preserving the existing default behavior.

This provides users with more flexibility to customize the look and feel of the lock screen, especially for tiling window manager users or those with specific multi-monitor setups.

Implementation Details

The following changes were made to helpers/auth_x11.c:

  • Window Positioning: The CreateOrUpdatePerMonitorWindow function now checks for the XSECURELOCK_TOP_LEFT variable. If it's set, the function uses the provided coordinates to calculate the window's position. Otherwise, it continues to center the window on the monitor.

  • Text Alignment: In the DisplayMessage function, the horizontal position of each line of text is now determined by whether XSECURELOCK_TOP_LEFT is set. If it is, the text is aligned to the left (x-coordinate 0 within the window); otherwise, it is centered.

  • Line Spacing: The vertical spacing between lines of text has been adjusted. When top-left alignment is active, the spacing is reduced for a more compact appearance.

  • Vertical Centering: The initial vertical position (y) of the text block is now calculated to start from the top of the window when XSECURELOCK_TOP_LEFT is set, removing the previous top margin that was present for centered alignment.

Documentation

The README.md file has been updated to include documentation for the new XSECURELOCK_TOP_LEFT environment variable.

This change has been tested manually to ensure that both the new top-left alignment and the default centered alignment work as expected.

./run-linter.sh and test/run-tests.sh have been run without new errors for this edit. Some error came out but not regarding this new edit.

We are open to make any changes to make the pull request possible.

@x71c9
Copy link
Author

x71c9 commented Nov 15, 2025

Kindly pinging @divVerent

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

Successfully merging this pull request may close these issues.

1 participant