better linux support
This commit is contained in:
parent
31e6108f40
commit
1da5c1bde9
@ -187,8 +187,9 @@ pub fn start_os_service() {
|
|||||||
d = get_display();
|
d = get_display();
|
||||||
}
|
}
|
||||||
if d.is_empty() {
|
if d.is_empty() {
|
||||||
d = ":0".to_owned()
|
d = ":0".to_owned();
|
||||||
}
|
}
|
||||||
|
d = d.replace(&whoami::hostname(), "").replace("localhost", "");
|
||||||
log::info!("DISPLAY: {}", d);
|
log::info!("DISPLAY: {}", d);
|
||||||
log::info!("XAUTHORITY: {}", auth);
|
log::info!("XAUTHORITY: {}", auth);
|
||||||
std::env::set_var("XAUTHORITY", auth);
|
std::env::set_var("XAUTHORITY", auth);
|
||||||
@ -343,18 +344,24 @@ pub fn get_display_server() -> String {
|
|||||||
pub fn is_login_wayland() -> bool {
|
pub fn is_login_wayland() -> bool {
|
||||||
if let Ok(contents) = std::fs::read_to_string("/etc/gdm3/custom.conf") {
|
if let Ok(contents) = std::fs::read_to_string("/etc/gdm3/custom.conf") {
|
||||||
contents.contains("#WaylandEnable=false")
|
contents.contains("#WaylandEnable=false")
|
||||||
|
} else if let Ok(contents) = std::fs::read_to_string("/etc/gdm/custom.conf") {
|
||||||
|
contents.contains("#WaylandEnable=false")
|
||||||
} else {
|
} else {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn fix_login_wayland() {
|
pub fn fix_login_wayland() {
|
||||||
|
let mut file = "/etc/gdm3/custom.conf".to_owned();
|
||||||
|
if !std::path::Path::new(&file).exists() {
|
||||||
|
file = "/etc/gdm/custom.conf".to_owned();
|
||||||
|
}
|
||||||
match std::process::Command::new("pkexec")
|
match std::process::Command::new("pkexec")
|
||||||
.args(vec![
|
.args(vec![
|
||||||
"sed",
|
"sed",
|
||||||
"-i",
|
"-i",
|
||||||
"s/#WaylandEnable=false/WaylandEnable=false/g",
|
"s/#WaylandEnable=false/WaylandEnable=false/g",
|
||||||
"/etc/gdm3/custom.conf",
|
&file
|
||||||
])
|
])
|
||||||
.output()
|
.output()
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user