Unfortunately, In the past year or two, everyday browsing on the netbook has become too slow, with modern browsers easily taking up more than 1 GB of RAM with just a few tabs open (Chrome/Chromium is a memory hog). For example, if I have gmail, Trello, Slack, and a Google Drive document open in separate tabs, the Intel Atom processor has a hard time keeping up. This doesn't even take into account non-browser apps I might be running, like QuodLibet music player or daemons for Dropbox and SpiderOakONE. Due to sluggish performance, I decided to say get rid of the overhead for an X11 graphical desktop.
My Acer D257 has found a new lease on life as a tty-only machine which I ssh into from my primary notebook. I was partly inspired by reading K. Mandla's blog which chronicles his adventures testing command line apps on obsolete hardware. After connecting over ssh, I launch a GNU Screen session with the following script:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#screen_netbook.sh | |
#This script launches Screen with various tabs and starts various programs | |
#such as htop, cmus, etc. as well as custom scripts in separate tabs. | |
#It is intended to be used in tty-only sessions on netbooks that don't | |
#have enough memory and CPU to handle X11 graphical sessions | |
# Meaning of GNU Screen option flags: | |
# -A adapt the sizes of all windows to the size of the current terminal | |
# -d -m launch GNU Screen in detached mode; creates a new session but | |
# doesn't attach to it | |
# -S specify session name | |
# -p preselect a window (by no. or name) | |
# -X send cmd to running screen session | |
# to list running Screen sessions, 'screen -ls' | |
# to reconnect to a Screen session, 'screen -r sessionName' | |
# launch a GNU Screen session named 'netbook' in detached mode | |
screen -AdmS netbook -t SHELL | |
# create separate tabs in session 'netbook' and launch programs in tabs | |
screen -S netbook -X screen -t HTOP htop | |
screen -S netbook -X screen -t CMUS cmus | |
screen -S netbook -X screen -t IRSSI irssi | |
screen -S netbook -X screen -t EMACS env TERM=xterm-256color emacs | |
# On tab 0, launch SpiderOakONE and dropboxd daemons for cli | |
screen -S netbook -p 0 -X stuff "cd $HOME/bin^M" | |
screen -S netbook -p 0 -X stuff "./tty_startup.sh^M" |
I then connect to the detached session with screen -r (you can see a list of detached sessions with screen -ls)
In the screenshot, you can see several GNU Screen tabs created by the script above. cmus is playing Internet radio, htop monitors CPU and memory for each process, and irssi with bitlbee daemon allows me to use irc to connect to Google Chat. In addition, I have the dropboxd and SpiderOakONE daemons running in headless mode so that my files on Dropbox and Spideroak get synced even when I'm not in a graphical session. Dropbox offers a script, dropbox.py for running dropboxd from the command line. This script has been packaged in AUR for Archlinux in the dropbox-cli package. In the case of SpiderOakONE, you can launch the daemon from the command line using the --headless option.
Here is a simple script that launches both daemons in the background when in a tty session:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script launches various daemons for a non-graphical | |
# session | |
SpiderOakONE --headless & | |
dropbox-cli start & |
In addition, I am running an NFS server for my LAN from this netbook -- all of this within 376 MB! In the screenshot above, the GNU Screen caption line shows the time, DoW, month, date, hostname, and a list of tabs that will expand to the right while properly reflowing even if the number of tabs goes off the right edge. You can find this caption setting in my .screenrc file from my dotfiles repo on Github.
In a series of posts I will talk more about cmus command line music player (that also supports Internet radio) and setting up irssi + bitlbee so you can connect to instant messaging services using an IRC client.