23

My first computer experience was with a Commodore. I would like to have Linux computer work similar to that. I was wondering if it was possible to have something similar using Linux.

What I would like to see is when I boot my machine into the command-line, and not into a GUI but have graphical resources available. So when I type say: Firefox, the program, and its graphical interface be made available. When I exit Firefox it returns to the command-line. If I need to browse the file system say I typed: XFE or whatever manager is being used and it come up and allow me to browse the folder, and when I exit then it return to the command-line again. So the ability to run, manage and use programs without having to use a GUI but have graphics available.

It would be nice to have all this geared toward programming. So at the BASH command-line, have the ability to call up a compiler environment IDE and just start writing programs without being distracted by a desktop environment.

And if more than one graphical program is running then have a tabbed window manager I guess. Is this feasible or am I dreaming?

  • 22
    You're just looking for a maximized konsole/gnome-terminal/xterm? – immibis Apr 26 '16 at 5:01
  • but this has then nothing to do with Ubuntu ;-) Better ask this on U&L unix.stackexchange.com – Rinzwind Apr 26 '16 at 18:40
  • 11
    I would like to invite you to press Ctrl+Alt+F1 through Ctrl+Alt+F7 respectively. – Michael Hampton Apr 27 '16 at 5:15
  • 1
    Another option is to use xterm as the window manager. Can't test this right now but it should be edit ~/.Xsession and set the last line to be /usr/bin/xterm without a & so this process is the non-terminating one keeping X alive. When this xterm exits, the session is over and X will quit. May need some geometry params. – Criggie Apr 27 '16 at 22:15
  • 1
    Xterm alone doesnt solve the problem. I have created a very minimal install. Then I installed Firefox. It says error: GDK_BACKEND does not match available displays. What am I missing? – Linuxuser00 May 27 '16 at 5:02

11 Answers 11

43

I think you can get what you want using a Tiling Window Manager, like i3 or xmonad. There are other minimalistic window managers with similar functionality. i3 and xmonad are both in Ubuntu repositories, so they are easy to install, and then you can select them in your login screen.

  • This is neat and interesting but It's not exactly what I'm looking for. I would like to see each program running in its own workspace using the entire screen to itself. – Linuxuser00 Apr 26 '16 at 16:02
  • 12
    @Linuxuser00: I think that's only a matter of configuration. Most users of tiling window managers like to use their big screens to display information side by side, but they all support swichting between several fullscreen apps. – ojdo Apr 26 '16 at 16:10
  • After reading this answer I have been giving i3 a try. It feels a bit more responsive than compiz. But it takes some getting used to. I still haven't figured out how to make windows in i3 have the exact sizes, I want them to have. – kasperd Apr 27 '16 at 10:26
  • @kasperd you mean mod+R then play with arrows? then after you're done escape? – vimdude Nov 28 '16 at 0:42
24

I am afraid that you missing the main difference between modern computing environments and those of the C-64 era. Home computers of the C-64 era were single user, single process systems, and did not share the computers resources with other processes. This quite simply means that when you would run a program on your C-64 that was a graphical program, it would reconfigure your computers hardware to be in 'graphics' mode and then your running program would handle all of the graphical output, and user input from the mouse and keyboard itself.

Modern computers and its software, by contrast, are multi user, multi process, but not only this, modern software depends on shared libraries, for example Firefox relies on the GTK windowing library, and that in turn relies on other lower level libraries. So in order for Firefox to run, it depends on a whole stack of software and configuration.

Because there is so much underlying software, this makes it more efficient to stay within a graphical environment once it starts up, rather than to load up the graphical environment for Firefox, then shut it down, then start up the graphical environment for another program, so forth and so on.

You can quite simply start and run any Linux GUI program from a terminal (console) window, so I would advise you to pick yourself a simple graphical desktop environment, perhaps Enlightenment or Openbox, and just run everything from a terminal / xterm window.

11

I agree with Eduar, you probably want a Tiling/Dynamic Window Manager (WM). But no-one's directly addressed:

What I would like to see is when I boot my machine into the command-line

Currently you should boot into a Display Manager (DM) where you login. So you have two options, boot into a shell or a console DM.

If you have no DMs set up then you will by default log into a shell, this will give you a login prompt of username then password, if you enter the correct credentials then you'll log into your default shell. I use this and the following is roughly my average startup 'process':

Arch Linux 4.1.5-1-ARCH (tty1)

localhost login: Joe
Password: 
$ startx

If you want to have a DM, but a console one then you'll have to install and configure it. Arch's wiki currently says there are three console DMs being: CDM, Console TDM and nodm.

