# twm working but no desktop environment connecting to display



## ankscorek (Oct 3, 2014)

Hi friends before I write I may explain I have gone through the threads https://forums.freebsd.org/viewtopic.php?f=38&t=48099 and https://forums.freebsd.org/viewtopic.php?f=38&t=48155. I have also rebuilt all my ports by enabling NEW_XORG and also when not enabled. I have tried to downgrade Cairo. The end result is that twm is working but no desktop environment is connecting to the display.

Any clues so far?


----------



## jmccue (Oct 7, 2014)

What does 





> twm working but no desktop environment connecting to display


 mean?

Does twm itself look and work OK?  Did you install a "desktop environment"?


----------



## SirDice (Oct 7, 2014)

Please post your /var/log/Xorg.0.log.

(TWM can't be working if there's no display to connect to)


----------



## ankscorek (Oct 9, 2014)

If I type the command `startx` by default it connects to TWM. However if I use any other desktop environment like `startfluxbox` or `enlightenment_start` or `exec xfce4` etc. etc. I get the error message 
	
	



```
Unable to connect to X display
```

I even tried making these entries in .xinitrc file, but it did not help.

If I enable Slim then I get the Slim login page but then it connects me to no desktop session.


----------



## SirDice (Oct 9, 2014)

This is the .xinitrc I use for slim:

```
# Used for SLiM

DEFAULT=awesome

case $1 in
        lxde)
                exec ck-launch-session dbus-launch --exit-with-session lxsession
                ;;

        xfce)
                exec ck-launch-session dbus-launch startxfce4
                ;;
        gnome)
                exec ck-launch-session dbus-launch gnome-session
        ;;
        *)
                exec ck-launch-session $DEFAULT
        ;;
esac
```

You can add multiple desktop environments to slim by editing slim.conf. What you choose is fed to the .xinitrc script and my example shows how you can start the different desktops.

In slim.conf:

```
# Available sessions (first one is the default).
# The current chosen session name is replaced in the login_cmd
# above, so your login command can handle different sessions.
# see the xinitrc.sample file shipped with slim sources
sessions            xfce4,lxde,gnome
```


----------



## nakal (Oct 9, 2014)

Choosing sessions does not work anymore with x11/slim, BTW. They also removed the configuration entry sessions in favor of sessiondir where .desktop files are expected. This will make choosing sessions work again, but won't start your .xinitrc anymore, but the executable you specified in Exec=.

I have only one window manager (and don't need to change sessions and there is a fallback to execute sessionstart_cmd when nothing is specified in sessiondir), but I've seen people complaining about it. A patch existed to restore the old behavior with sessions, but it got lost, because the developers emptied their bugtracker, as it seems.


----------



## ankscorek (Oct 10, 2014)

Except twm no other session is being executed.


----------



## SirDice (Oct 10, 2014)

nakal said:
			
		

> Choosing sessions does not work anymore with x11/slim, btw.


Really? Damn, I must get my desktop back into shape. I copied the files from my server but it's been a while since I last used any GUI on there.


----------



## ankscorek (Oct 10, 2014)

I am not using Slim. I am directly trying to connect using the `startfluxbox` etc. commands. Only `startx` is working with the twm entry.


----------



## SirDice (Oct 10, 2014)

Try using this in .xinitrc to start Xfce.

```
exec ck-launch-session dbus-launch startxfce4
```

If that fails post the /var/log/Xorg.0.log of that session.


----------



## wblock@ (Oct 10, 2014)

SirDice said:
			
		

> Try using this in .xinitrc to start XFCE.
> 
> ```
> exec ck-launch-session dbus-launch startxfce4
> ```



The more specific Xfce way is:

```
exec /usr/local/bin/startxfce4 --with-ck-launch
```


----------



## olivierd (Oct 10, 2014)

wblock@ said:
			
		

> SirDice said:
> 
> 
> 
> ...



Xfce provides a xinitrc file, I think it's better to use it.


----------



## ankscorek (Oct 11, 2014)

What about fluxbox? hald and dbus services are enabled in /etc/rc.conf. Is it `startfluxbox`?

Either way Fluxbox is not connecting to the X display. However the method given by SirDice and wblock@ does help in connecting Xfce4 to the X server.


----------



## wblock@ (Nov 6, 2014)

As far as I recall, x11-wm/fluxbox is just a normal window manager without a special start command.  Normally, it would be added to ~/.xinitrc, and be started when `startx` is run.


----------



## ankscorek (Nov 8, 2014)

wblock@ said:


> The more specific xfce way is:
> 
> ```
> exec /usr/local/bin/startxfce4 --with-ck-launch
> ```



This is working for the/an Xfce4 environment. However any other desktop environment like fluxbox, ratpoison or enlightment is not connecting to the X display. `exec /usr/local/bin/startfluxbox` is unable to connect to the X Display.

Here is an extract from Xorg.0.log

```
[   108.339] (II) LoadModule: "fbdev"
[   108.339] (WW) Warning, couldn't open module fbdev
[   108.339] (WW) Warning, couldn't open module fbdev
[   108.339] (II) UnloadModule: "fbdev"
[   108.339] (II) Unloading fbdev
[   108.339] (EE) Failed to load module "fbdev" (module does not exist, 0)
```


----------



## protocelt (Nov 8, 2014)

Please post the _entire_ output of your Xorg.0.log file.


----------



## ankscorek (Nov 10, 2014)

protocelt said:


> Please post the _entire_ output of your Xorg.0.log file.



The file is attached.


----------

