Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How do i start my session from tty?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
picarica
Apprentice
Apprentice


Joined: 11 Aug 2018
Posts: 189

PostPosted: Thu Nov 21, 2019 5:07 pm    Post subject: How do i start my session from tty? Reply with quote

hello so i have pretty wild setup right here
now i have Ligthdm with xfce4-session and with i3-wm
it will be easier to show you i guess
but right now i have this in .xinit
Code:
ck-launch-session dbus-launch --sh-syntax --exit-with-session xfce4-session

whcih works fine when i login using lightdm
but when i uninstall lightdm and i type startx from tty it says some errors and fails

but when i type startxfce4 it works but panel does not have gtk theme and crashers after while, if i reopen it it has gtk theme and everything
same with thunar if i open it first time it doesn use my gtk theme, but if o close the process and reopen it works normally

what is causing this ? how do i make my pc start session after login ?

right now i have autologin on tty functional but i want to start session too

i am using zsh, so when i treid this
Code:

unset -v HOME # Force bash to obtain its value for HOME from getpwent(3) on first use, so tilde-expansion is sane.
if shopt -q login_shell; then
    [[ -f ~/.bashrc ]] && source ~/.bashrc
    [[ -t 0 && $(tty) == /dev/tty1 && ! $DISPLAY ]] && exec startx
else
    exit 1 # Somehow this is a non-bash or non-login shell.
fi

and i got some error taking about xdm etc.

how do i make this work ?
Back to top
View user's profile Send private message
etnull
Apprentice
Apprentice


Joined: 26 Mar 2019
Posts: 289

PostPosted: Thu Nov 21, 2019 6:11 pm    Post subject: Reply with quote

zsh must be using its own .zshrc
You first should fix your startx error before trying to set up auto run of X session, provide the error which you get when you type startx or xinit from tty
Back to top
View user's profile Send private message
apurkrt
Tux's lil' helper
Tux's lil' helper


Joined: 26 Feb 2011
Posts: 99
Location: Czechia, Europe

PostPosted: Thu Nov 21, 2019 7:41 pm    Post subject: Reply with quote

Hi, I have added this at the end of ~/.bash_profile

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


i.e. on /dev/tty1 startx is executed after login - and I start xfce from ~/.xinitrc with the command

Code:
startxfce4 --with-ck-launch


Hope this helps.
Back to top
View user's profile Send private message
picarica
Apprentice
Apprentice


Joined: 11 Aug 2018
Posts: 189

PostPosted: Thu Nov 21, 2019 8:01 pm    Post subject: Reply with quote

etnull wrote:
zsh must be using its own .zshrc
You first should fix your startx error before trying to set up auto run of X session, provide the error which you get when you type startx or xinit from tty


the error is,
hostname: unknown host
even tho my /etc/conf.d/hostname is

Code:

cat /etc/conf.d/hostname
# Set to the hostname of this machine
#hostname="Beast"
HOSTNAME="partridge"
127.0.0.1 localhost partridge



also it keep getting this error when in tty
Code:

zle-line-init:echoti: no such terminfo capability:smkx
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3086

PostPosted: Fri Nov 22, 2019 6:27 am    Post subject: Reply with quote

picarica wrote:
the error is,
hostname: unknown host
even tho my /etc/conf.d/hostname is

Code:

cat /etc/conf.d/hostname
# Set to the hostname of this machine
#hostname="Beast"
HOSTNAME="partridge"
127.0.0.1 localhost partridge


Imo the line 127.0.0.1 localhost partridge is misplaced and might go into /etc/hosts
Back to top
View user's profile Send private message
picarica
Apprentice
Apprentice


Joined: 11 Aug 2018
Posts: 189

PostPosted: Sat Nov 23, 2019 2:16 am    Post subject: Reply with quote

charles17 wrote:
picarica wrote:
the error is,
hostname: unknown host
even tho my /etc/conf.d/hostname is

Code:

cat /etc/conf.d/hostname
# Set to the hostname of this machine
#hostname="Beast"
HOSTNAME="partridge"
127.0.0.1 localhost partridge


Imo the line 127.0.0.1 localhost partridge is misplaced and might go into /etc/hosts


ok so the hostname issue is fixed
now the proble miss that startx still doesnt work
i cannot copy the error meassage so here is panorama of a whole error

and no i cannot copy it, not even throguht xclip i tried
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3086

PostPosted: Sat Nov 23, 2019 7:40 am    Post subject: Reply with quote

