File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 55
66export 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 }
2828 }
2929fi
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
121121run_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}
You can’t perform that action at this time.
0 commit comments