My situation
I installed a few new unit files under $HOME/.local/share/systemd/user/
ls -1 $HOME/.local/share/systemd/user/
some.service
some.timer
some_other.service
I ran the following command to have them loaded properly: systemctl --user daemon-reload
They show up in auto completion of systemctl --user enable <tab> <tab>
. What I'm looking for is a way to later write a script with gum to show me a list of those units which are currently not enabled to enable them.
My question
Is there a better way than ls -1 $HOME/.local/share/systemd/user/
to get the list I'm looking for?
systemctl
knows about the units through auto completion, but I don't want to that deep for a seemingly rather simple question. I looked at systemctl list all possible (including disabled) services and some parts of the Systemd documentation, but I wasn't able to find what I was looking for yet. It doesn't have to be perfect, the auto complete list also has some other entries which I could filter out. That won't be a problem for me.