env injection for flatpak wechat

This commit is contained in:
js0ny 2025-12-08 07:34:37 +00:00
parent 54c2e54bb0
commit 93a11f6624

View file

@ -84,7 +84,7 @@ in {
{ {
# Patch for Hyprland (scale XWayland by hand) # Patch for Hyprland (scale XWayland by hand)
"flatpak/exports/bin/com.qq.QQ" = { "flatpak/exports/bin/com.qq.QQ" = {
force = true; force = true;
text = '' text = ''
#!/bin/sh #!/bin/sh
@ -115,6 +115,45 @@ in {
enable = true; enable = true;
force = true; force = true;
}; };
"flatpak/exports/bin/com.tencent.WeChat" = {
force = true;
text = ''
#!/bin/sh
EXTRA_ENVS=""
if [ "$XDG_CURRENT_DESKTOP" = "Hyprland" ]; then
EXTRA_ENVS="QT_SCALE_FACTOR=1.5"
fi
if [ -n "$EXTRA_ENVS" ]; then
exec flatpak run --env=$EXTRA_ENVS --branch=stable --arch=x86_64 com.tencent.WeChat "$@"
else
exec flatpak run --branch=stable --arch=x86_64 com.tencent.WeChat "$@"
fi
'';
enable = true;
executable = true;
};
"flatpak/exports/share/applications/com.tencent.WeChat.desktop" = {
text = ''
[Desktop Entry]
Name=WeChat
Name[zh_CN]=
Exec=${config.xdg.dataHome}/flatpak/exports/bin/com.tencent.WeChat
Terminal=false
Type=Application
Icon=com.tencent.WeChat
StartupWMClass=WeChat
Categories=Network;
Keywords=wechat;weixin;
Comment=WeChat Desktop
Comment[zh_CN]=
X-Flatpak=com.tencent.WeChat
'';
enable = true;
force = true;
};
} }
// appWrappers; // appWrappers;
home.activation.patchFlatpakDesktopFiles = lib.hm.dag.entryAfter ["writeBoundary"] '' home.activation.patchFlatpakDesktopFiles = lib.hm.dag.entryAfter ["writeBoundary"] ''