polybar: Change while read loop to an xargs pipe
This commit is contained in:
@@ -22,10 +22,11 @@ done
|
|||||||
if ! pgrep -ax polybar >/dev/null 2>&1; then
|
if ! pgrep -ax polybar >/dev/null 2>&1; then
|
||||||
# launch Polybar on every monitor
|
# launch Polybar on every monitor
|
||||||
# https://github.com/polybar/polybar/issues/763
|
# https://github.com/polybar/polybar/issues/763
|
||||||
while read -r m; do
|
polybar --list-monitors \
|
||||||
export MONITOR="${m%%:*}"
|
| cut -d: -f1 \
|
||||||
|
| xargs -I'{}' -P0 \
|
||||||
|
env MONITOR='{}' \
|
||||||
polybar --reload -c "$BASE_DIR/config" main &
|
polybar --reload -c "$BASE_DIR/config" main &
|
||||||
done <<<"$(polybar --list-monitors)"
|
|
||||||
|
|
||||||
echo "Polybar launched..."
|
echo "Polybar launched..."
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user