You are not logged in.
Pages: 1
Topic closed
Hey guys,
First of all I wanted to say hi, since I'm new here, so here you go: HI
.
I switched from Ubuntu to Arch a couple of days ago, since I felt that breaking my system with every mayor release isn't all that pleasing.
Now I'm running Xfce via .xinitrc, no login manager.
So here's my issue:
I was trying to get "Lock Screen on Suspend" to work as described in https://wiki.archlinux.org/index.php/XS … ibernating . However, xuserrun fails:
@X220 ➜ ~ % /usr/bin/xuserrun /usr/bin/xscreensaver-command -lock
Error: Active session is not x11I examined xuserrun and found out, that loginctl tells that my session-type is "tty" rather than "x11". I'd expect an X11-session since I'm running Xfce atm, right?
Here's the loginctl output:
@X220 ➜ ~ % loginctl show-session $XDG_SESSION_ID
Id=1
Timestamp=Sun 2013-03-31 04:10:22 CEST
TimestampMonotonic=17373478
DefaultControlGroup=name=systemd:/user/mohmann/1
VTNr=1
TTY=tty1
Remote=no
Service=login
Leader=357
Audit=1
Type=tty
Class=user
Active=yes
State=active
KillProcesses=no
IdleHint=yes
IdleSinceHint=1364695821610992
IdleSinceHintMonotonic=16948179Why would my session appear as a tty-session? Am I missing something in terms of Session handling? I dont use a login manager, i just login at tty1 and xinit/zprofile does the rest (see below). Is there something, I need to do, to get my Session recognized as X11-Session rather than TTY-Session?
I have Xfce autostart like this, once i login at tty1:
@X220 ➜ ~ % cat .zprofile
# autologin on tty1
[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startxMy .xinitrc (quite default):
@X220 ➜ ~ % cat .xinitrc
#!/bin/bash
if [ -d /etc/X11/xinit/xinitrc.d ]; then
for f in /etc/X11/xinit/xinitrc.d/*; do
[ -x "$f" ] && . "$f"
done
unset f
fi
xset b off
exec startxfce4I searched google and the arch forums regarding this issue, but didn't come up with something helpful.
I kinda fixed the "Lock Screen on Suspend" issue by just changing the services' ExecStart-line to
ExecStart=DISPLAY=":0.0" /usr/bin/xscreensaver-command -lockwhich works fine as long as your Xsession is always at display :0.0. However, I'm curious about why my session is being recognized as "tty" in the first place.
Looking forward to some enlightment ![]()
Martin
Last edited by mohmann (2013-03-31 04:26:04)
Offline
If you are the only user on the machine, instead of using xuserrun, you can simply issue the xscreensaver-command alone, and then add User=%I. Then call the service xscreensaveer@.service and enable it as xscreensaver@<youruser>.
Offline
yup, that sounds reasonable, haven't even thought about that until now, will give this a try!
. But it's only some cleaner way to get my aforementioned ExecStart "hack?" done, tho. This "wrong"-session-type thing really bugs me.
Last edited by mohmann (2013-03-31 05:13:57)
Offline
I'm not sure, as I don't use one, but I think a display manager will start the session in the traditional place. I also have a service that simply runs xinit and sets some environment variables, and I have it set to start on vt7. (I use systemd --user with the Arch kernel, but I also have a CK kernel set up which does not seem compatible with user sessions due to a difference in a cgroup kernel config.)
Offline
So, essentially you "login" via xinitrc as well, rather than using a login manager? Does loginctl recognize your session as X11 then? i'm starting to believe that just logging in and starting your DE isn't sufficient to get the session info right.
Greets
Martin
Last edited by mohmann (2013-04-01 06:19:47)
Offline
on ubuntu(startx)
```bash
sudo vim /etc/systemd/system/getty.target.wants/getty@tty1.service
```
add
```
Environment=XDG_SESSION_TYPE=x11
```
reboot
Last edited by yuzx2008 (2022-03-24 01:39:34)
Offline
I was about to shit on the OP for "I'm new - registered 9 years ago" … please don't necrobump. Also the bbs doesn't do markdown, https://bbs.archlinux.org/help.php#bbcode
Offline
Closing this old topic, don't necrobump.
Offline
Pages: 1
Topic closed