[Explorer] 关于浏览器(也许是玲珑包管理)的一个bug及解决方案 Resolved
Tofloor
poster avatar
shy
deepin
2024-04-29 07:41
Author

当使用浏览器安装网页应用时,生成的桌面.desktop文件不正确

(下图的功能)
截图_选择区域_20240429073748.png

自动生成的Exec行是这样的:

Exec=/usr/bin/browser --profile-directory=Default --app-id=bhckjfpcnnighkpkmdnfcoljbfhodadh

然而,由于浏览器已经迁移到玲珑下了,并没有/usr/bin/browser这个文件,于是无法打开

合理的处理方式是参照浏览器自己的.desktop文件改成下面这样

Exec= ll-cli run org.deepin.browser --exec "browser -profile-directory=Default --app-id=bhckjfpcnnighkpkmdnfcoljbfhodadh"
Reply Favorite View the author
All Replies
shy
deepin
2024-04-29 07:44
#1

当然,写个脚本处理或者手动处理都不难

但是希望官方主动解决一下这个问题tail

Reply View the author
dgmenghuan
deepin
2024-04-29 08:27
#2

tail

Reply View the author
CPU你的❤️
deepin
2024-04-29 08:35
#3

换成deb版本的没有这个问题。

Reply View the author
阿尼樱奈奈
Moderator
2024-04-29 09:00
#4
It has been deleted!
阿尼樱奈奈
Moderator
2024-04-29 09:00
#5
shy

当然,写个脚本处理或者手动处理都不难

但是希望官方主动解决一下这个问题tail

我也希望官方能修复这个问题agree

Reply View the author
Merlin
Super Moderator
Product Manager
2024-04-29 09:42
#6

玲珑项目,目前与系统的适配还有一些问题,RC正式发布的时候会将所有玲珑应用暂时回退到deb版本,这个正式发布的时候会出相关的公告。

Reply View the author
deepin
2024-04-29 09:42
#7

这波肯定是官方没有想到啦,被你发现了呢。我没遇到这种问题,因为我的默认浏览器是edge2333

Reply View the author
shy
deepin
2024-04-29 10:01
#8
Merlin

玲珑项目,目前与系统的适配还有一些问题,RC正式发布的时候会将所有玲珑应用暂时回退到deb版本,这个正式发布的时候会出相关的公告。

这样的话从beta3更新到rc会不会有什么问题confused

Reply View the author
shy
deepin
2024-04-29 10:20
#9

一个简单的脚本解决方式

#!/bin/bash
# 检查是否提供了文件名
if [ "$#" -ne 1 ]; then
    echo "Usage: \$0 "
    exit 1
fi


# 文件路径
DESKTOP_FILE="$1"
echo "Provided file path: "$DESKTOP_FILE""

# 检查文件是否存在
if [ ! -f "$DESKTOP_FILE" ]; then
    echo "Error: File does not exist."
    exit 1
fi
    

# 使用sed命令修改Exec行,适应可变的参数
sed -i -E 's|Exec=/usr/bin/browser (.*)|Exec= ll-cli run org.deepin.browser --exec "browser \1"|' "$DESKT>

echo "Exec line has been updated successfully."


保存为exec.sh

chmod +x ./exec.sh

./exec.sh /your/desktop/file.desktop

Reply View the author
神末shenmo
Moderator
Spark-App
2024-04-29 11:09
#10
shy

一个简单的脚本解决方式

#!/bin/bash
# 检查是否提供了文件名
if [ "$#" -ne 1 ]; then
    echo "Usage: \$0 "
    exit 1
fi


# 文件路径
DESKTOP_FILE="$1"
echo "Provided file path: "$DESKTOP_FILE""

# 检查文件是否存在
if [ ! -f "$DESKTOP_FILE" ]; then
    echo "Error: File does not exist."
    exit 1
fi
    

# 使用sed命令修改Exec行,适应可变的参数
sed -i -E 's|Exec=/usr/bin/browser (.*)|Exec= ll-cli run org.deepin.browser --exec "browser \1"|' "$DESKT>

echo "Exec line has been updated successfully."


保存为exec.sh

chmod +x ./exec.sh

./exec.sh /your/desktop/file.desktop

其实有个简单的办法

#!/bin/bash
ll-cli run org.deepin.browser --exec "$@"
Reply View the author