Without a GUI--How to Live Entirely in a Terminal

Puppy related raves and general interest that doesn't fit anywhere else
Post Reply
Message
Author
User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

Without a GUI--How to Live Entirely in a Terminal

#1 Post by Flash »

Without a GUI--How to Live Entirely in a Terminal
by Bryan Lunduke
on June 28, 2019
Sure, it may be hard, but it is possible to give up graphical interfaces entirely—even in 2019.

About three years back, I attempted to live entirely on the command line for 30 days—no graphical interface, no X Server, just a big-old terminal and me, for a month.

I lasted all of ten days.

Why did I attempt this? What on Earth would compel a man to give up all the trappings and features of modern graphical desktops and, instead, artificially restrict himself to using nothing but text-based, command-line software, as if he were stuck in the early 1980s?

Who knows. Clearly, I make questionable decisions.

But you know, if I'm being honest, the experience was not entirely unpleasant. Sure, I missed certain niceties from the graphical side of things, but there were some distinct benefits to living in a shell. My computers, even the low-powered ones, felt faster (command-line software tends to be a whole lot lighter and leaner than those with a graphical user interface). Plus, I was able to focus and get more work done without all the distractions of a graphical desktop, which wasn't bad.

What follows are the applications I found myself relying upon the most during those fateful ten days, separated into categories. In some cases, these are applications I currently use over (or in addition to) their graphical equivalents.

Quite honestly, it is entirely possible to live completely without a GUI (more or less)—even today, in 2019. And, these applications make it possible—challenging, but possible. ...

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#2 Post by rufwoof »

Doesn't have to be either/or, instead - combine both.

My Fatdog gui desktop has the panel at the bottom, menu as the first item ..etc. The 'usual' sort of desktop that we're all familiar with. The following images are thumbnails i.e. click to view.

Image

For tui (text user interface) I use tilda as I like its Quake like drop down/hide by pressing F1 toggle type action. My first item (tab) shows a ncurses style menu, where keys or mouse clicks can activate programs, and where programs launch in a new tilda tab. I have tilda set to fill most, but not all of the screen, leaves a gap at the bottom so my gui desktop panel is still visible. That tilda ncurses style menu isn't restricted to just launching tui programs such as htop, but could also launch gui programs such as galculator or libre office/whatever.

Image

On the tui side, I also connect to a ssh server, hashbang.sh in my case. When logged into that it runs a tmux session, and typically I have email (mutt) and irc running in separate tmux windows, the visible tmux window 4 in the following image is opening a BBS connection, where window 1 is email (mutt), window 2 is irc (irssi) ...etc.

Image

Using a server for frontline email is good in the sense that its textual, and running on a server means that it has low risk of a 'bad' attachment type email being opened and infecting my local system. A filter, where emails I actually want can be forwarded to my gui based email account. Being a always on ssh server, I can leave irc etc. all running and simply just detach and attach at any time, from any device and its all still running as I last left it (but of course updated for any events that occurred whilst I was 'away'), and where someone else takes care of all the backups etc. involved in maintaining that server.

As that last image shows, my location is indicated as being in the US, whilst I'm actually in the UK, that's because of the ssh server I connect to being in the US. I can also route all of my browser (I prefer chrome) traffic via that ssh connection so that any web sites visited or dns lookup's all appear as though I were in the US, and my local IP (and UK government) snooping only sees a single ssh encrypted connection between me and that ssh server (they don't see what actually flows through that ssh tunnel).

For me, using tui alone is as restrictive as using gui alone. Why restrict yourself and miss out. Yes sometimes you may only have need for one or the other, for instance I now have my Fatdog boot setup so that I can drop to cli within initrd, where wireless network connection has already been established so I can ssh or whatever using cli. That's before the main fatdog fd64.sfs gets loaded, so no X/gui desktop, but only requires 75MB or so to boot. That could even pull down a different variant of the main sfs (fd64.sfs) over the net and then resume to booting that instead of booting the default local copy fd64.sfs. ... Flexibility/functionality.

