How can I go about using the tty only on my system
from theshyprisoner@lemmy.ml to linux@lemmy.ml on 11 Jul 2024 17:10
https://lemmy.ml/post/17876406

I wanted to have a separate laptop where I only use the terminal for my use cases. At the moment I am somewhat confident using the terminal, but I think limiting myself to tty only would build my confidence even more. Any tips?

EDIT: I am already using nvim and I already have installed a minimal distro (Arch). I just need advice on how to actually run this system effectively.

#linux

threaded - newest

savvywolf@pawb.social on 11 Jul 2024 17:15 next collapse

If you’re serious about sticking to the terminal, it’s probably worth learning a terminal text editor like emacs or vim. Once you get the hang of them, you can be much more productive compared to something like nano.

I think it’s also worth learning about job control and/or terminal multiplexers, but I’ve yet to fully understand them myself.

arcosenautic@lemmy.world on 11 Jul 2024 17:49 next collapse

Julia Evans recently did a thing about job control here. Nothing yet on multiplexers though

GravitySpoiled@lemmy.ml on 11 Jul 2024 18:15 next collapse

How can you be more productive in vim compared to nano?

Serious question.

NeoNachtwaechter@lemmy.world on 11 Jul 2024 19:21 next collapse

Easy. Just learn to use it and it is already there.

With nano, you work with that letter where your cursor is at the moment. This is convenient, but limited.

With vim, you can also work with a word, or the whole line, or part of the line, or a section, or the whole file (or many files if you use the shell extension) and it goes all with the same ease.

Vim also allows you to keep your hands in place on the letters on your keyboard all the time. No need to move the hands around, grabbing the mouse and back, or the arrow keys, and thus search for the correct position for your hand every few seconds - which costs time and focus.

GravitySpoiled@lemmy.ml on 11 Jul 2024 20:20 collapse

If I understand you correctly, I can write more efficiently because I can move to the next paragraph or sentence which I can’t with normal keybindings. Or special commands where I delete everything within “”. I understand the appeal of special moves but why not simply creating a Ctrl, Meta or alt command for that?

NeoNachtwaechter@lemmy.world on 11 Jul 2024 22:43 next collapse

but why not simply creating a Ctrl, Meta or alt command for that?

No need to create such things when they are already there

I find Ctrl etc. rather inefficient. So much extra bending of your hand for these special keys. Are you able to type with 10 fingers?

GravitySpoiled@lemmy.ml on 12 Jul 2024 06:24 collapse

I learned it but I only use 7 or 8 fingers. The speed isn’t limiting me.

CsXGF8uzUAOh6fqV@lemmy.world on 11 Jul 2024 22:45 collapse

Vim uses these commands like di" (delete everything inside “”) instead of chords (holding multiple keys down at once). Both work fine. The reason vim does this is that many regard it as more ergonomic. You don’t stretch your hand/fingers out and you can keep your fingers at homerow. You might have heard about people getting an “Emacs Pinky”. It’s basically down to preference. I don’t use emacs but I know people use vim bindings in emacs (emacs is very scriptable after all). That way you can try or integrate vim like bindings without leaving your comfy emacs.

SnotFlickerman@lemmy.blahaj.zone on 11 Jul 2024 19:33 next collapse

why use big app when nano does trick?

F04118F@feddit.nl on 11 Jul 2024 19:48 next collapse

Try running this: vimtutor

If you are already aware of hjkl, skip to the part where you learn motions:

/motion

Then look up surround (ysw is usually the command to surround a word, ys3w the next 3 words, etc)

It’s pretty neat.

GravitySpoiled@lemmy.ml on 11 Jul 2024 20:24 collapse

That is some very useful commands, thx! But I don’t think I’ll be using it often and hence I’ll lose the skill. I know ctrl+vxs or f etc because I use them very often. Anything that I don’t use is forgotten even if I’d use vim

F04118F@feddit.nl on 11 Jul 2024 20:34 collapse

