voidrice
voidrice copied to clipboard
Bug fix in `displayselect`
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.