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::*; use crate::internal::*;
pub fn choose_pkgs(desktop_setup: &str) { pub fn choose_pkgs(desktop_setup: &str) {
@ -11,6 +12,14 @@ pub fn choose_pkgs(desktop_setup: &str) {
"lightdm-gtk-greeter", "lightdm-gtk-greeter",
"lightdm-gtk-greeter-settings", "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" => { "gnome" => {
install(vec![ install(vec![
@ -20,6 +29,7 @@ pub fn choose_pkgs(desktop_setup: &str) {
"chrome-gnome-shell", "chrome-gnome-shell",
"gdm", "gdm",
]); ]);
enable_dm("gdm");
} }
"kde" => { "kde" => {
install(vec![ install(vec![
@ -30,6 +40,7 @@ pub fn choose_pkgs(desktop_setup: &str) {
"kde-applications", "kde-applications",
"sddm", "sddm",
]); ]);
enable_dm("sddm");
} }
"budgie" => { "budgie" => {
install(vec![ install(vec![
@ -40,6 +51,14 @@ pub fn choose_pkgs(desktop_setup: &str) {
"lightdm-gtk-greeter", "lightdm-gtk-greeter",
"lightdm-gtk-greeter-settings", "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" => { "cinnamon" => {
install(vec![ install(vec![
@ -51,6 +70,14 @@ pub fn choose_pkgs(desktop_setup: &str) {
"metacity", "metacity",
"gnome-shell", "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" => { "mate" => {
install(vec![ install(vec![
@ -61,6 +88,14 @@ pub fn choose_pkgs(desktop_setup: &str) {
"lightdm-gtk-greeter-settings", "lightdm-gtk-greeter-settings",
"mate-extra", "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" => { "xfce" => {
install(vec![ install(vec![
@ -71,6 +106,14 @@ pub fn choose_pkgs(desktop_setup: &str) {
"lightdm-gtk-greeter-settings", "lightdm-gtk-greeter-settings",
"xfce4-goodies", "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" => { "enlightenment" => {
install(vec![ install(vec![
@ -81,6 +124,14 @@ pub fn choose_pkgs(desktop_setup: &str) {
"lightdm-gtk-greeter-settings", "lightdm-gtk-greeter-settings",
"terminology", "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<()> { pub fn append_file(path: &str, content: &str) -> std::io::Result<()> {
log(format!( log(format!(
"[ \x1b[2;1;32mOK\x1b[0m ] Append '{}' to file {}", "[ \x1b[2;1;32mOK\x1b[0m ] Append '{}' to file {}",
content.replace("\n", ""), content.trim_end(),
path path
)); ));
let mut file = OpenOptions::new().append(true).open(path)?; let mut file = OpenOptions::new().append(true).open(path)?;

Loading…
Cancel
Save