This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Why files in ~/.config/plasma-workspace/env can't source?

Tags: None
(comma "," separated)
User avatar
Fire-Dragon-DoL
Registered Member
Posts
8
Karma
0
Hello,
I have a script file in
Code: Select all
~/.config/plasma-workspace/env
with the following content:

Code: Select all
#!/bin/bash

. /home/francesco/.bash_config/.path
. /home/francesco/.bash_config/.exports


If I change the content to

Code: Select all
#!/bin/bash

source /home/francesco/.bash_config/.path
source /home/francesco/.bash_config/.exports


Nothing gets exported.
My guess is because it's not executed as "bash".

Problem is, I'd love to be able to export all those variables that some 3rd-party scripts create for my bash profile (chruby, asdf, nvm and friends), but they are bash scripts, so I cannot execute them since those scripts are being executed as "sh" scripts.

Is there any workaround or something I should be aware of?
Cheers!

P.S.
I also noticed that if a script from there exits with a non-zero value, I'm blocked from being able to login (had to stop the exit from appearing anywhere)
User avatar
blue_bullet
Registered Member
Posts
87
Karma
0
OS
Not sure if this helps, but I have a line in my .bashrc:
# Important: For kde look in .kde/env/ for a script file, e.g. path.sh for setting user specific environment variables RCB 02/02/13 11:56:48
source $HOME/.kde/env/path.sh

I also have the same path.sh stored in ~/.config/plasma-workspace/env, but b/c of the source statement
in .bashrc I would expect that at least to be working.

Here's my path.sh:
Code: Select all
# User specific environment variables go here.  Program name can be anything.  It just needs to reside in the /home/user/.kde/env directory.                      # /etc/environment does not resolve variables like $HOME on the rhs of equation so put variables like that here if you use kde.                                   # It is also suggested you put something like "source $HOME/.kde/env/xyz.sh", where xyz.sh is this program, as last line of .bashrc.                              # .pam_enviroment also runs in the kde environment, but I have not figured out how to get pam to resolve $ variables.                                                                                                                                                                                                               # Adding rcss directories so all machines in rcss have access to the same settings:                                                                               |...+....1....+....2....+....3....+....4....+....5....+....6....+....7.]..+....8....+....9....+...10....+...11....+...12....+...13....+...14....+...15....+...16. export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:"$HOME"/Dropbox/shared_rcss_complex:/usr/local/share/rcss"                                                                                                                                                                                     # This is where The Hessling Editor looks for the (rexx) macros you may use:                                                                                      #export THE_MACRO_PATH=$HOME"/source/the_macros"                                                                                                                  # This path looks at dropbox instead of line commented line above:                                                                                                export THE_MACRO_PATH=$HOME"/Dropbox/shared_files/source/the_macros"                                                                                              # Create a variable WAMI (Who or Where Am I) just for kicks:                                                                                                      export WAMI=$USER"@"$HOSTNAME                                                                                                                                                                                                                                                                                                       # This will force compositing to O2: OpenGL 2 backend Updated 2016-02-26 @ 10:57:29 by rob@fargo                                                                  export KWIN_COMPOSE=O2


Migrated from Linux Mint 17.3/18.3 KDE to KDE neon User Edition.
User avatar
Fire-Dragon-DoL
Registered Member
Posts
8
Karma
0
blue_bullet wrote:Not sure if this helps, but I have a line in my .bashrc:
# Important: For kde look in .kde/env/ for a script file, e.g. path.sh for setting user specific environment variables RCB 02/02/13 11:56:48
source $HOME/.kde/env/path.sh

I also have the same path.sh stored in ~/.config/plasma-workspace/env, but b/c of the source statement
in .bashrc I would expect that at least to be working.

Here's my path.sh:
Code: Select all
# User specific environment variables go here.  Program name can be anything.  It just needs to reside in the /home/user/.kde/env directory.                      # /etc/environment does not resolve variables like $HOME on the rhs of equation so put variables like that here if you use kde.                                   # It is also suggested you put something like "source $HOME/.kde/env/xyz.sh", where xyz.sh is this program, as last line of .bashrc.                              # .pam_enviroment also runs in the kde environment, but I have not figured out how to get pam to resolve $ variables.                                                                                                                                                                                                               # Adding rcss directories so all machines in rcss have access to the same settings:                                                                               |...+....1....+....2....+....3....+....4....+....5....+....6....+....7.]..+....8....+....9....+...10....+...11....+...12....+...13....+...14....+...15....+...16. export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:"$HOME"/Dropbox/shared_rcss_complex:/usr/local/share/rcss"                                                                                                                                                                                     # This is where The Hessling Editor looks for the (rexx) macros you may use:                                                                                      #export THE_MACRO_PATH=$HOME"/source/the_macros"                                                                                                                  # This path looks at dropbox instead of line commented line above:                                                                                                export THE_MACRO_PATH=$HOME"/Dropbox/shared_files/source/the_macros"                                                                                              # Create a variable WAMI (Who or Where Am I) just for kicks:                                                                                                      export WAMI=$USER"@"$HOSTNAME                                                                                                                                                                                                                                                                                                       # This will force compositing to O2: OpenGL 2 backend Updated 2016-02-26 @ 10:57:29 by rob@fargo                                                                  export KWIN_COMPOSE=O2


