Created attachment 144590 [details] Startup Scripts SUMMARY I want to run a script after logging into kde. On this page, https://userbase.kde.org/System_Settings/Autostart it mentions I create a Login Script. Within System Settings > Startup and Shutdown > Autostart there is no such option STEPS TO REPRODUCE 1. Navigate to System Settings > Startup and Shutdown > Autostart 2. Try to add a Login Script 3. Option does not exist SOFTWARE/OS VERSIONS Ubuntu: Ubuntu 20.04.3 LTS Linux/KDE Plasma: plasmashell 5.18.5 ADDITIONAL INFORMATION I have tried to add a progran, and a script and none of these work
The UI for this was redesigned at some point after your Plasma version and the documentation shows the new design. The scripts seen in your screenshot should be executed on login ("Startup" in the old UI should be the same as "Login" in the new UI). make sure that your script files are executable, i.e. make sure that running "./restart-latte-dock.sh" in a terminal works
The script I am trying to run is meant to restart latte-dock after my laptop wakes up from sleep, after I login to KDE The script looks like ➜ cat ./bin/restart-latte-dock.sh #!/usr/bin/env bash /usr/bin/latte-dock --replace & 08:17:22 in ~ ➜ ls -la ./bin/restart-latte-dock.sh -rwxrwxr-x 1 win win 52 Dec 2 07:44 ./bin/restart-latte-dock.sh But latte dock does not restart after I login to KDE
> after my laptop wakes up from sleep, after I login to KDE Those are two different things. Which one do you want? Because we have "execute on login" scripts but we don't have "execute on wake up" scripts.
When my laptop wakes up from sleep, I have to login to KDE. I wanted to run the script at that point (after I have logged into KDE)
You mean after you entered you password to unlock the screen?
> You mean after you entered you password to unlock the screen? Yes At the end of the day, I close my laptop lid, and my laptop enters sleep mode. When I open my lid, I log into KDE, and I can continue where I left off. At this point my latte dock has the fuzzy graphics bug, from NVIDIA, and I have to run my script manually each time to restart latte dock. I wanted to automate that
OK, that's not logging in, that's unlocking the screen. So a login script will not automatically run when you unlock the screen. That is perhaps the source of the issue. The script should run when you log in after explicitly logging our or restarting the computer, but not when you unlock the screen. Instead of manually having a script to restart latte dock on wakeup/unlock, it might be useful to file a bug report to the latte-dock prodict so that whatever bug you're trying to work around can be fixed properly. :)
Thank you very much for phrasing what happens correctly I was thinking that I am "Logging into KDE" but what I am actually doing is "Unlocking my session" This is definitely not a bug then and I am marking it as not a bug Thank you for all the assistance, I'm a big fan of KDE
You're welcome!
Just dropping the fix here I created a script with the contents ``` #!/usr/bin/env bash # https://unix.stackexchange.com/a/361612/386718 dbus-monitor --session "type='signal',interface='org.freedesktop.ScreenSaver'" | while read x; do case "$x" in *"boolean true"*) /usr/bin/sleep 1;; *"boolean false"*) /usr/bin/sleep 1 && /usr/bin/latte-dock --replace &;; esac done ``` I added this script to be executed at startup This script will listen to events for lock and unlock and restart latte dock on an unlock event