Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Problems with startx and probably i3
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
mymemeganoowontwork
n00b
n00b


Joined: 18 Aug 2018
Posts: 7

PostPosted: Sat Aug 18, 2018 12:25 pm    Post subject: Problems with startx and probably i3 Reply with quote

For the last few days I have been trying to get my i3 to autostart at login but nothing seems to work. I have this in my ~/.xinitrc
Code:
exec i3
and this in my ~/.bash_profile
Code:
if [ -z "$DISPLAY" -a $XDG_VTNR -eq 1 ]; then
  startx
fi


This should do everything I want, xinit executes i3 and bash_profile runs startx, right? But when I login to my user nothing happens, I need to manually startx to run i3. I specifically would like not to use display manager but to just login from the tty.
https://wiki.gentoo.org/wiki/Xorg/Guide#Using_startx "To set a system wide default session run:"
Code:
echo XSESSION="Xfce4" > /etc/env.d/90xsession
So if I want system wide default session run do I put i3 there or what? And will this make it so that it happens after login?
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


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

PostPosted: Sat Aug 18, 2018 12:31 pm    Post subject: Reply with quote

Code:
if [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then
  exec startx
fi


And are you sure you're running it from console 1?
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
mymemeganoowontwork
n00b
n00b


Joined: 18 Aug 2018
Posts: 7

PostPosted: Sat Aug 18, 2018 1:44 pm    Post subject: Reply with quote

I replaced that
Code:
if [ -z "$DISPLAY" -a $XDG_VTNR -eq 1 ]; then
  startx
fi


in my ~/.bash_profile with:

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


It seems to be working fine now, it did start i3 after login. Is this fine like this, like it wont conflict with anything or is there a better way to do this?
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


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

PostPosted: Sat Aug 18, 2018 1:48 pm    Post subject: Reply with quote

You can modify it, if you ever plan to startx from anything other than the first console.

https://wiki.archlinux.org/index.php/Xinit#Autostart_X_at_login

Other than the above hints, it should be fine.

Edit to add: you could have used the original -z, -a and -eq, the difference being the double brackets.


https://stackoverflow.com/questions/669452/is-double-square-brackets-preferable-over-single-square-brackets-in-ba
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
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