Skip to content

Commit c094844

Browse files
farseerfcwengxt
authored andcommitted
fcitx5-configtool: which -> command -v
1 parent fe927ae commit c094844

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

data/fcitx5-configtool.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55

66
export TEXTDOMAIN=fcitx5
77

8-
if which kdialog > /dev/null 2>&1; then
8+
if command -v kdialog > /dev/null 2>&1; then
99
message() {
1010
kdialog --msgbox "$1"
1111
}
1212
error() {
1313
kdialog --error "$1"
1414
}
15-
elif which zenity > /dev/null 2>&1; then
15+
elif command -v zenity > /dev/null 2>&1; then
1616
message() {
1717
zenity --info --text="$1"
1818
}
@@ -28,7 +28,7 @@ else
2828
}
2929
fi
3030

31-
if which gettext > /dev/null 2>&1; then
31+
if command -v gettext > /dev/null 2>&1; then
3232
_() {
3333
gettext "$@"
3434
}
@@ -108,7 +108,7 @@ detectDE() {
108108
if [ x"$DE" = x"gnome" ]; then
109109
# gnome-default-applications-properties is only available in GNOME 2.x
110110
# but not in GNOME 3.x
111-
which gnome-default-applications-properties > /dev/null 2>&1 || DE="gnome3"
111+
command -v gnome-default-applications-properties > /dev/null 2>&1 || DE="gnome3"
112112
fi
113113
}
114114

@@ -119,7 +119,7 @@ run_kde() {
119119
}
120120

121121
run_qt() {
122-
if which fcitx5-config-qt > /dev/null 2>&1; then
122+
if command -v fcitx5-config-qt > /dev/null 2>&1; then
123123
exec fcitx5-config-qt
124124
fi
125125
return 1
@@ -135,13 +135,13 @@ run_xdg() {
135135
;;
136136
esac
137137

138-
if command="$(which xdg-open 2>/dev/null)"; then
138+
if command="$(command -v xdg-open 2>/dev/null)"; then
139139
exec "$command" "$HOME/.config/fcitx5"
140140
fi
141141
}
142142

143143
_which_cmdline() {
144-
cmd="$(which "$1")" || return 1
144+
cmd="$(command -v "$1")" || return 1
145145
shift
146146
echo "$cmd $*"
147147
}

0 commit comments

Comments
 (0)