summaryrefslogtreecommitdiff
path: root/utils/installer/install.sh
diff options
context:
space:
mode:
authoropalmay <[email protected]>2022-10-09 22:55:47 +0300
committerGitHub <[email protected]>2022-10-09 19:55:47 +0000
commit523bafacb67708d56d0c05eadd6968eb58957c0e (patch)
treead307707dd8cdf485a1b349eed88471e97158ff5 /utils/installer/install.sh
parentc8ef47622d4b9d24e72f4a997de10d642f8de17c (diff)
Feat(installer): desktop entry (#3187)
Co-authored-by: Opal Mizrahi <[email protected]>
Diffstat (limited to 'utils/installer/install.sh')
-rwxr-xr-xutils/installer/install.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/utils/installer/install.sh b/utils/installer/install.sh
index aefc52c2..bd751abe 100755
--- a/utils/installer/install.sh
+++ b/utils/installer/install.sh
@@ -439,6 +439,8 @@ function setup_lvim() {
setup_shim
+ create_desktop_file
+
[ ! -f "$LUNARVIM_CONFIG_DIR/config.lua" ] \
&& cp "$LUNARVIM_BASE_DIR/utils/installer/config.example.lua" "$LUNARVIM_CONFIG_DIR/config.lua"
@@ -453,6 +455,22 @@ function setup_lvim() {
verify_core_plugins
}
+function create_desktop_file() {
+ OS="$(uname -s)"
+ # TODO: Any other OSes that use desktop files?
+ [ "$OS" != "Linux" ] && return
+ echo "Creating desktop file"
+
+ for d in "$LUNARVIM_BASE_DIR"/utils/desktop/*/; do
+ size_folder=$(basename "$d")
+ mkdir -p "$XDG_DATA_HOME/icons/hicolor/$size_folder/apps/"
+ 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
+}
+
function print_logo() {
cat <<'EOF'