Exactly! If you only have to edit small text files on a server once in a blue moon, nano is much less biomemory-heavy. But if you regularly write docs and code in l vim or neovim, it starts to pay off after a week or two.

I really enjoyed learning to quickly select and change entire words or lines, doing things like: :%s/replace_this_text/with_that/g Etc. If you enjoy that, you will soon get to a point where you miss the motions in your regular editor and install a vim extension in VS Code and stuff, just before fully switching to neovim

GravitySpoiled@lemmy.ml on 11 Jul 2024 20:40 collapse

Thx! I’ll check out neovim!

GolfNovemberUniform@lemmy.ml on 11 Jul 2024 19:56 next collapse

Tbh I think it’s just a matter of preference and some people are being elitist about it or overestimate the importance of it.

chameleon@fedia.io on 11 Jul 2024 20:16 next collapse

vim has better default keybindings/commands that allow for less movement of your hands. Nowadays, in reasonably current versions of nano, that's mostly it. The main difference is nano is somewhat usable but extremely inefficient unless you learn it, while vim forces you to learn it to get anything done at all, which also pushes people to spend a bit of time learning it in general.

If you're sure of the numbers you're using, vim's ability to repeat commands is also helpful. In practice I find that it's really hard to make use of them beyond low numbers, where nano can still achieve things in similar amounts of keypresses. Eg something to delete 3 words like <escape>3dwi can be done similar with a sequence like Alt-A ^→ ^→ ^→ ^K in nano. Make it 20 words and nano is going to be a lot slower, but that's quite an uncommon action.

But the practice is that nano users don't spend time learning any of that and just hold delete until the words are gone, which takes forever. Everyone that can do basics in vim quickly learns that you can dw words away and make it 3dw to delete 3 of them. The default, easiest to use & access tool for any given situation gets blamed not just for its flaws, but also for the users that don't want to spend time learning any tool.

GravitySpoiled@lemmy.ml on 11 Jul 2024 20:32 next collapse

After reading up on vim, I ended up at emacs now and I like the emacs style because it works with ctrl and meta keys which feels familar to me. I may learn emacs now.

Your example makes completely sense, yet I’ve never felt that the standard way was slow in the first place. I could see my workflow improving, but I guess I just want to have extra special commands. Thank you!

[deleted] on 12 Jul 2024 02:42 collapse

.

sem@lemmy.blahaj.zone on 12 Jul 2024 01:31 collapse

I agree that vim forces you to learn before you can use it, but it is possible to learn the bare minimum of vim.

I get by with a very basic understanding of insert mode and the other mode where :q! quits

mryessir@lemmy.sdf.org on 12 Jul 2024 00:31 next collapse

