I am using ‘latte-dock’ from the /extra repo for my dock, and unfortunately it does crash here and there and can be a tad annoying to have to manually relaunch it every time. I won’t ask if there is a way because of course this is Linux, there always seems to be. But instead, ill ask what is the best way to accomplish this, and how would I do that? I’m going to take a wild guess and assume a script has to be written that keeps checking to see if latte is running and if it isnt, it will launch it. Too bad I have no idea how to write that.
@Kundalini
If you still accept this non-supported application and reluctant to dig into debug lists, yay -S daemon
and replace latte-dock in Autostart with this
That was an error. I should edit that. After I double-checked I realized it was from the /extra applications which belong to the main repo from my understanding. I mistakenly assumed AUR only because I used the yay command which I normally do for AURS whereas I normally would use pacman -S for main repo stuff. My mistake
If you cannot fix the error and the crash is “not too often” then you can just run it as systemd service. It is already part of your system.
Every time the service crashes systemd tries to restart it. If it crashes too soon after the restart it just gives up and keep it crashed so that the computer is not swamped by a bad service.
I do not know latte-dock and how it does what it does so maybe this is not applicable.
Honestly you need to take the time to learn about the different logs and what information they give you. The logs you posted have a bunch of information that really isn’t needed or necessary to help with the issue. This is going to make it much harder for someone to be able to help you because now you have them looking and sorting through a bunch of irrelevant information.
This is ChatGPT’s solution to keeping ‘latte-dock-git’ open if it crashes. An auto restart script.
Automating the restart of latte-dock-git when it crashes can be achieved by creating a simple script and using a tool like systemd to manage the process. Here’s a step-by-step guide:
Create a Script:
Open your preferred text editor and create a script to restart latte-dock-git. For example, you can create a script named restart_latte.sh:
#!/bin/bash
while true; do
latte-dock-git
# Sleep for a short duration before restarting to avoid high CPU usage
sleep 2
done
Save the script and make it executable:
chmod +x restart_latte.sh
Create a systemd Service:
Now, you’ll create a systemd service that will run this script. Create a service file, e.g., latte-dock.service, in the /etc/systemd/system/ directory:
[Unit]
Description=Latte Dock Restarter
[Service]
ExecStart=/path/to/restart_latte.sh
Restart=always
User=your_username
[Install]
WantedBy=default.target
Make sure to replace /path/to/restart_latte.sh with the actual path to your script and replace your_username with your actual username.
Enable and Start the Service:
Once the service file is created, reload the systemd manager configuration:
sudo systemctl daemon-reload
Enable the service to start on boot:
sudo systemctl enable latte-dock.service
Start the service:
sudo systemctl start latte-dock.service
Now, the service will restart latte-dock-git automatically if it crashes.
Check the Status:
You can check the status of the service to see if it’s running without issues:
sudo systemctl status latte-dock.service
This command will display information about the service, including whether it’s active and any recent log output.
This setup should provide a basic mechanism to automatically restart latte-dock-git if it crashes. If you encounter any issues or want more advanced configuration, you may need to adjust the script or systemd service accordingly.
thats why i said take the time to learn the different ones. fstab for instance was not needed as it has nothing to do with applications. I would start with something like xsession errors and xorg logs.
Or start from terminal window latte-dock -d
and the ruins / log can be seen there. But it is not developed any more.
I repeat: having installed daemon daemon -r /usr/bin/latte-dock
can be put into Autostart ( -r, --respawn - Respawn the client when it terminates)