Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Trying to run a script before LightDM
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Sadsandman
n00b
n00b


Joined: 18 Sep 2023
Posts: 5

PostPosted: Sun Oct 29, 2023 6:21 am    Post subject: Trying to run a script before LightDM Reply with quote

Hello, i installed Gentoo and tried to install NVIDIA drivers, i was not getting any image(only blank screen on my laptop) but after i connected the HDMI all was working normally on the second screen, then i ran the command bellow and then i got image on both of my screens.

Code:

 xrand --setprovideroutputsource modesetting NVIDIA-0
 xrand --auto
 


I created a sh file usr/local/bin/prepare-optimus.sh, then made chmod +x to the file and added on lightdm config as bellow

Code:

 #etc/lightdm/lightdm.conf
greeter-setup-script=/usr/local/bin/prepare-optimus.sh




but on the log of ligthdm it appears
Code:

#DEBUG: [LightDM] contains unkown option greeter-setup-script


How could I make this work?. thanks in advance
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3918

PostPosted: Sun Oct 29, 2023 10:52 am    Post subject: Reply with quote

You should have in lightdm.conf
Code:

display-setup-script=/usr/local/bin/prepare-optimus.sh


not
greeter-setup-script
_________________
:)
Back to top
View user's profile Send private message
Sadsandman
n00b
n00b


Joined: 18 Sep 2023
Posts: 5

PostPosted: Sun Oct 29, 2023 2:44 pm    Post subject: Reply with quote

alamahant wrote:
You should have in lightdm.conf
Code:

display-setup-script=/usr/local/bin/prepare-optimus.sh


not
greeter-setup-script


now the log shows
Code:

[+0.03s] DEBUG: Loading configuration from /etc/lightdm/lightdm.conf
[+0.03s] DEBUG:   [LightDM] contains unknown option display-setup-script
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3918

PostPosted: Sun Oct 29, 2023 3:14 pm    Post subject: Reply with quote

Please post your full lightdm.log.
I suspect the problem is different.
Do you have a xorg.conf for nvidia?
Also plz pastebin your ~/.local/share/xorg/Xorg.0.log
_________________
:)
Back to top
View user's profile Send private message
Sadsandman
n00b
n00b


Joined: 18 Sep 2023
Posts: 5

PostPosted: Sun Oct 29, 2023 4:39 pm    Post subject: Reply with quote

alamahant wrote:
Please post your full lightdm.log.
I suspect the problem is different.
Do you have a xorg.conf for nvidia?
Also plz pastebin your ~/.local/share/xorg/Xorg.0.log


this is the full log of lightdm
Code:

