[TRICK] create missing XDG RUNTIME DIR  [Solved]

Here is where you can post tips and tricks to share with other users of MX. Do not ask for help in this Forum.
Message
Author
gor9

[TRICK] create missing XDG RUNTIME DIR  [Solved]

#1 Post by gor9 »

most people will have it working correctly. But I have been playing with 2 ttys....tty7 runs icewm and tty1 sometimes runs sway.
I have not worked out if that is the reason....but my work around works so here it is

firstly run....edit correction

Code: Select all

env | grep 1000
one of the results should show your XDG_RUNTIME_DIR=/run/user/1000, unless you have 2 more users?

so my work around is an executable such that

Code: Select all

cat /usr/local/bin/run-dir 
#!/bin/sh

DIR=/run/user/1000
if [ ! -d $DIR ] ; then mkdir -p $DIR && echo "not found so creating"
    else echo "found"
fi
chmod 0700 $DIR
chown -R gor:gor $DIR
ls -al /run/user
change gor to your local login name please

2) if you missing the runtime dir then run

Code: Select all

sudo run-dir
and hopefully you fix it by seeing

Code: Select all

sudo run-dir
not found so creating
total 0
drwxr-xr-x  3 root root  60 Sep 25 12:30 .
drwxr-xr-x 22 root root 860 Sep 25 12:16 ..
drwx------  2 gor  gor   40 Sep 25 12:30 1000
and then

Code: Select all

export XDG_RUNTIME_DIR=/run/user/1000
env | grep 1000
my output
GPG_AGENT_INFO=/run/user/1000/gnupg/S.gpg-agent:0:1
XDG_RUNTIME_DIR=/run/user/1000

Hope that helps someone if they are playing with 2 open displays at once
Last edited by gor9 on Sun Sep 25, 2022 10:15 am, edited 1 time in total.

User avatar
bassplayer69
Posts: 69
Joined: Wed Dec 25, 2019 5:37 pm

Re: [TRICK] create missing XDG RUNTIME DIR

#2 Post by bassplayer69 »

gor9 wrote: Sun Sep 25, 2022 12:40 am most people will have it working correctly. But I have been playing with 2 ttys....tty7 runs icewm and tty1 sometimes runs sway.
I have not worked out if that is the reason....but my work around works so here it is

firstly run

Code: Select all

env | 1000
one of the results should show your XDG_RUNTIME_DIR=/run/user/1000, unless you have 2 more users?

....

That code line should be:

Code: Select all

env | grep 1000
"The world is full of kings and queens, who blind your eyes and steal your dreams. It's Heaven and Hell." - Ronnie James Dio
Linux Registered User #450992 (defunct)

gor9

Re: [TRICK] create missing XDG RUNTIME DIR

#3 Post by gor9 »

oops got it right at the bottom sorry about that.

Post Reply

Return to “Tips & Tricks by users (not for help)”