Zenithにstdoutとstderrを表示する

Zenithにstdoutとstderrを表示する

.debNemoでこのファイルを右クリックしてインストールしようとしています。

私のNemoアクションは次のとおりです。

[Nemo Action]
Name=Install Deb File
Comment=Install %F
Exec=<scripts/install_deb_file.sh %F>
Icon-Name=package-x-generic-symbolic
Selection=s
Extensions=deb;
EscapeSpaces=true
Dependencies=zenity;dpkg;

私のzenity_askpass.shファイルは次のとおりです。

#!/bin/bash
zenity --password --title="Authenticate"

私のinstall_deb_file.shファイルは次のとおりです。

#!/bin/dash

export SUDO_ASKPASS="$HOME/.local/share/nemo/actions/scripts/zenity_askpass.sh"
sudo dpkg -i "$1"

install_deb_file.shパッケージをインストールして.debzenityにstdout / stderrを表示するように変更するにはどうすればよいですか?sudo dpkg -i "$1"

ベストアンサー1

文書install_deb_file.sh:

#!/bin/dash

export SUDO_ASKPASS="$HOME/.local/share/nemo/actions/scripts/zenity_askpass.sh"

# zenity --notification --text="$(sudo dpkg -i "$1" 2>&1)"

# zenity --width=250 --height=250 --info --text="$(sudo dpkg -i "$1" 2>&1)"

COMMAND_OUTPUT=$(sudo dpkg -i "$1" 2>&1)

if [ $? = 1 ]; then
    zenity --info --width=250 --text="$COMMAND_OUTPUT"
    exit 1
else
    notify-send --expire-time=200000 "Successfully Installed $1"
    exit 0
fi

おすすめ記事