Diff
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 0000000..d94ee76
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,37 @@
+# Maintainer: Tony, btw <tony@tonybtw.com>
+pkgname='oxwm-git'
+_pkgname='oxwm'
+pkgver=0.3.0.25.g0b0d9e3
+pkgrel=1
+arch=('x86_64')
+url="https://github.com/tonybanters/oxwm"
+pkgdesc="DWM but better with sane defaults, and not suckless."
+license=('GPL-3.0-or-later')
+depends=('libx11' 'libxft' 'libxcb' 'fontconfig' 'freetype2' 'libxrender')
+makedepends=('cargo' 'git')
+provides=('oxwm')
+conflicts=('oxwm')
+source=("$_pkgname::git+https://github.com/tonybanters/oxwm.git")
+sha256sums=('SKIP')
+
+pkgver() {
+ cd $_pkgname
+ echo "$(grep '^version =' Cargo.toml | head -n1 | cut -d\" -f2).$(git rev-list --count HEAD).g$(git rev-parse --short HEAD)"
+}
+
+build() {
+ cd $_pkgname
+ cargo build --release --locked
+}
+
+check() {
+ cd $_pkgname
+ cargo test --release
+}
+
+package() {
+ cd $_pkgname
+ install -Dm755 "target/release/$_pkgname" "$pkgdir/usr/bin/$_pkgname"
+ install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+ install -Dm644 oxwm.desktop "$pkgdir/usr/share/xsessions/oxwm.desktop"
+}
diff --git a/oxwm.desktop b/oxwm.desktop
new file mode 100644
index 0000000..0b93438
--- /dev/null
+++ b/oxwm.desktop
@@ -0,0 +1,6 @@
+[Desktop Entry]
+Name=oxwm
+Comment=DWM but better with sane defaults
+Exec=oxwm
+Type=Application
+Keywords=wm;windowmanager;window;manager;
diff --git a/src/layout/mod.rs b/src/layout/mod.rs
index ab09ff8..cf96dd2 100644
--- a/src/layout/mod.rs
+++ b/src/layout/mod.rs
@@ -3,6 +3,8 @@ pub mod tiling;
use x11rb::protocol::xproto::Window;
+pub type LayoutBox = Box<dyn Layout>;
+
pub struct GapConfig {
pub inner_horizontal: u32,
pub inner_vertical: u32,
@@ -14,7 +16,7 @@ pub const TILING: &str = "tiling";
pub const NORMIE: &str = "normie";
pub const FLOATING: &str = "floating";
-pub fn layout_from_str(s: &str) -> Result<Box<dyn Layout>, String> {
+pub fn layout_from_str(s: &str) -> Result<LayoutBox, String> {
match s.to_lowercase().as_str() {
TILING => Ok(Box::new(tiling::TilingLayout)),
NORMIE | FLOATING => Ok(Box::new(normie::NormieLayout)),
diff --git a/src/window_manager.rs b/src/window_manager.rs
index bf3f6b3..03066dd 100644
--- a/src/window_manager.rs
+++ b/src/window_manager.rs
@@ -4,7 +4,7 @@ use crate::errors::WmError;
use crate::keyboard::{self, Arg, KeyAction, handlers};
use crate::layout::GapConfig;
use crate::layout::tiling::TilingLayout;
-use crate::layout::{Layout, layout_from_str, next_layout};
+use crate::layout::{Layout, LayoutBox, layout_from_str, next_layout};
use crate::monitor::{Monitor, detect_monitors};
use std::collections::HashSet;
use x11rb::cursor::Handle as CursorHandle;
@@ -54,7 +54,7 @@ pub struct WindowManager {
root: Window,
screen: Screen,
windows: Vec<Window>,
- layout: Box<dyn Layout>,
+ layout: LayoutBox,
window_tags: std::collections::HashMap<Window, TagMask>,
window_monitor: std::collections::HashMap<Window, usize>,
window_geometries: std::collections::HashMap<Window, (i16, i16, u16, u16)>,