diff --git a/README.md b/README.md index 96a6b81..19cb178 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,8 @@ Layouts are essential and not installed by cargo. They are installed manually: $ sudo mv bottom_row.xml /usr/share/unfettered-keyboard/layouts $ curl -OL https://github.com/Julow/Unexpected-Keyboard/raw/1.29.1/res/xml/numeric.xml $ sudo mv numeric.xml /usr/share/unfettered-keyboard/layouts + $ curl -OL https://github.com/Julow/Unexpected-Keyboard/raw/1.29.1/res/xml/greekmath.xml + $ sudo mv numeric.xml /usr/share/unfettered-keyboard/layouts # Configuration diff --git a/src/core/layout.rs b/src/core/layout.rs index 2a5dd60..1a9b2e1 100644 --- a/src/core/layout.rs +++ b/src/core/layout.rs @@ -611,6 +611,7 @@ impl LayoutFile { pub struct Layout { main_layout: LayoutFile, numeric: LayoutFile, + greekmath: LayoutFile, bottom_row: LayoutFile, rows: Vec>, @@ -700,12 +701,16 @@ impl Layout { let path = dir.join("numeric.xml"); let numeric = LayoutFile::load(path)?; + let path = dir.join("greekmath.xml"); + let greekmath = LayoutFile::load(path)?; + let path = dir.join("bottom_row.xml"); let bottom_row = LayoutFile::load(path)?; let mut layout = Layout { main_layout, numeric, + greekmath, bottom_row, rows: Vec::new(), @@ -818,6 +823,13 @@ impl Layout { self.set_text_supported(self.text_supp); } + pub fn switch_greekmath(&mut self) + { + let data = self.greekmath.clone(); + self.open_layout(data); + self.set_text_supported(self.text_supp); + } + pub fn switch_text(&mut self) { let data = self.main_layout.clone();