LukeSmithxyz / voidrice

My dotfiles (deployed by LARBS)
GNU General Public License v3.0
4.26k stars 1.22k forks source link

Bug fix in `displayselect` #1383

Closed davidnevadoc closed 3 months ago

davidnevadoc commented 8 months ago

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.