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:
#!/bin/bash nupdates=`checkupdates | wc -l` updates=`checkupdates` 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: $updates Unnecessary packages: $official $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:
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!