Troubleshooting startup script

In my quest to make Plasma and my phone feel more synchronous with each other, much like iOS and MacOS, I managed to get Google Messages for Web installed as a PWA that auto starts and pins to my system tray at every login. The problem I’m dealing with now is getting it to close properly on logout. Plasma naturally wants to automatically turn on programs I had running at logout or shutdown, and I want to preserve this behavior, but it’s creating conflicts with my script since both Plasma and the script are trying to start the same application. I was hoping someone in here could offer some guidance into resolving this conflict. I have tried using a logout script that closes Messages but to no avail. Here are the contents of my login script:

#!/bin/bash

# Start Messages
/opt/google/chrome/google-chrome --profile-directory=Default --app-id=hpfldicfbfomlpcikngkocigghgafkph &

# Set Messages ID variable
messages=$(xdotool search --sync --name "Messages - Google Messages for web")

# Pin to tray
kdocker -w $messages -i /home/ego/.local/share/icons/hicolor/128x128/apps/chrome-hpfldicfbfomlpcikngkocigghgafkph-Default.png

Hey Prod_EGO

Have you tried removing the auto-start script and just let Plasma do it’s thing?

I had a similar issue and that fixed it.

Good luck

Vektor

And to go the other way, you can blacklist the app from the saved desktop session, and only use the script to start it, if that works more to your liking.

2 Likes

Yes but the problem is that it only starts Messages back up, it does not invoke kdocker to pin Messages to the tray.

Where is the setting to do this? Seems like the best solution.

It is in the desktop session section, can’t recall the exact name. In Plasma 6 it will be near the very bottom of System Settings.

This ended up being the best solution. Simple an effective. I am trying to do something similar with another app where the window title changes if you have ideas.