gardesk/gar / 2b12bf1

Browse files

Add force_close_window action

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
2b12bf166e846123febdbaf3b63dddbfa3049bb5
Parents
186c6d5
Tree
f033c22

1 changed file

StatusFile+-
M gar/src/config/lua.rs 19 0
gar/src/config/lua.rsmodified
@@ -15,6 +15,7 @@ pub enum Action {
1515
     Swap(String),
1616
     Resize(String, f32),
1717
     CloseWindow,
18
+    ForceCloseWindow,  // Force kill without asking nicely
1819
     Workspace(usize),
1920
     MoveToWorkspace(usize),
2021
     Equalize,
@@ -265,6 +266,7 @@ impl LuaConfig {
265266
                     if let Ok(action_type) = t.get::<String>("action") {
266267
                         match action_type.as_str() {
267268
                             "close_window" => Action::CloseWindow,
269
+                            "force_close_window" => Action::ForceCloseWindow,
268270
                             "reload" => Action::Reload,
269271
                             "exit" => Action::Exit,
270272
                             "equalize" => Action::Equalize,
@@ -399,6 +401,11 @@ impl LuaConfig {
399401
         close_window.set("action", "close_window")?;
400402
         gar.set("close_window", close_window)?;
401403
 
404
+        // gar.force_close_window - force kill without asking nicely
405
+        let force_close = self.lua.create_table()?;
406
+        force_close.set("action", "force_close_window")?;
407
+        gar.set("force_close_window", force_close)?;
408
+
402409
         // gar.reload
403410
         let reload = self.lua.create_table()?;
404411
         reload.set("action", "reload")?;
@@ -547,6 +554,18 @@ fn parse_keyspec(spec: &str) -> Option<(ModMask, u32)> {
547554
         "f10" => 0xffc7,
548555
         "f11" => 0xffc8,
549556
         "f12" => 0xffc9,
557
+        // Punctuation
558
+        "comma" => 0x2c,
559
+        "period" => 0x2e,
560
+        "semicolon" => 0x3b,
561
+        "apostrophe" => 0x27,
562
+        "bracketleft" => 0x5b,
563
+        "bracketright" => 0x5d,
564
+        "backslash" => 0x5c,
565
+        "slash" => 0x2f,
566
+        "minus" => 0x2d,
567
+        "equal" => 0x3d,
568
+        "grave" => 0x60,
550569
         // Numbers
551570
         "0" => 0x30,
552571
         "1" => 0x31,