]> git.madduck.net Git - etc/awesome.git/blobdiff - .config/awesome/rc.lua

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

fix positioning of certain modal apps
[etc/awesome.git] / .config / awesome / rc.lua
index 4a1632905614c2d3dcf5bc6df3a4c9f4821ac7e0..4041dba13b959de7fa323e506eb50ef2c5295356 100644 (file)
@@ -77,7 +77,9 @@ cmdkey = "Mod3"
 -- Table of layouts to cover with awful.layout.inc, order matters.
 local layouts = {
     default = awful.layout.suit.fair,
+    default_horiz = awful.layout.suit.fair.horizontal,
     tiled = awful.layout.suit.tile,
+    tiled_horiz = awful.layout.suit.tile.top,
     floating = awful.layout.suit.floating,
     maximised = awful.layout.suit.max
 }
@@ -86,6 +88,8 @@ awful.layout.layouts = {
     layouts.tiled,
     layouts.maximised,
     layouts.floating,
+    layouts.default_horiz,
+    layouts.tiled_horiz,
 }
 -- }}}
 
@@ -173,8 +177,11 @@ menubar.utils.terminal = terminal -- Set the terminal for applications that requ
 --    forced_width = 4,
 --    widget = wibox.widget.separator
 --}
-local spacer = wibox.widget.textbox()
-spacer:set_text(" │ ")
+local function make_spacer(text)
+    local spacer = wibox.widget.textbox()
+    spacer:set_text(text or " │ ")
+    return spacer
+end
 
 -- Keyboard map indicator and switcher
 mykeyboardlayout = awful.widget.keyboardlayout()
