From 6faae93d1598e988c75086a36cc99c0eed834f2d Mon Sep 17 00:00:00 2001 From: krisdoodle45 <86745210+krisdoodle45@users.noreply.github.com> Date: Thu, 14 Oct 2021 20:46:07 +0200 Subject: [PATCH] Replicate tail functionality in awk --- .local/bin/displayselect | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.local/bin/displayselect b/.local/bin/displayselect index f9e8062..0b33f7b 100755 --- a/.local/bin/displayselect +++ b/.local/bin/displayselect @@ -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//')