Tmux Terminal Desktop

Most of what I do is on openSUSE Tumbleweed or Leap. Some of this may work in other distributions but that is not my focus.

Installation

Installation is pretty straight forward.

sudo zypper install tmux

Running Tmux

There are a few ways to launch it. The most basic way

tmux

This just launches the tmux application and there isn’t much to see really. It just looks like a terminal.

tmux new -s session-name

This will create a new tmux session and name it. Example: tmux new -s default will create a session name called “default”. Knowing the session name you can disconnect and reconnect to the session. More on that later

tmux a

This will reattach to the last tmux session.

tmux attach -t session-name

This will reattach to a specific session in this case, it would be “session-name” or if you name it something cool, like “AwesomeTerminalDesktop” you would type: tmux attach -t AwesomeTerminalDesktop

tmux ls

For those times that you cannot recall what your Tmux sessions names are.

These are the basic usages of starting up Tmux.

From here, you just see a terminal window with, in my case, a green bar at the bottom.

To get out of Tmux, you can either exit and terminate the session by typing exit or more usefully, detach from Tmux to attach later by pressing: Ctrl+b d

For clarification that holding down Ctrl and pressing b, release and press d. Keep that in mind for the next section.

Tmux Keysequences

This is not an extensive list, just some basic controls. For a full listing see TmuxCheatSheet.com. In order to not overwhelm a new-to-Tmux user, I am just highlighting the most basic of commands.

Window Controls (like virtual desktops)

Ctrl+b c
Creates a new window or virtual desktop

Ctrl+b ,
Rename the current window or virtual desktop

Ctrl+b n
Move to next window or virtual desktop

Ctrl+b p
Move to previous window or virtual desktop

Ctrl+b &
Close the current window or virtual desktop

Pane Controls

When in any particular window you can start by splitting it vertically or horizontally.

Ctrl+b %
Split active pane vertically

Ctrl+b “
Split active pane horizontally

Ctrl+b
Ctrl+b
Ctrl+b
Ctrl+b
Navigate to pane in the direction of the arrow key pressed

Ctrl+b q
Show pane numbers

Ctrl+b q 0 … 9
Show pane numbers and switch to that pane by pressing that particular number. You do have to be kind of quick in hitting that particular number

Ctrl+b Ctrl+⬆ (don’t release Ctrl)
Resize active pane upward

Ctrl+b Ctrl+⬇ (don’t release Ctrl)
Resize active pane downward

Ctrl+b Ctrl+⬅ (don’t release Ctrl)
Resize active pane to the left

Ctrl+b Ctrl+➡ (don’t release Ctrl)
Resize active pane to the right

Ctrl+b [Spacebar]
Toggle between pane layouts. This changes the pane layout.

Ctrl+b z
Toggle pane zoom. This makes the active pane go full screen in the current window / virtual desktop. Pressing Ctrl+b z again will restore the pane to its previous size and location.

Ctrl+b !
Convert Pane into a new window

Ctrl+b x
Close current pane

Additional Terminal Applications

In order to make the Tmux desktop useful you need some applications to play around with. I have a list here of nifty terminal applications but there are more to really make this fun.

tty-clock

Displays a simple digital clock with some fun configuration options. Some options include displaying the date, color, blinking colon and seconds display. When the application is launched, moving the location of the clock is as easy as using the arrow keys to set it just right.

calcurse

A calendar and scheduling application for the command line. It helps keep track of events, appointments and everyday tasks. I think this would be more fun if I could integrate it with Korganizer and maybe that is possible but I don’t know. This has a configurable notification system reminds user of upcoming deadlines, the curses based interface and can be customized. It has a very powerful set of command line options can be used to filter and format appointments, making it suitable for use in scripts.

weechat

Full featured IRC client with many plugins and options

See here for the quick start guide

telegram-cli

Just like it sounds. Telegram with a command line interface. I installed the snap for this.

https://snapcraft.io/install/telegram-cli/

matrixcli

A minimal command line matrix client that can be easily installed. The instructions are here:
https://github.com/ahmedsaadxyzz/matrixcli

w3m

Simple terminal web browsing application.

sudo zypper install w3m

mc

Midnight Commander is an orthodox (two-pane) file manager that has been around for many years. I have used this file manager style since my Amiga days.

sudo zypper install mc

nnn

A full-featured terminal file manager. It’s tiny and very fast to use. Arrow keys can be used to rapidly navigate through he folders.

bmon

A monitoring and debugging tool to capture networking related statistics and prepare them visually in a human friendly way. It features various output methods including an interactive curses user interface and a programmable text output for scripting.

sudo zypper install bmon

wavemon

This is a wireless device monitoring application that allows you to watch signal and noise levels, packet statistics, device configuration and network parameters of your wireless network hardware. It should work (though with varying features) with all devices supported by the Linux kernel.

This list will grow over time but this will likely get you started

Use and application

The purpose of this is to have a terminal desktop environment that is, well, tiling. Not because I necessarily need one on my main system but more so that I can attach to a tmux session from different devices and be productive. It also opens up the possibility of using older, vintage machines that have network capability and setting up specific tmux sessions for each of them. The trick is, as I see it, to automate the sessions starting up with specific configurations for each vintage machine… hmmm…

Final Thoughts

Do I necessarily need to live in the terminal? No, not at all, but how fun is it to be able to be productive in a quasi desktop environment, albeit in the terminal. There are many, many, many more fun terminal applications and I am still discovering them. The trick would be accessing email and my Google Calendar or Nexcloud Calendar in the terminal.

More explorations for the future and future updates to this page.

References

https://linuxunplugged.com/articles/build-your-own-desktop-in-the-terminal
https://github.com/tmuxinator/tmuxinator
https://tmuxcheatsheet.com/
https://weechat.org/
https://snapcraft.io/install/telegram-cli/
https://github.com/ahmedsaadxyzz/matrixcli