For some of us, the ability to boot to a command line (without a graphical interface) is critical. For example, many of us normally run our boards "headless" (without a display hooked up).
But still, we need a graphical interface for either remote graphical sessions, or when we simply want to run the board in a graphical mode on demand (for whatever reason).
Note that a graphical interface is very "expensive" in both memory and CPU resources, so the ability to do without can really save the day if you doing something like running a board as a server.
Here at the SwampWërks, we need to be able to do both, and the MATE 15.04 install that came with my ODROID-XU4 does not provide that as an out of the box solution, so I am going to present a little code to try make this happen.
Please note that the material presented is not necessarily the "best" or "most proper" way to do this (and I am very sure there will be many a guru that will "chime in" to let me know that). Also, I take NO RESPONSIBILITY for what the following may do to your system. Please back up, and accept the risk, OK? Finally, if this does not work for you, I am sorry, and I probably cannot provide further assistance.
The following details my changes the 15.04 distro that came with my ODROID-XU4. It may work with other versions, distros and other boards. You mileage may vary.
First things first. For now, you need to turn off auto-login for MATE, and set up the correct desktop to start. To so this, go to the "system" menu, select "control center", then select "user and groups". Make sure the "Password" is set to "Asked at login". If not, click the "Change" button, and uncheck the "Don't ask for password on login" selection.
Now reboot, and at the logon screen, there should be a white circle next to the username. Click it, and there may be two desktop selections to choose from:
I had to choose "MATE (default)" to get things working.
If that does not work to your liking, then set it back.
Ok, now let's set things up. We need to use systemctl to tell the system to boot either a graphical interface, or a command line interface.
To enable command line interface on boot, in a terminal window, type:
sudo systemctl set-default multi-user.target
To re-enable a graphical interface on boot, in a terminal window, simply type:
sudo systemctl set-default graphical.target
OK I want both! I want to boot to the command line and be able to start a graphical interface on demand using startx (and that blows chunks).
To be able to use the "startx" command to start the MATE desktop, you may need to add a file ".xinitrc" home directory containing the command "exec mate-session". Perhaps you already have one, so you might want to check by typing the following in a terminal window:
If you have one, you will see it's contents, and you should proceed with caution if it does not contain:
by backing up the file with the following command:
cp ~/.xinitrc ~/.xinitrc.backup
and to get it back type
cp ~/.xinitrc.backup ~/.xinitrc
If you received a "No such file or directory", then you don't have a .xinitrc, so there is no need to back it up.
In either case, the following command issued into terminal (as the normal user, not as a super user) will create (or overwrite) the .xinitrc file with the command we need:
echo "exec mate-session">~/.xinitrc
You should be able to type that in from anywhere, as the "~/" means "my home directory"
We also need make sure that the owner of the .Xauthority file in your home directory is indeed owned by the user. The following command will tell you:
ls -l command ~/.Xauthority
Your username should be listed in the third column. If it is not, we will change the owner, so be sure to write down the owner (so we can change it back if things go badly).
If you received something like "No such file or directory", then you need to solve that issue first (and I am considering that issue to be beyond the scope of this article - sorry).
If need be, the following command can be used to change the owner (substitute your user name for "YourUserName"):
sudo chown YourUserName ~/.Xauthority
OK, you should be set to go! Reboot, and with any luck, you will be greeted with the log in prompt to a command line interface. One logged in, to start up the MATE desktop, simply type "startx". When you are done with your desktop session, you have the option to either "shut down" or to "log out" (where log out should just bring you back to the command line interface).
To make it easy to switch between a graphical and a command line interface at boot time, I added two shell files (startxY.sh and startxN.sh) to my /usr/bin/ directory. They use a fancy check to see if you are running as the root user, and if not, you will be promoted for the root password needed to complete the command:
contents of startxY.sh:
if [ "$(id -u)" != "0" ]; then
$SUDO systemctl set-default graphical.target
echo please reboot
contents of startxN.sh:
if [ "$(id -u)" != "0" ]; then
$SUDO systemctl set-default multi-user.target
echo please reboot
You will need to set them to be executable:
chmod +x usr/bin/startxY.sh
chmod +x usr/bin/startxN.sh
So now, you should be able to type startxY.sh in terminal (from anywhere) to enbable auto booting to a graphical interface, and type startxN.sh in terminal (from anywhere) to enable booting to a command line interface.
I hope someone found this helpful!
Copyright © 2015 by CODE4SALE, LLC - All rights reserved. License to share granted.
TJoe™ is a trademark of CODE4SALE, LLC. (Yup, we really do own his words).
SwampWërks is a trademark of CODE4SALE, LLC.
CODE4SALE™ is a trademark of CODE4SALE, LLC.
So let’s talk about views for just a second here. Earlier this year, Android Enthusiast was off to a flying start with numerous number of views- but you may have noticed recently the “view counter” post has been posted less and less. This is because of the large drop in views that’s occurred recently.
Part of this is due to the fact that I had plenty of school work and exams, so there have been less posts. But even on the posts that we do put out that used to get hundreds of views are noticing a drop as well. We think that some of this might be due to people clicking less perhaps. Or, it’s the fact that we only tend to promote our posts conservatively (so that we don’t spam people in multiple communities), or perhaps it’s our content? So we’re opening up to your suggestions on how we can improve Android Enthusiast.
Of course, don’t think that we’re just interested in views- because that’s not how we work. We just believe that there is a direct correlation between the number of views and the engagement between our audience. So what do you think would make Android Enthusiast better? Whatever your suggestion is, feel free to drop a comment below.
We really appreciate your help so that we can continue to bring you original Android news that is unparalleled even amongst other Tech sites.
The Editor at Android Enthusiast
File managers are still a missing puzzle in a big Android ecosystem. We have Windows Explorer, The Finder and Nautilus or Nemo on our PCs, but Android still has no truly extensive file explorer included in the system.
For many years the top choice was quite obvious. There was one king, or rather emperor, to rule them all: ES File Explorer. Users loved its simplicity, intuitive interface and what is even more for XDA users – root access and ability to open almost any type of file. ES File Explorer is still a complex solution to those of you who want to perform some easy file management or even more complicated stuff like modifying /system partition or adding some stuff to build.prop. If you were using this application for more than a couple of months you may have noticed that something terribly wrong is going on with one of your favorite applications. A company behind the app started to add some unnecessary features, which frankly speaking made it a bloated, resource hungry hog. Yep, you read it well – bloated.
So whilst it is very feature packed (and I've been using it for years) the comments on the article below show strong favour now for Root Explorer at https://play.google.com/store/apps/details?id=com.speedsoftware.rootexplorer&hl=en.
HowTo: Upgrade To a Newer Version of Ubuntu 14.04 LTS
Back up any important data on the Ubuntu server. Make a backup - it cannot be stressed enough how important it is to make a backup of your s
Amazon.com : Black iPearl mCover Hard Shell Case for 11.6" Acer C72...
Amazon.com : Black iPearl mCover Hard Shell Case for 11.6" Acer C720 C720P series ChromeBook Laptop : Computers & Accessories
The Humble Store: Great games. Fantastic prices. Support charity.
The Humble Store offers a great selection of games at great prices for PC, Mac, Linux and Android with new games added daily.
CryptoLocker - Dangerous ransomware | Computer Help Documents | Oregon S...
What is CryptoLocker? CryptoLocker is malicious software that encrypts your data files (word, powerpoint, pictures, music, videos, etc.). Th