fix(systemd): remove sudo from power-related aliases (#9441)

This commit is contained in:
scrouthtv 2021-12-29 10:31:29 +01:00 committed by GitHub
commit 5b2f99bcb7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 52 additions and 23 deletions

View file

@ -3,7 +3,8 @@
The systemd plugin provides many useful aliases for systemd.
To use it, add systemd to the plugins array of your zshrc file:
```
```zsh
plugins=(... systemd)
```
@ -22,7 +23,7 @@ plugins=(... systemd)
| `sc-show-environment` | `systemctl show-environment` | Dump the systemd manager environment block |
| `sc-cat` | `systemctl cat` | Show backing files of one or more units |
| `sc-list-timers` | `systemctl list-timers` | List timer units currently in memory |
| **Aliases with sudo** |
| **Aliases with sudo** |||
| `sc-start` | `sudo systemctl start` | Start Unit(s) |
| `sc-stop` | `sudo systemctl stop` | Stop Unit(s) |
| `sc-reload` | `sudo systemctl reload` | Reload Unit(s) |
@ -59,9 +60,11 @@ to your prompt, drop `$(systemd_prompt_info [unit]...)` into your prompt (more t
may be specified).
The plugin will add the following to your prompt for each `$unit`.
```
```text
<prefix><unit>:<active|notactive><suffix>
```
You can control these parts with the following variables:
- `<prefix>`: Set `$ZSH_THEME_SYSTEMD_PROMPT_PREFIX`.
@ -79,7 +82,7 @@ You can control these parts with the following variables:
For example, if your prompt contains `PROMPT='$(systemd_prompt_info dhcpd httpd)'` and you set the following variables:
```
```sh
ZSH_THEME_SYSTEMD_PROMPT_PREFIX="["
ZSH_THEME_SYSTEMD_PROMPT_SUFFIX="]"
ZSH_THEME_SYSTEMD_PROMPT_ACTIVE="+"
@ -89,6 +92,6 @@ ZSH_THEME_SYSTEMD_PROMPT_CAPS=1
If `dhcpd` is running, and `httpd` is not, then your prompt will look like this:
```
```text
[DHCPD: +][HTTPD: X]
```