Have you checked the Using startx section of the wiki article?
You could save the screen output to a file. e.g.
Code:
$ startx > /tmp/startx_errors 2>&1
Back to top
View user's profile Send private message
etnull
Apprentice
Apprentice


Joined: 26 Mar 2019
Posts: 289

PostPosted: Sat Nov 23, 2019 11:19 am    Post subject: Reply with quote

You have some problems with your shell, do "echo $0" and check which shell you are using after login.
Try bash first, fix your startx in bash, then work on what's wrong with the "no such terminfo capability:smkx"
Back to top
View user's profile Send private message
picarica
Apprentice
Apprentice


Joined: 11 Aug 2018
Posts: 189

PostPosted: Sat Nov 23, 2019 2:02 pm    Post subject: Reply with quote

charles17 wrote:
Have you checked the Using startx section of the wiki article?
You could save the screen output to a file. e.g.
Code:
$ startx > /tmp/startx_errors 2>&1


your command said to me in bash ambigious redirect and in zsh no such file or directory

but when i replace the &1 to &0 i got this
Code:



X.Org X Server 1.20.6
X Protocol Version 11, Revision 0
Build Operating System: Linux 5.3.9-gentoo x86_64 Gentoo
Current Operating System: Linux partridge 5.3.9-gentoo #1 SMP Fri Nov 8 08:30:33 CET 2019 x86_64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.3.9-gentoo root=UUID=049f07ea-2dea-4234-b0e7-590a0e100091 ro quiet splash
Build Date: 23 November 2019  02:31:53AM
 
Current version of pixman: 0.38.4
   Before reporting problems, check http://wiki.x.org
   to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
   (++) from command line, (!!) notice, (II) informational,
   (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Sat Nov 23 14:58:40 2019
(==) Using config file: "/etc/X11/xorg.conf"
(==) Using config directory: "/etc/X11/xorg.conf.d"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Unsupported high keycode 372 for name <I372> ignored
>                   X11 cannot support keycodes above 255.
>                   This warning only shows for the first high keycode.
Errors from xkbcomp are not fatal to the X server
/home/picarica/.xinitrc: line 3: ck-launch-session: command not found
xinit: connection to X server lost

waiting for X server to shut down (II) Server terminated successfully (0). Closing log file.

didnt worked what it should supossed to do ?


echo$0 did this in zsh -zsh and in bash bash
Back to top
View user's profile Send private message
etnull
Apprentice
Apprentice


Joined: 26 Mar 2019
Posts: 289

PostPosted: Sat Nov 23, 2019 4:40 pm    Post subject: Reply with quote

Lower the amount of unknowns which can give you problem. Get rid of zsh for now. What's this: ck-launch-session, why are you using additional options instead of just calling "exec startxfce4"? Provide the full content of your .bashrc ; .xinitrc ; .bash_profile. Did you install your X to run rootless or any other modifications worth mentioning?
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 14972

PostPosted: Sat Nov 23, 2019 5:20 pm    Post subject: Reply with quote

picarica wrote:
charles17 wrote:
Have you checked the Using startx section of the wiki article?
You could save the screen output to a file. e.g.
Code:
$ startx > /tmp/startx_errors 2>&1
your command said to me in bash ambigious redirect and in zsh no such file or directory
That command works fine for me here. Please show exactly what you ran, and the output of /proc/self/exe --version.
Back to top
View user's profile Send private message
Chiitoo
Administrator
Administrator


Joined: 28 Feb 2010
Posts: 1993
Location: Here and Away Again

PostPosted: Sat Nov 23, 2019 5:37 pm    Post subject: ><)))°€ Reply with quote

etnull wrote:
What's this: ck-launch-session, why are you using additional options instead of just calling "exec startxfce4"?

Likely a consolekit remnant.

Does the system use elogind or systemd? If so, it shouldn't be using consolekit.

Since the command isn't found, consolekit is probably not installed, and as such, 'ck-launch-session' should not be called for. :]
_________________
Kind regards,
Chiitoo.

You might remember me from Gentoo projects such as Forums, LXQt, Qt, and Wine.
Back to top
View user's profile Send private message
picarica
Apprentice
Apprentice


Joined: 11 Aug 2018
Posts: 189

PostPosted: Sat Nov 23, 2019 6:11 pm    Post subject: Reply with quote

