You are not logged in.

#1 2014-07-30 21:35:09

hillbicks
Member
Registered: 2014-03-14
Posts: 14

running nvidia-settings at startup

Hey guys,

I'm certain that I'm missing something fairly obvious but I'm stuck right now.

I'm using xbmc as a HTPC, powered by arch. xbmc is started through a systemd (just like in the description in the wiki) and is working just fine. Only problem is that the fan of the nvidia graphics card is running way to high, so I'd like to set the maximum fan speed manually. I tested this manually beforehand and the temp is fine with an acceptable fan speed.

The only problem is that  nvidia-settings won't work without setting the display first, but I haven't found a way to do that automatically. Although the user xbmc is starting xbmc the .xinitrc in the home dir is not executed when xbmc itself is started via systemd, only if I login via ssh.

So my question is, how do I run a nvidia-settings command at startup without logging in manually everytime?

Thanks for your help guys smile

Offline

#2 2014-07-31 09:47:53

rebootl
Member
Registered: 2012-01-10
Posts: 431
Website

Re: running nvidia-settings at startup

Hello

I had a look at this. Not sure if that's really the best way to do it but:

The relevant file that starts xbmc is /usr/lib/systemd/system/xbmc.service, I'll post it for you:

[Unit]
Description = Starts instance of XBMC using xinit
After = systemd-user-sessions.service network.target
Conflicts=getty@tty7.service

[Service]
User = xbmc
Group = xbmc
PAMName=login
Type = simple
TTYPath=/dev/tty7
ExecStart = /usr/bin/xinit /usr/bin/dbus-launch --exit-with-session /usr/bin/xbmc-standalone -- :0 -nolisten tcp vt7
Restart = on-abort

[Install]
WantedBy = multi-user.target

As you can see it uses xinit to start xbmc and the way it is done it won't execute .xinitrc, as you already found out. See "man xinit" for more information (must-read wink).
So one thing you could do would be to override this line (the ExecStart) by a custom one. See https://wiki.archlinux.org/index.php/sy … unit_files on how to do this.
On this line you could try to leave out the "client" part (see man xinit again), then the .xinitrc should be executed. Then place these commands into your .xinitrc + the additional commands you'd like to run. Remember the exec statement, in this case calling xbmc, must be the last statement. Also see https://wiki.archlinux.org/index.php/xinitrc.

Edit: Beside that it maybe would be better to investigate the actual problem: What's the reason that it's spinning at max ? Is it a bug ? Could it be dusty ? And, have you tried tuning the frequencies down instead, or even better are there powersave settings ?

Last edited by rebootl (2014-07-31 09:59:39)


Personal website: reboot.li
GitHub: github.com/rebootl

Offline

Board footer

Powered by FluxBB