https://bugs.kde.org/show_bug.cgi?id=420085

            Bug ID: 420085
           Summary: User autostart scripts sourced after system-level
                    scripts
           Product: plasmashell
           Version: 5.18.4
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: k...@davidedmundson.co.uk
          Reporter: frther...@gmail.com
                CC: plasma-b...@kde.org
  Target Milestone: 1.0

SUMMARY

I am trying to use a shell script placed in ~/.config/plasma-workspace/env/ to
set my `$EDITOR` variable, as described in the KDE docs here:
https://userbase.kde.org/Session_Environment_Variables

The script is correctly executed during login, and $EDITOR is correctly set at
one point. However, later on it is overwritten by the value specified in
/etc/xdg/plasma-workspace/env/envars.sh. This file is provided by the Manjaro
distribution to provide default values of common environment variables (such as
PATH and EDITOR).

User preferences should prevail over system defaults. I would expect that the
$EDITOR value I set in my user-specific session autostart scripts should be the
final, active value set after session startup is complete.

STEPS TO REPRODUCE

1. Create the user vars file:

echo "export EDITOR=/usr/bin/nvim" >
$HOME/.config/plasma-workspace/env/uservars.sh
echo "export EDITOR2=bar" >> $HOME/.config/plasma-workspace/env/uservars.sh
chmod +x $HOME/.config/plasma-workspace/env/uservars.sh

2. Edit (or create) the system level envars file:

Edit the file /etc/xdg/plasma-workspace/env/envars.sh. Change the line "export
EDITOR=/usr/bin/nano"  to "export EDITOR=FOO".

3. Log out and log back in.

OBSERVED RESULT

The EDITOR2 variable is set, indicating that the user script was executed.
However, the EDITOR variable was overwritten by the system-level script:

$> echo $EDITOR
FOO

$> echo $EDITOR2
bar

FINAL NOTE

I am not sure which script/process executes these files. It seems the order is
wrong. The KDE docs (linked above) say that the "startkde" script runs them,
yet it appears that this script was replaced by a binary named
"startplasma-x11". I searched KDE's phabricator but was not able to find the
source for this file. If someone can point me to the source file, I can grep
through it with my half-understanding of C++/Qt and attempt to find the source
of the bug.

I should also note that according to pacman,
/etc/xdg/plasma-workspace/env/envars.sh belongs to the package
`manjaro-kde-settings-19.0 20200408-2`.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to