[+0.03s] DEBUG: Logging to /var/log/lightdm/lightdm.log
[+0.03s] DEBUG: Starting Light Display Manager 1.32.0, UID=0 PID=2375
[+0.03s] DEBUG: Loading configuration dirs from /usr/share/lightdm/lightdm.conf.d
[+0.03s] DEBUG: Loading configuration dirs from /usr/local/share/lightdm/lightdm.conf.d
[+0.03s] DEBUG: Loading configuration dirs from /etc/xdg/lightdm/lightdm.conf.d
[+0.03s] DEBUG: Loading configuration from /etc/lightdm/lightdm.conf
[+0.03s] DEBUG:   [LightDM] contains unknown option display-setup-script
[+0.03s] DEBUG: Registered seat module local
[+0.03s] DEBUG: Registered seat module xremote
[+0.03s] DEBUG: Using D-Bus name org.freedesktop.DisplayManager
[+0.08s] DEBUG: Using cross-namespace EXTERNAL authentication (this will deadlock if server is GDBus < 2.73.3)
[+0.13s] DEBUG: _g_io_module_get_default: Found default implementation local (GLocalVfs) for ‘gio-vfs’
[+0.14s] DEBUG: Monitoring logind for seats
[+0.14s] DEBUG: New seat added from logind: seat0
[+0.14s] DEBUG: Seat seat0: Loading properties from config section Seat:*
[+0.14s] DEBUG: Seat seat0 has property CanMultiSession=no
[+0.14s] DEBUG: Seat seat0: Starting
[+0.14s] DEBUG: Seat seat0: Creating greeter session
[+0.16s] DEBUG: Seat seat0: Creating display server of type x
[+0.16s] DEBUG: Could not run plymouth --ping: Failed to execute child process “plymouth” (No such file or directory)
[+0.16s] DEBUG: Using VT 7
[+0.16s] DEBUG: Seat seat0: Starting local X display on VT 7
[+0.16s] DEBUG: XServer 0: Logging to /var/log/lightdm/x-0.log
[+0.16s] DEBUG: XServer 0: Writing X server authority to /var/run/lightdm/root/:0
[+0.16s] DEBUG: XServer 0: Launching X Server
[+0.16s] DEBUG: Launching process 2423: /usr/bin/X :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
[+0.16s] DEBUG: XServer 0: Waiting for ready signal from X server :0
[+0.16s] DEBUG: Acquired bus name org.freedesktop.DisplayManager
[+0.16s] DEBUG: Registering seat with bus path /org/freedesktop/DisplayManager/Seat0
[+0.19s] WARNING: Error getting user list from org.freedesktop.Accounts: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.Accounts was not provided by any .service files
[+0.19s] DEBUG: Loading user config from /etc/lightdm/users.conf
[+0.23s] DEBUG: User sadsandman added
[+8.26s] DEBUG: Got signal 10 from process 2423
[+8.26s] DEBUG: XServer 0: Got signal from X server :0
[+8.26s] DEBUG: XServer 0: Connecting to XServer :0
[+8.26s] DEBUG: Seat seat0: Display server ready, starting session authentication
[+8.27s] DEBUG: Session pid=2712: Started with service 'lightdm-greeter', username 'root'
[+8.51s] DEBUG: Session pid=2712: Authentication complete with return value 0: Success
[+8.51s] DEBUG: Seat seat0: Session authenticated, running command
[+8.51s] DEBUG: Session pid=2712: Running command /usr/sbin/lightdm-gtk-greeter
[+8.51s] DEBUG: Creating shared data directory /var/lib/lightdm-data/root
[+8.51s] DEBUG: Session pid=2712: Logging to /var/log/lightdm/seat0-greeter.log
[+8.65s] DEBUG: Activating VT 7
[+8.65s] DEBUG: Activating login1 session 1
[+8.65s] DEBUG: Seat seat0 changes active session to 1
[+8.65s] DEBUG: Session 1 is already active
[+10.22s] DEBUG: Greeter connected version=1.32.0 api=1 resettable=false
[+11.39s] DEBUG: Greeter start authentication for sadsandman
[+11.39s] DEBUG: Session pid=2826: Started with service 'lightdm', username 'sadsandman'
[+11.44s] DEBUG: Session pid=2826: Got 1 message(s) from PAM
[+11.44s] DEBUG: Prompt greeter with 1 message(s)
[+13.74s] DEBUG: Continue authentication
[+13.79s] DEBUG: Session pid=2826: Authentication complete with return value 0: Success
[+13.79s] DEBUG: Authenticate result for user sadsandman: Success
[+13.79s] DEBUG: User sadsandman authorized
[+13.80s] DEBUG: Greeter sets language C.utf8
[+13.88s] DEBUG: Greeter requests session xmonad
[+13.88s] DEBUG: Seat seat0: Stopping greeter; display server will be re-used for user session
[+13.88s] DEBUG: Terminating login1 session 1
[+13.88s] DEBUG: Session pid=2712: Sending SIGTERM
[+13.89s] DEBUG: Seat seat0 changes active session to
[+14.16s] DEBUG: Greeter closed communication channel
[+14.16s] DEBUG: Session pid=2712: Exited with return value 0
[+14.16s] DEBUG: Seat seat0: Session stopped
[+14.16s] DEBUG: Seat seat0: Greeter stopped, running session
[+14.16s] DEBUG: Registering session with bus path /org/freedesktop/DisplayManager/Session0
[+14.16s] DEBUG: Session pid=2826: Running command /etc/lightdm/Xsession /etc/X11/Sessions/xmonad
[+14.16s] DEBUG: Creating shared data directory /var/lib/lightdm-data/sadsandman
[+14.16s] DEBUG: Session pid=2826: Logging to .xsession-errors
[+14.23s] DEBUG: Activating VT 7
[+14.23s] DEBUG: Activating login1 session 2
[+14.23s] DEBUG: Seat seat0 changes active session to 2
[+14.23s] DEBUG: Session 2 is already active


and this is the Xorg.conf
Code:

# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 535.113.01

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
    Inactive       "InactiveDevice1"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "InputDevice"
    # generated from data in "/etc/conf.d/gpm"
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol"
    Option         "Device" "/dev/input/mice"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BusID          "PCI:1:0:0"
EndSection

Section "Device"
    Identifier     "InactiveDevice1"
    Driver         "modesetting"
    VendorName     "Unknown"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "AllowEmptyInitialConfiguration" "True"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection
Back to top
View user's profile Send private message
mrbassie
l33t
l33t


Joined: 31 May 2013
Posts: 823
Location: Go past the sign for cope, right at the sign for seethe. If you see the target you've missed it.

PostPosted: Sun Oct 29, 2023 5:58 pm    Post subject: Reply with quote

Do you use a DE? I have a similar script (xmodmap not xrandr) to disable some mouse buttons in my homedir which I added to the startup and shutdown->autostart in kde, I'd imagine gnome/mate etc have something similar. I suppose you could add the xrandr commands to .bashrc as well.
_________________
I spent a christmas in Vienna twenty something years ago. It was a beautiful city. Everyone was so friendly.
Back to top
View user's profile Send private message
Sadsandman
n00b
n00b


Joined: 18 Sep 2023
Posts: 5

PostPosted: Sun Oct 29, 2023 6:52 pm    Post subject: Reply with quote

mrbassie wrote:
Do you use a DE? I have a similar script (xmodmap not xrandr) to disable some mouse buttons in my homedir which I added to the startup and shutdown->autostart in kde, I'd imagine gnome/mate etc have something similar. I suppose you could add the xrandr commands to .bashrc as well.


Right now im using Xmonad with Lightdm, the problem is that there is only a black screen if there is no second monitor connected to my laptop. thanks why im trying to get the command execute before lightdm as in the manual, but lightdm conf doesnt recognize de parameter
Back to top
View user's profile Send private message
Sadsandman
n00b
n00b


Joined: 18 Sep 2023
Posts: 5

PostPosted: Sat Nov 04, 2023 11:50 pm    Post subject: Reply with quote

alamahant wrote:
Please post your full lightdm.log.
I suspect the problem is different.
Do you have a xorg.conf for nvidia?
Also plz pastebin your ~/.local/share/xorg/Xorg.0.log



In the end it was because the display-setup-script or greeter-setup-script should be bellow [Seat:*], but even this could not get my laptop screen working
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo 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