How To: Embedding Terminals in Linux

I’ve already pointed out a couple of places where Gnome-users can get good information on creating Embedded terminals, but I haven’t been able to find a good guide to do the same thing in Fluxbox.

It’s actually quite easy, once you know how. Which is, of course, the trick. Here I will explain the process for others who want to achieve the same look.

Setting up the Window

Start by opening a terminal, sizing it to the right dimensions, and placing it where you want it to be.

Next go to File and select New Profile. Choose a distinctive name, and go to the profile config window.

Here, you can configure your terminal to have the no-trimmings look we’re going for.

  • On the ‘general’ tab, unselect ‘system fixed width font’ and choose your own if you wish. Untick ‘Show menubar by default in new terminals’.
  • Under ‘Title and Command’ change ‘Dynamically-set title’ to ‘isn’t displayed’.
  • Change colours to whatever seems suitable. I have a light background, so I prefer a darker text color.
  • Effects dictates the background for your terminal. In this case, we want a transparent background, so tick that and set shade to none. You can also choose to display any image file as a background.
  • In the ‘Scrolling’ tab, set ‘Scrollbar is’ to ‘disabled’. Increase the scrollback lines if necessary.

We can ignore the Compatability tab so close the window.

Right click on the terminal and choose ‘change profile’. Change it to your new profile.

The App File

Now we need to set up our auto-start settings, and get rid of the decorations.

Open up ~/.fluxbox/apps in your favourite editor. You don’t need sudo, as it’s in your home directory.

The apps file is where you set the properties for windows and applications that you want to open in a particular way. You can define the properties for all instances of an application, for set number of instances, or for windows with a particular title. You can find more information about the apps file, and how to use it, here.

Our terminal now has it’s own title, the name of the profile you created. Any terminal with the same profile will have the same title, but terminals with other profiles, or the default profile, will not. Lets say we called our profile termie.

  1. First we need to find the dimensions for our terminal. To do this, type xwininfo in a terminal, and click on the window you want information about (in this case, our terminal). This will bring up a long list of stats. Put it to one side to refer to.
  2. Now copy the following into your apps file:
    [app] (title=termie) {1}
    [Dimensions] {538 274}
    [Position] (UPPERLEFT) {0 0}
    [Layer] {12}
    [IconHidden] {yes}
    [Deco] {NONE}
    [Sticky] {yes}
    [end]

    • Replace termie with the name of your profile.
    • Dimensions are in {width height} format. Get your width and height from the xwininfo.
    • This position will place the window right in the upper left corner. You can choose from WINCENTER, CENTRE, UPPERLEFT, UPPERRIGHT, LOWERLEFTLOWERRIGHT. You then state how far from that position your window is in x-y co-ordinates. If you leave your position as ‘UPPERLEFT’ then you can find the appropriate co-ordinates in xwininfo, as the Absolute upper-left X: and Absolute upper-left Y:.
    • Layer {12} states that the window will be part of the desktop layer.
    • IconHidden determines whether or not the program shows up on your taskbar.
    • Deco {None} gets rid of all the window decorations, leaving just the window contents.
    • Sticky {yes} shows the terminal on all workspaces, not just the current one, so when you switch workspace, it’s still there.
  3. Save the file when you’re happy with the settings, and open your startup file at ~/.fluxbox/startup
    • If you followed the guides, you will already have various programs listed in here that you want to start on reboot. For example I have conky and emesene auto-starting. Now we’re going to add our terminal.
    • In the same section as the other startup programs, add this line:
    • gnome-terminal –window-with-profile=termie &
    • Change ‘termie’ to the name of your profile.
    • It may be that you want your embedded terminal to automatically run a particular command on startup. For example, I have a terminal that automatically runs IRSSI. To do that, edit your startup command to look like this:

      gnome-terminal --window-with-profile=termie --command=irssi &
  4. Save the file when you’re happy with it, and close the terminal.
  5. Now try rebooting, to see if it worked!
Advertisements

4 Comments

Filed under How To, Linux

4 responses to “How To: Embedding Terminals in Linux

  1. Diabolic Preacher

    Hello,
    I visited this post, from a wordpress.com forum post you made about unordered list not displaying properly inside ordered list, which is exactly the problem I’m facing with my latest post at http://abusiveviews.wordpress.com/2009/04/12/treat-spammers-the-right-way/ How did you resolve the issue? Did you change theme? or figured out some other workaround? My theme is not Kubrick, so I couldn’t relate entirely.

    Thanks
    Diabolic Preacher

  2. mesut

    Lusule would you share a screenshot for that ?
    nice tutorial btw.
    Thanks.

    • lusule

      I haven’t had time to update the blog unfortunately since last summer, but I should still have screenshots around, I’ll try and dig one out and post it. Thanks for the comment!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s