Bug 488772

Summary: User .desktop not work when using keyboard shortcuts
Product: [Frameworks and Libraries] frameworks-kglobalaccel Reporter: Ronald <followait>
Component: generalAssignee: kdelibs bugs <kdelibs-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: felixernst, followait, meven29, nate
Priority: NOR    
Version First Reported In: 6.9.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Ronald 2024-06-20 05:04:11 UTC
SUMMARY

For env, `LC_COLLATE="en_US.UTF-8"`
To sort in Chinese Pinyin in dolphin,
add ~/.local/share/applications/org.kde.dolphin.desktop,
the only different line to /usr/share/applications/org.kde.dolphin.desktop is as below
```
Exec=env LC_COLLATE="zh_CN.UTF-8" dolphin %u
```

STEPS TO REPRODUCE
1. Add `~/.local/share/applications/org.kde.dolphin.desktop` as above
2. Press "Win + E" to open dolphin

OBSERVED RESULT
The name in Chinese are not sorted in Pinyin

EXPECTED RESULT
The name in Chinese are sorted in Pinyin

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 6.0
Qt Version: 6.7.1

ADDITIONAL INFORMATION
When launching Dolphin by click the icon in the application menu, the sort order respect "~/.local/share/applications/org.kde.dolphin.desktop", which gets LC_COLLATE="zh_CN.UTF-8", so that it sorts in Chinese Pinyin as expected.
But when launching Dolphin with keyboard shortcuts, it doesn't.
Comment 1 Felix Ernst 2024-06-20 10:13:56 UTC
>When launching Dolphin by click the icon in the application menu,
>the sort order respect "~/.local/share/applications/org.kde.dolphin.desktop",
>which gets LC_COLLATE="zh_CN.UTF-8", so that it sorts in Chinese Pinyin as expected.
>But when launching Dolphin with keyboard shortcuts, it doesn't.

So the global keyboard shortcut for Dolphin as defined in system settings does not seem to care about the extra environment variables defined in the Dolphin .desktop file. Yes, I guess that might be unexpected.

If that is the issue you should be able to work around this by binding a custom command that includes the environment variable to a keyboard shortcut in system settings.
Comment 2 Méven Car 2024-07-22 11:57:22 UTC
Btw does it work when setting globally the env variable, i.e for the session :

export LC_COLLATE="zh_CN.UTF-8"

Or via the systemsettings language setting ?

Those could be workaround, but your bug is more general and could concern other apps/shortcuts too.
Comment 3 Ronald 2024-07-23 05:25:34 UTC
I'm not going to change the global locale settings as a workaround.
Not a blocking problem, waiting for the fixing.
Comment 4 Ronald 2024-12-18 02:06:00 UTC
*** Bug 455212 has been marked as a duplicate of this bug. ***