summaryrefslogtreecommitdiff
path: root/utils/installer
diff options
context:
space:
mode:
authoropalmay <[email protected]>2022-10-14 19:33:08 +0300
committerGitHub <[email protected]>2022-10-14 18:33:08 +0200
commit1fbdcabf1915b35599c7912a45ef92888417ea65 (patch)
treeede4192a5aaca0b16bdfc5511546d623c2d6cd72 /utils/installer
parent4586140260b50ba81bca53cd90c91c22e28ee5ca (diff)
fix: don't install desktop file w/o xdg-desktop-menu (#3229)
Diffstat (limited to 'utils/installer')
-rwxr-xr-xutils/installer/install.sh5
-rwxr-xr-xutils/installer/uninstall.sh4
2 files changed, 4 insertions, 5 deletions
diff --git a/utils/installer/install.sh b/utils/installer/install.sh
index bd751abe..87f60fd4 100755
--- a/utils/installer/install.sh
+++ b/utils/installer/install.sh
@@ -458,7 +458,7 @@ function setup_lvim() {
function create_desktop_file() {
OS="$(uname -s)"
# TODO: Any other OSes that use desktop files?
- [ "$OS" != "Linux" ] && return
+ ([ "$OS" != "Linux" ] || ! command -v xdg-desktop-menu &>/dev/null) && return
echo "Creating desktop file"
for d in "$LUNARVIM_BASE_DIR"/utils/desktop/*/; do
@@ -467,8 +467,7 @@ function create_desktop_file() {
cp "$LUNARVIM_BASE_DIR/utils/desktop/$size_folder/lvim.svg" "$XDG_DATA_HOME/icons/hicolor/$size_folder/apps"
done
- cp "$LUNARVIM_BASE_DIR/utils/desktop/lvim.desktop" "$XDG_DATA_HOME/applications/lvim.desktop"
- xdg-desktop-menu forceupdate
+ xdg-desktop-menu install --novendor "$LUNARVIM_BASE_DIR/utils/desktop/lvim.desktop"
}
function print_logo() {
diff --git a/utils/installer/uninstall.sh b/utils/installer/uninstall.sh
index 16d3c365..597bbf85 100755
--- a/utils/installer/uninstall.sh
+++ b/utils/installer/uninstall.sh
@@ -63,11 +63,11 @@ function remove_lvim_bin() {
function remove_desktop_file() {
OS="$(uname -s)"
# TODO: Any other OSes that use desktop files?
- [ "$OS" != "Linux" ] && return
+ ([ "$OS" != "Linux" ] || ! command -v xdg-desktop-menu &>/dev/null) && return
echo "Removing desktop file..."
find "$XDG_DATA_HOME/icons/hicolor" -name "lvim.svg" -type f -delete
- rm "$XDG_DATA_HOME/applications/lvim.desktop"
+ xdg-desktop-menu uninstall lvim.desktop
}
function main() {