Libreoffoffice

来自linux中国网wiki
跳到导航 跳到搜索

deb



mkdir /home/evan/data/apps/libreoffice

  tar xvf LibreOffice_25.2.4_Linux_x86-64_deb.tar.gz

cd LibreOffice_25.2.4.3_Linux_x86-64_deb/DEBS

#也可以用root 
 for f in *.deb; do dpkg-deb -x $f /home/evan/apps/libreoffice; done 


#run 
 /home/evan/data/apps/libreoffice/opt/libreoffice25.2/program/soffice



图标问题  参考原来的 apt 
root@myxps:/usr/share/applications# ll libreoffice6.4-base.desktop 
lrwxrwxrwx 1 root root 42  6月 25  2020 libreoffice6.4-base.desktop -> /opt/libreoffice6.4/share/xdg/base.desktop


加几个ln  

ln -s /home/evan/data/apps/libreoffice/opt/libreoffice25.2/share/xdg/base.desktop  /usr/share/applications/libreoffice25-base.desktop 


➜  xdg pwd
/home/evan/data/apps/libreoffice/opt/libreoffice25.2/share/xdg
➜  xdg ls 
base.desktop  calc.desktop  draw.desktop  impress.desktop  math.desktop  startcenter.desktop  writer.desktop  xsltfilter.desktop

diy icon

 cat cicon.sh 
#!/bin/bash

# 定义路径和变量
APP_NAME="LibreOffice 25.2"
EXEC_PATH="/home/evan/data/apps/libreoffice/opt/libreoffice25.2/program/soffice"
ICON_PATH="/home/evan/data/apps/libreoffice/opt/libreoffice25.2/share/config/images_classic/brand_logo.png"
#DESKTOP_FILE="$HOME/.local/share/applications/libreoffice-custom.desktop"
DESKTOP_FILE="/usr/share/applications/libreoffice.desktop"

# 创建 .desktop 文件内容
cat > "$DESKTOP_FILE" <<EOF
[Desktop Entry]
Name=$APP_NAME
Comment=LibreOffice from custom path
Exec=$EXEC_PATH
Icon=$ICON_PATH
Terminal=false
Type=Application
Categories=Office;WordProcessor;Spreadsheet;Presentation;
StartupNotify=true
EOF

# 设置执行权限(有些桌面环境要求)
chmod +x "$DESKTOP_FILE"

echo "✅ LibreOffice 图标已创建:$DESKTOP_FILE"


##我的改一下 差不多 这样

[Desktop Entry]
Version=1.0
Terminal=false
Icon=libreoffice25.2-base
Icon=/home/evan/data/images/libre.jpeg
Type=Application
Categories=Office;Database;X-Red-Hat-Base;
Exec=/home/evan/data/apps/libreoffice/opt/libreoffice25.2/program/soffice %U
#Exec=libreoffice25.2 --base %U
MimeType=application/vnd.oasis.opendocument.base;application/vnd.sun.xml.base;
Name=LibreOffice 25.2 Base
GenericName=libreoffice25
GenericName[ab]=Адырқәа рбаза
GenericName[vi]=Phát triển cơ sở dữ liệu
GenericName[xh]=Database Development
GenericName[zh_CN]=libreoffice



LibreOffice as AppImage

更加方便