You are not logged in.

#1 2008-06-24 10:55:30

leo2501
Member
From: Buenos Aires, Argentina
Registered: 2007-07-07
Posts: 658

DWM. Apps Can't open X display

Hi! im having a problem with scrot for taking screenshots, he's refusing tongue im now using dwm and before i use wmii, with wmii i can take screenshots with no problem

[aleyscha@aleyscha 13 ~]$ scrot -d 5 -q 75 -t 25 -c ~/desktop.jpg
giblib error: Can't open X display. It *is* running, yeah?

i suspect it has something to do with the way i have my .xinitrc...

.xinitrc

#!/bin/sh

#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)
#

### Wallpaper set command ###
eval `cat ~/.fehbg`

### Autostart applications ###
numlockx &

### Window Manager set ###
# exec startkde
# fusion-icon &
# exec wmaker
# exec startxfce4
# exec icewm
# exec fvwm
# exec openbox
# exec startfluxbox
# exec awesome
# exec wmii
# exec ratpoison

# dwm
while true
do
        echo '|' CPU:$(get_cputemp Core0)C/$(get_cputemp Core1)C '|' Ram:$(get_freemem)/Swap:$(get_freeswap) '|' /downloads:$(get_diskinfo sdb1) /sdd1:$(get_diskinfo sdd1) /sde1:$(get_diskinfo sde1) /cdrom:$(get_cdrominfo cdrom) '|' PCM:$(get_volume PCM)% '|' $(date +'%R %d/%m/%Y')
        sleep 2
done | dwm

Thanks!

Last edited by leo2501 (2008-06-25 02:20:06)


Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
-- Antoine de Saint-Exupery

Offline

#2 2008-06-25 02:18:57

leo2501
Member
From: Buenos Aires, Argentina
Registered: 2007-07-07
Posts: 658

Re: DWM. Apps Can't open X display

I'm having the same issue in other programs as well when i try to open the game "N" it says:

[aleyscha@aleyscha 42 ~]$ n

Gtk-WARNING **: cannot open display: 
[aleyscha@aleyscha 43 ~]$

i think it has to do with DISPLAY=my_host:0 exec dwm in /etc/X11/xinit/xinitrc as says here -> http://wiki.archlinux.org/index.php/Dwm
but i dont know if i need to edit that file because my says twm, i think that is the default, and if i have an .xinitrc file at my home dir, it jumps that file, right?

Post Installation

After you have downloaded and installed dwm using pacman you go ahead and get started using it. It should be noted that currently dwm is configured through its source. If you simply download and install it, then you'll be given the default setup.

Fire up your favorite text editor and add dwm to your xinitrc script:

su
nano -w /etc/X11/xinit/xinitrc

Your's should look something like this:

#!/bin/sh
# $XConsortium: xinitrc.cpp,v 1.4 91/08/22 11:41:34 rws Exp $

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/usr/X11R6/lib/X11/xinit/.Xresources
sysmodmap=/usr/X11R6/lib/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
exec dwm

When I installed it on my laptop I had to use the following line:

DISPLAY=my_host:0 exec dwm

instead of

exec dwm

Finally, now all you need to do is

startx

at the command line.

Enjoy.


Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
-- Antoine de Saint-Exupery

Offline

#3 2008-06-25 02:27:13

bender02
Member
From: UK
Registered: 2007-02-04
Posts: 1,328

Re: DWM. Apps Can't open X display

Just try leaving off the 'DISPLAY=my_host:0', or try 'DISPLAY=:0' or try replacing my_host by your machine name (from /etc/hosts).

Offline

#4 2008-06-25 02:58:11

leo2501
Member
From: Buenos Aires, Argentina
Registered: 2007-07-07
Posts: 658

Re: DWM. Apps Can't open X display

but i don't understand that if i edit that file, any user that logins will have dwm as wm? or why that file and not my ~/.xinitrc?

my /etc/X11/xinit/xinitrc:

#!/bin/sh
# $Xorg: xinitrc.cpp,v 1.3 2000/08/17 19:54:30 cpqbld Exp $

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



twm &
xclock -geometry 50x50-1+1 &
xterm -geometry 80x50+494+51 &
xterm -geometry 80x20+494-0 &
exec xterm -geometry 80x66+0+0 -name login

Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
-- Antoine de Saint-Exupery

Offline

Board footer

Powered by FluxBB