You are not logged in.
@BLizgreat!, is there an echo in here? 8o
if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then exec startx; fi
My version does the exact same thing but quicker
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)
Offline
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.
Offline
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
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!
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
...~/.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
^ Yes, good point, I should have mentioned that.
Didn't work for me Hoas
That's very strange because I've just used that method in a fresh installation (Helium-dev) and it works just fine in my Debian, Arch, Alpine & OpenBSD systems.
All the test is doing is running the `tty` command and launching `startx` if the output is "/dev/tty1" so perhaps try running `tty` from the actual console screen.
Your posted code just checks if $DISPLAY is set as well and that will never be the case if `tty` outputs "/dev/tty1" so it is entirely superfluous.
Also, if your check worked then my check must also work because it is checking the exact same command output before running `startx` so I really think you must be experiencing a PEBKAC error.
Offline
I don't get it either, just didn't work. Am burnt out on this topic. Though going to leave OS w/o a display manager for awhile just cause. It's going on the 2dork list and I'll mess with again soon no doubt. Lol ... maybe sometime tonight. Definitely no expert in this topic, what I have works for now though always sounds good to do it a cleaner/better way to me. Sounds like a good general guideline no matter what. One of the many joys of all this gnu/Nixy kickbuttness, always seems to be many ways to accomplish dang near anything but yeah, rather do it the more proper way whenever possible.
Only now somewhat getting to the point where I'm feeling ready to really start messing with stuff.
Vll!
@Hoas ... would you mind posting a clear cut example of that section of your ~/.profile file. Just to make it painfully clear to everybody. Only got a couple hours sleep last night, went to work, head isn't all that clear atm. Hopefully some coffee will help too.
Last edited by BLizgreat! (2017-12-28 23:44:36)
Offline
would you mind posting a clear cut example of that section of your ~/.profile file.
This is the entire file for Arch:
Xanadu: ~ $ cat ~/.profile
export PAGER='most'
export EDITOR='ed'
export VISUAL='vim'
export BROWSER='firefox'
export PATH="${HOME}/bin:$PATH"
export QT_QPA_PLATFORMTHEME='gtk2'
export QT_PLATFORMTHEME='gtk2'
export QT_PLATFORM_PLUGIN='gtk2'
[ "$SHELL" = "/bin/loksh" ] && export ENV="${HOME}/.lokshrc"
case "$(tty)" in
/dev/tty1) exec startx;;
/dev/tty2) exec startx /usr/bin/kodi;;
/dev/tty3) exec startx /usr/bin/openbox;;
esac
Xanadu: ~ $
Note that the order is important: anything after an `exec` command will not be read so that's probably what you've done.
For completeness sake, here is the file from my BunsenLabs (Helium-dev) system:
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
#
# Modified version provided by bunsen-configs.
#
# NOTE this file is not sourced by lightdm when logging in to X sessions.
# Use .xsessionrc for graphical sessions.
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
# include sbin in PATH
if [ -d "/sbin" ] ; then
PATH="/sbin:$PATH"
fi
if [ -d "/usr/sbin" ] ; then
PATH="/usr/sbin:$PATH"
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
# set tty colours to match .Xresources scheme.
if [ "$TERM" = "linux" ]; then
printf "\e]P0000000" # color0
printf "\e]P19e1828" # color1
printf "\e]P2aece92" # color2
printf "\e]P3968a38" # color3
printf "\e]P4414171" # color4
printf "\e]P5963c59" # color5
printf "\e]P6418179" # color6
printf "\e]P7bebebe" # color7
printf "\e]P8888888" # color8
printf "\e]P9cf6171" # color9
printf "\e]PAc5f779" # color10
printf "\e]PBfff796" # color11
printf "\e]PC4186be" # color12
printf "\e]PDcf9ebe" # color13
printf "\e]PE71bebe" # color14
printf "\e]PFffffff" # color15
# clear # removes artefacts but also removes /etc/{issue,motd}
fi
[ "$(tty)" = "/dev/tty1" ] && exec startx
Note again that `exec startx` is the last line — if I add anything after that line then it is not read at all. EDIT: unless the login is not at TTY1, ofc.
Last edited by Head_on_a_Stick (2017-12-29 00:04:48)
Offline
^ Thanks will do a bit of comparison later. It was added to the end of file EOF and far as know is tty1 but still obviously I missed something, no worries.
Update: Ok works ... thanks Hoas, still not sure wth happened ... still doesn't really matter.
Last edited by BLizgreat! (2017-12-29 01:27:15)
Offline