Skip to content

Automatically detect lightdm or gdm? #2

@quicksketch

Description

@quicksketch

It looks like these scripts are identical other than the service restart command at the end of the script. If that's the case, shouldn't it be possible to simply detect the display manager and consolidate these two scripts into a single one?

eg:

DISPLAY_MANAGER = $(tail /etc/X11/default-display-manager);
if [[ $DISPLAY_MANAGER = *"gdm"* ]]; then
  service gdm restart;
elif [[ $DISPLAY_MANAGER = *"lightdm"* ]]; then
  service lightdm restart;
else
  echo "Unknown display manager."
fi

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions