[SOLVED] Lightdm startup script not working

Post Reply
hotsno
recruit crewman
Posts: 2
Joined: Tue Feb 22, 2022 12:58 am

I am trying to run a script when lightdm starts so that my monitor has the correct refresh rate and my mouse has the right sensitivity when lightdm starts, as opposed to when bspwm starts (I find this more ideal).

Looking at the Arch wiki I was able to figure out this can be done by adding the "display-setup-script" line to /etc/lightdm/lightdm.conf. So this is what I currently have:

/etc/lightdm/lightdm.conf:

Code: Select all

[LightDM]
run-directory=/run/lightdm

[Seat:*]
greeter-session=lightdm-gtk-greeter
session-wrapper=/etc/lightdm/Xsession
autologin-session=bspwm
display-setup-script=/usr/share/scripts/on-startup.sh
And the script at /usr/share/scripts/on-startup.sh

Code: Select all

#!/bin/bash
xrandr --output DP-2 --mode 1920x1080 --rate 144 &
xinput set-prop pointer:'Logitech G305' 'libinput Accel Speed' -0.8 &
I've tried removing the xinput line and just having the xrandr line, and that still doesn't work. I've tried running the script from my terminal once logged in, and it seems to be working properly.

Any ideas or help with debugging this would be appreciated.

Edit: It seems like a bug with lightdm. There's some talk about it on the internet starting from like 8 years ago (!) about the startup scripts not running for people, and I haven't found a single solution to it. According to one post this broke with an update to lightdm a long time ago, but I'm really surprised if this is why it's not working for me, since it's been so long. I confirmed it doesn't even run the script at all. I made a new script that just creates a file (touch test.txt) and after logging in, the file was never created. Really frustrating.
Last edited by hotsno on Wed Feb 23, 2022 1:06 am, edited 1 time in total.
User avatar
erikdubois
Captain
Posts: 5694
Joined: Tue Nov 07, 2017 3:45 pm
Location: Belgium
Contact:

See if sddm works for you.

You can put your script in the .config/autostart as well
Learn, have fun and enjoy.
But first use the power of the Arch Wiki
use the tutorials on https://www.youtube.com/erikdubois
then use the power of google
then use the power of our moderators.
hotsno
recruit crewman
Posts: 2
Joined: Tue Feb 22, 2022 12:58 am

I ended up solving this about an hour after posting.

I changed a bunch of things at once in lightdm.conf before restarting so I'm not 100% sure what fixed it, but here was my final file:

Code: Select all

#[LightDM]
#run-directory=/run/lightdm

[Seat:*]
display-setup-script=/usr/share/scripts/on-startup.sh
greeter-session=lightdm-gtk-greeter
session-wrapper=/etc/lightdm/Xsession
autologin-session=bspwm
So either it was because I commented out the first 2 lines, or because I moved the display-setup-script line up to the beginning of the [Seat:*] section.
User avatar
erikdubois
Captain
Posts: 5694
Joined: Tue Nov 07, 2017 3:45 pm
Location: Belgium
Contact:

marking as solved then
Learn, have fun and enjoy.
But first use the power of the Arch Wiki
use the tutorials on https://www.youtube.com/erikdubois
then use the power of google
then use the power of our moderators.
Post Reply

Return to “BYOI Any ArcoLinuxB”