Tested, .kde/env doesn't get executed at all, it's an old directory
User avatar
blue_bullet
Registered Member
Posts
87
Karma
0
OS
Fire-Dragon-DoL wrote:Tested, .kde/env doesn't get executed at all, it's an old directory


Good to know, thanks. Another change in the move from kde 4 to 5. I was going to test as well but have not gotten a round tuit.


Migrated from Linux Mint 17.3/18.3 KDE to KDE neon User Edition.
User avatar
blue_bullet
Registered Member
Posts
87
Karma
0
OS
Tested, .kde/env doesn't get executed at all, it's an old directory

I take that back. How did you test? I find a symbolic link to .kde/env:

Code: Select all
rob@sigma:~$  cd /home/rob/.kde/env
rob@sigma:~/.kde/env$ ^C
rob@sigma:~/.kde/env$  cd /home/rob
rob@sigma:~$ ^C
rob@sigma:~$  cd /home/rob/.config/plasma-workspace/env
rob@sigma:~/.config/plasma-workspace/env$ ls -la
total 8
drwxrwxr-x 2 rob rob 4096 Feb  1 13:09 .
drwxrwxr-x 4 rob rob 4096 Jan 14 12:25 ..
lrwxrwxrwx 1 rob rob   26 Feb  1 13:09 path.sh -> /home/rob/.kde/env/path.sh
rob@sigma:~/.config/plasma-workspace/env$



I now have a round tuit ;D


Migrated from Linux Mint 17.3/18.3 KDE to KDE neon User Edition.
User avatar
Fire-Dragon-DoL
Registered Member
Posts
8
Karma
0
blue_bullet wrote:
Tested, .kde/env doesn't get executed at all, it's an old directory

I take that back. How did you test? I find a symbolic link to .kde/env:

Code: Select all
rob@sigma:~$  cd /home/rob/.kde/env
rob@sigma:~/.kde/env$ ^C
rob@sigma:~/.kde/env$  cd /home/rob
rob@sigma:~$ ^C
rob@sigma:~$  cd /home/rob/.config/plasma-workspace/env
rob@sigma:~/.config/plasma-workspace/env$ ls -la
total 8
drwxrwxr-x 2 rob rob 4096 Feb  1 13:09 .
drwxrwxr-x 4 rob rob 4096 Jan 14 12:25 ..
lrwxrwxrwx 1 rob rob   26 Feb  1 13:09 path.sh -> /home/rob/.kde/env/path.sh
rob@sigma:~/.config/plasma-workspace/env$



I now have a round tuit ;D


I tested by disabling everything in plasma workspace and manually moving the file to .kde/env, they don't get executed at all, so even if you have the symlink, it's just irrelevant. What matters is plasma-workspace/env
User avatar
blue_bullet
Registered Member
Posts
87
Karma
0
OS
Fire-Dragon-DoL wrote:
blue_bullet wrote:
Tested, .kde/env doesn't get executed at all, it's an old directory

I take that back. How did you test? I find a symbolic link to .kde/env:

Code: Select all
rob@sigma:~$  cd /home/rob/.kde/env
rob@sigma:~/.kde/env$ ^C
rob@sigma:~/.kde/env$  cd /home/rob
rob@sigma:~$ ^C
rob@sigma:~$  cd /home/rob/.config/plasma-workspace/env
rob@sigma:~/.config/plasma-workspace/env$ ls -la
total 8
drwxrwxr-x 2 rob rob 4096 Feb  1 13:09 .
drwxrwxr-x 4 rob rob 4096 Jan 14 12:25 ..
lrwxrwxrwx 1 rob rob   26 Feb  1 13:09 path.sh -> /home/rob/.kde/env/path.sh
rob@sigma:~/.config/plasma-workspace/env$



I now have a round tuit ;D


I tested by disabling everything in plasma workspace and manually moving the file to .kde/env, they don't get executed at all, so even if you have the symlink, it's just irrelevant. What matters is plasma-workspace/env


Sorry to belabor this. The code I showed stated that the symlink is in ~/.config/plasma-workspace/env where path.sh is shown as a symlink back to ~/.kde/env/path.sh.
I did not create the symlink in .config and presume KDE Neon must have done that as a carryover going from KDE 4 to Plasma 5. If so, that's a nice touch, and kudos to the developers. As such I can now remove the "$HOME/.kde/env/path.sh" statement from my .bashrc since ~/.config/plasma-workspace/env/path.sh accomplishes the same thing.
I have a feeling we may be saying the same thing. If not, I willingly defer to you.

I still have a round tuit, but there is "More than one way to skin a cat." BTW that's in reference to catfish for all you feline lovers. ;D


Migrated from Linux Mint 17.3/18.3 KDE to KDE neon User Edition.
User avatar
Fire-Dragon-DoL
Registered Member
Posts
8
Karma
0
Yep I meant exactly that! ;)


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]