about summary refs log tree commit diff
path: root/awesome
diff options
context:
space:
mode:
authorNguyễn Gia Phong <cnx@loang.net>2024-05-13 02:10:05 +0900
committerNguyễn Gia Phong <cnx@loang.net>2024-05-13 02:10:05 +0900
commit849a7ad18688358489f315d5a8c69e0ae76cbd16 (patch)
tree5b743c2e6ebfd40d4f75c73c088594ac1c19803b /awesome
parente445f6ad4c4665e83523c85406ccde2084d6d2a7 (diff)
downloaddotfiles-849a7ad18688358489f315d5a8c69e0ae76cbd16.tar.gz
Clean up laptop env
Diffstat (limited to 'awesome')
-rw-r--r--awesome/.config/awesome/rc.lua93
1 files changed, 36 insertions, 57 deletions
diff --git a/awesome/.config/awesome/rc.lua b/awesome/.config/awesome/rc.lua
index 38a9c75..5dd0c1a 100644
--- a/awesome/.config/awesome/rc.lua
+++ b/awesome/.config/awesome/rc.lua
@@ -89,12 +89,12 @@ local modkey = "Mod4"
 
 -- Table of layouts to cover with awful.layout.inc, order matters.
 awful.layout.layouts = {
-  awful.layout.suit.fair,
-  --awful.layout.suit.fair.horizontal,
-  awful.layout.suit.tile,
+  --awful.layout.suit.tile,
   --awful.layout.suit.tile.left,
-  --awful.layout.suit.tile.bottom,
+  awful.layout.suit.tile.bottom,
   --awful.layout.suit.tile.top,
+  awful.layout.suit.fair,
+  --awful.layout.suit.fair.horizontal,
   --awful.layout.suit.spiral,
   --awful.layout.suit.spiral.dwindle,
   awful.layout.suit.max,
@@ -155,13 +155,15 @@ local function showclipboard()
   local items = {}
   for c in order:gmatch(".") do
     local f = io.open(base .. c)
-    table.insert(items, {f:read("*a"):gsub("\n", " "), function ()
-      local new_order = order:gsub(c .. "(.*)", "%1" .. c)
-      io.open(base .. "order", "w"):write(new_order):close()
-      awful.spawn.easy_async("clipbuzz", spawner"xdotool key shift+Insert")
-      awful.spawn(("xclip %s"):format(base .. c))
-    end})
-    f:close()
+    if f ~= nil then
+      table.insert(items, {f:read("*a"):gsub("\n", " "), function ()
+        local new_order = order:gsub(c .. "(.*)", "%1" .. c)
+        io.open(base .. "order", "w"):write(new_order):close()
+        awful.spawn.easy_async("clipbuzz", spawner"xdotool key shift+Insert")
+        awful.spawn(("xclip %s"):format(base .. c))
+      end})
+      f:close()
+    end
   end
   awful.menu{items = items, theme = {width = 911}}:show()
 end
@@ -204,7 +206,7 @@ vicious.register(mybattery_text, vicious.widgets.bat,
                    return (" %s%03d%%"):format(args[1], args[2])
                  end, 7, "BAT0")
 local mybattery = wibox.container.background(mybattery_text, beautiful.green)
-mybattery.fg = beautiful.gray
+mybattery.fg = beautiful.black
 
 -- Create a volume widget
 local myvolume_text = wibox.widget.textbox()
@@ -238,7 +240,7 @@ local function volume_mute(parameter)
 end
 
 local myvolume = wibox.container.background(myvolume_text, beautiful.cyan)
-myvolume.fg = beautiful.gray
+myvolume.fg = beautiful.black
 myvolume:buttons(awful.util.table.join(
   awful.button({}, 1, volume_setter"+5"),
   awful.button({}, 2, volume_mute),
@@ -263,7 +265,7 @@ local function seeker(time, sign)
 end
 
 local myplayer = wibox.container.background(myplayer_text, beautiful.magenta)
-myplayer.fg = beautiful.gray
+myplayer.fg = beautiful.black
 myplayer:buttons(awful.util.table.join(
   awful.button({}, 1, spawner(forward)),
   awful.button({}, 2, spawner(play_pause)),
@@ -399,26 +401,26 @@ awful.screen.connect_for_each_screen(function (s)
      -- mylauncher,
      {mytextclock,
       bg = beautiful.red,
-      fg = beautiful.gray,
+      fg = beautiful.black,
       widget = wibox.container.background},
-     wibox.widget.imagebox(arrow(beautiful.red, beautiful.yellow)),
+     wibox.widget.imagebox(arrow(beautiful.red, beautiful.orange)),
      {mycpuusage,
-      bg = beautiful.yellow,
-      fg = beautiful.gray,
+      bg = beautiful.orange,
+      fg = beautiful.black,
       widget = wibox.container.background},
-     wibox.widget.imagebox(arrow(beautiful.yellow, beautiful.green)),
+     wibox.widget.imagebox(arrow(beautiful.orange, beautiful.yellow)),
      {mymemusage,
-      bg = beautiful.green,
-      fg = beautiful.gray,
+      bg = beautiful.yellow,
+      fg = beautiful.black,
       widget = wibox.container.background},
-     --wibox.widget.imagebox(arrow(beautiful.yellow, beautiful.green)),
-     --mybattery,
-     --wibox.widget.imagebox(arrow(beautiful.yellow, beautiful.cyan)),
-     --myvolume,
-     wibox.widget.imagebox(arrow(beautiful.green, beautiful.blue)),
+     wibox.widget.imagebox(arrow(beautiful.yellow, beautiful.green)),
+     mybattery,
+     wibox.widget.imagebox(arrow(beautiful.green, beautiful.cyan)),
+     myvolume,
+     wibox.widget.imagebox(arrow(beautiful.cyan, beautiful.blue)),
      {myweather,
       bg = beautiful.blue,
-      fg = beautiful.gray,
+      fg = beautiful.black,
       widget = wibox.container.background},
      wibox.widget.imagebox(arrow(beautiful.blue, beautiful.magenta)),
      myplayer,
@@ -494,31 +496,6 @@ local globalkeys = awful.util.table.join(
   awful.key({modkey}, "]",
             function () awful.screen.focus_relative(1) end,
             {description = "focus the next screen", group = "screen"}),
-  awful.key({modkey}, "0",
-            function ()
-              for s in screen do
-                if s.geometry.width > 2880 then
-                  local geo = s.geometry
-                  s.phy_width = geo.width
-                  s:fake_resize(geo.x, geo.y, 1920, geo.height)
-                  s.fake = screen.fake_add(geo.x + 1920, geo.y,
-                                           s.phy_width - 1920, geo.height)
-                end
-              end
-            end,
-            {description = "add fake screens", group = "screen"}),
-  awful.key({modkey, "Shift"}, "0",
-            function ()
-              for s in screen do
-                if s.fake ~= nil then
-                  local geo = s.geometry
-                  s:fake_resize(geo.x, geo.y, s.phy_width, geo.height)
-                  s.fake:fake_remove()
-                  s.fake = nil
-                end
-              end
-            end,
-            {description = "add fake screens", group = "screen"}),
   awful.key({modkey, "Shift"}, "u", awful.client.urgent.jumpto,
             {description = "jump to urgent client", group = "client"}),
   awful.key({modkey}, "Tab",
@@ -554,7 +531,7 @@ local globalkeys = awful.util.table.join(
   awful.key({modkey, "Shift"}, "f", spawner"torbrowser-launcher",
             {description = "open Tor Browser", group = "launcher"}),
   awful.key({modkey}, "o", function ()
-              awful.spawn.with_shell("mpv --ytdl-format=b $(xclip -out -selection clipboard)")
+              awful.spawn.with_shell('mpv --ytdl-format=b "$(xclip -out -selection clipboard)"')
             end,
             {description = "open URL with mpv", group = "launcher"}),
   awful.key({modkey}, "t", spawner"transmission-gtk",
@@ -575,10 +552,8 @@ local globalkeys = awful.util.table.join(
             {description = "lock screen then suspend", group = "launcher"}),
   awful.key({modkey}, "i", spawner(senpai),
             {description = "open senpai", group = "launcher"}),
-  awful.key({modkey, "Shift"}, "m", spawner"nheko -p halogen",
-            {description = "open Nheko for Halogen City", group = "launcher"}),
-  awful.key({modkey}, "m", spawner"nheko -p loang",
-            {description = "open Nheko for loang network", group = "launcher"}),
+  awful.key({modkey}, "m", spawner"nheko",
+            {description = "open Nheko", group = "launcher"}),
   awful.key({modkey, "Shift"}, "-", spawner"audacious",
             {description = "Audacious: jump-to-song", group = "multimedia"}),
   awful.key({modkey}, "=", spawner(play_pause),
@@ -601,6 +576,10 @@ local globalkeys = awful.util.table.join(
              group = "multimedia"}),
   awful.key({"Shift"}, "Print", spawner(scrot),
             {description = "capture a screenshot", group = "multimedia"}),
+  awful.key({}, "XF86MonBrightnessUp", spawner"brillo -A 5",
+            {description = "raise 5% volume", group = "multimedia"}),
+  awful.key({}, "XF86MonBrightnessDown", spawner"brillo -U 5",
+            {description = "raise 5% volume", group = "multimedia"}),
   awful.key({}, "XF86AudioRaiseVolume", volume_setter"+5",
             {description = "raise 5% volume", group = "multimedia"}),
   awful.key({}, "XF86AudioLowerVolume", volume_setter"-5",