Add 'New Login' button to unlock dialog
This commit is contained in:
@ -20,8 +20,6 @@ bscreensaver-util = { path = "../util" }
|
||||
humantime = "2"
|
||||
log = "0.4"
|
||||
nix = "0.23"
|
||||
toml = "0.5"
|
||||
# git source needed until extension event error resolution fix is released
|
||||
xcb = { git = "https://github.com/rust-x-bindings/rust-xcb", rev = "d09b5f91bc07d56673f1bc0d6c7ecd72b5ff7b3e", features = ["randr", "xfixes", "xinput"] }
|
||||
xcb-xembed = { path = "../xcb-xembed" }
|
||||
xdg = "2"
|
||||
|
@ -15,7 +15,7 @@ use nix::{
|
||||
use std::{
|
||||
env,
|
||||
ffi::CString,
|
||||
fs::{read_link, File},
|
||||
fs::read_link,
|
||||
io::{self, Read},
|
||||
os::{
|
||||
linux::process::{ChildExt, CommandExt, PidFd},
|
||||
@ -277,19 +277,11 @@ fn main() -> anyhow::Result<()> {
|
||||
|
||||
fn parse_config() -> anyhow::Result<Configuration> {
|
||||
use humantime::parse_duration;
|
||||
use toml::Value;
|
||||
|
||||
match xdg::BaseDirectories::new()?.find_config_file("bscreensaver.toml") {
|
||||
None => Ok(Configuration::default()),
|
||||
Some(config_path) => {
|
||||
let mut f = File::open(config_path)?;
|
||||
let mut config = String::new();
|
||||
f.read_to_string(&mut config)?;
|
||||
drop(f);
|
||||
|
||||
let config_toml = config.parse::<Value>()?;
|
||||
let mut config = Configuration::default();
|
||||
|
||||
let mut config = Configuration::default();
|
||||
match load_configuration()? {
|
||||
None => Ok(config),
|
||||
Some(config_toml) => {
|
||||
config.lock_timeout = match config_toml.get("lock-timeout") {
|
||||
None => config.lock_timeout,
|
||||
Some(val) => parse_duration(val.as_str().ok_or(anyhow!("'lock-timeout' must be a duration string like '10m' or '90s'"))?)?,
|
||||
|
Reference in New Issue
Block a user