# .Xinitrc & the Enligtenment desktop.



## dalpets (Nov 6, 2019)

I have spent the last 6 weeks or so trying to get a desktop to work with 11.3 x64. Both Gnome & Xfce have been installation failures. My recent post for support on the Xfce forum has not been answered after 170 views. The best I have achieved with my attempts is a black screen with a frozen mouse.

Also, one of the things that has been vexing for me is that although FreeBSD has numerous *boot type files & kernel files*, I have not come across any FreeBSD configuration documents that call for their use & how to use them in generic or specific situations that I have been involved with.

However, I have just come across the Enlightenment desktop that calls for the configuration of the .xinitrc file. This file has also not been part of my past failed endeavors and I'm thinking that this and the boot files mentioned must surely have some place in producing a working desktop, but I haven't been able to find any detail on that.

So, to shortcut the problem, I am looking at automatically configuring Enlightenment which, apparently, can be done via the .xinitrc file.

My question is what configuration detail do I need in the .xinitrc file to achieve an automatic desktop installation.

Thank You for any help you can give me.


----------



## SirDice (Nov 6, 2019)

The ~/.xinitrc is just a startup file that can tell Xorg which window manager (or desktop) you want to load. If you don't have one the default Xorg window manager is loaded (TWM).

I would suggest testing and making sure a "plain" Xorg works first, then you can install and use alternate window (or desktop) managers. It's rather pointless to try and build a house if there's no foundation yet. Building various things on top isn't magically going to make the foundation appear.


----------



## dalpets (Nov 8, 2019)

I can see twm & startx in usr/local/bin but the command for twm says it's unable to open the display & startx says it's unable to connect to the server.
I've looked at Wiki.x.org & var/log/Xorg.0.log but the info there is all a bit foreign & overwhelming to me.  Also looked at section 5 of handbook re configuration. The only thing I have not done is
to add the kern.vty=vt line to /boot/loader.conf to enable vt(4)


I thought without configuration the system was supposed to provide a working default for startx but that hasn't happened.


----------



## SirDice (Nov 8, 2019)

dalpets said:


> I can see twm & startx in usr/local/bin but the command for twm says it's unable to open the display & startx says it's unable to connect to the server.


That's an indication your Xorg hasn't been configured correctly. Fix that first. Then you can take the next step and install an alternative WM or DE. 



dalpets said:


> I've looked at Wiki.x.org & var/log/Xorg.0.log but the info there is all a bit foreign & overwhelming to me


That's understandable, it's indeed quite daunting if you've never done this before. Just take it step by step, don't try to run before you can walk. 



dalpets said:


> The only thing I have not done is
> to add the kern.vty=vt line to /boot/loader.conf to enable vt(4)


There's no need for this, vt(4) has been set as the default for quite some time now. 



dalpets said:


> I thought without configuration the system was supposed to provide a working default for startx but that hasn't happened.


On FreeBSD you typically get the default configuration files as supplied by the source. These often need adjusting before you can actually use them on FreeBSD. Assume you need to configure _everything_, don't expect the system to "automagically' do it for you.

One of the things I liked about FreeBSD is that you're more or less forced to figure out how things work before you can actually use them. Installing something and it just works? Where's the fun in that?


----------



## rigoletto@ (Nov 8, 2019)

What is your video card? nVidia cards often needs something like this on xorg.conf (or more likely in a file in xorg.conf.d):


```
Section "Device"
    Identifier "nVidia Card"
    Driver "nvidia"
    VendorName "NVIDIA Corporation"
    BoardName "GeForce GT 630"
EndSection
```


----------



## tedbell (Nov 9, 2019)

rigoletto@ said:


