From 90455e5dfb25656783c1413ba4f97ed9a793b5f7 Mon Sep 17 00:00:00 2001 From: Anthony Axenov Date: Sun, 23 Jul 2023 01:22:02 +0000 Subject: [PATCH] is_full_screen --- shell/helpers.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/shell/helpers.sh b/shell/helpers.sh index 0332dc0..4e67cfc 100644 --- a/shell/helpers.sh +++ b/shell/helpers.sh @@ -397,6 +397,20 @@ assert_code() { # Misc ######################################################## +# https://askubuntu.com/a/30414 +is_full_screen() { + WINDOW=$(echo $(xwininfo -id $(xdotool getactivewindow) -stats | \ + egrep '(Width|Height):' | \ + awk '{print $NF}') | \ + sed -e 's/ /x/') + SCREEN=$(xdpyinfo | grep -m1 dimensions | awk '{print $2}') + if [ "$WINDOW" = "$SCREEN" ]; then + return 0 + else + return 1 + fi +} + curltime() { curl -w @- -o /dev/null -s "$@" <<'EOF' time_namelookup: %{time_namelookup} sec\n