You are not logged in.

#1 2017-12-25 14:26:58

HLF
Member
Registered: 2017-07-30
Posts: 9

LightDM, command line login

Hey,

real linux newbie here.

I thought, it would be cool to boot into command line where i would log in a then it would automatically start a GUI desktop - openbox + conky + tint2, right? (btw, is KDE and GNOME something that contains window manager and taskbar and maybe some other things or I dont get it at all?)

But, when I uninstalled LightDM, it did boot into command line, but dont know how to start my GUI - is LightDM taking care of it?

Im in runlevel 5, but dont know what scripts i should run to start my GUI. I was trying to find something in init.d, but Im really confused what is what. smile

I really want to understand the system.

Offline

#2 2017-12-25 14:43:02

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: LightDM, command line login

HLF wrote:

when I uninstalled LightDM, it did boot into command line, but dont know how to start my GUI

This should do the trick:

startx

I also dislike LightDM so I have added this line to the end of ~/.profile to run that command automatically if the log in is performed from TTY1:

[ "$(tty)" = "/dev/tty1" ] && exec startx

Or use this line to start the desktop automatically from any TTY:

[ -z "$DISPLAY" ] && exec startx

Or a simple display manager:

case "$(tty)" in
    "/dev/tty1") exec startx;; # starts openbox on tty1
    "/dev/tty2") exec startx /usr/bin/kodi;; # kodi on tty2
    "/dev/tty3") exec startx /opt/games/bin/steam -bigpicture;; # steam on tty3
esac

“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#3 2017-12-25 15:00:14

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: LightDM, command line login

I missed some things...

HLF wrote:

is KDE and GNOME something that contains window manager and taskbar and maybe some other things

That's right, yes — GNOME and KDE both offer a window manager along with a panel and varoius other "helper" utilities to knit the desktop together as a coherent whole.

In BunsenLabs, we follow the so-called "Unix philosophy"[1] and instead create our desktop from disparate components (that can be freely swapped out, unlike the aforementioned DEs) thus allowing more scope for cutomisation and minimalism.

HLF wrote:

Im in runlevel 5

BunsenLabs uses systemd as PID1 (init) and so "runlevels" are only simulations, .targets[2] are the new paradigm.

Specifically, you are now booted to multi-user.target, which is the non-graphical bootup.

Try this:

systemctl cat multi-user.target

[1] https://en.wikipedia.org/wiki/Unix_philosophy
[2] See systemd.target(5).


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#4 2017-12-26 08:30:21

ohnonot
...again
Registered: 2015-09-29
Posts: 4,167
Website

Re: LightDM, command line login

i would strongly consider to make the gui starting optional - i have a small bit in my ~/.bash_profile that will start the gui only when a certain key is pressed, otherwise i have the command line system.
also nice tips from HoaS!

anyhow, if you switch from displaymanager to startx, you probably need to fix a few things that the displaymanager takes care of, at leat that was my experience.
it's been so long, i don't remember anymore exactly, but you might notice some problems, like suddenly you're asked for a password when you want to plug a usb stick etc.

startx will look for a configuration file in your $HOME, i use .xinitrc, that's where you tell it to exec openbox-session.

i had to add this to my xinitrc:

