]> Sergey Matveev's repositories - nnn.git/commitdiff
xdgdefault: make dmenu case-insensitive, fix style
authorNRK <nrk@disroot.org>
Wed, 28 Jul 2021 06:30:30 +0000 (12:30 +0600)
committerNRK <nrk@disroot.org>
Wed, 28 Jul 2021 06:30:30 +0000 (12:30 +0600)
Most *.desktop entries have same name as their application name so this
is not an issue most of the time. However in the case of Neovim, the
application name is "Neovim" while the desktop entry is "nvim.desktop"

Since dmenu is case sensitive by default this means that searching
"neovim" will not show any results since the N is not capitalized and
the desktop entry name is "nvim"

fzf doesn't have this issue since its case-insensitive/fuzzy by
default. Making dmenu case-insensitive solves this.

Also fix the indentation to be consistent with the rest of the script.

plugins/xdgdefault

index 159dbc6c3fb57448f4636e3d1ce08f7fe2ddce57..7d49c2bfb33c0ac32e60e9036eb04d18b92ed78a 100755 (executable)
 # set to 1 to enable GUI apps
 GUI="${GUI:-0}"
 
-if [ "$GUI" -ne 0 ] && command -v dmenu >/dev/null 2>& 1; then
-  menu="dmenu -l 7"
+if [ "$GUI" -ne 0 ] && command -v dmenu > /dev/null 2>& 1; then
+    menu="dmenu -i -l 7"
 elif command -v fzf > /dev/null 2>& 1; then
-  menu="fzf -e --tiebreak=begin"
+    menu="fzf -e --tiebreak=begin"
 fi
 
 if [ -z "$1" ] || [ -z "$menu" ] > /dev/null 2>& 1; then