You are not logged in.

#1 2021-09-02 19:50:45

aXXo
Member
Registered: 2021-09-02
Posts: 2

[Solved] Xorg, startx with dwm

Hi,

I recently installed Arch Linux and used X server with dwm. I configured my .xinitrc file:

#!/bin/sh

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

# merge in defaults and keymaps
if [ -f $sysresources ]; then
    xrdb -merge $sysresources
fi

if [ -f $sysmodmap ]; then
    xmodmap $sysmodmap
fi

if [ -f "$userresources" ]; then
    xrdb -merge "$userresources"
fi

if [ -f "$usermodmap" ]; then
    xmodmap "$usermodmap"
fi

# start some nice programs
if [ -d /etc/X11/xinit/xinitrc.d ] ; then
 for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
  [ -x "$f" ] && . "$f"
 done
 unset f
fi

#twm &
#xclock -geometry 50x50-1+1 &

# Launch custom script with dwm
while xsetroot -name "  `date +"%D"`  `date +"%H:%M %p"`"
do
        sleep 20s
done &
nitrogen --restore
exec dwm

I then open my session by doing sudo startx. Everything runs fine but my problem is that dwm runs as root, I'm unsure if it is supposed to be like that but because of this, things like dmenu and st run everything as root. I tried running startx as non-root also but then it simply crashes. I know the problem is obvious here but I don't understand what I'm supposed to change.

Last edited by aXXo (2021-09-02 21:09:55)

Offline

#2 2021-09-02 19:52:38

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [Solved] Xorg, startx with dwm

Running startx with elevated privileges has likely created files with root ownership in your home. Remove them and just run startx as your regular user.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2021-09-02 20:27:10

aXXo
Member
Registered: 2021-09-02
Posts: 2

Re: [Solved] Xorg, startx with dwm

jasonwryan wrote:

Running startx with elevated privileges has likely created files with root ownership in your home. Remove them and just run startx as your regular user.

Thank you, indeed i simply logged as super user and in it's home directory (/root) listed all files (ls -a) and deleted one (.xauthority). I also copied my (.xinitrc) file to my user's home directory and (exit && startx). Fixed the problem!

Have a nice day smile

Last edited by aXXo (2021-09-02 20:29:02)

Offline

#4 2021-09-02 20:41:10

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [Solved] Xorg, startx with dwm

Please remember to mark your thread as [Solved] by editing your first post and prepending it to the title.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB