web-dev-qa-db-fra.com

Démarrage automatique de Compton dans Lubuntu 16.04

Désolé pour mon mauvais anglais Mon problème est de déchirer l’écran dans Lubuntu 16.04, mon GPU est Intel HD graphic. J’installe compton et cette commande m’aide $ compton -b --vsync opengl Mais je souhaite démarrer automatiquement Compton afin que je recherche Internet pour cela. J'édite le fichier /etc/xdg/lxsession/Lubuntu/autostart en ajoutant cette ligne @compton -b --vsync opengl Mais cela ne fonctionne pas, quelqu'un peut-il m'aider?

$ which compton
/usr/bin/compton

$ Sudo systemctl status mycompton.service
● mycompton.service - compton autostart script
   Loaded: loaded (/etc/systemd/system/mycompton.service; enabled; vendor preset: enabled)
   Active: inactive (dead) (Result: exit-code) since T5 2017-09-07 15:59:44 ICT; 5s ago
  Process: 6342 ExecStart=/usr/bin/compton -b --vsync opengl (code=exited, status=1/FAILURE)

Th09 07 15:59:44 GaCon systemd[1]: Failed to start compton autostart script.
Th09 07 15:59:44 GaCon systemd[1]: mycompton.service: Unit entered failed state.
Th09 07 15:59:44 GaCon systemd[1]: mycompton.service: Failed with result 'exit-code'.
Th09 07 15:59:44 GaCon systemd[1]: mycompton.service: Service hold-off time over, scheduling restart.
Th09 07 15:59:44 GaCon systemd[1]: Stopped compton autostart script.
Th09 07 15:59:44 GaCon systemd[1]: mycompton.service: Start request repeated too quickly.
Th09 07 15:59:44 GaCon systemd[1]: Failed to start compton autostart script.

$ journalctl -xe
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit mycompton.service has finished shutting down.
Th09 07 15:59:44 GaCon systemd[1]: Starting compton autostart script...
-- Subject: Unit mycompton.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit mycompton.service has begun starting up.
Th09 07 15:59:44 GaCon compton[6342]: session_init(): Can't open display.
Th09 07 15:59:44 GaCon systemd[1]: mycompton.service: Control process exited, code=exited status=1
Th09 07 15:59:44 GaCon systemd[1]: Failed to start compton autostart script.
-- Subject: Unit mycompton.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit mycompton.service has failed.
-- 
-- The result is failed.
Th09 07 15:59:44 GaCon systemd[1]: mycompton.service: Unit entered failed state.
Th09 07 15:59:44 GaCon systemd[1]: mycompton.service: Failed with result 'exit-code'.
Th09 07 15:59:44 GaCon systemd[1]: mycompton.service: Service hold-off time over, scheduling restart.
Th09 07 15:59:44 GaCon systemd[1]: Stopped compton autostart script.
-- Subject: Unit mycompton.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit mycompton.service has finished shutting down.
Th09 07 15:59:44 GaCon systemd[1]: mycompton.service: Start request repeated too quickly.
Th09 07 15:59:44 GaCon systemd[1]: Failed to start compton autostart script.
-- Subject: Unit mycompton.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit mycompton.service has failed.
-- 
-- The result is failed.
Th09 07 15:59:50 GaCon Sudo[6344]:      lhv : TTY=pts/0 ; PWD=/home/lhv ; USER=root ; COMMAND=/bin/systemctl status mycompton.service
Th09 07 15:59:50 GaCon Sudo[6344]: pam_unix(Sudo:session): session opened for user root by (uid=0)
Th09 07 15:59:50 GaCon Sudo[6344]: pam_unix(Sudo:session): session closed for user root
Th09 07 16:00:14 GaCon com.canonical.indicator.application[974]: (process:1199): indicator-application-service-WARNING **: Application already exists, re-requesting pro
lines 2628-2669/2669 (END)
1
Việt Lê Huy

Vous pouvez utiliser un simple service systemd pour le démarrer automatiquement:

  1. Créer un fichier de service:

    Sudo nano /etc/systemd/system/mycompton.service
    
  2. Ajoutez les configurations suivantes:

    [Unit]
    Description=compton autostart script
    After=network.target
    
    [Service]
    Type=forking
    ExecStart=/usr/bin/compton -b --vsync opengl
    Restart=always
    
    [Install]
    WantedBy=multi-user.target
    
  3. Démarrez et activez le service compton:

    Sudo systemctl start mycompton
    Sudo systemctl enable mycompton
    
  4. Vérifiez le statut:

    systemctl status mycompton
    
  5. Arrêtez-le avec:

    Sudo systemctl stop mycompton
    

Note:

Remplacez la ligne /usr/bin/coompton par le résultat de which compton, si elle est différente de ma propre entrée.

1
George Udosen