vim is more then simple file editing.

  • netrw (interactive file manager)
  • copen/lopen (windows to connect, e.g. external programs)
  • :global, %s/, etc. which form text manipulation language (from editor ed, I guess)
  • args & argsdo (multi-file editing)
  • filetype (hooks for the user)
  • ctrl_X completion modes
  • motion (fluent & with jumplist to walk forward/backwardl
  • undotree (persisting, unlimited, timebased - on-demand)
  • macros (record and replay keypress)
  • romainl (awesome community member)

vim for one-time tasks at work. When people are proposing to script something, I open buffers, normalize the data and filter the results. I think in vim and I would very, very much recommend it, if you work with data or are a dev.

GravitySpoiled@lemmy.ml on 12 Jul 2024 09:24 collapse

you guys convinced me. I check vim out for at least the weekend

h0bbl3s@lemmy.world on 12 Jul 2024 16:52 collapse

VIM for the win. I really enjoy the built in file browser accessed by the command :explore

I also code in go frequently and go-fmt and go-lint etc work flawlessly. You can use whatever LSP you want so you get your code tips and autosuggestion etc.

The tabs and split window functions are nice too. Plus if you learn Vi well it’s on almost every system in existence. Nano not so much

GravitySpoiled@lemmy.ml on 12 Jul 2024 17:16 collapse

I had my first training sessions and edited some prose. I’m excited how it’ll be with code.

mryessir@lemmy.sdf.org on 12 Jul 2024 23:03 collapse

The most important thing about terminal multiplexers is that you have to atart them with the terminal command. e.g. yourterminal --startcommand=tmux.

TunaCowboy@lemmy.world on 11 Jul 2024 17:17 next collapse

Just don’t install a DE? Am I missing something?

theshyprisoner@lemmy.ml on 11 Jul 2024 21:04 collapse

Well yeah, but I want to know any tips on doing it effectively. If I just “don’t install a DE” I wouldn’t know where to go from there.

bobs_monkey@lemm.ee on 11 Jul 2024 23:41 collapse

If I’m reading your post right, you basically want a fully functional system that is console only (no GUI), right? So when you go to install, just simply skip installing the desktop environment/window manager.

That, or you can set it up to where your system boots to the console, and you can activate the DE/WM if you want to (like startx for X11). Each environment is different, but I think it’s removing the line for starting the DE/WM from either systemctl or maybe a hook, I forget.

PlasticExistence@lemmy.world on 12 Jul 2024 02:09 next collapse

With systemd, you set the default target to something other than a desktop environment.

theshyprisoner@lemmy.ml on 12 Jul 2024 03:25 collapse

Yes, I know how to this. I think the way I’m saying it is confusing so let me explain. I know how to install a minimal system without a GUI, however I needed advice on the tools to be able to run this system effectively (i.e. tmux, byobu, and other things people have been mentioning).

frankenswine@lemmy.world on 11 Jul 2024 17:24 next collapse

Just go for it! It’ll be fun. You will find yourself navigating your digital life (or at least: most of it) at relative ease with less distractions and graphical fuzz you otherwise get.

Getting to know terminal multiplexer (like screen) or vi-keys are crucial skills for anyone who is not afraid from working on “headless” machines!

GolfNovemberUniform@lemmy.ml on 11 Jul 2024 19:59 collapse

vi-keys are crucial skills

I can very seriously argue on this one.

ipacialsection@startrek.website on 11 Jul 2024 17:30 next collapse

If you haven’t set up this laptop yet, then I’d suggest installing a server-oriented distro like Debian, AlmaLinux, or Ubuntu Server. Those have minimal install options that come without a desktop environment installed, as most servers do not need one. If you’d like to make the install harder for yourself, this might be a good excuse to give Arch Linux or Gentoo a try, as those have the option of a fully manual install. If you’d like, you can install a desktop environment afterwards using the package manager.

If you already have a Linux with a graphical desktop installed, you can configure the system not to automatically start it with sudo systemctl set-default multi-user.target. (Do not do this on your main device!) You can re-enable it with sudo systemctl set-default graphical.target.

Regardless, you can then start a graphical session using startx, or whatever command is more appropriate for your desktop environment (gnome-session to start GNOME on Wayland, startplasma-wayland to start KDE Plasma), or by sudo systemctl starting your login screen manager (sddm, gdm, lightdm, etc).

schizo@forum.uncomfortable.business on 11 Jul 2024 17:32 next collapse

I read this thinking you meant you wanted to only use a serial terminal, which sounds like a really neat project: they’re cool hardware and would certainly be a unique way to interact with modern computing.

But uh, yeah no that’s probably not what you meant and I’ve spent WAY too much time dealing with retro stuff lately.

theshyprisoner@lemmy.ml on 11 Jul 2024 18:10 collapse

What are these serial terminals you’re talking about?

schizo@forum.uncomfortable.business on 11 Jul 2024 18:33 collapse

Back in the super early era of computers, they were stupidly expensive. One solution was to hook up a lot of people to a single computer via a computer terminal, which were much cheaper.

Basically it would allow you to deploy a ton of monitors and keyboards to access a single computer relatively cheaply, and UNIX was the OS that (mostly) was used for this.

You noticed that your console session is called ‘TTY-a-number’. Well, TTY stands for ‘teletypewriter’ which was the very first incarnation of this, and was what was in use when the name of the console was a made, and it’s just… never been changed, though tty devices and their later serial consoles are quite dead as far as tech goes.

Enabling a serial terminal in Linux is a one-line change, and you can then use any terminal emulator you’d want to connect over it, but eh, it’s a pretty dead technology and nobody uses that at this point.

Since I seem to be dumping useless retro facts all over the place: you could do this with DOS, and Digital Research released Concurrent DOS to allow multi-tasking, multi-user access to a DOS system. If you wanted to fiddle with that in the modern era, you’d want the Novell Multiuser DOS rebrand, since it supports vt100 emulation and thus can be used with basically any serial terminal app unlike the previous versions which emulated specific HP and IBM serial terminals.

CsXGF8uzUAOh6fqV@lemmy.world on 11 Jul 2024 17:49 next collapse

  • set a good tty font (it’s almost all you’re gonna see)
  • be comfy with basic core utils (mv, cp, chmod, …)
  • choose a shell (bash, fish, …) and set up some useful aliases/abbreviations
  • fzf or something similar does wonders (also replaces things like dmenu)
  • terminal multiplexers are used instead of window managers
  • some applications allow you to do some graphics (like mpv to play video)
  • there is more advanced stuff you can do with frame buffers
  • there are terminal browsers like w3m or lynx
  • a good extensible text editor is essential (vim, nvim, emacs, helix, …)
  • research some cli applications for your usecase (cal (calendar), neomutt (email), …)

Over time your collection of aliases and scripts will grow to make common tasks you do easier.

theshyprisoner@lemmy.ml on 11 Jul 2024 18:03 next collapse

Thanks a lot, I’ll definitely try the terminal multiplexers you’re talking about. I wondered how you would get different windows in tty.

vipaal@aussie.zone on 11 Jul 2024 23:21 collapse

Byobu provides good abstraction on tmux as well as screen. Allows you to choose keybindings from any of the two.

sem@lemmy.blahaj.zone on 12 Jul 2024 01:26 collapse

I really enjoy byobu, especially since it has nice colors and is a mature well supported project

ctr1@fl0w.cc on 11 Jul 2024 19:07 next collapse

Great list. Customizing the font is definitely a priority. I recommend one of the Terminus fonts. Also zellij multiplexer + helix editor is a great combo that works well in the tty.

One thing to add is that it took me a while to create a decent 16-color theme for helix and vim, and while they’re okay by default you can actually get a pretty nice looking IDE if you spend some time tinkering with the colors

gramgan@lemmy.ml on 11 Jul 2024 21:53 collapse

+1 for the Terminus + zellij + helix combo

cybersandwich@lemmy.world on 12 Jul 2024 12:19 collapse

How does zellij do copy and paste? That’s the only thing keeping me from diving into tmux (beyond using it as a persistent terminal).

ctr1@fl0w.cc on 12 Jul 2024 14:12 collapse

I’m not sure how to paste directly into a pane, but you can copy by opening up the scrollback in EDITOR from search mode using Ctrl+S e. This creates a file in /tmp so I try to make sure to clear it when I’m done.

I usually only copy and paste between editor windows using a script that mimics xclip (automatically used by helix), and if I need to paste a command I either edit my bash history or write a script.

atzanteol@sh.itjust.works on 11 Jul 2024 20:00 next collapse

I disagree on the aliases. I’d recommend using almost none. It builds competence with the commands on all systems even without your special .bashrc. It’ll be easier to write scipts and change shells as well.

CsXGF8uzUAOh6fqV@lemmy.world on 11 Jul 2024 22:36 collapse

I use fish abbreviations. Unlike bash/zsh aliases, they expand when you press space or enter. This way you see the original command every time you use the alias, and you can edit as well. This should lighten the concern you have a bit. Your concern is something that sysadmins keep in mind e.g. default vim bindings so you are always comfortable on any server. However for desktop use I don’t think leaving the speed and comfort on table is worth it. Most desktop users only use their own systems anyway.

atzanteol@sh.itjust.works on 11 Jul 2024 23:33 collapse

It’s about building muscle memory as well though. You are right that many home-gamers will probably never be without their customizations though. But if you do re-installs, setup VMs, try new distros, etc. it’s beneficial.

Just my opinion though.

Shareni@programming.dev on 12 Jul 2024 07:41 collapse

That really depends on what you’re doing. It’s only really useful when you’re regularly SSH-ing into other machines for work. Otherwise you’re wasting time every day so that you might save a second once every few years.

MonkderDritte@feddit.de on 12 Jul 2024 11:20 collapse

  • terminal multiplexers are used instead of window managers

Well, there’s twin.

SnotFlickerman@lemmy.blahaj.zone on 11 Jul 2024 17:51 next collapse

Almost every CLI only version of Linux is designed to be a server.

Servers assume you have no WiFi. There will not be an option to set it up during first-time setup, you will have to do it manually.

You are doing this on a laptop which generally assumes you will be using WiFi.

You will have to set up wpa_supplicant during install via command line outside of the automated setup.

Further, if your WiFi drivers have any non-free proprietary code in them, you will need to manually install drivers for them like you would normally. Once again, best to do during setup, if possible.

If you have the option of connecting directly with ethernet during setup, you can sort of wiggle past it and set it up after, but I’ve personally found that the servers prefer it if you do it during setup (ie. fewer weird networking issues).

As others have said, you could also just not install a desktop environment in a normal version of Linux instead of going for a server version, as another way to avoid this issue.

Source: personal experience using server version of Linux on laptop

bloodfart@lemmy.ml on 11 Jul 2024 20:42 collapse

This is not true.

Especially nowadays network manager handles all that stuff. Nmcli or nmtui make it beyond easy and I haven’t messed with wpa_supplicant in about ten years.

sem@lemmy.blahaj.zone on 12 Jul 2024 01:28 collapse

There is some truth to it. If you are installing a server distro it may not come with nmcli by default. Maybe it will. But good to think about

arcosenautic@lemmy.world on 11 Jul 2024 17:52 next collapse

Like others said, you can try installing Arch manually (not with the install script). You get the hang of the terminal and you get to see a bit more of how Linux works under the hood. The wiki is your friend, spend some time reading it!

theshyprisoner@lemmy.ml on 11 Jul 2024 18:01 collapse

I actually am using a manual Arch install. What i meant by gaining confidence is completely abandoning xorg and using the tty only.

lemmyvore@feddit.nl on 11 Jul 2024 18:35 collapse

Look into terminal multiplexers like screen or tmux, they are a sort of “window” system for tty.

There are text-only browsers but I’m not sure they’ll be usable on today’s websites. May want to set your tty to a graphical mode (framebuffer) and use a mixed-mode browser that can render images and some other stuff.

theshyprisoner@lemmy.ml on 11 Jul 2024 21:07 next collapse

I’ll look into that, thanks.

LunarLoony@lemmy.sdf.org on 13 Jul 2024 17:55 collapse

Lynx is surprisingly capable, but it depends on how the website’s been built.

Elonkilledmymom@lemmy.ml on 12 Jul 2024 04:49 next collapse

Get the server version of whatever your favorite distro is. Nothing but terminal.

xylogx@lemmy.world on 12 Jul 2024 11:20 next collapse

What are your use cases?

theshyprisoner@lemmy.ml on 12 Jul 2024 13:59 collapse

Messaging, reading, school work, watching anime, music, web browsing (may not be able to do this one nicely though). My use cases are very simple to implement on tty-only I think.

steeznson@lemmy.world on 12 Jul 2024 15:01 collapse

It is possible to watch movie files rendered in ascii with ffmpeg but I wouldn’t recommend it. Playing videos any other way requires a graphical interface.

Web browsing is possible with links, w3m and eww-mode on emacs.

You will struggle with school work. Eduroam is hard to connect to using the CLI for example.

theshyprisoner@lemmy.ml on 12 Jul 2024 23:25 collapse

I was able to use mpv to watch some anime I had downloaded on tty. Does this mean this was only possible because I already had xorg installed and running (I was using qtile prior to that)? I’m not sure if that’s how that works though.

steeznson@lemmy.world on 13 Jul 2024 03:58 collapse

Yeah you’ve got xorg running if graphics are being drawn, like windows or specifically windows with borders

MonkderDritte@feddit.de on 12 Jul 2024 11:25 next collapse

I’ll just dump this here.

shell tools

github.com/rust-unofficial/awesome-rust zaiste.net/posts/shell-commands-rust/

alternatives

  • fd: simpler find
  • bat: nicer cat
  • lsd: ls with NerdFont icons
  • broot: smarter tree
  • ripgrep: better grep

GUI alternatives

Task Management:

  • dun: note-taking & task manager
  • cubby: encrypted note taking to cloud, with markdown
  • girok: TUI calendar

Services:

File Manager:

  • clifm: nice shell file manager with tagging
  • nnn: cli fm with split-view file preview
  • TUIFI Manager: cli fm with rendered images in 2D layout
  • xplr: hackable, minimal, TUI fm

Login Manager:

  • CDM: shell login manager with history
  • Qingy: directfb login manager

Others:

ease of use

  • edir: rename with text file
  • mdcat: Sophisticated Markdown rendering for the terminal
  • clipboard: shell clipboard manager & more
  • portal: cli file transfer agent between computers
  • croc: simple file transfer tool via local server, Android Appp too
  • transfer.sh: cli file sharing via cloud
  • detox: file name cleanup
  • ouch: simple de/compressor
  • mnamer: intelligent video renamer
  • gum: bells and whistles for shell scripters
  • pytermgui: bells and whistles for python scripters

specialist tools

  • erd: Translates a plain text description of a relational database schema to a graphical entity-relationship diagram.
  • LiteCLI
theshyprisoner@lemmy.ml on 12 Jul 2024 13:57 collapse

Great list, thank you!

theshatterstone54@feddit.uk on 14 Jul 2024 10:28 collapse

I’d like to add MPV. It’s a video player that works from the tty using a framebuffer. So if you run “mpv path/to/video/file” it will play the video! Just learn the keybinds first so you’re not stuck with it. In fact, that applies to all of the framebuffer programs.

theshyprisoner@lemmy.ml on 14 Jul 2024 19:55 collapse

Yes I’m familiar with mpv. I thought I needed to have xorg or a display server running for it to work, thanks!

gronjo45@lemm.ee on 12 Jul 2024 14:01 next collapse

Amazing post! I’ve been wanting to do the same… Have you found a CLI .csv file editor? One of the points of friction for me is finding how to replace Excel’s functionality past Libreoffice. I’m more curious to see what that workflow can do when one uses no GUI whatsoever.

theshyprisoner@lemmy.ml on 12 Jul 2024 14:52 next collapse

I’ve found sc-im to be very useful, but I’m still a little new to it. Visidata is another one that seems to be a lot more powerful than sc-im.

Hule@lemmy.world on 12 Jul 2024 16:16 collapse

I have used sc-im a few times, I like the simplicity and vim shortcuts.

Thanks for mentioning visidata, I’ll install it.

steeznson@lemmy.world on 12 Jul 2024 14:56 next collapse

csv-mode on emacs

[deleted] on 12 Jul 2024 18:54 next collapse

.

NotAnArdvark@lemmy.ca on 13 Jul 2024 03:36 collapse

VisiData may do what you want.

markstos@lemmy.world on 12 Jul 2024 19:28 collapse

I built a console-only laptop once for financial reasons. I wanted something to travel with on a trip and was donated a laptop that, I think 20 MB of RAM after I upgraded it. I was able to run vim, perl and mutt was very tolerable performance.

I don’t think there’s really special tips. Pick a goal of some tasks to accomplish. Work towards them, discover the rough edges and find solutions for them. If you install everyone else’s favorite CLI apps, you can end up more than you need.

All that said, if I had the memory to run a GUI, I probably would have do so. But I wasn’t going to have a lot of time for web browsing and other laptop on that trip anyway.