> What is your video card? nVidia cards often needs something like this on xorg.conf (or more likely in a file in xorg.conf.d):
> 
> 
> ```
> ...



Don't forget the BusID. Sometimes it won't work without it.

As for the xinit file, you can find a couple examples that you can edit to your taste here:

```
/usr/local/etc/X11/xinit/xinitrc
/usr/local/etc/xdg/xfce4/xinitrc
```

Copy one or the other to your home directory:

```
cp /usr/local/etc/X11/xinit/xinitrc ~/.xinitrc
```

add the line with your window manager executable to the end of the file:

```
exec startxfce4
```

You may need to add something like this in case you have D-bus issues like a missing trash bin:

```
exec startxfce4 --with-ck-launch
```


----------



## dalpets (Nov 9, 2019)

Thanks all for your contributions so far. This is mind boggling stuff. There seem to be so much involved. So much to just to get Startx working. I get the impression that much of the stuff outside these forums, either on the net or in text books, could be either outdated or inapppropriate & therefore I'm hesitant to use it.
There is very well meaning help coming out of the forums & I'm highly appreciative of that but often it is piecemeal help or written in a fashion that assumes more than a modicum of technical knowledge.

The howto @ https://m.wikihow.com/Configure-X11-in-Linux is more in my present learning style, but I need to ask the question 'does it also apply to FreeBSD & can I use it'? There is even a comment there that a monitor could be damaged by misconfiguration. Wow!

I'm trying not to overthink all this  so I'm looking for a simpler approach, if possible, hence the reference to the wiki.

Thanks all.


----------



## ghostdawg (Nov 9, 2019)

Hi, I'm fairly new to FreeBSD myself but do use Linux. Once I got it installed to my hdd, using ufs filesystem, I was able to get startx to run with TWM. Searching online I found this guide on setting up my desktop (Mate) and other settings. I just adjusted it to how my setup is used. I hope this helps.
Also there is great help from the FreeBSD Handbook.









						A FreeBSD 11 Desktop How-to
					

A guide to a full-featured modern desktop FreeBSD installation




					cooltrainer.org


----------



## dalpets (Nov 10, 2019)

I've now managed to access X-config /root/xorg.conf.new & I see the sections involved in the X11 config.  I have been able to record my monitor (Dell) & the model number but not anything else since I'm unsure what to record for the other sections. When doing preliminaries I used the linux config example in the the linux wiki referenced in thread 7 above. This is different to the FBSD version & probably some of the info there is not required, however Ghostdawg's desktop howto above looks promising.

It is evident from the above contributions that I need to also configure the ~/.xinitrc file, & also the xorg.conf  (or  xorg.conf.d)  for my video card. Which is the better to use? What is the overriding purpose for conf.d?
My video is controlled by the Intel integrated graphic processor which I believe needs to be driven by the i915 driver. Where is the best place for this driver?
Do I need to rename xorg.conf.new to xorg.conf?

Do I leave installing the actual desktop (Gnome or whatever) until after I have fully configured X11 for Startx?

If you have any tips, in addition to those helpfully contributed above for completing the config, I would be most appreciative.

Have I missed any other files that need to be configured to start a desktop?

Sorry to be somewhat of a dunce in this particular matter. Hopefully it's just a passing aberration.


----------



## dalpets (Nov 10, 2019)

tedbell said:


> Don't forget the BusID. Sometimes it won't work without it.
> 
> As for the xinit file, you can find a couple examples that you can edit to your taste here:
> 
> ...


Thanks very much for going out of your way for this old codger. I've been retired for 25 years & probably lost some brain cells along the way from my past life as an administrator. 

What is the bus ID you refer to?


----------



## dalpets (Nov 10, 2019)

tedbell said:


> Don't forget the BusID. Sometimes it won't work without it.
> 
> As for the xinit file, you can find a couple examples that you can edit to your taste here:
> 
> ...


Thanks for your detailed help.


----------



## dalpets (Nov 10, 2019)

rigoletto@ said:


> What is your video card? nVidia cards often needs something like this on xorg.conf (or more likely in a file in xorg.conf.d):
> 
> 
> ```
> ...


My video is integrated into the Intel cpu, using the i915 driver. Thanks for your comments.


----------



## tedbell (Nov 10, 2019)

dalpets said:


> Thanks very much for going out of your way for this old codger. I've been retired for 25 years & probably lost some brain cells along the way from my past life as an administrator.
> 
> What is the bus ID you refer to?



No problem.   I've only been using FreeBSD for a year so I am still learning myself. BusID (and someone may provide a better explanation) is just that. An identifier to which PCI bus the graphics card is connected to. By default, the Intel device is usually at "BusID       "PCI:0:2:0". However, sometimes you will have a system with two video cards (Intel on board and NVIDIA or ATI discrete, or two discrete cards) and you run into problems with using the discrete cards which are usually on BusID PCI:1:0:0. So you will have to tell Xorg where to find the card you want to use manually by editing your xorg.conf file and adding the BusID line in your "Device" section:


```
Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BusID          "PCI:1:0:0"
EndSection
```

You can find the BusIDs of your devices by issuing this command:


```
pciconf -lv | grep -A 3 -B 3 VGA
```


----------



## ghostdawg (Nov 11, 2019)

dalpets said:


> My video is integrated into the Intel cpu, using the i915 driver. Thanks for your comments.


I didn't have to do anything with xorg.conf, and I also use the i915 driver. Did you add this to /etc/rc.conf?
*


		Code:
	

kld_list="i915kms"

*


----------



## dalpets (Nov 11, 2019)

ghostdawg said:


> I didn't have to do anything with xorg.conf, and I also use the i915 driver. Did you add this to /etc/rc.conf?
> *
> 
> 
> ...


yes I did


----------



## dalpets (Nov 13, 2019)

Success OOTB with 12 but 11.3 didn't work for me. 
Thanks to all who have generously helped me along the way.


----------

