Wie starte ich ein Programm nachdem X gestartet wurde?

18892
cyborg

Es gibt eine kleine App namens F.Lux, die Ihre Bildschirmtemperatur an die Tageszeit anpasst . Die Linux-Version ist etwas spartanisch und verfügt nur über eine Konsolenschnittstelle, sie funktioniert jedoch einwandfrei.

Wo kann ich es aufrufen, damit es nach dem Start von X startet?

18
Ich liebe ** f.lux! Wahrscheinlich hat es mir in den letzten Jahren die Augen gerettet, ich kann ohne es nicht mehr rechnen. Phoshi vor 13 Jahren 1
Interessante Software, ich lade es jetzt zum Ausprobieren .. Dentrasi vor 13 Jahren 0
Das ist großartig, dies wird mich davon abhalten, mich nachts über die Helligkeit des Bildschirms zu beschweren. Corey vor 13 Jahren 0
In der Tat, tolle App. Shiki vor 13 Jahren 0
Dies ist eine gute Ressource zum Thema https://lb.raspberrypi.org/forums/viewtopic.php?t=132637 Hernán Eche vor 5 Jahren 0

4 Antworten auf die Frage

7
stevenrjanssens

.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.

5
akira

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
Darth Android

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. >.>

Hmm, nicht sicher, dass es funktioniert hat, gibt es irgendwo ein Protokoll dafür? cyborg vor 13 Jahren 0
Nicht, wenn F.Lux sich irgendwo anmeldet. Sie können immer "echo" hinzufügen "Hallo!" >> ~ / .launchlog `bis zu Ihrer` .xinitrc`, bis Sie sicher sind, und löschen Sie das Testprotokoll anschließend. Darth Android vor 13 Jahren 0
1
Ignacio Vazquez-Abrams

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