Comment by β freezr
Re: "I'd like to set up my non-GUI Debian 12 system so that itβ¦"
I second @mbays with tmux, for instance, you have much more control and don't need to jump from a TTY to another... π
2025-05-08 Β· 1 year ago
7 Later Comments β
π hack-wizard [OP] Β· 2025-05-08 at 23:47:
Thanks for the feedback everyone
@Nexy that's exactly what I'm trying to figure out how to do here, though .bashrc may be the place but wasn't sure if it was that or another file, much less how to actually pull the value of the current TTY...
@candycanearter I'm... Not sure that specifically helps me, of if it does how ti use that information. If it that page does define a place/method to auto run a program on login its unclear to me, is there a specific relative segment you can point to, as well as how I'd implement it?
π hack-wizard [OP] Β· 2025-05-08 at 23:47:
@mbays @freezr I've considered that, but... Switching windows in tmux involves a lot more keypresses - ctrl+b p/n for instance, it feels so inelegant versus alt+arrow to swap between TTYs. That said, I see where you're coming from, as I'd need to log into each TTY and I suspect having multiple shell instances and logins would potentially have resource and security implications. I'm expecting usually using 3-4 of them regularly, maybe 5-6 at most. Given this is on a uConsole with a Raspberry Pi 4 Compute module with 4GB ram, do you really think tmux would be less resource intensive for this scenario? Or is there another factor I'm not aware of?
π hack-wizard [OP] Β· 2025-05-09 at 01:08:
Actually I just figured it out, added this to my .bashrc
π» Nexy Β· 2025-05-09 at 01:35:
@hack-wizard I always play changing things in the .bashrc.
the thing i do its change the prompt text to have nicer colors, I make some alias permanent there and I make it open neofetch automatically when I open the terminal.
You can do a program you like and just at the end of the .bashrc put "./warever.sh" and that thing will open automatically when you start the PC for example.
π§οΈ candycanearter [βοΈ] Β· 2025-05-09 at 03:41:
the part in the article about setting up a agetty systemd dropin file to autologin with specific arguments
π Ashnar Β· 2025-05-10 at 13:05:
Going to try something like that too now. Looks interesting.
π norayr Β· 2025-05-13 at 20:33:
if you didn't have tty variable, you could do 'w' and see which tty 'w' ran from.
Original Post
I'd like to set up my non-GUI Debian 12 system so that it automatically launches a specific program in each TTY I log into. Eg: htop on TTY1, mc on TTY2, etc, but I'm not sure exactly what to set up and where. Any advice would be very appreciated.