if [ -d /etc/X11/xinit/xinitrc.d ]
then
  for f in /etc/X11/xinit/xinitrc.d/*
  do
    [ -x "$f" ] && . "$f"
  done
  unset f
fi

PS:
neither HoaS nor I have delivered a full tutorial for this, because those already exist on the wild web!

Last edited by ohnonot (2017-12-26 08:31:40)

Offline

#5 2017-12-26 10:57:57

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: LightDM, command line login

ohnonot wrote:

if you switch from displaymanager to startx, you probably need to fix a few things that the displaymanager takes care of, at leat that was my experience.

Actually, no.

I think your experiences may be from Arch Linux because in BunsenLabs plain old `startx` should deliver the exact same desktop as if the user logged in from the display manager.

Here is the Debian man page for startx:

https://manpages.debian.org/stretch/xin … .1.en.html

Compare and contrast with `man startx` on your Arch box wink

The relevant paragraph:

startx(1) wrote:

Note that in the Debian system, what many people traditionally put in the .xinitrc file should go in .xsession instead; this permits the same X environment to be presented whether startx, xdm, or xinit is used to start the X session. All discussion of the .xinitrc file in the xinit(1) manual page applies equally well to .xsession. Keep in mind that .xinitrc is used only by xinit(1) and completely ignored by xdm(1).

Consequently, your suggestion

ohnonot wrote:

use .xinitrc

would actually break the BunsenLabs desktop quite significantly.

@johnraff has written an extensive breakdown of the X server's initialisation in a Debian system, it is well worth reading:

https://forums.bunsenlabs.org/viewtopic.php?id=3774


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#6 2017-12-26 11:02:59

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: LightDM, command line login

Also:

ohnonot wrote:

~/.bash_profile

^ BunsenLabs does not use this file and adding any file by that name may subtly break some aspects of a console-based login.

Any modifications should be applied to ~/.profile instead; this file also has the benefit of being read by all shells, not just the broken one bash.


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#7 2017-12-26 14:57:37

ohnonot
...again
Registered: 2015-09-29
Posts: 4,167
Website

Re: LightDM, command line login

^ thanks for clarifying!
not much of a distro-hopper, me...
anyhow, the information is out there, be it for debian or archlinux.

Offline

#8 2017-12-26 16:55:51

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: LightDM, command line login

I've submitted a PR on github to add the line to our stock ~/.profile:

https://github.com/BunsenLabs/bunsen-configs/pull/71


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#9 2017-12-26 20:13:12

BLizgreat!
Resident Babbler - vll!
Registered: 2015-10-03
Posts: 1,217

Re: LightDM, command line login

Might check this thread out, so as not to reinvent the wheel, BLizgreat = lmintnewb2 over in that community or used to. Rather than removing lightdm, went ahead and disabled it from starting with the systemctl command and it worked out well enough. Anyway may be some info of interest about this topic and some pointers of where/what to look at.

Offline

#10 2017-12-26 23:17:01

jr2
Member
Registered: 2017-12-24
Posts: 52

Re: LightDM, command line login

Head_on_a_Stick wrote:

all shells, not just the broken one bash.

Give it a rest, already!


normal service will be resumed as soon as possible

Offline

#11 2017-12-26 23:21:42

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: LightDM, command line login

^ devil

OK...


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#12 2017-12-27 00:48:14

BLizgreat!
Resident Babbler - vll!
Registered: 2015-10-03
Posts: 1,217

Re: LightDM, command line login

Also as in that stupe Mint babble thread, still feel that way, that being that display managers take very lil resources and make much convenient imo. I'd rather just go ahead and use one. Esp on a system if someone were to have several DE's/Wm's installed. Believe in Debian/based the relevant file is likely .xsession and similar. Could always hit up "man xsession" to give some added insight into it, location of relevant files, hopefully in what order they're executed.

Remember babbling about this type of thing before, on this OS I only have 1 wm-windows manager ... openbox. Though am wondering what happens if I just go ahead and set it to something else via a command like "sudo update-alternatives --config x-session-manager" and were to pick something other than openbox ? Then disabled lightdm again ... "sudo systemctl disable lightdm". Would startx launch the default xsession I chose with all config files from /home/username ?

Also noted in LM forum, having to re-enable lightdm "sudo systemctl enable lightdm" and believe I also had to reconfigure the thing to reverse the process of disabling it and getting it working normally again .. "dpkg-reconfigure lightdm"

Anyway either way you go, removing or as above just temporarily disabling lightdm, personally preferred just disabling it, not like reinstalling it takes long too. Ah ok ... wth, will install fluxbox or summin and see what happens in this situation and report back, startx should launch the default xsession ... hopefully. big_smile

Offline

#13 2017-12-27 01:17:33

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: LightDM, command line login

BLizgreat! wrote:

Believe in Debian/based the relevant file is likely .xsession and similar. Could always hit up "man xsession" to give some added insight into it, location of relevant files, hopefully in what order they're executed.

Or you could take a few moments to read through the thread that johnraff spent many hours researching and crafting that explains exactly how everything starts up in Debian.

I already linked to it earlier in the thread but I think you missed it:

https://forums.bunsenlabs.org/viewtopic.php?id=3774


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#14 2017-12-27 01:19:35

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: LightDM, command line login

BLizgreat! wrote:

Also noted in LM forum, having to re-enable lightdm "sudo systemctl enable lightdm" and believe I also had to reconfigure the thing to reverse the process of disabling it and getting it working normally again .. "dpkg-reconfigure lightdm"

Anyway either way you go, removing or as above just temporarily disabling lightdm, personally preferred just disabling it, not like reinstalling it takes long too. Ah ok ... wth, will install fluxbox or summin and see what happens in this situation and report back, startx should launch the default xsession ... hopefully. big_smile

Disable LightDM with:

sudo systemctl set-default multi-user.target

Re-enable LightDM with:

sudo systemctl set-default graphical.target

No need to uninstall wink


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#15 2017-12-27 01:20:19

BLizgreat!
Resident Babbler - vll!
Registered: 2015-10-03
Posts: 1,217

Re: LightDM, command line login

Ok well, yep appeared to work well enough, still had to jump through some unexpected hoops, you may not have to though. These included, had to run "updatedb" thing, so fluxbox would show up in locate command, that's not strictly necessary and when tried to set it as x-session manager, OS complained of only having one option = openbox. So I had to install/add it as follows.

sudo update-alternatives --install /usr/bin/x-session-manager x-session-manager /usr/bin/fluxbox 100

Then set it (fluxbox) Chose it from the list. It was actually set to default with the above, having the value of 100, whereas openbox-session was set to 40 but just to be thorough.

sudo update-alternatives --config x-session-manager

Disabled lightdm

sudo systemctl disable lightdm

Reboot, yep command line, log user in, username/password. Ended up installing the xinit package again. That was a different OS I was using at the time while posting in LM forum. So got the dang no command found thing when tried startx, so had to install that package. Then ran "startx" and yeppers fluxbox started right up. Didn't try customizing it any, so don't even know if any of the user config's in /home were run atm.

Anyway reversed the process, by setting openbox back to being the x-session-manager, then "dpkg-reconfigure lightdm" got lightdm working again and now back to normal.

Last edited by BLizgreat! (2017-12-27 01:24:23)

Offline

#16 2017-12-27 01:51:25

BLizgreat!
Resident Babbler - vll!
Registered: 2015-10-03
Posts: 1,217

Re: LightDM, command line login

Missed your posts Hoas, no worries, am just dorking around with this. Still outright prefer the convenience a display manager provides, nothing wrong with learning how this stuff works or experimenting though, so good deal OP. smile

Vll!

Offline

#17 2017-12-27 04:24:16

BLizgreat!
Resident Babbler - vll!
Registered: 2015-10-03
Posts: 1,217

Re: LightDM, command line login

Pointless update: Had to see, so went through the above again, disabled lightdm, set fluxbox as default x-session-manager and then modified one of it's keybinds, reboot, same deal login user/password ... startx. Yep ... fluxbox started as expected and upon testing the custom keybind I'd set, yep it works fine too. So clearly the config files in my /home used with it.

And now ... time to dork around with fluxbox for awhile, it's been forever. Remember very lil about it but do remember it's a cool windows manager itself and why not give it a refresher dorking around with ? tongue Though am going to put lightdm back in action too o course.

Last edited by BLizgreat! (2017-12-27 04:25:03)

Offline

#18 2017-12-27 05:34:34

BLizgreat!
Resident Babbler - vll!
Registered: 2015-10-03
Posts: 1,217

Re: LightDM, command line login

Why not ... one more funny one. Found this via googling, went ahead and tried it and works, same deal disabled lightdm again, edited /home/username/.profile and added this to the bottom of it.

# If uncommented the line below will autostart X after user login username/password.
if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then exec startx; fi

The top line in that is just a comment to remind myself what the hades the line is supposed to do when I leave it uncommented (while not using a display manager etc). But that's what it does, once you login your user in command-line, it'll automatically start the default xsession, again chosen with the update-alternatives --config x-session-manager deal. Starts it in tty1 which generally X is running in tty7 but whatever.

Also note as mentioned in the ~/.profile file itself this ...

# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login exists.

Not sure if BL has either of these by default. Though as per above they'll take precedence if they are present. Just  noting this weirdness here cause it's kinda interesting.

Also just to be overly anal, it works the same if added to the bottom of .bashrc too. The actual order these are sourced goes like this ...

*  /etc/profile
*  ~/.bash_profile
*  ~/.bashrc
*  ~/.bash_login
*  ~/.profile
*  ~/.bash_logout

Still funny stuff and on the cool side. Vll! smile

Last edited by BLizgreat! (2017-12-27 05:52:42)

Offline

#19 2017-12-27 09:29:23

Steve
Member
Registered: 2017-01-03
Posts: 642

Re: LightDM, command line login

Then you could edit etc/motd "message of the day".

https://manpages.debian.org/jessie/manp … .5.en.html

Enter something like "Bunsenlabs" or whatever distro your using, or maybe a something like "Bash is not broken" eh Hoas wink

Offline

#20 2017-12-27 09:34:31

ohnonot
...again
Registered: 2015-09-29
Posts: 4,167
Website

Re: LightDM, command line login

oh, i will try to remember that next time i feel like giving arch-specific advice...

Offline

#21 2017-12-27 11:25:14

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: LightDM, command line login

@BLizgreat!, is there an echo in here? monkey

Blizgreat! wrote:
if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then exec startx; fi

My version does the exact same thing but quicker tongue

EDIT: also, please read this post.

If ~/.bash_profile is created in a BunsenLabs system then bash will not read ~/.profile and that file contains some important things that are needed for our desktop to work.

Last edited by Head_on_a_Stick (2017-12-27 11:27:37)


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#22 2017-12-27 11:29:51

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: LightDM, command line login

BLizgreat! wrote:

it works the same if added to the bottom of .bashrc too

It is preferable to add the test to ~/.profile because if it is added to ~/.bashrc then the test will be run every time a terminal is opened, which isn't ideal.


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#23 2017-12-27 12:55:44

BLizgreat!
Resident Babbler - vll!
Registered: 2015-10-03
Posts: 1,217

Re: LightDM, command line login

Hmmm Hoas hadn't considered that, also interesting Ohnonot, cool approach too I mean the adding a keybind to run this type of thing (nice touch.)

Offline

#24 2017-12-28 01:00:17

BLizgreat!
Resident Babbler - vll!
Registered: 2015-10-03
Posts: 1,217

Re: LightDM, command line login

Btw: Thanks for the refinement Hoas

[ "$(tty)" = "/dev/tty1" ] && exec startx

Will try that one out, the other works great, though also glad you mentioned the quirk with using .bashrc, it also didn't seem to be causing any issues but you're right and that makes sense. Moved it over to .profile again instead. This thread actually had me go ahead and forego the blessed display manager, mix of what's here and other places around the interwebz. Just changing the default via update-alternatives, works fine too.

Don't know why but will likely continue dorking with the idea too. There's a couple other approaches on the 2dork list to accomplish this, that I haven't seen anywhere else as yet. Hmmmmm ... not really sure it's worth the time/effort to bother with though.

1. rc.local ( commands to be run as user not root.)
2. @boot crontab (root can run commands as any/another user.
3. Couple others blahblah.

Really if going for a well polished user-friendly distro type thing, would still just use a DM, lightdm uses next to nothing in terms of system resources, nor adds much time to boot etc etc. Though for a personal OS, this is kinda cool.

Vll! smile

PS, Didn't work for me Hoas, was running startx on tty1 as per above. Reverted to the one 1st babbled about up there in ~/.profile. Works fine, not sure what I did wrong, not going to devote time to dorking with it to try and figure it out. Not a big deal.

Last edited by BLizgreat! (2017-12-28 01:49:57)

Offline

#25 2017-12-28 02:16:59

jr2
Member
Registered: 2017-12-24
Posts: 52

Re: LightDM, command line login

Head_on_a_Stick wrote:

...~/.profile ... that file contains some important things that are needed for our desktop to work.

NB ~/.profile is not read by lightdm (which reads ~/.xsessionrc instead) so only affects BL when using a tty.


normal service will be resumed as soon as possible

Offline

Board footer

Powered by FluxBB