Skip to content

Commit

Permalink
Updated README and man page.
Browse files Browse the repository at this point in the history
  • Loading branch information
apognu committed Oct 5, 2021
1 parent 1784c00 commit 087b0f3
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,18 @@ Then refer to your wrapper script in a custom desktop file (in a directory decla
Name=Wayland Gnome
Exec=/path/to/my/wrapper.sh
```

### Power management

Two power actions are possible from `tuigreet`, shutting down (through `shutdown -h now`) and rebooting (with `shutdown -r now`) the machine. This requires that those commands be executable by regular users, which is not the case on some distros.

To alleviate this, there are two options that can be used to customize the commands that are run: `--power-shutdown` and `--power-reboot`. The provided commands must be non-interactive, meaning they will not be able to print anything or prompt for anything. If you need to use `sudo` or `doas`, they will need to be configured to run passwordless for those specific commands.

An example for `/etc/greetd/config.toml`:

```
[default_session]
command = "tuigreet --power-shutdown 'sudo systemctl poweroff'"
```

Note that, by default, all commands are prefixed with `setsid` to completely detach the command from our TTY. If you would prefer to run the commands as is, or if `setsid` does not exist on your system, you can use `--power-no-setsid`.
16 changes: 16 additions & 0 deletions contrib/man/tuigreet-1.scd
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,26 @@ tuigreet - A graphical console greeter for greetd
*--prompt-padding ROWS*
Add spacing between form fields.

*--power-shutdown CMD [ARGS]...*
Customize the command run when instructed to shut down the machine. This must
be a non-interactive command (sudo cannot prompt for a password, for example).

*--power-reboot CMD [ARGS]...*
Customize the command run when instructed to reboot the machine. This must be
a non-interactive command (sudo cannot prompt for a password, for example).

*--power-no-setsid*
Do not prefix power commands with *setsid*, which is used to detach it from
current TTY.


# AUTHORS

Maintained by Antoine POPINEAU <[email protected]>.

Contributed to by great people at
https://github.com/apognu/tuigreet/graphs/contributors.

# DEVELOPMENT

Issue reporting and development discussion should happen at
Expand Down

0 comments on commit 087b0f3

Please sign in to comment.