Replicate tail functionality in awk

This commit is contained in:
krisdoodle45 2021-10-14 20:46:07 +02:00 committed by GitHub
parent 64f31bf86c
commit 6faae93d15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,9 +14,9 @@ twoscreen() { # If multi-monitor is selected and there are two screens.
internal=$(echo "$screens" | grep -v "$external")
res_external=$(xrandr --query | sed -n "/^$external/,/\+/p" | \
tail -n 1 | awk '{print $1}')
awk 'END {print $1}')
res_internal=$(xrandr --query | sed -n "/^$internal/,/\+/p" | \
tail -n 1 | awk '{print $1}')
awk 'END {print $1}')
res_ext_x=$(echo "$res_external" | sed 's/x.*//')
res_ext_y=$(echo "$res_external" | sed 's/.*x//')