panedの2番目のタブで取得できない
panedの1番目のタブではコマンドラインから取得できるのですが、2番目のタブでは取得できません。 どうすれば出来ますか? 例えば以下のように
while true; do
echo aaa
sleep 1
echo bbb
sleep 1
if [[ -z ps -A | grep yad ]]; then break; fi
done | yad --plug=$$ --tabnum=1 --form --field=: --cycle-read|
yad --plug=$$ --tabnum=2 --form --field=: --cycle-read &
yad --paned --key=$$ --width=300 --height=150
I think the reason why it doesn't work as your expectation would be because the yad for the first tab passes nothing to the next yad through the pipe.
What about using tee and the process substitution?
#!/bin/bash
while true; do
echo aaa
sleep 1
echo bbb
sleep 1
if [[ -z `ps -A | grep yad` ]]; then
break;
fi
done |
tee >(yad --plug=$$ --tabnum=1 --form --field=: --cycle-read) |
yad --plug=$$ --tabnum=2 --form --field=: --cycle-read &
yad --paned --key=$$ --width=300 --height=150
The above code works like this, I'm not sure if it's your expected behavior though. Possibly you might want to show aaa for the first tab and bbb for the next tab.
https://github.com/user-attachments/assets/522e548d-a264-494b-a82a-5d41bff049ad
See also: https://qiita.com/ronin_gw/items/bacef57a53411bbc7406
ありがとうございます。 コメントの最後に言っているように、最初のタブでaaa、2番目のタブでbbbを表示したいと思っています。 しかし、非常にいいヒントになって、タブ毎のループにしてみました。最初のタブでもbbbが表示されてしまうのが今一ですが,,,
while true; do
echo aaa
sleep 1
echo bbb
sleep 1
if [[ -z ps -A | grep yad ]]; then
break;
fi
done | tee >(yad --plug=$$ --tabnum=1 --form --field=: --cycle-read) |
while read line; do
if [[ $line = bbb ]]; then
echo $line
fi
done | yad --plug=$$ --tabnum=2 --form --field=: --cycle-read |
yad --paned --key=$$ --width=300 --height=150
コメントの最後に言っているように、最初のタブでaaa、2番目のタブでbbbを表示したいと思っています。
I'm not sure why we need the infinite loop here then. What about the following code?
#!/bin/bash
echo aaa | yad --plug=$$ --tabnum=1 --form --field=: --cycle-read &
echo bbb | yad --plug=$$ --tabnum=2 --form --field=: --cycle-read &
yad --paned --key=$$ --width=300 --height=150
aaaとbbbは最初のループで変化する値を取得して、それぞれのタブで表示したいと思っています。説明不足ですいません。
Don't you mean --field=:txt
On Fri, 21 Feb 2025, 20:31 Ryo Nakano, @.***> wrote:
コメントの最後に言っているように、最初のタブでaaa、2番目のタブでbbbを表示したいと思っています。
I'm not sure why we need the infinite loop here then. What about the following code?
#!/bin/bash echo aaa | yad --plug=$$ --tabnum=1 --form --field=: --cycle-read &echo bbb | yad --plug=$$ --tabnum=2 --form --field=: --cycle-read & yad --paned --key=$$ --width=300 --height=150
— Reply to this email directly, view it on GitHub https://github.com/v1cont/yad/issues/290#issuecomment-2674433551, or unsubscribe https://github.com/notifications/unsubscribe-auth/APRODETTYMRYOQNXQBUUB3D2Q4MB7AVCNFSM6AAAAABXDZ3XHOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNZUGQZTGNJVGE . You are receiving this because you are subscribed to this thread.Message ID: @.***> [image: ryonakano]ryonakano left a comment (v1cont/yad#290) https://github.com/v1cont/yad/issues/290#issuecomment-2674433551
コメントの最後に言っているように、最初のタブでaaa、2番目のタブでbbbを表示したいと思っています。
I'm not sure why we need the infinite loop here then. What about the following code?
#!/bin/bash echo aaa | yad --plug=$$ --tabnum=1 --form --field=: --cycle-read &echo bbb | yad --plug=$$ --tabnum=2 --form --field=: --cycle-read & yad --paned --key=$$ --width=300 --height=150
— Reply to this email directly, view it on GitHub https://github.com/v1cont/yad/issues/290#issuecomment-2674433551, or unsubscribe https://github.com/notifications/unsubscribe-auth/APRODETTYMRYOQNXQBUUB3D2Q4MB7AVCNFSM6AAAAABXDZ3XHOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNZUGQZTGNJVGE . You are receiving this because you are subscribed to this thread.Message ID: @.***>