Ubuntu uses LightDM by default, so you may have to remove it.
But as someone who currently doesn't have a DM I would recommend keeping with your current DM, and just change your WM. It's tedious having to type startx and from memory making it automatically execute correctly was annoying to setup.

  • Ubuntu uses lightdm by default, at least on the Unity variant. – Léo Lam Apr 27 '16 at 23:05
  • In terms of running startx automatically, I believe each account has a bash script that is run at login (or equivalent for other shells) – Nick Mertin Apr 28 '16 at 0:14
  • Please forgive me if this is completely incorrect, but since .bash_profile is an ordinary bash script, could you not simply put startx in it? – Nick Mertin Apr 28 '16 at 11:31
  • @MagikM18 What if you want to run an interactive bash shell after X has started? Without any checks, .bash_profile would try to run startx again. – joeytwiddle Apr 29 '16 at 3:29
  • @joeytwiddle true, I did not think of that – Nick Mertin Apr 29 '16 at 3:37
10

startx and xinit can both be handed an initial client to start with. The following command:

startx /usr/bin/firefox

will spin up an xserver on the TTY you are currently working on, and start a single instance of firefox in something like full screen. You can switch to other tty's to avoid having to bring down the firefox session just to get back to the console, or to bring up other clients there. You might have to specify a lot of options to make this look nice for your monitor since you won't have the desktop environment doing some of that configuration for you.

You should be aware that some xclients don't work nicely outside of window managers or desktop environments. There's no DE providing window decorations, and no WM listening for MOD key combos, so if they don't provide a graphical way to quit you will have to kill the process (or X) from another TTY.

Normally the initial client people use with X is a desktop environment or window manager which is just a special kind of client that launches and embeds other clients in addition to displaying its own window.

10

Alternatives

Framebuffer mode

There are some programs which are capable of running in framebuffer mode. Framebuffer mode allows an application have the screen all to itself, allowing the application to draw whatever it wants on the screen pixel-by-pixel. Not all programs support it, but there are a few which do.

Framebuffer mode doesn't require an X Server (such as X.org in case of current Ubuntu versions, or in the near future perhaps Mir or Wayland depending on which one becomes more popular), or any window manager/desktop environment to be started. This should give you a faster text to graphics mode switching (and back), especially as on (most?) modern Linux distros and graphics drivers the Alt-F[1-6] consoles are rendered using framebuffer mode anyway.

"Text User Interface" (TUI)

Some programs which are normally command line-only support using a mouse via gpm. On Ubuntu, all you need to do is just install the package gpm and it should work straight away without any configuration or even reboot necessary (IIRC). Once gpm is installed, your mouse pointer will be shown as a block-style text cursor and you may use the mouse as normal to click at the elements of the UI. You may also highlight text and use copy and paste.

If you want to go a step further, there is even a "window manager" which allows you to run multiple terminal applications on the same text mode "desktop".


Non-exhaustive list of programs supporting framebuffer mode

  • mc (Midnight Commander) - file manager
  • Links/Links 2, Netsurf - web browsers
  • fbi - image viewer
  • fbgs (related to fbi, part of the same suite), fbpdf - PDF viewer
  • mplayer, fbff (ffmpeg based) - audio/video playback
  • This sounds really nice, if only it wasn't so limited, thank you. – Linuxuser00 Apr 26 '16 at 15:57
  • Hi @Linuxuser00. There are a few more programs, I just didn't have time to list more :) – Pabru Apr 27 '16 at 14:34
  • Hey @Linuxuser00, I've added a couple more if you're still interested – Pabru Jun 30 '17 at 0:26
4

Look into using a window manager like FVWM2, rather than a "desktop". You can configure it to open just one (or more) xterms on boot, can run any graphical application such a web browser from the command line, aren't bothered by desktop stuff like "system tray" or icons for everything, but can add any bits of that you might find to actually be useful. (In my case, that's a pager window for multiple screens, and a Conky load monitor.)

  • I'm currently playing around with this one. Maybe I don't have it configured right at the moment but seems to be unstable and crashed on me. – Linuxuser00 May 27 '16 at 6:13
  • Humm... I've been running it since - oh, sometime in the late 20th century - and haven't had problems. But I use OpenSuSE rather than Ubuntu because (among other reasons) it seems simpler to use window managers rather than the default 'desktop'. If you want to go further, FVWM does have a support forum: fvwmforums.org/phpBB3 The trick to signing up is that they ask you a question about a "line-up". The answer is the members of the Beatles, a '60s pop group. (I had to Google for the answer even though I was around in the '60s.) – jamesqf May 27 '16 at 18:10
4

This is very possible.

First your need to disable graphical boot. Then you want "Single User Mode" (warning there are some pretty extreme security risks with this), finally you need to address what to do when you want to run a GUI.

See How do I boot into single-user mode from GRUB?

Essentially you add the option single to your GRUB boot config. You can do this in your /etc/default/grub file to make the changes permanent.

See How do I disable X at boot time so that the system boots in text mode?

Essentially you add text to your options in /etc/default/grub

