• Making YAD Programs

    Hi again everyone!

    So today I was trying to make a GUI program using YAD, but got a little stuck. I have everything working right except the buttons at the bottom. The commands I have tied to them require root permissions, and honestly, it would be nice if they were visible in the terminal. So I guess it comes down to this. Does anyone know a command (or set of commands) that will open a terminal and run a command in it? Not a script sort of thing, but a command that 1, opens a terminal, and 2, automatically executes the command inside it. Here’s my code so far:

    nupdates=`checkupdates | wc -l`
    official=`pacman -Qqtd | grep -Fv -f <(pacman -Qqtdm)`
    unofficial=`pacman -Qqmtd`
    fethcmirrors=`yes | sudo fetchmirrors --country US`
    cache=`yes | sudo pacman -Scc`
    yad --title "System Maintainence" --form --width=400 --height=100 --text "$nupdates New packages are available: 
    Unnecessary packages:
    $unofficial"  \
    --button="Update":sudo pacman -Syu --noconfirm \
    --button="Remove packages":sudo yaourt -Qtd --noconfirm \
    --button="Fetch Mirrors":$fetchmirrors \
    --button="Clear Cashe":$cache \
    --button="Clean Journal":sudo journalctl --vacuum-time=3d && sync \

    In addition, everything works except the buttons. Here’s a screenshot of the program:

    0_1501718474285_my program.png
    If anyone could offer advice or help, that would be great! (even if you don’t know what YAD is, but have some command ideas😄). Thank you everyone!

  • 1- To run a command on a terminal you can use xterm -e.

    2- Your buttons don’t work because you need type your commands within quotes.

    For example,
    --button="Update":"xterm -e sudo pacman -Syu --noconfirm"

  • Thank you so much @psscnp142! It worked exactly as I have wanted it to😀.

Posts 3Views 541
Log in to reply
Bloom Email Optin Plugin

Looks like your connection to Antergos Community Forum was lost, please wait while we try to reconnect.