@@ -193,7 +200,7 @@ local lain_bat = lain.widget.bat({
 clocksarray = clocksarray.get_clocksarray("%a %d %b %H:%M:%S %Z", {
         ["NZ"] = "Pacific/Auckland",
         ["DE"] = "Europe/Berlin"
-    }, spacer)
+    }, make_spacer())
 
 -- Create a wibox for each screen and add it
 local taglist_buttons = gears.table.join(
@@ -286,34 +293,31 @@ awful.screen.connect_for_each_screen(function(s)
 
     -- Add widgets to the wibox
     local right_widgets = gears.table.join(clocksarray, {
-        spacer,
-        --spacing = 4,
-        --spacing_widget = spacer,
+        make_spacer(" "),
+        wibox.widget.systray(),
         s.mylayoutbox,
         layout = wibox.layout.fixed.horizontal,
     })
 
     if s == screen.primary then
         right_widgets = gears.table.join({
-            wibox.widget.systray(),
-            spacer,
+            make_spacer(" "),
             ccwidgets.btc_widget,
-            spacer,
+            make_spacer(),
             ccwidgets.eth_widget,
-            spacer,
+            make_spacer(),
             lain_bat.widget,
-            spacer,
+            make_spacer(),
         }, right_widgets)
     end
 
     s.mywibox:setup {
         layout = wibox.layout.align.horizontal,
         { -- Left widgets
-            spacing = 4,
-            spacing_widget = spacer,
             layout = wibox.layout.fixed.horizontal,
             --s.namebox,
             s.mytaglist,
+            make_spacer(" "),
             s.mypromptbox,
         },
         s.mytasklist, -- Middle widget
@@ -472,7 +476,7 @@ default_tags = gears.table.join(default_tags, {
     selected    = true,
     exec_once   = { terminal .. " -name irc -e env MOSH_TITLE_NOPREFIX=true mosh -4 -- irc-host tmux new -As irc irssi" },
     instance    = { "irc" },
-    targets     = { "catalyst/eDP1", "mtvic/eDP1" },
+    targets     = { "catalyst/eDP1", "mtvic/eDP1", "lehel/DisplayPort-2" },
   },
   {
     name        = "[m]",
@@ -483,7 +487,7 @@ default_tags = gears.table.join(default_tags, {
     selected    = true,
     exec_once   = { "revolt" },
     instance    = { "Revolt" },
-    targets     = { "catalyst/eDP1", "mtvic/eDP1" },
+    targets     = { "catalyst/eDP1", "mtvic/eDP1", "lehel/DisplayPort-2" },
   },
   {
     name        = "dflt",
@@ -500,7 +504,7 @@ default_tags = gears.table.join(default_tags, {
     layout      = layouts.default,
     exec_once   = { "thunderbird" },
     class       = { "Thunderbird" },
-    targets     = { "catalyst/HDMI1", "mtvic/eDP1" },
+    targets     = { "catalyst/HDMI1", "mtvic/eDP1", "lehel/DisplayPort-1" },
   },
   {
     name        = "chr",
@@ -509,7 +513,7 @@ default_tags = gears.table.join(default_tags, {
     layout      = layouts.default,
     exec_once   = { "chromium" },
     class       = { "Chromium" },
-    targets     = { "catalyst/HDMI1", "mtvic/eDP1" },
+    targets     = { "catalyst/HDMI1", "mtvic/eDP1", "lehel/DisplayPort-1" },
   },
   {
     name        = "ffx",
@@ -518,7 +522,7 @@ default_tags = gears.table.join(default_tags, {
     layout      = layouts.default,
     exec_once   = { "firefox" },
     class       = { "Firefox" },
-    targets     = { "catalyst/HDMI1", "mtvic/eDP1" },
+    targets     = { "catalyst/HDMI1", "mtvic/eDP1", "lehel/DisplayPort-1" },
   },
 })
 
@@ -695,6 +699,7 @@ globalkeys = gears.table.join(
                     bg_cursor    = '#ff0000',
                     textbox      = widget,
                     history_path = awful.util.get_cache_dir() .. "/history",
+                    completion_callback = awful.completion.shell,
                     hooks = {
                         -- Replace the 'normal' Return with a custom one
                         {{         }, 'Return', function(command)
@@ -753,11 +758,11 @@ globalkeys = gears.table.join(
     awful.key({ modkey,           }, "d", th.delete_tag,
               {description = "delete the current tag", group = "tag"}),
     awful.key({ modkey, "Shift",           }, "a", function()
-        move_to_new_tag(nil,nil,true,true,true)
+        th.move_to_new_tag(nil,nil,true,true,true)
     end,
               {description = "add a volatile tag with the focused client", group = "tag"}),
     awful.key({ modkey, "Shift", "Control" }, "a", function()
-        move_to_new_tag(nil,nil,false,true,true)
+        th.move_to_new_tag(nil,nil,false,true,true)
     end,
               {description = "add a permanent tag with the focused client", group = "tag"}),
     awful.key({ modkey, "Mod1"   }, "a", th.copy_tag,
@@ -973,7 +978,7 @@ awful.rules.rules = {
     { rule = { class = "URxvt" },
       properties = { size_hints_honor = false, }
     },
-    { rule = { instance =  "irc" },
+    { rule = { instance = "irc" },
       callback = move_to_tag_by_name(nil, "irc"),
     },
     { rule = { class = "Revolt" },
@@ -991,30 +996,41 @@ awful.rules.rules = {
     { rule_any = { class = {
         "MuPDF",
         "Wicd-client.py",
+        "Gxmessage",
+        "Pinentry"
     }},
       properties = { floating = true,
+                     maximized = false,
                      focus = true,
-                     placement = function(c)
-                         float_client_in_the_middle_with_margins(c, 50, 25)
-                     end,
+                     placement = awful.placement.centered,
                    },
     },
-    { rule_any = { class = {
-                        "Gscan2pdf",
-                        "Gimp",
-                    },
-                    instance = {
-                        "libreoffice",
-                    }
-                },
-      properties = { new_tag = {
-                        layout = layouts.maximised,
-                        volatile = true,
-                    },
-                     switchtotag = true,
+    { rule_any = { instance = {
+        "tridactyl-edit",
+        "libreoffice"
+    }},
+      properties = { floating = true,
+                     maximized = false,
                      focus = true,
+                     placement = awful.placement.centered,
                    },
     },
+--    { rule_any = { class = {
+--                        "Gscan2pdf",
+--                        "Gimp",
+--                    },
+--                    instance = {
+--                        "libreoffice",
+--                    }
+--                },
+--      properties = { new_tag = {
+--                        layout = layouts.maximised,
+--                        volatile = true,
+--                    },
+--                     switchtotag = true,
+--                     focus = true,
+--                   },
+--    },
 --XX--    { rule = { class = "Gscan2pdf" },
 --XX--               properties = {
 --XX--                   switchtotag = true
@@ -1138,10 +1154,10 @@ client.connect_signal("request::activate", function(c, context, hints)
     }, context) then
         gears.timer.delayed_call(function()
             -- we need a delayed call so that we execute *after layout changes
-            centre_mouse_on_area(client.focus)
+            if hints.raise and c == client.focus and client.focus:isvisible() then
+                move_mouse_to_area(client.focus)
+            end
         end)
-    else
-        dbg.dump(c, context, hints)
     end
 end)