Tty screen login to more then one windows manager.?

At the moment I have two mangers i3wm and awesomewm is it possible to choose windows managers from the tty screen. With out editing the .xinitrc with vi each time.
Even if i3wm = tty1 And awesome = tty2 or something along these lines.

Hope this is the right place to post this. ?

2 Likes

Looks like a good idea but I get errors installing from the AUR. Tried yay first then pamac-manager same error.

Building emptty...
Running as unit: run-u42.service
==> Making package: emptty 0.5.1-1 (Mon 24 May 2021 12:57:27)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found emptty-0.5.1.tar.gz
==> Validating source files with sha512sums...
    emptty-0.5.1.tar.gz ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Extracting emptty-0.5.1.tar.gz with bsdtar
==> Removing existing $pkgdir/ directory...
==> Starting build()...
Building...
fatal: No names found, cannot describe anything.
missing $GOPATH
make: *** [Makefile:23: build] Error 1
==> ERROR: A failure occurred in build().
    Aborting...
Finished with result: exit-code
Main processes terminated with: code=exited/status=4
Service runtime: 691ms
CPU time consumed: 771ms
legion: ~  $ yay -S emptty
:: There are 2 providers available for emptty:
:: Repository AUR
    1) emptty 2) emptty-git 

Enter a number (default=1): 
:: Checking for conflicts...
:: Checking for inner conflicts...
[Aur:1]  emptty-0.5.1-1

:: Downloaded PKGBUILD (1/1): emptty
  1 emptty                                   (Build Files Exist)
==> Diffs to show?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==> n
:: (1/1) Parsing SRCINFO: emptty
==> Making package: emptty 0.5.1-1 (Sun 23 May 2021 11:25:39 PM EDT)
==> Retrieving sources...
  -> Downloading emptty-0.5.1.tar.gz...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   121  100   121    0     0    746      0 --:--:-- --:--:-- --:--:--   746
100 30081    0 30081    0     0  79790      0 --:--:-- --:--:-- --:--:-- 79790
==> Validating source files with sha512sums...
    emptty-0.5.1.tar.gz ... Passed
==> Making package: emptty 0.5.1-1 (Sun 23 May 2021 11:25:41 PM EDT)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found emptty-0.5.1.tar.gz
==> Validating source files with sha512sums...
    emptty-0.5.1.tar.gz ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Extracting emptty-0.5.1.tar.gz with bsdtar
==> Sources are ready.
==> Making package: emptty 0.5.1-1 (Sun 23 May 2021 11:25:44 PM EDT)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Starting build()...
Building...
fatal: No names found, cannot describe anything.
go: downloading github.com/msteinert/pam v0.0.0-20200810204841-913b8f8cdf8b
Done
==> Entering fakeroot environment...
==> Starting package()...
Installing...
Done
Installing manual...
Done
Installing pam file...
Done
Installing config...
Done
Installing systemd service...
Done
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Stripping unneeded symbols from binaries and libraries...
  -> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "emptty"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Adding install file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: emptty 0.5.1-1 (Sun 23 May 2021 11:25:49 PM EDT)
==> Cleaning up...
[sudo] password for lhe: 
loading packages...
resolving dependencies...
looking for conflicting packages...

Packages (1) emptty-0.5.1-1

Total Installed Size:  2.36 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                                  [###################################] 100%
(1/1) checking package integrity                                [###################################] 100%
(1/1) loading package files                                     [###################################] 100%
(1/1) checking for file conflicts                               [###################################] 100%
(1/1) checking available disk space                             [###################################] 100%
:: Processing package changes...
(1/1) installing emptty                                         [###################################] 100%
Disable your DM and run 'systemctl enable emptty' to enable emptty at the next boot
Optional dependencies for emptty
    xorg-server: default display server [installed]
    xorg-xauth: required if using xorg-server [installed]
    util-linux: mcookie required if using xorg-server [installed]
    wayland: alternative to xorg-server [installed]
legion: ~  $ which emptty
/usr/bin/emptty

Sorry don’t what I was doing wrong has installed fine now. Thanks

@KoO

2021-05-24-092919_569x403_scrot

Yes: xinit - ArchWiki

Or perhaps try this snippet in your login shell configuration (~/.profile?):

if [[ $(tty) = /dev/tty1 ]] ; then
   printf 'Please select window manager:\n'
   select wm in i3wm awesome ; do
      exec startx /usr/bin/"$wm"
      break
   done
fi

But note that select is undefined in POSIX sh so that will only work for bash, zsh & the Korn Shell variants.

For that try this snippet instead:

case "$(tty)" in
   /dev/tty1) exec startx /usr/bin/i3wm ;;
   /dev/tty2) exec startx /usr/bin/awesome ;;
esac

That is POSIX compliant but ~/.xinitrc will be ignored so you will have to use the startup facilities offered by the window managers instead.

2 Likes

Was hoping someone would come up with a script idea, I only use bash.

Thanks Head_on_a_Stick and to all for your reply’s.

Come to think of it your the reason why I don’t use a login manager. :+1:

@KoO

tbsm IS PURE bash. Nothing else.

Yes tbsm works just fine. Thanks

I will be testing all of the above.

1 Like

I always have problems choosing something when too many options are available. :crazy_face:

2 Likes