add profile.sh to start stdm on tty1

This commit is contained in:
Adrian Schneider 2020-05-29 17:49:28 +02:00 committed by Jan Christian Grünhage
parent f16596632b
commit 2b38eaf38b
Signed by: jcgruenhage
GPG Key ID: 6594C449C633D10C
4 changed files with 21 additions and 8 deletions

View File

@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [0.1.1] - 2020-05-30
### Added
- Add profile.sh for installation in /etc/profile.d/stdm.sh
## [0.1.0] - 2020-05-13
### Added
- Initial release

View File

@ -1,6 +1,6 @@
[package]
name = "stdm"
version = "0.1.0"
version = "0.1.1"
authors = ["Jan Christian Grünhage <jan.christian@gruenhage.xyz>"]
edition = "2018"
description = "A simple terminal display manager"

View File

@ -1,8 +1,9 @@
# STDM
STDM is a simple terminal display manager. It's inspired by cdm, but way simpler.
Right now it can only start Wayland sessions, and apparently only some of those too.
I might extend it to do more myself, but I use it for starting sway, and that works.
STDM is a simple terminal display manager. It's inspired by cdm, but way
simpler. Right now it can only start Wayland sessions, and apparently only some
of those too. I might extend it to do more myself, but I use it for starting
sway, and that works.
## Installation
@ -10,12 +11,12 @@ Install it with `cargo` like any old rust project
## Usage
Run it, done. Running it automatically is left as an exercise for the reader.
A profile.d file will be provided in the future, for now go check on
[cdm's profile.sh](https://github.com/evertiro/cdm/blob/master/src/profile.sh).
Put the `contrib/profile.sh` file into `/etc/profile.d/` as `stdm.sh`. This
starts stdm automatically when logging in on `tty1`.
## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Pull requests are welcome. For major changes, please open an issue first to
discuss what you would like to change.
Please make sure to update tests as appropriate.

8
contrib/profile.sh Normal file
View File

@ -0,0 +1,8 @@
# To avoid potential situation where cdm(1) crashes on every TTY, here we
# default to execute cdm(1) on tty1 only, and leave other TTYs untouched.
if [[ "$(tty)" == '/dev/tty1' ]]; then
[[ -n "$STDM_SPAWN" ]] && return
# Avoid executing cdm(1) when X11 has already been started.
STDM_SPAWN=true exec stdm
fi