Run command on lock/unlock - advanced Notifications calls?

On my old system, I have it set to turn off the screen, and run a command to turn a Kasa plug on and off by going to settings > applications and system notifications > manage notifications and adding the commands to the events for scree lock and unlocked by following this guide:

Is there an equivalent version? Or is it a Zorin Pro only feature? it's ok if it is (providing it's straightforward), but I would like to know before I commit

Zorin Pro does not lock performance or functionality behind a paywall.
It comes with extra stuff, but Core and Lite (free) are the same functionality.
So, if it did come with Pro, you would be able to implement it in Corer or Lite without Pro.

It shows the O.P.'s workaround:

#!/bin/bash

dbus org.freedesktop.ScreenSaver /ScreenSaver Lock
xset dpms force standby

Which the above should work in Zorin OS. Are you asking about an equivalent GUI method?

is that the command for the Zorin desktop manager to? I was under the impression that any command line operators would vary depending on the windowing environment used.
an equivalent gui method would be appreciated as it would be easier to validate and change later, and do variations of the command. Plus I'm starting to notice that more GUI-reliant distributions of linux will manage settings independently of the commandline functions and will overwrite command line changes, so I would like to avoid doing so in case it breaks with a later update, if Zoring doesn't already overwrite those files.

Additionally, when the screen is locked or shutdown is initiated i would like to run "kasa --alias "SpeakerPlug" off" and when login or unlock is initiated i would like to run the command "kasa --alias "SpeakerPlug" on". If I had a GUI settings page I can find where I need to change things there.

If you are thinking X Window or Wayland, then yes. But you are not using Wayland.
XSET is part of X Window, not part of Plasma, GNome or XFCE.

I do not use Gnome or KDE, so I am less helpful as to the details...

Apologies for the long time responding, I figured out how to do it in KDE and so was running Kubuntu, but Zorin OS is basically better in every way and solved some problems I had.

Does Zorin OS have a custom management system for creating systemd services that can execute commands on shutdown or sleep? Or should I just figure out normal systemd?

Certainly, you can run commands from Scripts.


This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.