From 47f5b774d4359b855c8cf105b638c2bad91e22bf Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Fri, 8 Mar 2013 23:47:09 +0100 Subject: [PATCH] Shell: winefps function to monitor FPS in all Wine games. --- .shell.d/funs_rc | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.shell.d/funs_rc b/.shell.d/funs_rc index d2a7cbb4..89f399ec 100644 --- a/.shell.d/funs_rc +++ b/.shell.d/funs_rc @@ -403,6 +403,29 @@ webdl () movgrab -f webm:$RES "$2" } +## Wine FPS monitor +winefps () +{ + if [ $# -ne 1 ]; then + echo "Usage: ${0##*/} WIN32EXE" + return + fi + + if [ -z "$(command -v osd_cat)" ]; then + echo "You must have osd_cat." + return + fi + + if [ -z "$(sed --version | grep "GNU")" ]; then + echo "You must have GNU sed." + return + fi + + WINEDEBUG=fps wine "$1" 2>&1 | tee /dev/stderr | \ + sed -un '/^trace:fps:/{s/.* \([^ ]*\)fps/\1/;p}' | \ + osd_cat -l1 -f "-*-*-*-*-*-*-32-*-*-*-*-*-*-*" -O1 -c "yellow" +} + ##============================================================================== ## Pacman functions