allow capture to run in tmenu

This commit is contained in:
stupidcomputer 2024-07-25 00:51:56 -05:00
parent ecbd242551
commit 8ed9beffba
2 changed files with 10 additions and 1 deletions

View File

@ -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 \ display=$(xrandr \
| grep ' connected' \ | grep ' connected' \
| awk -F ' ' '{print $1}' \ | awk -F ' ' '{print $1}' \
@ -29,7 +37,7 @@ printf "[] capturing in medium %s\n" "$medium"
case "$medium" in case "$medium" in
*"mp4"*) *"mp4"*)
ffcast -g $geom rec ffcast -g $geom rec $HOME/output.mp4
;; ;;
*"png"*) *"png"*)
ffcast -g $geom png ffcast -g $geom png

View File

@ -15,5 +15,6 @@ if [ "$(basename $0)" = "regenerate" ]; then
xmessage "regeneration complete" xmessage "regeneration complete"
exit exit
else else
export IS_RUNNING_IN_TMENU="yes"
cat $HOME/.local/share/tmenu_cache | tmenu | ${SHELL:-"/bin/sh"} & cat $HOME/.local/share/tmenu_cache | tmenu | ${SHELL:-"/bin/sh"} &
fi fi