etnull wrote:
Lower the amount of unknowns which can give you problem. Get rid of zsh for now. What's this: ck-launch-session, why are you using additional options instead of just calling "exec startxfce4"? Provide the full content of your .bashrc ; .xinitrc ; .bash_profile. Did you install your X to run rootless or any other modifications worth mentioning?


i dont run startxfce4 because when i do i gtk doesnt work like this i have these errors eveywhere in thunar panel etc.

Code:

alias Bashrc='doas vim ~/.bashrc'
alias Makeconf='doas vim /etc/portage/make.conf'
alias Gentoo-upgrade='doas emerge --sync && doas layman -S && doas emerge --ask --quiet --update --newuse --deep @world && doas emerge --quiet @smart-live-rebuild && doas emerge --depclean && echo -e "\e[1;31mFull System Upgrade Complete \e[0m" && notify-send "Full System Upgrade Complete"'
alias music='mpv --no-audio-display --no-resume-playback --shuffle /home/picarica/Desktop/Hudba/*'
alias Gentoo-upgrade-nosync='doas emerge --ask --quiet --update --newuse --deep @world && doas emerge --quiet @smart-live-rebuild && doas emerge --depclean && echo -e "\e[1;31mFull System Upgrade Complete \e[0m" && notify-send "Full System Upgrade Complete"'
alias Youtubemp3='youtube-dl -x --audio-format mp3  --audio-quality 0'
alias layman-list='eix --installed-from-overlay'
alias WOW='WINEPREFIX=/home/picarica/.wow/ wine /home/picarica/torrenty/World\ of\ Warcraft\ -\ The\ Burning\ Crusade\ 2.4.3/Wow.exe'
alias Cemu='WINEPREFIX=/home/picarica/.cemu/ wine /home/picarica/cemu_1.13.0/Cemu.exe'
exec zsh


this is my bashrc but it just execuses zsh
here is my zshrc

Code:

 ~  cacat .xinitrc
#!/bin/sh
#exec startxfce4
ck-launch-session dbus-launch --sh-syntax --exit-with-session xfce4-session

here is my xinitrc

my bash_profile is non-existent
but i dot have zsh_profile
Code:

unset -v HOME # Force bash to obtain its value for HOME from getpwent(3) on first use, so tilde-expansion is sane.
if shopt -q login_shell; then
   [[ -f ~/.zshrc ]] && source ~/.zshrc
   [[ -t 0 && $(tty) == /dev/tty1 && ! $DISPLAY ]] && exec startx
else
    exit 1 # Somehow this is a non-bash or non-login shell.
fi


like this

also yes i didt enabled rootles login in tty0
Back to top
View user's profile Send private message
picarica
Apprentice
Apprentice


Joined: 11 Aug 2018
Posts: 189

PostPosted: Sat Nov 23, 2019 6:12 pm    Post subject: Reply with quote

Hu wrote:
picarica wrote:
charles17 wrote:
Have you checked the Using startx section of the wiki article?
You could save the screen output to a file. e.g.
Code:
$ startx > /tmp/startx_errors 2>&1
your command said to me in bash ambigious redirect and in zsh no such file or directory
That command works fine for me here. Please show exactly what you ran, and the output of /proc/self/exe --version.


uhhhhh
Code:

/proc/self/exe --version.
/proc/self/exe: no such option: version.
Back to top
View user's profile Send private message
picarica
Apprentice
Apprentice


Joined: 11 Aug 2018
Posts: 189

PostPosted: Sat Nov 23, 2019 6:13 pm    Post subject: Re: ><)))°€ Reply with quote

Chiitoo wrote:
etnull wrote:
What's this: ck-launch-session, why are you using additional options instead of just calling "exec startxfce4"?

Likely a consolekit remnant.

Does the system use elogind or systemd? If so, it shouldn't be using consolekit.

Since the command isn't found, consolekit is probably not installed, and as such, 'ck-launch-session' should not be called for. :]


yes i dont use elogind or systemd i use openrc system and dont know what elogind is but i have consolekit installed, well not yet because i have problems mergint it but i will have in a day or two

but even with this in xinit i still managed to login using lightdm
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 3547
Location: Illinois, USA

PostPosted: Sat Nov 23, 2019 7:12 pm    Post subject: Reply with quote

I use Openrc, no systemd, no elogind, no consolekit. ck-launch-session doesn't exist. I'm 99% sure it's part of consolekit2.
Quote:
but even with this in xinit i still managed to login using lightdm
lightdm probably has a fallback when the command fails.
Run "equery b ck-launch-session" and if you run one of the locates, try "locate ck-launch-session". I'll bet it either doesn't exist or doesn't belong to any installed package.

