yad icon indicating copy to clipboard operation
yad copied to clipboard

panedの2番目のタブで取得できない

Open akira-87 opened this issue 11 months ago • 5 comments

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

akira-87 avatar Feb 14 '25 05:02 akira-87

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

ryonakano avatar Feb 16 '25 08:02 ryonakano

ありがとうございます。 コメントの最後に言っているように、最初のタブで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

akira-87 avatar Feb 18 '25 09:02 akira-87

コメントの最後に言っているように、最初のタブで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

ryonakano avatar Feb 21 '25 12:02 ryonakano

aaaとbbbは最初のループで変化する値を取得して、それぞれのタブで表示したいと思っています。説明不足ですいません。

akira-87 avatar Feb 21 '25 12:02 akira-87

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: @.***>

cou645 avatar Feb 21 '25 12:02 cou645