about summary refs log tree commit diff
path: root/awesome/.config/awesome/rc.lua
diff options
context:
space:
mode:
authorNguyễn Gia Phong <cnx@loang.net>2024-05-13 02:51:22 +0900
committerNguyễn Gia Phong <cnx@loang.net>2024-05-13 02:53:06 +0900
commit6296dac9ba0692707d6f6d608b828f41106b52b9 (patch)
tree9582f3db603497ae3606fdf7cfed46ac6a2e841d /awesome/.config/awesome/rc.lua
parent849a7ad18688358489f315d5a8c69e0ae76cbd16 (diff)
downloaddotfiles-master.tar.gz
Scale for slightly lower screen density HEAD master
Diffstat (limited to 'awesome/.config/awesome/rc.lua')
-rw-r--r--awesome/.config/awesome/rc.lua28
1 files changed, 15 insertions, 13 deletions
diff --git a/awesome/.config/awesome/rc.lua b/awesome/.config/awesome/rc.lua
index 5dd0c1a..392dbae 100644
--- a/awesome/.config/awesome/rc.lua
+++ b/awesome/.config/awesome/rc.lua
@@ -1,5 +1,6 @@
 -- Standard library
 local io = {open = io.open}
+local math = {floor = math.floor, pi = math.pi}
 local pi = math.pi
 
 -- Awesome library
@@ -173,7 +174,7 @@ end
 
 -- Menubar configuration
 -- Set geometry so it would overlay the wibox
-menubar.geometry = {y = 0, height = 28}
+menubar.geometry = {y = 0, height = beautiful.menu_height}
 -- Set the terminal for applications that require it
 menubar.utils.terminal = terminal
 -- }}}
@@ -335,14 +336,16 @@ local function restore()
 end
 
 local function arrow(fg, bg)
-  local img = cairo.ImageSurface.create(cairo.Format.ARGB32, 14, 28)
+  local height = beautiful.menu_height
+  local width = height / 2
+  local img = cairo.ImageSurface.create(cairo.Format.ARGB32, width, height)
   local cr = cairo.Context(img)
   cr:set_source(gears.color(bg))
-  cr:rectangle(0, 0, 14, 28)
+  cr:rectangle(0, 0, width, height)
   cr:fill()
   cr:set_source(gears.color(fg))
   local trigon = shape.transform(shape.isosceles_triangle)
-  trigon:translate(0, 14):rotate_at(14, 14, pi/2)(cr, 28, 14)
+  trigon:translate(0, width):rotate_at(width, width, pi/2)(cr, height, width)
   cr:fill()
   return img
 end
@@ -354,13 +357,10 @@ awful.screen.connect_for_each_screen(function (s)
   set_wallpaper(s)
   -- Each screen has its own tag table.
   -- Wallpaper
-  if s.geometry.width > s.geometry.height then
-    awful.tag({"1", "2", "3", "4", "5", "6", "7", "8", "9"},
-              s, awful.layout.suit.fair)
-  else
-    awful.tag({"1", "2", "3", "4", "5", "6", "7", "8", "9"},
-              s, awful.layout.suit.tile)
-    for _, t in ipairs(s.tags) do t.master_count = 0 end
+  awful.tag({"1", "2", "3", "4", "5", "6", "7", "8", "9"},
+            s, awful.layout.suit.tile.bottom)
+  for _, t in ipairs(s.tags) do
+    t.master_count = math.floor(s.geometry.width / 800)
   end
 
   -- Create a promptbox for each screen
@@ -388,7 +388,9 @@ awful.screen.connect_for_each_screen(function (s)
   -- )
 
   -- Create the wibox
-  s.mywibox = awful.wibar{position = "top", height = "28", screen = s}
+  s.mywibox = awful.wibar{position = "top",
+                          height = beautiful.menu_height,
+                          screen = s}
 
   -- Virtual keyboard
   --s.vkb = boardary(s)
@@ -818,7 +820,7 @@ client.connect_signal(
                    end)
     )
 
-    awful.titlebar(c, {size=28}):setup{
+    awful.titlebar(c, {size=beautiful.menu_height}):setup{
       {-- Left
        awful.titlebar.widget.closebutton(c),
        awful.titlebar.widget.ontopbutton(c),