Example Custom Commands #194
joshuar
started this conversation in
Show and tell
Replies: 1 comment
-
Here is a example script that can create a swich in Home Assistant that turns on or off a service in the user's session. Requires systemd configured with the linger option (see the FAQ for how to enable lingering). The script: #!/bin/bash
if [ "$1" = "ON" ]; then
systemctl --user start tmux
fi
if [ "$1" = "OFF" ]; then
systemctl --user stop tmux
fi
if [ "$(systemctl --user is-active tmux)" = "active" ]; then
echo ON
else
echo OFF
fi The configuration in [[switch]]
name = "Toggle Tmux Service"
exec = "/path/to/toggle-tmux.sh" |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey folks,
Use this topic to share examples of custom commands you have configured in the agent!
Beta Was this translation helpful? Give feedback.
All reactions