activate dm and configue correct greeter for lightdm

axtloss/rework-partitioning
amy 3 years ago
parent 2147f676e8
commit 4988fb2034

@ -1,3 +1,4 @@
use crate::internal::exec::*;
use crate::internal::*;
pub fn choose_pkgs(desktop_setup: &str) {
@ -11,6 +12,14 @@ pub fn choose_pkgs(desktop_setup: &str) {
"lightdm-gtk-greeter",
"lightdm-gtk-greeter-settings",
]);
files_eval(
files::append_file(
"/mnt/etc/lightdm/lightdm.conf",
"[SeatDefaults]\ngreeter-session=lightdm-gtk-greeter\n",
),
"Add lightdm greeter",
);
enable_dm("lightdm");
}
"gnome" => {
install(vec![
@ -20,6 +29,7 @@ pub fn choose_pkgs(desktop_setup: &str) {
"chrome-gnome-shell",
"gdm",
]);
enable_dm("gdm");
}
"kde" => {
install(vec![
@ -30,6 +40,7 @@ pub fn choose_pkgs(desktop_setup: &str) {
"kde-applications",
"sddm",
]);
enable_dm("sddm");
}
"budgie" => {
install(vec![
@ -40,6 +51,14 @@ pub fn choose_pkgs(desktop_setup: &str) {
"lightdm-gtk-greeter",
"lightdm-gtk-greeter-settings",
]);
files_eval(
files::append_file(
"/mnt/etc/lightdm/lightdm.conf",
"[SeatDefaults]\ngreeter-session=lightdm-gtk-greeter\n",
),
"Add lightdm greeter",
);
enable_dm("lightdm");
}
"cinnamon" => {
install(vec![
@ -51,6 +70,14 @@ pub fn choose_pkgs(desktop_setup: &str) {
"metacity",
"gnome-shell",
]);
files_eval(
files::append_file(
"/mnt/etc/lightdm/lightdm.conf",
"[SeatDefaults]\ngreeter-session=lightdm-gtk-greeter\n",
),
"Add lightdm greeter",
);
enable_dm("lightdm");
}
"mate" => {
install(vec![
@ -61,6 +88,14 @@ pub fn choose_pkgs(desktop_setup: &str) {
"lightdm-gtk-greeter-settings",
"mate-extra",
]);
files_eval(
files::append_file(
"/mnt/etc/lightdm/lightdm.conf",
"[SeatDefaults]\ngreeter-session=lightdm-gtk-greeter\n",
),
"Add lightdm greeter",
);
enable_dm("lightdm");
}
"xfce" => {
install(vec![
@ -71,6 +106,14 @@ pub fn choose_pkgs(desktop_setup: &str) {
"lightdm-gtk-greeter-settings",
"xfce4-goodies",
]);
files_eval(
files::append_file(
"/mnt/etc/lightdm/lightdm.conf",
"[SeatDefaults]\ngreeter-session=lightdm-gtk-greeter\n",
),
"Add lightdm greeter",
);
enable_dm("lightdm");
}
"enlightenment" => {
install(vec![
@ -81,6 +124,14 @@ pub fn choose_pkgs(desktop_setup: &str) {
"lightdm-gtk-greeter-settings",
"terminology",
]);
files_eval(
files::append_file(
"/mnt/etc/lightdm/lightdm.conf",
"[SeatDefaults]\ngreeter-session=lightdm-gtk-greeter\n",
),
"Add lightdm greeter",
);
enable_dm("lightdm");
}
_ => {
@ -88,3 +139,11 @@ pub fn choose_pkgs(desktop_setup: &str) {
}
}
}
fn enable_dm(dm: &str) {
log(format!("Enabling {}", dm));
exec_eval(
exec_chroot("systemctl", vec![String::from("enable"), String::from(dm)]),
format!("Enable {}", dm).as_str(),
);
}

@ -17,7 +17,7 @@ pub fn create_file(path: &str) {
pub fn append_file(path: &str, content: &str) -> std::io::Result<()> {
log(format!(
"[ \x1b[2;1;32mOK\x1b[0m ] Append '{}' to file {}",
content.replace("\n", ""),
content.trim_end(),
path
));
let mut file = OpenOptions::new().append(true).open(path)?;

Loading…
Cancel
Save