voidrice icon indicating copy to clipboard operation
voidrice copied to clipboard

Bug fix in `displayselect`

Open davidnevadoc opened this issue 1 year ago • 0 comments

Description

The displayselect script gets the connected displays in the variable screens, with each screen in a new line. When selecting 2 or more displays, the last display (secondary or tertiary) are selected by filtering out the already selected displays with grep - v "$primary". This can be problematic in the cases where one display name is a substring of anothers name. For example: (eDP1 and DP1). In this case, if DP1 is selected as primary display, the selection of secondary display will fail, as grep -v "DP1" will filter out both lines.

Changes

Adjust grep -v pattern to avoid unintended matches by adding ^ and $ to the searched pattern.

davidnevadoc avatar Dec 20 '23 11:12 davidnevadoc