This will give you a single user, text only environment. Next up is using the GUI. The program you want to run is startx

You would run

startx /path/to/executable

The problem is that you probably want a window manager of some kind. I would suggest twm your your needs.

sudo apt-get install twm

Then to run commands, I would say run startx then head back to your console (CTRL+ALT+F1) and do something like export DISPLAY=:0. Now when ever you your a GUI application from the command line it will launch in the "Graphics Side" which you can get to with Ctrl+Alt+F7 (usually).

If you like that setup you can even automate the setup of it with a script.

That it, that's as close as your going to get, with out a lot of work.

  • Why do you need Single User Mode? – MSalters Apr 28 '16 at 12:35
  • "What I would like to see is when I boot my machine into the command-line, ...". The old "Commodore" computers were not multi user. They weren't "user" at all. You turned them on and got a blinky cursor for typing commands. All commands were tries and there was no security to speak of. The closest thing to that to day is "single user mode", which basically starts you logged in as root, bypass most, if not all, security. – coteyr Apr 28 '16 at 14:09
  • Aha, I already suspected you were confused. There's no good reason why you want Single User Mode here. In Linux, single-user mode versus multi-user mode is independent from the GUI or CLI choice. – MSalters Apr 28 '16 at 15:42
  • No, I am not confused. The OP asked for an environment as much like a Commodore as possible. This mean no security, no multi user, and login. The best way to get close to this is single user mode. The two goals are not related to one another you can have console access with multi user you can have GUI with single user. It's two parts of the larger overall goal. – coteyr Apr 28 '16 at 15:45
  • No, I don't want an environment as close as possible as the Commodore. I want simplicity similar to the Commodore (no graphical OS). Bash alone is great, but would like to enter a coding environment if I want to code or enter a browser environment if I want to surf the net and so forth. And when finished with these programs close them out and return to BASH. or maybe have multiple programs running in their own work space. I have been busy and haven't been able to implement some of these methods discussed so far. – Linuxuser00 May 2 '16 at 16:06
3

I like ratpoison for what you are trying to do. I wont post a screenshot because you can't tell the difference from a screenshot of xterm (or whatever application you are running). In its standard configuration it displays one window full screen. You can split it to display multiple windows, but for most of my daily use I don't. If you start a terminal emulator from your .ratpoisionrc file you get a prompt almost as soon as you log in. It is inspired by gnu screen, and the only concept that they missed was detachable and shared sessions (but vnc fills that gap nicely).

2

I think you can get what you want without throwing away the desktop. As other answers have covered, you will likely get better performance with the desktop running anyways and there are technical reasons running linux like an older OS wouldn't really work.

I am going to use gnome as my example workflow because it's what I know, but I would guess other desktop environments would also support similar functionality. In gnome 3 you can have a workspace (or multiple) with with a full screen terminal that has the same look and feel as running in command line only mode. The fact that the gnome desktop is running in the background is irrelevant.

Then, using a window manager (such as the one discussed in this SO question) to control which workspace new windows are created on, you can force each new window to be placed on its own workspace. If you are willing to move windows yourself when they are created, then you don't need any software beyond gnome. Gnome 3 supports automatic workspaces, so as you open/close windows on the bottommost workspace new workspaces will automatically created/deleted for them. Then you can just use ctrl + alt + arrow to quickly move between them. When you close a window the workspace it was on is automatically deleted, and the two workspaces on each side move together. All you ever see are the windows you have open and the terminal.

  • This sounds about right. Maybe Openbox and Gnome would give me what I want? – Linuxuser00 Apr 26 '16 at 16:01
  • I haven't used openbox (or any other window manager) so you will have to evaluate them on your own), but I run gnome 3 on my laptop and use the workflow described in this answer (moving windows manually). I am pretty happy with it although reorganizing windows into the order I want after they are created is a little more painful that it should be. – Godric Seer Apr 26 '16 at 16:04
2

Install Xvfb:

apt-get install xvfb

Run:

/usr/bin/Xvfb :1 &
export DISPLAY=:1

then run any graphical software you like headless.

1

You can quickly switch to a command line interface using [ctrl][alt][F1] (works with [F1]-[F12] I think). One of these will also switch back to your GUI for when you need one; I think it's [ctrl][alt][F8] on Mint, so you might want to try that one. I'll throw myself in the "use a tiling window manager" camp though; i3 really is a great tool.

  • Yes, but the problem I have with this is that there is a GUI running in the background using my resources so I should just use the GUI instead of pretending it isnt there. – Linuxuser00 May 23 '16 at 17:36
  • Very true! One way to get around this would be to set the OS to swap out that entire session when it isn't active. I wouldn't be too surprised if it did this automatically, but it is probably something you would need to go through considerable trouble to set. – Johnathan Andersen May 24 '16 at 18:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.