21

There's a little app called F.Lux that sets your screen temperature based on the time of day. The Linux version is a little spartan with just a console interface but it works perfectly well.

Where can I invoke it so that it starts up after X has started?

5
  • 1
    I love f.lux! It's probably saved my eyes these last few years, I can't stand computing without it anymore.
    – Phoshi
    Commented Jun 8, 2010 at 20:24
  • Interesting software, I'm downloading now to try out..
    – Dentrasi
    Commented Jun 8, 2010 at 20:59
  • This is awesome, this will save me from complaining about screen brightness at night.
    – Corey
    Commented Jun 9, 2010 at 6:13
  • Indeed, awesome app.
    – Apache
    Commented Jun 9, 2010 at 9:19
  • this is a good resource on the topic lb.raspberrypi.org/forums/viewtopic.php?t=132637 Commented Jul 25, 2018 at 18:45

4 Answers 4

7

.xinitrc is the one to use if you start your window manager from there. If you use KDE or GNOME you will need to add the program to the services that autostart on login.

6

first of all, read 'man X':

 STARTING UP

   There are two main ways of getting the X server and an initial  set  of
   client  applications  started.   The  particular method used depends on
   what operating system you are running and whether or not you use  other
   window systems in addition to X.

you will learn, that, depending on how you bring up the xserver, 2 scripts are used for starting things after the xserver came up:

  • .xinitrc (for when you launched the session via startx (which fires up xinit))
  • .xsession (for when you logged into your system via a display manager (xdm))

(i personally ln -s .xinitrc .xsession, so it does not matter, how i bring up the xserver).

depending on what you use to log into your system (and i think it is either gdm or kdm these days), things get a bit different. normally gdm and kdm (and other display managers as well) offer the user to select the "user session" or something similar labeled. if you pick this "user-session" then mostly these display managers will launch ~/.xsession. you would be responsible for bringing up your applications AND the desktop environment / windowmanager.

the other possible solution is to find out how the different desktop environments / windowmanagers support the concept of "autostart". i personally avoid these mechanisms and stick to the good old .xinitrc / .xsession way.

an example .xinitrc would look like:

xmodmap ~/.Xmodmap
xsetxkbmap de
autocutsel &
xflux -l 52
exec /usr/bin/fluxbox
3

Try placing a script named .xinitrc in your home directory. KDE and Gnome also have the ability to run scripts/applications on login if you're using one of those. I believe .Xstartup or .xstartup might also do what you want if .xinitrc doesn't. My linux is getting a bit rusty it seems. >.>

2
  • 1
    Hmm, not sure that it worked, is there a log for it anywhere?
    – cyborg
    Commented Jun 8, 2010 at 20:32
  • 1
    Not unless F.Lux logs somewhere. You can always add echo "hello!" >> ~/.launchlog to your .xinitrc until you know for sure, and delete the test log afterwards. Commented Jun 8, 2010 at 20:34
2

The XDG Autostart Specification works for any XDG-compliant desktop environment, including Gnome, KDE, XFCE, and others.

1
  • Nice pointer, but to make this answer a bit more useful, I'd add "look into $XDG_CONFIG_DIRS (e.g. /etc/xdg) and you'll see an autostart directory with a bunch of .desktop files".
    – Matthieu
    Commented Jul 4 at 21:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .