From 48e4ba09b5fc70b8c59169c4141eaa7be96d7366 Mon Sep 17 00:00:00 2001
From: Chris Cochrun <chris@tfcconnection.org>
Date: Sun, 7 Feb 2021 14:43:59 -0600
Subject: [PATCH] Adding some new keybindings and bling

---
 .gitmodules             |  3 +++
 awesome/bling           |  1 +
 awesome/init.fnl        |  6 ++++++
 awesome/keybindings.fnl | 32 ++++++++++++++++++++++----------
 qutebrowser/quickmarks  |  2 +-
 5 files changed, 33 insertions(+), 11 deletions(-)
 create mode 160000 awesome/bling

diff --git a/.gitmodules b/.gitmodules
index f251b7c..2642d40 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -10,3 +10,6 @@
 [submodule "emacs-native-comp-git-enhanced"]
 	path = emacs-native-comp-git-enhanced
 	url = https://aur.archlinux.org/emacs-native-comp-git-enhanced
+[submodule "awesome/bling"]
+	path = awesome/bling
+	url = https://github.com/Nooo37/bling.git
diff --git a/awesome/bling b/awesome/bling
new file mode 160000
index 0000000..2cb0c54
--- /dev/null
+++ b/awesome/bling
@@ -0,0 +1 @@
+Subproject commit 2cb0c54ebe6aea8c133da8259fd44b40ae94b9eb
diff --git a/awesome/init.fnl b/awesome/init.fnl
index 4aed1c2..55104e4 100644
--- a/awesome/init.fnl
+++ b/awesome/init.fnl
@@ -46,6 +46,9 @@
 ;; Themes define colours, icons, font and wallpapers.
 (beautiful.init "/home/chris/.config/awesome/theme.lua")
 
+;; Import the bling modules and layouts
+(local bling (require "bling"))
+
 ;; This is used later as the default terminal and editor to run.
 (var terminal "alacritty")
 (var editor (or (os.getenv "EDITOR") "emacsclient"))
@@ -75,6 +78,8 @@
 ;; Table of layouts to cover with awful.layout.inc, order matters.
 (set awful.layout.layouts [
                            awful.layout.suit.tile
+                           bling.layout.centered
+                           bling.layout.mstab
                            awful.layout.suit.floating
                            ;; awful.layout.suit.tile.left
                            ;; awful.layout.suit.tile.bottom
@@ -162,6 +167,7 @@
                               (awful.button [] 3 (fn [] (awful.layout.inc -1 s)))
                               (awful.button [] 4 (fn [] (awful.layout.inc 1 s)))
                               (awful.button [] 5 (fn [] (awful.layout.inc -1 s)))))
