Skip to content

Commit

Permalink
Allow users to cancel opening config directory
Browse files Browse the repository at this point in the history
  • Loading branch information
nuzar authored Jul 22, 2024
1 parent 64bdd71 commit 7eea87a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions data/fcitx5-configtool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ export TEXTDOMAIN=fcitx5

if command -v kdialog > /dev/null 2>&1; then
message() {
kdialog --msgbox "$1"
kdialog --yesno "$1"
}
error() {
kdialog --error "$1"
}
elif command -v zenity > /dev/null 2>&1; then
message() {
zenity --info --text="$1"
zenity --question --text="$1"
}
error() {
zenity --error --text="$1"
Expand Down Expand Up @@ -138,6 +138,11 @@ run_xdg() {
;;
esac

# user choose no
if [ $? -ne 0 ]; then
exit
fi

if command="$(command -v xdg-open 2>/dev/null)"; then
exec "$command" "$HOME/.config/fcitx5"
fi
Expand Down

0 comments on commit 7eea87a

Please sign in to comment.