You are not logged in.

#1 2016-09-06 10:41:24

sk4hrr
New Member
From: Lognes, France
Registered: 2016-09-06
Posts: 3
Website

[solved] XDG_CONFIG_HOME to /dev/shm

Hello,

To limit HDD usage, I want to put .cache directory to /dev/shm. On many website, I read the best way is to define XDG_CONFIG_HOME variable in ~/.profile or /etc/profile.

I tested this solution on Lubuntu and works perfectly but on BunsenLabs not.

Here are the lines I added at the end of ~/.profile:

# Optimize
mkdir --mode=755 /dev/shm/sk4hrr
export XDG_CACHE_HOME="/dev/shm/sk4hrr"

After reboot and login, I check if variable is set with the following command :

env | grep XDG

If I type the commands in a terminal, it works.

Thanks for your help :)

edit 15h39:
I just try two things in ~/.profile:

# Optimize
XDG_CACHE_HOME=/dev/shm

and

# Optimize
export XDG_CACHE_HOME=/dev/shm

Same result, I don't understand why my .profile is ignored.

edit 15h47:
This is probably not the best way but this works by editing ~/.xsession and adding commands at the end.

Last edited by sk4hrr (2016-09-06 13:49:16)


"Parce que la connaissance appartient à tout le monde", inios.fr.

Offline

#2 2016-09-06 18:13:25

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

Re: [solved] XDG_CONFIG_HOME to /dev/shm

thanks for the good info.
and welcome to the forum!
maybe you'd like to introduce yourself?

Offline

#3 2016-09-06 18:14:28

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: [solved] XDG_CONFIG_HOME to /dev/shm

Try adding your command to ~/.xsessionrc instead.

EDIT: What ohnonot said big_smile

Last edited by Head_on_a_Stick (2016-09-06 18:14:54)

Offline

#4 2016-09-06 19:35:09

Horizon_Brave
Operating System: Linux-Nettrix
Registered: 2015-10-18
Posts: 1,473

Re: [solved] XDG_CONFIG_HOME to /dev/shm

Welcome! And you may have been viewing it from a more Ubuntu-centric login process. Or at least assuming a console based login. I believe that debian's login process of the gui variety, sources your profile from the xsession and .xsessionrc files.


"I have not failed, I have found 10,000 ways that will not work" -Edison

Offline

#5 2016-09-07 06:21:22

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: [solved] XDG_CONFIG_HOME to /dev/shm

Horizon_Brave wrote:

I believe that debian's login process of the gui variety, sources your profile from the xsession and .xsessionrc files.

~/.xsession is only run by LightDM if "Default Xsession" is selected as the desktop.

Also, I think Ubuntu handles these things in exactly the same way as Debian.

Offline

#6 2016-09-07 06:37:01

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,657
Website

Re: [solved] XDG_CONFIG_HOME to /dev/shm

Head_on_a_Stick wrote:

~/.xsession is only run by LightDM if "Default Xsession" is selected as the desktop.

...and if it exists - which it doesn't in a default BL.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#7 2016-09-07 07:38:37

sk4hrr
New Member
From: Lognes, France
Registered: 2016-09-06
Posts: 3
Website

Re: [solved] XDG_CONFIG_HOME to /dev/shm

ohnonot wrote:

thanks for the good info.
and welcome to the forum!
maybe you'd like to introduce yourself?

Thanks and sorry, it's ok for now smile

I don't understand why ~/.profile was edited by developers if it is not used.

Last edited by sk4hrr (2016-09-07 07:39:00)


"Parce que la connaissance appartient à tout le monde", inios.fr.

Offline

#8 2016-09-07 08:17:17

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,657
Website

Re: [solved] XDG_CONFIG_HOME to /dev/shm

.profile is used in non-graphical logins. You can test this by setting some variable there and logging in to another tty and not starting X.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#9 2016-09-07 16:43:09

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

Re: [solved] XDG_CONFIG_HOME to /dev/shm

^ the woes of using a display manager...

Offline

#10 2016-09-07 17:10:10

Horizon_Brave
Operating System: Linux-Nettrix
Registered: 2015-10-18
Posts: 1,473

Re: [solved] XDG_CONFIG_HOME to /dev/shm

ohnonot wrote:

^ the woes of using a display manager...

The woes of still trying to remember which login process gives you which profile/xsession/bash config is used..   sad


"I have not failed, I have found 10,000 ways that will not work" -Edison

Offline

#11 2016-09-08 03:13:26

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,657
Website

Re: [solved] XDG_CONFIG_HOME to /dev/shm

ohnonot wrote:

^ the woes of using a display manager...

Actually, .xsessionrc is read in all default X sessions, regardless of DM, but if you startx from a tty .profile will also have been read first.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#12 2016-09-08 18:14:16

Horizon_Brave
Operating System: Linux-Nettrix
Registered: 2015-10-18
Posts: 1,473

Re: [solved] XDG_CONFIG_HOME to /dev/shm

johnraff wrote:
ohnonot wrote:

^ the woes of using a display manager...

Actually, .xsessionrc is read in all default X sessions, regardless of DM, but if you startx from a tty .profile will also have been read first.

The movement and flow of which files are called would make for a great full color flowchart diagram...future project idea..


"I have not failed, I have found 10,000 ways that will not work" -Edison

Offline

Board footer

Powered by FluxBB