+
    ;; Create a taglist widget
    (set s.mytaglist (awful.widget.taglist {
                                            :screen s
diff --git a/awesome/keybindings.fnl b/awesome/keybindings.fnl
index 11b8d91..8d6dd49 100644
--- a/awesome/keybindings.fnl
+++ b/awesome/keybindings.fnl
@@ -40,6 +40,10 @@
                                 {:description "swap with next client by index" :group "client"})
                      (awful.key [ modkey shift ] "k" (fn [] (awful.client.swap.byidx -1))
                                 {:description "swap with previous client by index" :group "client"})
+                     (awful.key [ modkey shift ] "h" (fn [] (awful.client.swap.global_bydirection "left"))
+                                {:description "swap with client to the left" :group "client"})
+                     (awful.key [ modkey shift ] "l" (fn [] (awful.client.swap.global_bydirection "right"))
+                                {:description "swap with client to the right" :group "client"})
                      (awful.key [ modkey ctrl ] "j" (fn [] (awful.screen.focus_relative 1))
                                 {:description "focus the next screen" :group "screen"})
                      (awful.key [ modkey ctrl ] "k" (fn [] (awful.screen.focus_relative -1))
@@ -64,14 +68,22 @@
                                 {:description "increase master width factor" :group "layout"})
                      (awful.key [ modkey ] "h" (fn [] (awful.tag.incmwfact -0.05))
                                 {:description "decrease master width factor" :group "layout"})
-                     (awful.key [ modkey shift ] "h" (fn [] (awful.tag.incnmaster 1 nil true))
+                     (awful.key [ modkey ctrl ] "h" (fn [] (awful.tag.incnmaster 1 nil true))
                                 {:description "increase the number of master clients" :group "layout"})
-                     (awful.key [ modkey shift ] "l" (fn [] (awful.tag.incnmaster -1 nil true))
+                     (awful.key [ modkey ctrl ] "l" (fn [] (awful.tag.incnmaster -1 nil true))
                                 {:description "decrease the number of master clients" :group "layout"})
-                     (awful.key [ modkey ctrl ] "h" (fn [] (awful.tag.incncol 1 nil true))
-                                {:description "increase the number of columns" :group "layout"})
-                     (awful.key [ modkey ctrl ] "l" (fn [] (awful.tag.incncol -1 nil true))
-                                {:description "decrease the number of columns" :group "layout"})
+                     (awful.key [ modkey alt ] "l" (fn [] (when client.floating (client.relative_move 0 0 10 0)))
+                                {:description "Increase width of floating window" :group "layout"})
+                     (awful.key [ modkey alt ] "h" (fn [] (when client.floating (client.relative_move 0 0 -10 0)))
+                                {:description "Decrease width of floating window" :group "layout"})
+                     (awful.key [ modkey alt ] "j" (fn [] (when client.floating (client.relative_move 0 0 0 10)))
+                                {:description "Increase height of floating window" :group "layout"})
+                     (awful.key [ modkey alt ] "k" (fn [] (when client.floating (client.relative_move 0 0 0 -10)))
+                                {:description "Decrease height of floating window" :group "layout"})
+                     ;; (awful.key [ modkey alt ] "h" (fn [] (awful.tag.incncol 1 nil true)) ||#
+                     ;;            {:description "increase the number of columns" :group "layout"}) ||#
+                     ;; (awful.key [ modkey alt ] "l" (fn [] (awful.tag.incncol -1 nil true)) ||#
+                     ;;            {:description "decrease the number of columns" :group "layout"}) ||#
                      (awful.key [ modkey ] "space" (fn [] (awful.layout.inc 1))
                                 {:description "select next" :group "layout"})
                      (awful.key [ modkey shift ] "space" (fn [] (awful.layout.inc -1))
@@ -256,28 +268,28 @@
                                     (let [screen (awful.screen.focused)
                                           tag    (. screen.tags 1)]
                                       (when tag
-                                        (awful.tag.viewtoggle))))
+                                        (awful.tag.viewtoggle tag))))
                                 {:description "toggle tag #1" :group "tag"})
                      (awful.key [ modkey ctrl ] "2"
                                 (fn []
                                     (let [screen (awful.screen.focused)
                                           tag    (. screen.tags 2)]
                                       (when tag
-                                        (awful.tag.viewtoggle))))
+                                        (awful.tag.viewtoggle tag))))
                                 {:description "toggle tag #2" :group "tag"})
                      (awful.key [ modkey ctrl ] "3"
                                 (fn []
                                     (let [screen (awful.screen.focused)
                                           tag    (. screen.tags 3)]
                                       (when tag
-                                        (awful.tag.viewtoggle))))
+                                        (awful.tag.viewtoggle tag))))
                                 {:description "toggle tag #3" :group "tag"})
                      (awful.key [ modkey ctrl ] "4"
                                 (fn []
                                     (let [screen (awful.screen.focused)
                                           tag    (. screen.tags 4)]
                                       (when tag
-                                        (awful.tag.viewtoggle))))
+                                        (awful.tag.viewtoggle tag))))
                                 {:description "toggle tag #4" :group "tag"})
                    ;; Toggle tag on focused client.
                    (awful.key [ modkey ctrl shift ] "1"
diff --git a/qutebrowser/quickmarks b/qutebrowser/quickmarks
index ad8eb88..b2b3892 100644
--- a/qutebrowser/quickmarks
+++ b/qutebrowser/quickmarks
@@ -14,7 +14,7 @@ bw https://bitwarden.tfcconnection.org/#/
 coin https://www.coinbase.com/dashboard
 remind https://www.remind.com/classes/4223h9
 admin https://admin.microsoft.com/AdminPortal/Home#/homepage
-jelly https://jellyf.hopto.org/web/index.html#!/home.html
+jelly https://jelly.cochrun.xyz/web/index.html#!/home.html
 st http://127.0.0.1:8384/#
 ha https://home.cochrun.xyz/lovelace/default_view
 tfc https://www.tfcconnection.org/