canonical / lightdm

Display Manager
GNU General Public License v3.0
810 stars 137 forks source link

How to set cursor size in Lightdm #139

Open etrigan63 opened 3 years ago

etrigan63 commented 3 years ago

I am a hidpi monitor (dual 4k monitors) user and my cursor theme is huge on the login screen. I have already fixed it in my user session but cannot for the life of me figure out how to do the same in lightdm. Some guidance in this arena would be appreciated.

ljluestc commented 10 months ago
#!/usr/bin/env python3

import os

# Define the DPI value according to your preference
dpi_value = 192

# Define the LightDM configuration file path
config_file_path = '/etc/lightdm/lightdm.conf.d/50-cursor.conf'

# Create or modify the configuration file
config_content = f"[Seat:*]\n" \
                 f"xserver-command=X -dpi {dpi_value}\n"

# Write the content to the configuration file
with open(config_file_path, 'w') as config_file:
    config_file.write(config_content)

# Restart the LightDM service
os.system('sudo service lightdm restart')

print("Cursor size adjustment complete!")
comphilip commented 4 days ago

@ljluestc not working on xubuntu 24.04