Bug 345422 - Scripts run as part of screensaver notifications have wrong locale
Summary: Scripts run as part of screensaver notifications have wrong locale
Status: RESOLVED UNMAINTAINED
Alias: None
Product: plasma4
Classification: Unmaintained
Component: screensaver overlay (show other bugs)
Version: unspecified
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-22 13:37 UTC by Ofnuts
Modified: 2018-06-08 18:36 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ofnuts 2015-03-22 13:37:44 UTC
Scripts run as part of screensaver notifications have a different locale from the one set for Konsole sessions. As far as I can tell, the environment for Konsole sesssions (and built-in terminals in Dolphin, Kate and others) is set using ~/.kde/env/setlocale.sh but this isn't used in scrpit run as notifications from the screensaver.

Reproducible: Always

Steps to Reproduce:
1. Create a script that does "locale >/var/tmp/locale.dumped"
2. Run the script from a terminal session and check/save the contents of the file
3. Assign the script in System settings>Application and System notifications>Managr notifications>Event source:Screen saver>Screen unlocked
4. Lock/unlock the screen and check the contents of /var/tmp/locale.dumped again

Actual Results:  
In the notification, these contents are not to those of the KDE environment, but are identical to those of the TTY sessions, namely:

LANG=en_US.UTF-8
LANGUAGE=en_US
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=fr_FR.UTF-8
LC_TIME=fr_FR.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=fr_FR.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=fr_FR.UTF-8
LC_NAME=fr_FR.UTF-8
LC_ADDRESS=fr_FR.UTF-8
LC_TELEPHONE=fr_FR.UTF-8
LC_MEASUREMENT=fr_FR.UTF-8
LC_IDENTIFICATION=fr_FR.UTF-8
LC_ALL=

Expected Results:  
Same locale as in Konsole sessions:

LANG=en_IE.UTF-8
LANGUAGE=en
LC_CTYPE="en_IE.UTF-8"
LC_NUMERIC=en_IE.UTF-8
LC_TIME=en_IE.UTF-8
LC_COLLATE="en_IE.UTF-8"
LC_MONETARY=en_IE.UTF-8
LC_MESSAGES="en_IE.UTF-8"
LC_PAPER=en_IE.UTF-8
LC_NAME=en_IE.UTF-8
LC_ADDRESS=en_IE.UTF-8
LC_TELEPHONE=en_IE.UTF-8
LC_MEASUREMENT=en_IE.UTF-8
LC_IDENTIFICATION=en_IE.UTF-8
LC_ALL=




My locale setup is a tad weird because I'm in France with a laptop using an AZERTY keyboard. However, I prefer to use computers in English, and the Ireland locale has the nice property of using English while still having everything else compatible with France (measures, formats, and monetary units).

Bug found while writing a script that uses the "chage" command, that outputs a date using LC_TIME (and which therefore didn't give the same results when the script was run as a notification).
Comment 1 Nate Graham 2018-06-08 18:36:44 UTC
Hello!

This bug report was filed for KDE Plasma 4, which reached end-of-support status in August 2015. KDE Plasma 5's desktop shell has been almost completely rewritten for better performance and usability, so it is likely that this bug has already been resolved in Plasma 5.

Accordingly, we hope you understand why we must close this bug report. If the issue described  here is still present in KDE Plasma 5.12 or later, please feel free to open a new ticket in the "plasmashell" product after reading https://community.kde.org/Get_Involved/Bug_Reporting

If you would like to get involved in KDE's bug triaging effort so that future mass bug closes like this are less likely, please read https://community.kde.org/Get_Involved#Bug_Triaging

Thanks for your understanding!

Nate Graham