zsh-systemd is a zsh plugin that provides aliases for
systemd
commands, both system and user.
Add this to your zinit config (.zshrc):
zinit light redxtech/zsh-systemd
# it also works with turbo mode:
zinit ice wait lucid
zinit load redxtech/zsh-systemd
Install it with your favourite zsh package manager, or clone it directly to your $ZSH_CUSTOM/plugins
directory with git, and add systemd
to the plugins array in your .zshrc
file:
plugins=(... systemd)
here is a list of all the commands:
alias ss="sudo systemctl"
alias sss="sudo systemctl status"
alias ssstart="sudo systemctl start"
alias ssstop="sudo systemctl stop"
alias ssr="sudo systemctl restart"
alias sse="sudo systemctl enable --now"
alias ssd="sudo systemctl disable --now"
alias ssm="sudo systemctl mask"
alias ssum="sudo systemctl unmask"
alias ssdr="sudo systemctl daemon-reload"
alias scu="systemctl --user"
alias ssu="systemctl --user status"
alias scus="systemctl --user start"
alias scust="systemctl --user stop"
alias scur="systemctl --user restart"
alias scue="systemctl --user enable --now"
alias scud="systemctl --user disable --now"
alias scum="systemctl --user mask"
alias scuum="systemctl --user unmask"
alias scudr="systemctl --user daemon-reload"