Re: [dwm] Apps Can't open X display

From: pancake <pancake_AT_youterm.com>
Date: Wed, 25 Jun 2008 16:23:48 +0200

On Wed, 2008-06-25 at 03:40 -0700, Leandro Chescotta wrote:
> Hi! im having a problem with various apps that doesn't run saying that
> can't open DISPLAY, scrot for taking screenshots for example, im now
> using dwm and before i use wmii, with wmii i can take screenshots with
> no problem:
>
> [aleyscha_AT_aleyscha 13 ~]$ scrot -d 5 -q 75 -t 25 -c ~/desktop.jpg
> giblib error: Can't open X display. It *is* running, yeah?
>
> and:
>
> [aleyscha_AT_aleyscha 42 ~]$ n
> Gtk-WARNING **: cannot open display:
>

> i suspect it has something to do with the way i have my .xinitrc...
>
> #!/bin/sh
> # ~/.xinitrc
> # 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
>
> i think it has to do with DISPLAY=my_host:0 exec dwm in

DISPLAY is set automatically. you dont have to define it manually. the X
server allocates it for you. btw if you want to force it (nosense) you
can do it in this way:

DISPLAY=:0

no need to define hostname. hostname is only for remote connections, and
most of X servers currently run without TCP/UDP support.

hope this helps

> /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.
> #####
>
> 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
> #####
>
> THANKS!
>
Received on Wed Jun 25 2008 - 16:23:19 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:51:26 UTC