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
Code: Select all
#!/bin/bash
xrandr --output DP-2 --mode 1920x1080 --rate 144 &
xinput set-prop pointer:'Logitech G305' 'libinput Accel Speed' -0.8 &
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.