More on lightdm. I can't say I'm familiar with it, but most dm's have a string of "if"s that they run to find one that works.

Problems emerging consolekit? Not that I'm saying you should be emerging consolekit, far from it, but maybe your problem is a messed up install. What do you get from "emerge -puvND @world" ?
I don't have xfce4, but I think there is supposed to be a script in /etc/X11/Sessions

IMHO, the more you mess with these bloated kits, the more fragile your system will be.
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 3547
Location: Illinois, USA

PostPosted: Sat Nov 23, 2019 7:28 pm    Post subject: Reply with quote

Had an inspiration, my Raspberry pi runs XFCE from Sakaki's build.
Code:
raspy ~ # locate ck-launch-session
/usr/bin/ck-launch-session
/usr/share/man/man1/ck-launch-session.1.bz2
raspy ~ # equery b /usr/bin/ck-launch-session
 * Searching for /usr/bin/ck-launch-session ...
sys-auth/consolekit-1.2.1 (/usr/bin/ck-launch-session)

Yep. You can't run a program that has installation problems.
Code:
raspy /etc/X11/Sessions # ls -l /etc/X11/Sessions
total 8
lrwxrwxrwx 1 root root    5 Apr 13  2018 Xfce -> Xfce4
-rwxr-xr-x 1 root root   11 Apr 13  2018 Xfce4
-rwxr-xr-x 1 root root 2187 Mar 19  2018 Xsession
Code:
raspy /etc/X11/Sessions # cat Xfce4
startxfce4

Paydirt seems to be here:
Code:
raspy /etc/X11/Sessions # cat  Xsession
#!/bin/sh
# $XConsortium: Xsession /main/10 1995/12/18 18:21:28 gildea $

case $# in
1)
   case $1 in
   failsafe)
      exec xterm -geometry 80x24-0-0
      ;;
   esac
esac

# redirect errors to a file in user's home directory if we can
for errfile in "$HOME/.xsession-errors" "${TMPDIR-/tmp}/xses-$USER" "/tmp/xses-$USER"
do
   if ( cp /dev/null "$errfile" 2> /dev/null )
   then
      chmod 600 "$errfile"
      exec > "$errfile" 2>&1
      break
   fi
done

# clean up after xbanner
if which freetemp 2> /dev/null ; then
   freetemp
fi

startup=$HOME/.xsession

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
userxkbmap=$HOME/.Xkbmap

sysresources=/etc/X11/Xresources
sysmodmap=/etc/X11/Xmodmap
sysxkbmap=/etc/X11/Xkbmap

rh6sysresources=/etc/X11/xinit/Xresources
rh6sysmodmap=/etc/X11/xinit/Xmodmap


# merge in defaults
if [ -f "$rh6sysresources" ]; then
    xrdb -merge "$rh6sysresources"
fi

if [ -f "$sysresources" ]; then
    xrdb -merge "$sysresources"
fi

if [ -f "$userresources" ]; then
    xrdb -merge "$userresources"
fi

# merge in keymaps
if [ -f "$sysxkbmap" ]; then
    setxkbmap `cat "$sysxkbmap"`
    XKB_IN_USE=yes
fi

if [ -f "$userxkbmap" ]; then
    setxkbmap `cat "$userxkbmap"`
    XKB_IN_USE=yes
fi

#
# Eeek, this seems like too much magic here
#
if [ -z "$XKB_IN_USE" -a ! -L /etc/X11/X ]; then
    if grep '^exec.*/Xsun' /etc/X11/X > /dev/null 2>&1 && [ -f /etc/X11/XF86Config ]; then
       xkbsymbols=`sed -n -e 's/^[     ]*XkbSymbols[   ]*"\(.*\)".*$/\1/p' /etc/X11/XF86Config`
       if [ -n "$xkbsymbols" ]; then
           setxkbmap -symbols "$xkbsymbols"
           XKB_IN_USE=yes
       fi
    fi
fi

# xkb and xmodmap don't play nice together
if [ -z "$XKB_IN_USE" ]; then
    if [ -f "$rh6sysmodmap" ]; then
       xmodmap "$rh6sysmodmap"
    fi

    if [ -f "$sysmodmap" ]; then
       xmodmap "$sysmodmap"
    fi

    if [ -f "$usermodmap" ]; then
       xmodmap "$usermodmap"
    fi
