From 8ed9beffba35cae37059c4543ef01e7eb0eaac0d Mon Sep 17 00:00:00 2001 From: stupidcomputer Date: Thu, 25 Jul 2024 00:51:56 -0500 Subject: [PATCH] allow capture to run in tmenu --- builds/utils/capture | 10 +++++++++- builds/utils/tmenu_run | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/builds/utils/capture b/builds/utils/capture index fba1415..eb1a99b 100755 --- a/builds/utils/capture +++ b/builds/utils/capture @@ -1,3 +1,11 @@ +#!/bin/sh + +if [ "$IS_RUNNING_IN_TMENU" = "yes" ]; then + unset IS_RUNNING_IN_TMENU + st -c tmenu-prompt -e "$0" + exit +fi + display=$(xrandr \ | grep ' connected' \ | awk -F ' ' '{print $1}' \ @@ -29,7 +37,7 @@ printf "[] capturing in medium %s\n" "$medium" case "$medium" in *"mp4"*) - ffcast -g $geom rec + ffcast -g $geom rec $HOME/output.mp4 ;; *"png"*) ffcast -g $geom png diff --git a/builds/utils/tmenu_run b/builds/utils/tmenu_run index 7884659..dfa4131 100755 --- a/builds/utils/tmenu_run +++ b/builds/utils/tmenu_run @@ -15,5 +15,6 @@ if [ "$(basename $0)" = "regenerate" ]; then xmessage "regeneration complete" exit else + export IS_RUNNING_IN_TMENU="yes" cat $HOME/.local/share/tmenu_cache | tmenu | ${SHELL:-"/bin/sh"} & fi