The big Fatdog attraction for me is its multi-session usb functionality. Where I can boot from usb with the saves also on that same usb, but unplug it once booted, only needing to be reattached to boot again, or to save. Typically I don't save that often as I save data separately so saves primarily just reflect system updates, such as after I've updated google chrome. If you only save after installing/updating, then each new boot loads a desktop system that is as good as factory fresh/pristine. Known clean and virus free.
[size=75]( ͡° ͜ʖ ͡°) :wq[/size]
[url=http://murga-linux.com/puppy/viewtopic.php?p=1028256#1028256][size=75]Fatdog multi-session usb[/url][/size]
[size=75][url=https://hashbang.sh]echo url|sed -e 's/^/(c/' -e 's/$/ hashbang.sh)/'|sh[/url][/size]

User avatar
Colonel Panic
Posts: 2171
Joined: Sat 16 Sep 2006, 11:09

#3 Post by Colonel Panic »

Good article, especially for those of us with older computers. I use midnight commander a lot more than I do any graphical file manager anyway.
Gigabyte M68MT-52P motherboard, AMD Athlon II X4 630, 5.8 GB of DDR3 RAM and a 250 GB Hitachi hard drive running Ubuntu 16.04.6, MX-19.2, Peppermint 10, PCLinuxOS 20.02, LXLE 18.04.3, Pardus 19.2, exGENT 200119, Bionic Pup 8.0 and Xenial CE 7.5 XL.

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#4 Post by rufwoof »

mc as a file manager is indeed good. Its editor is also good (mcedit), supporting having multiple files open at the same time, cut and paste, word wrap etc. With mc you can add a simple menu file to a folder and the F2 Menu will show that specific menu, or failing that the main default menu that can also be easily configured. mc runs well on a remote box accessed via ssh, seemingly as quick as if it were being run locally. If you use that remote box also for calendar, email, irc ...etc. then someone else takes care of all the backups/integrity.

Even the likes of reddit can be nicer via a textual interface. Open a terminal window and try

Code: Select all

ssh redditbox.us
for instance (tip type /puppylinux once in, and it will flip you over to the puppylinux area, down arrows to move up/down the listings, right arrow to read a listing).

But of course where textual is better in some cases, gui is better in others. LibreOffice or online googledocs, image editing, multimedia ...etc. Yes you can live with just one arm, tui or gui, but having/using both arms is so much better.
[size=75]( ͡° ͜ʖ ͡°) :wq[/size]
[url=http://murga-linux.com/puppy/viewtopic.php?p=1028256#1028256][size=75]Fatdog multi-session usb[/url][/size]
[size=75][url=https://hashbang.sh]echo url|sed -e 's/^/(c/' -e 's/$/ hashbang.sh)/'|sh[/url][/size]

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#5 Post by rufwoof »

See this post. Today I've opted to swap out usage of mcedit (that is part of mc i.e. alternatively launched with mc -e), with the FreePascal IDE (Interactive Desktop Environmen) launched by running 'fp').

I more prefer fp as a text editor, albeit intended as a developers code editor/compiler.

I didn't install the full fp set, instead just booted, installed fp and then copied the fp binary program to HDD, and rebooted without saving (so fp was 'uninstalled') and then copied that HDD preserved copy of the fp program into /usr/local/bin, so only the IDE/editor is actually available, and the saved (to make that change persistent across reboots).

The fp IDE is more intuitive/easy IMO for highlighting/cut/pasting, moving/resizing windows (including using the mouse) - and it even includes a calculator.

Image
[size=75]( ͡° ͜ʖ ͡°) :wq[/size]
[url=http://murga-linux.com/puppy/viewtopic.php?p=1028256#1028256][size=75]Fatdog multi-session usb[/url][/size]
[size=75][url=https://hashbang.sh]echo url|sed -e 's/^/(c/' -e 's/$/ hashbang.sh)/'|sh[/url][/size]

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#6 Post by rufwoof »

Bryan likes w3m for a browser, and I'd tend to agree. For some web sites its great, such as yahoo as pages load really quick, unlike a gui browser where the blitz of content can make it very laggy. For other web sites however, such as the PuppyLinux board, its OK if running under X where you can scale down the font size to better fit the content to the screen (see attached), but the web site layout isn't really well designed for the likes of w3m when running in a console.

Image
[size=75]( ͡° ͜ʖ ͡°) :wq[/size]
[url=http://murga-linux.com/puppy/viewtopic.php?p=1028256#1028256][size=75]Fatdog multi-session usb[/url][/size]
[size=75][url=https://hashbang.sh]echo url|sed -e 's/^/(c/' -e 's/$/ hashbang.sh)/'|sh[/url][/size]

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#7 Post by rufwoof »

Text User Interface (TUI), can be set to a comfortable screen size/resolution. I tend to use 640x400 myself (terminus 32 bit bold font - that also works well with telnet'ing into BBS's). Nice to avoid having to go -_- wth your eyes. Some web sites totally distract you with popups/ads ..etc. so for those web sites a text only browser such as w3m can be nice (yahoo for instance is very quick via w3m, view it using a gui browser and its sluggish).

hashbang is a good ssh server, free and functional from the get-go. The hashbang server code is in github so you could alternatively set up your Debian home based server (PC) to use that instead - but for convenience (out of box), using hashbang is a good starting point IMO. With that you can socks proxy i.e. set things up to route all your internet traffic via that ssh link/tunnel, and it runs tmux by default, with weechat (irc), mutt (email) already activated. A nice thing about that is you can reboot your local end/PC, and the things running on the server continue running, all ready to be accessed again, perhaps from a different device/location. I prefer to keep irc and mail running on the ssh server myself, just attach (tmux attach) and detach (ctrl-b d) as desired. If I want another tmux window then ctrl-b c creates one, and then perhaps run w3m google.com to fire up the browser in that window. ctrl-b n steps to the next tmux window (or ctrl-b 1 (or any window number) to jump directly to that tmux window. Awkward at first, but relatively quickly to start to do those actions instinctively.

For me, tilda terminal is a nice to the local system, I like the F1 to show/hide it (Quake style), so when set to full screen (or a little less i.e. I like to still have my Fatdog panel at the bottom of screen still visible), then you can toggle between tui and gui quickly. Fatdog doesn't come with tilda, so its a add-in. Fatdog does however come with sshfs-fuse by default, so you can mount your hashbang home folder so it appears as just another local folder. With ssh configured sshfs mounting your ssh server (such as hashbang) is as easy as

Code: Select all

mkdir /hashbang
sshfs userid@ny1.hashbang.sh:/home/userid /hashbang
(replacing userid with your actual hashbang userid)

I like to store my tui main menu on the server, i.e store and run it via the sshfs mount (my /hashbang folder), and I sshfs mount as soon as I boot, so once connected the ssh keys (~/.ssh folder) can be encrypted/hidden for the rest of the session (less chance of the private keys being copied/stolen). I have it set so that clicking on any menu option in the tui menu opens up a new tilda tab with that program (menu choice) loaded. To achieve that I installed xdotool and have a script function to add another tilda tab

Code: Select all

_tab () { 
      # escape code to change a tilda terminals tab label 
      # and run a command in the tab 
      # 
      # $1 label to set tab title to 
      # $2 command to run on tab 

      newtitle=$1 
      command=$2 
      esc="\"\\x1B]2;${newtitle}\\x07\"" 
      xdotool key ctrl+T            # add a new tilda tab 
      xdotool type 'echo -e ' $esc 
      xdotool key KP_Enter 
      xdotool type "$command" 
      xdotool key KP_Enter 
} 
For some things, tui is best, for others gui is best, you tend to soon find what suits you best relatively quickly - a form of natural selection. Predominately for me tui involved becoming familiar with tilda, ssh, tmux, irssi, mutt and mc (along with mcedit) and even then I use them in a limited manner i.e. mostly just a handful of common/basic commands. Scripting ability is also required, such as writing your own bespoke tui menu, but that can be moderately easy if you just tweak a pre-existing one that's already out-there. Fatdog already comes with mc (that includes mcedit), so fundamentally a reasonable combined tui/gui under fatdog requires just installing tilda and registering for a hashbang acount in addition - and educating yourself as to how to set up and use the tui (ssh, tmux etc.).

Best of both worlds is far better than being pedantic about sticking solely with one-or-tother.
[size=75]( ͡° ͜ʖ ͡°) :wq[/size]
[url=http://murga-linux.com/puppy/viewtopic.php?p=1028256#1028256][size=75]Fatdog multi-session usb[/url][/size]
[size=75][url=https://hashbang.sh]echo url|sed -e 's/^/(c/' -e 's/$/ hashbang.sh)/'|sh[/url][/size]

User avatar
Colonel Panic
Posts: 2171
Joined: Sat 16 Sep 2006, 11:09

#8 Post by Colonel Panic »

I don't know if this will work for posters outside the UK, but George Ornbo has just posted a fantastic use for the mpv media player.

With mpv installed, typing or pasting this link into a terminal will bring up BBC 6 Music;

mpv 'http://a.files.bbci.co.uk/media/live/ma ... music.m3u8'

I've just done it and got Rush's Tom Sawyer :)

https://shapeshed.com/listening-to-bbc- ... g-with-mpv
Gigabyte M68MT-52P motherboard, AMD Athlon II X4 630, 5.8 GB of DDR3 RAM and a 250 GB Hitachi hard drive running Ubuntu 16.04.6, MX-19.2, Peppermint 10, PCLinuxOS 20.02, LXLE 18.04.3, Pardus 19.2, exGENT 200119, Bionic Pup 8.0 and Xenial CE 7.5 XL.

User avatar
tallboy
Posts: 1760
Joined: Tue 21 Sep 2010, 21:56
Location: Drøbak, Norway

#9 Post by tallboy »

I did the same at the uni, we found the server at nrk, our version of bbc. I used the original mplayer in a terminal, not the mpv, to download the programs while listening, they had the wma format. A weekly program with 2 hours of club music, which no other radio stations played at the time. Ahh, those were the times...
Hmm, still have the programs from 2008/2009!

Code: Select all

23:24 ~ # mpv 'http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/uk/sbr_high/ak/bbc_6music.m3u8'
Playing: http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/uk/sbr_high/ak/bbc_6music.m3u8
[ytdl_hook] youtube-dl failed, trying to play URL directly ... 
[ffmpeg] http: HTTP error 403 Forbidden
[lavf] avformat_open_input() failed

Playing: http://as-hls-uk-live.akamaized.net/pool_904/live/uk/bbc_6music/bbc_6music.isml/bbc_6music-audio%3d320000.norewind.m3u8
[ytdl_hook] youtube-dl failed, trying to play URL directly ... 
[ffmpeg] http: HTTP error 403 Forbidden
Failed to open http://as-hls-uk-live.akamaized.net/pool_904/live/uk/bbc_6music/bbc_6music.isml/bbc_6music-audio%3d320000.norewind.m3u8.


Exiting... (Some errors happened)
True freedom is a live Puppy on a multisession CD/DVD.

User avatar
Colonel Panic
Posts: 2171
Joined: Sat 16 Sep 2006, 11:09

#10 Post by Colonel Panic »

Many people here already know this, but inxi is a very good command-line system information utility whose output can be piped to a file like inxi.txt. If you want a comprehensive display of the information, use the -F switch; inxi -F.
Gigabyte M68MT-52P motherboard, AMD Athlon II X4 630, 5.8 GB of DDR3 RAM and a 250 GB Hitachi hard drive running Ubuntu 16.04.6, MX-19.2, Peppermint 10, PCLinuxOS 20.02, LXLE 18.04.3, Pardus 19.2, exGENT 200119, Bionic Pup 8.0 and Xenial CE 7.5 XL.

User avatar
Colonel Panic
Posts: 2171
Joined: Sat 16 Sep 2006, 11:09

#11 Post by Colonel Panic »

I've just installed calcurse, a terminal-based calendar application which both imports and exports calendar files in the Ical format. A good range of configuration items too, including the ability to change the background and foreground colours.
Gigabyte M68MT-52P motherboard, AMD Athlon II X4 630, 5.8 GB of DDR3 RAM and a 250 GB Hitachi hard drive running Ubuntu 16.04.6, MX-19.2, Peppermint 10, PCLinuxOS 20.02, LXLE 18.04.3, Pardus 19.2, exGENT 200119, Bionic Pup 8.0 and Xenial CE 7.5 XL.

Post Reply