robert cooper aka yadbash

132 views
Skip to first unread message

manoflinux

unread,
Feb 29, 2024, 1:03:57 PM2/29/24
to yad-common
hi, can you please share your code on outputting a running command to yad!

Robert Cooper

unread,
Apr 9, 2024, 2:48:27 PM4/9/24
to yad-common
Sorry for Delay, just found this post.

#### CODE START #####
#!/bin/bash

run_fdisk () { 
sudo fdisk -l > $logDir/term-feedback.log 
}
export -f run_fdisk

tail -f term-feedback.log | yad --text-info --text="Output fdisk to yad window" --width=500 --height=500 --on-top --center --button="Run Fdisk":"bash -c run_fdisk" --button="Close:0" > term-feedback.log --tail

#### CODE END #####

Robert Cooper

unread,
Apr 9, 2024, 2:55:10 PM4/9/24
to yad-common

xensurve

unread,
Apr 9, 2024, 7:30:48 PM4/9/24
to 'Robert Cooper' via yad-common


Thank you for your help and response

--
You received this message because you are subscribed to the Google Groups "yad-common" group.
To unsubscribe from this group and stop receiving emails from it, send an email to yad-common+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/yad-common/ca7503ee-d091-43aa-b083-de27f4a68c09n%40googlegroups.com.

Robert Cooper

unread,
Apr 10, 2024, 12:07:48 PM4/10/24
to yad-common
Glad to help !   

Wolfgang Stey

unread,
Apr 12, 2024, 2:56:07 AM4/12/24
to yad-common
Hi,
another example

#! /bin/bash

export ausgabe_cmd='@bash -c "ausgabe"'
export meika=$(mktemp -u --tmpdir chmod.XXXXXXXX)
mkfifo $meika
trap "rm -f $meika" EXIT
fkey=$(($RANDOM * $$))

function ausgabe
{
befehl="inxi -Fz -c0"
bash -c "$befehl" >"$meika"
}
export -f ausgabe
exec 8<> $meika

yad --plug="$fkey" \
    --tabnum=1 \
    --form \
    --field="Ausgabe:fbtn" "$ausgabe_cmd" &

cat "$meika"|\
yad --plug="$fkey" \
    --tabnum=2 \
    --text-info &

yad --key="$fkey" \
    --paned \
    --button="gtk-close:1" \
    --orient=Horizotal \
    --splitter=300 \
    --width=1200 \
    --height=600
return="$?"

case "$return" in
1|252) #Bei beenden Button, Escape, Fenster schließen
    unset ausgabe_cmd ausgabe
    exec 8>&-
    yad --text="Script ordentlich beendet" \
        --center \
        --width=200 \
        --height=80
    exit 0
    ;;
esac


Greeting
Wolfgang

Robert Cooper

unread,
Apr 12, 2024, 2:04:41 PM4/12/24
to yad-common
WOW - Awesome. Thank You for sharing! 

  Could your code be tweaked to get the contents of a webpage continuously or at set intervals ? and display in same window.

Reply all
Reply to author
Forward
Message has been deleted
0 new messages