summaryrefslogtreecommitdiff
path: root/src/command.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/command.rs')
-rw-r--r--src/command.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/command.rs b/src/command.rs
index f351e14..8f7218e 100644
--- a/src/command.rs
+++ b/src/command.rs
@@ -95,8 +95,7 @@ pub fn move_win_to(wm: &mut DotWM, _: xlib::XEvent, args: &[String]) -> bool {
if let Some(ref win) = wm.current_window() {
match win.move_to(x, y) {
Ok(()) => true,
- Err(e) => {
- println!("{}", e);
+ Err(_) => {
false
}
}
@@ -194,7 +193,7 @@ pub fn resize_win_sticky(wm: &mut DotWM, _: xlib::XEvent, args: &[String]) -> bo
let val = xgeo.iter().skip_while(|&a| *a <= win_right).next();
if let Some(xpoint) = val {
- let new_width = (*xpoint - attrs.x);
+ let new_width = *xpoint - attrs.x;
let _ = win.resize_to(new_width, attrs.height);
}
},
@@ -205,7 +204,6 @@ pub fn resize_win_sticky(wm: &mut DotWM, _: xlib::XEvent, args: &[String]) -> bo
let val = ygeo.iter().skip_while(|&a| *a >= attrs.y + attrs.height).next();
if let Some(v) = val {
let diff = attrs.height - (*v - attrs.y);
- println!("Resizing to {}x{}", attrs.width, diff);
if *v - attrs.y > 0 {
let _ = win.resize_to(attrs.width, attrs.height - diff);
}
@@ -219,7 +217,6 @@ pub fn resize_win_sticky(wm: &mut DotWM, _: xlib::XEvent, args: &[String]) -> bo
let val = ygeo.iter().skip_while(|&a| *a <= win_bot).next();
if let Some(v) = val {
let new_height = *v - attrs.y;
- println!("Resizing to {}x{}", attrs.width, new_height);
let _ = win.resize_to(attrs.width, new_height);
}
},
@@ -274,3 +271,9 @@ pub fn add_binding(wm: &mut DotWM, bindings: &mut BindingHash,
}
bindings.insert((key, modifiers), (func, v));
}
+
+pub fn change_desktop(wm: &mut DotWM, _: xlib::XEvent, args: &[String]) -> bool {
+ let num = args[0].parse::<usize>().unwrap();
+ wm.change_desktop(num);
+ true
+}