On Mon, Mar 19, 2018 at 09:04:57PM -0700, Elias Mårtenson wrote:
> On Monday, 19 March 2018 20:06:41 UTC+8, Unman  wrote:
> 
> > generally the Xsession wont touch .profile - there are exceptions.
> > It's picking up stuff from /etc/X11/Xsession.d
> > You can also use ~/.xsessionrc which is sourced from a file in
> > /etc/X11/Xsession.d
> > You probably dont want to source .bashrc directly, but you can create
> > another file to hold environment variables and source it from
> > .xsessionrc AND .bashrc/.profile
> 
> Thank you. I followed your recommendations but it does not seem to work.
> 
> I tried this by creating a file /etc/X11/Xsession.d/99xsession with the 
> following content:
> 
>     if [ -r "$HOME/.xsessionrc" ] ; then
>         . "$HOME/.xsessionrc"
>     fi
> 
> I then added some code in .xsessionrc that adds a log message to a file in 
> /tmp. After this I sourced /etc/X11/Xsession.d/99xsession to confirm that the 
> everything worked.
> 
> After rebooting the VM, the environment variable was not set, and there was 
> no entry in the file in /tmp which is updated by the script.
> 
> >From this I draw the conclusion that the scripts in /etc/X11/Xsession.d are 
> >not actually sourced when booting a VM.
> 
> Did I do something wrong, or is my analysis of the situation incorrect?
> 

You dont seem to have followed my recommendations :-(

On a Debian system, sourcing user defined xessionrc is already set up -
it is in /etc/X11/Xsession.d/40x11-common_xsessionrc.
I suspect Fedora would have something similar.

If you put env variable in .bashrc,and start nautilus from command
line, the variable will be available. You can see this using script that
dumps 'env' to file, and running that script from nautilus.
If you start nautilus from menu this wont be the case - the environment
variable wont exist when you run the same script.

Create ~/.envsrc , and set a variable there.
Create .xsessionrc  and source ~/.envsrc
Now shutdown the qube and start nautilus from the menu and behold, the
variable WILL be available in nautilus.
Note that this will be a GLOBAL variable, so you dont NEED to source it
from .bashrc, but you can overwrite it from there.
Also, of course, you can set the variable directly in .xsessionrc - I
just prefer to keep such variables separate.

Without knowing exactly what you put in the file, I cant comment on why
it didn't work for you.


-- 
You received this message because you are subscribed to the Google Groups 
"qubes-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to qubes-users+unsubscr...@googlegroups.com.
To post to this group, send email to qubes-users@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-users/20180320133435.b4cmlc5kz2v3igts%40thirdeyesecurity.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to