fi

unset XKB_IN_USE

if [ -x "$startup" ]; then
   exec "$startup"
elif [ -x "$HOME/.Xclients" ]; then
   exec "$HOME/.Xclients"
elif [ -x /etc/X11/xinit/Xclients ]; then
   exec /etc/X11/xinit/Xclients
elif [ -x /etc/X11/Xclients ]; then
   exec /etc/X11/Xclients
else
   exec xsm
fi
Back to top
View user's profile Send private message
etnull
Apprentice
Apprentice


Joined: 26 Mar 2019
Posts: 289

PostPosted: Sat Nov 23, 2019 9:16 pm    Post subject: Reply with quote

Quote:
/proc/self/exe --version.
/proc/self/exe: no such option: version.

Something seriously messed up with your shell or you running this under zsh.

I have no more suggestions. If it was my problem I would try to get my system to the more basic state, that means no lightdm, switching back to bash, I don't have consolekit so I would delete it also, and then after emerge -av --depclean and emerge --ask @preserved-rebuild I would try the most basic .xinitrc:
Quote:
#!/bin/sh
exec startxfce4

and startx or xinit from tty. It should work without lightdm or consolekit, that what I would do.
Back to top
View user's profile Send private message
picarica
Apprentice
Apprentice


Joined: 11 Aug 2018
Posts: 189

PostPosted: Sun Nov 24, 2019 1:51 pm    Post subject: Reply with quote

etnull wrote:
Quote:
/proc/self/exe --version.
/proc/self/exe: no such option: version.

Something seriously messed up with your shell or you running this under zsh.

I have no more suggestions. If it was my problem I would try to get my system to the more basic state, that means no lightdm, switching back to bash, I don't have consolekit so I would delete it also, and then after emerge -av --depclean and emerge --ask @preserved-rebuild I would try the most basic .xinitrc:
Quote:
#!/bin/sh
exec startxfce4

and startx or xinit from tty. It should work without lightdm or consolekit, that what I would do.


so sorry yes i ran it in zsh in bash i got this output
Code:

picarica@picarica ~ $ /proc/self/exe --version
GNU bash, version 5.0.11(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.


and the startxfce4 work but like i said the gtk doesnt work after hours i also managed to install consolekit and launched my session with the ck-launch command but the problem were the same, no gtk and starting time is so long
so i still have no idea why it doesnt work normally throught startx :/
Back to top
View user's profile Send private message
Anon-E-moose
Advocate
Advocate


Joined: 23 May 2008
Posts: 4405
Location: Dallas area

PostPosted: Sun Nov 24, 2019 3:10 pm    Post subject: Reply with quote

lightdm is probably setting some variables that get inherited, and startx* doesn't do that.

You need to see what the environment has inside lightdm and then the same with startx and that's where you'll find the difference

look at ps to see what parameters are being passed to xfce.
_________________
PRIME x570-pro, 3700x, RX 550 & 560, 5.5.15 zen kernel, gcc 9.3.0
Acer E5-575 (laptop), i3-7100u - i965, 5.0.13 zen kernel, gcc 8.2.0
---both---
profile 17.1 (no-pie & modified) amd64-no-multilib eudev, openrc, openbox, palemoon
Back to top
View user's profile Send private message
picarica
Apprentice
Apprentice


Joined: 11 Aug 2018
Posts: 189

PostPosted: Sun Nov 24, 2019 5:08 pm    Post subject: Reply with quote

Anon-E-moose wrote:
lightdm is probably setting some variables that get inherited, and startx* doesn't do that.

You need to see what the environment has inside lightdm and then the same with startx and that's where you'll find the difference

look at ps to see what parameters are being passed to xfce.


okay first of all, great idea but where do i have to look at? what ps

what i did was to copy /etc/light/Xsession to /etc/X11/Xsession

so i replaced the old one but that did nothing so :/ what next
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 14972

PostPosted: Tue Nov 26, 2019 3:03 am    Post subject: Reply with quote

etnull wrote:
Quote:
/proc/self/exe --version.
/proc/self/exe: no such option: version.
Something seriously messed up with your shell or you running this under zsh.
Actually, that's just basic user error. I used bold tags to delimit the command I wanted him to run, and left the period outside the bold block. He included the period in the command despite this, and though his shell probably understands --version, it would be very surprising for it to understand --version., hence the error message.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum