Skip to content

Commit

Permalink
Merge pull request #370 from viraniac/display-manager
Browse files Browse the repository at this point in the history
Generalize handling of display managers on hpd event
  • Loading branch information
numbqq authored Jan 13, 2025
2 parents cecf3d7 + 5e09eb7 commit 4df5397
Showing 1 changed file with 2 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if systemctl is-enabled resize2fs.service | grep "^enabled$" > /dev/null; then
exit
fi

if ! (systemctl is-active --quiet gdm || systemctl is-active --quiet lightdm); then
if ! (systemctl is-active --quiet display-manager.service); then
## For server
## Get hdmi resolution
for x in $(cat /proc/cmdline); do
Expand All @@ -33,19 +33,7 @@ else
## For desktop
## Restart the display manager (gdm3 or lightdm) when hdmitx plugin

gdm_process_name="gdm-wayland-session"
lightdm_process_name="lightdm"
gdm_search_string="/usr/libexec/gdm-wayland-session"
lightdm_search_string="/usr/sbin/lightdm"

gdm_output=$(ps aux | grep "$gdm_process_name" | grep -v "grep")
lightdm_output=$(ps aux | grep "$lightdm_process_name" | grep -v "grep")

if [ "$gdm_output" ]; then
systemctl restart gdm3
elif [ "$lightdm_output" ]; then
systemctl restart lightdm
fi
systemctl reload-or-restart display-manager.service
fi

exit

0 comments on commit 4df5397

Please sign in to comment.