Turn Your Terminal Into A Tiling Window Manager With Zellij

DistroTube
233 followers
6 Video Views·Jun 17, 2024
today I want to share a really neat
piece of free and open source software
with you this program it's called zage
what is zelig it's a terminal
multiplexer it's very similar to
something like G new screen or to t-u so
zage what it allows you to do it allows
you to take a terminal emulator a
terminal window and divide it into panes
it basically turns a terminal almost
into like its own tiling Window Manager
now the name zage is very interesting
what does that actually mean at first I
wasn't sure how to pronounce it because
I thought maybe it was like one of the
intellig uh products but it's not piece
of free and open source software has
nothing to do with intellig so it's not
zelig it's actually zelig what this is
this is a Moroccan Arabic word and it
means Mosaic which is actually a pretty
cool name when you think about it for a
terminal multiplexer zage is available
on both Linux and Mac for download and
installation and if you want to test it
out without installing it which is kind
of neat they do have these commands that
you can enter in the bash shell the Z
shell or the fish shell and just enter
the appropriate command for your shell
and you can actually test drive zelig
without installing it you can find the
source code for zelig over on GitHub
again it's free and open source software
licensed under the MIT license so let me
switch to an empty workspace let me open
a terminal let me go ahead and run zeage
without any other arguments the great
thing about zeage it's very new
userfriendly it only takes you about 10
minutes to learn a lot of the basic key
bindings to navigate around in zage by
default when you first open it you have
one pane here that opens your shell and
then at the top you have a tab bar and
at the bottom you have a status bar and
this status bar has pretty much all the
key bindings you need to know right here
so the very first thing you want to do
is probably open a new Pane and if you
want to open a new pane there's a couple
of different ways you can do this you
could do control peve for pain and then
it has a new submenu here and you see in
for new and that opens a new pane but
you can see I could also have done just
alt in to open new pan so alt in also
opens a new pan looking here through the
basic key bindings you can see contrl
plus h would move a pan so let's do
controll H and then I get this submenu
and you see I can navigate with the
arrows and I can move I can move that up
or I can move it over to the left hand
section make it the main pain and then I
could hit Escape if you want to close a
pain you can do contrl p for pain and
then you have X for close here so X
would close that paint if I do contrl p
again to get back into this menu you
also have f for toggle full screen so I
can make that pan full screen and it
gives you a hint that you're currently
in full screen and that you have one
hidden pane if I do contrl p for pain
again I could toggle f for full screen
and it toggles that back off you also
had a floating mode in there I don't
know if you saw that but contrl p and w
to toggle the floating window you know
now we get this new pane that is a
floater right I can do an LS or I could
run htop in that and then contrl PX to
close that window now anytime you want
to quit out of zage all you need to do
is control q and it will kill this zage
session and all the pain so control Q
just quits gets you back into the proper
shell here now one of the most
fascinating parts of zeage is uh the
documentation because the documentation
even though you know you have all the
key bindings and everything already in
zage itself you don't really need to
learn too much there is a really
interesting aspect to zage and that is
configuration because you can actually
make a configuration file and that's
what I've done I went ahead and created
a a little config file they give you an
example of a config file I go into
chapter five here layouts creating a
layout and they give you some examples
of some things you can throw in a config
file that way when you launch zage you
give it the location to this config file
and it just preloads all your panes and
whatever order you want launching them
in whatever programs you happen to want
as well so if I go to some of the
examples of these layouts files um here
is the example they give it's just this
basic layout where it opens three panes
right it splits it into three panes
they're all just launching the shell
there's nothing terribly complicated
with that what I did is I copied that
and then if I go back into the shell and
I give it the location to where I copied
that file
and I place this file in config slz SL
example- layout. KDL is the extension
for these files if I run that that is an
example file there right actually I I
modified it in a a slight way because I
did specify in one of the panes for it
to actually run htop let me switch to an
empty workspace and I'll show you that
file so let me go ahead and open with uh
Vim
fig
/z/ examples. layout I'll zoom in here
and you can see the layout's pretty
simple first we have layout and then
opening and closing brackets Pane and
then a second pane so you get you know
the two columns but in the second pane
you can see I split it vertically and
within it I have two panes one is just a
the default pane which is the shell and
then I have Pane and then command equals
htop which gives me htop in this Pane
and that is a very basic example layout
because there's really nothing
complicated I'm not really launching any
programs I'm not giving any programs any
arguments I also didn't include a lot of
the uh visual bars I didn't include the
tab bar at the top I didn't include the
status bar at the bottom here but you
can include all of that if I actually do
controll q and let me up arrow and I do
ze-- layout and then I give it the
location to this example layout file all
I created in this one I've got a little
bit more stuff going on first I decided
to put the tab bar at the top here
because if I wanted to use tabs it it
would be nice to have the tab bar to let
me know which tab I was in I I probably
wouldn't use tabs a whole lot in this
because it's kind of Overkill you're
already multiplexing you know splitting
things into panes and then you have a
tab with a whole new set of paines going
on but if you're one of those people
that really live in the terminal you
might find tabs useful so I put the bar
at the top and then I also went ahead
and added a status bar back here at the
bottom and there's a couple of different
uh status bars there's actually a
compact bar that doesn't show quite as
much information but I wanted the key
bindings here because again I'm rather
new to this and you can see in the panes
I specified launching neovim in one
running the ls command with various
Flags in the other Pane and then htop
here in this Pane and let me show you
this example file so this layout file
again has a little bit more stuff in it
again just as an example for you guys to
follow along what I did is the very
first pane is actually the tab bar so if
I go back that section gives me the tab
bar here at the top and then the very
bottom pane you can see is the status
bar so that's the status bar at the
bottom and then everything in between
the tab bar and the status bar are the
pains inside and you can see the first
pain is running the command invm neovim
then I'm doing a horizontal split and
then within that I've got two panes and
the first pane is running the command LS
and then arguments d l ah because you
can't just give a command and then some
arguments inside the command you
actually have to split up the command
and the arguments for that shell command
and when you do this you can see it's
command and then space and then the
command it's not command equals command
if you don't give it any arguments then
the command is actually pain command
equals command but if I was giving it an
AR arent there's no equal sign and then
you got to give it arguments as a a
separate argument if you will but this
layout file is pretty easy to work with
and again this this is what this looks
like you know in action by the way since
I mentioned the tab bar if you did want
to use tabs contrl T would actually
create a tab so control T get you this
tab submenu and if you wanted a new one
in for new and now we have tab two it
just created a whole new tab and by
default it does the same default layout
out so we have tab two if I click on it
with the mouse I go back to tab one it's
kind of hard to tell because they're
running the same thing but I can solve
this problem by exiting out of one of
these commands this LS command has
finished so let me uh go ahead and hit
Escape Escape drops you back into the
shelf and now this is tab two this is
tab one now you can see that we're on
two different workspaces if you will now
of course you probably don't want to use
the mouse uh because if you're in a
terminal you're going to have your hand
on the keyboard to switch between the
tabs in the terminal contrl T to get
that submenu again and then change Focus
you can see you can use the arrow keys
also hjk L works so if I use um H to go
left I'd go back to tab one if I go
right with L I go back to tab two until
I hit escape to get out of that control
tab menu if you want to adjust the size
of your windows very much like you would
expand or Shrink windows in a tiling
Window Manager you can do that with crln
crln is size and then H and L for left
and right so L right H left and again
escape to get out of that so that's just
a really brief overview of zel Edge I've
been playing around with it for a couple
of hours today and I just thought it was
one of the best programs as far as a
terminal multiplexer I've ever used
because I don't really have a need for a
terminal multiplexer I don't because I
have a tiling Window Manager that's my
terminal multiplexer when I'm using
terminals Plus if I'm going to do that
kind of terminal workflow where I need a
lot of paines I'm just going to open up
emac and emac itself is a multiplexer
right so I don't need a a multiplexer
inside a multiplexer if I'm using emac
but I do think this kind of program
would be extremely useful for you guys
that do live in the terminal if you're a
terminal slvm user and then this kind of
program makes sense if you're a terminal
slvm user that uses a floating window
manager or a desktop environment like
gnome or KD plasma you're going to love
zeage now before I go I need to thank a
few special people I need to thank the
producers of this episode Matt James
Steve armor Dragon dof datus gdr George
Lee Matthew methos Aran Paul Peace Arch
and Fedor reality foress red profit
Rolland solry T Ro ginu and abun and
Willie these guys they're my highest
steered patrons over on patreon without
these guys this quick look at zeage
would not have been possible the show's
also brought to you by each and every
one of these fine ladies and gentlemen
all these names you're seeing on the
screen right now these are all my
supporters over on patreon because I
don't have any corporate sponsors I'm
sponsored by you guys the community if
you like my work want to see more videos
about Linux and free and open source
software like zelich subscribe to Dro
tube over on patreon peace guys
