From: Samir Benmendil Date: Sun, 18 Oct 2020 10:17:31 +0000 (+0100) Subject: awesome: replace decrecated awful.util with corresponding gears module X-Git-Url: https://git.rmz.io/dotfiles.git/commitdiff_plain/cfa0b7c3a6056ae43fc1bcf60a4d832e7dacd932?ds=inline awesome: replace decrecated awful.util with corresponding gears module --- diff --git a/awesome/bindings.lua b/awesome/bindings.lua index 96b31ea..dd3edff 100644 --- a/awesome/bindings.lua +++ b/awesome/bindings.lua @@ -5,12 +5,12 @@ modkey = "Mod4" altkey = "Mod1" -- Mouse bindings {{{1 -root.buttons(awful.util.table.join( +root.buttons(gears.table.join( awful.button({ }, 3, function () mymainmenu:toggle() end) )) -- Global Keys {{{1 -globalkeys = awful.util.table.join(globalkeys, +globalkeys = gears.table.join(globalkeys, awful.key({ modkey, }, "s", hotkeys_popup.show_help, {description="show help", group="awesome"}), awful.key({ modkey, }, "Left", awful.tag.viewprev, @@ -114,7 +114,7 @@ globalkeys = awful.util.table.join(globalkeys, prompt = "Run Lua code: ", textbox = awful.screen.focused().mypromptbox.widget, exe_callback = awful.util.eval, - history_path = awful.util.get_cache_dir() .. "/history_eval" + history_path = gears.filesystem.get_cache_dir() .. "/history_eval" } end, {description = "lua execute prompt", group = "awesome"}), @@ -147,7 +147,7 @@ globalkeys = awful.util.table.join(globalkeys, ) -- Client keys {{{1 -clientkeys = awful.util.table.join( +clientkeys = gears.table.join( awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen @@ -192,7 +192,7 @@ clientkeys = awful.util.table.join( -- Be careful: we use keycodes to make it works on any keyboard layout. -- This should map on the top row of your keyboard, usually 1 to 9. for i = 1, 9 do - globalkeys = awful.util.table.join(globalkeys, + globalkeys = gears.table.join(globalkeys, -- View tag only. awful.key({ modkey }, "#" .. i + 9, function () @@ -243,7 +243,7 @@ for i = 1, 9 do end -- Client Buttons {{{1 -clientbuttons = awful.util.table.join( +clientbuttons = gears.table.join( awful.button({ }, 1, function (c) client.focus = c; c:raise() end), awful.button({ modkey }, 1, awful.mouse.client.move), awful.button({ modkey }, 3, awful.mouse.client.resize)) diff --git a/awesome/rc.lua b/awesome/rc.lua index 93a28f0..c932e62 100644 --- a/awesome/rc.lua +++ b/awesome/rc.lua @@ -34,7 +34,7 @@ end -- Variable definitions {{{1 -- Themes define colours, icons, font and wallpapers. -beautiful.init(awful.util.getdir("config").."/themes/mlp/theme.lua") +beautiful.init(gears.filesystem.get_dir("config").."/themes/mlp/theme.lua") -- This is used later as the default terminal and editor to run. terminal = "urxvtc" diff --git a/awesome/themes/mlp/theme.lua b/awesome/themes/mlp/theme.lua index f883ff0..d19e8f4 100644 --- a/awesome/themes/mlp/theme.lua +++ b/awesome/themes/mlp/theme.lua @@ -5,7 +5,7 @@ local theme = {} local awful = require("awful") -theme.path = awful.util.getdir("config").."/themes/mlp" +theme.path = gears.filesystem.get_dir("config").."/themes/mlp" theme.font = "Droid Sans 8" diff --git a/awesome/themes/shattered/theme.lua b/awesome/themes/shattered/theme.lua index b2adbfe..d494cad 100644 --- a/awesome/themes/shattered/theme.lua +++ b/awesome/themes/shattered/theme.lua @@ -4,7 +4,7 @@ theme = {} -local themes = awful.util.getdir("config").."/themes/shattered" +local themes = gears.filesystem.get_dir("config").."/themes/shattered" theme.font = "sans 8" diff --git a/awesome/topbar.lua b/awesome/topbar.lua index 3d73e11..6f97887 100644 --- a/awesome/topbar.lua +++ b/awesome/topbar.lua @@ -23,7 +23,7 @@ end -- Wibox {{{1 -- Create a wibox for each screen and add it -local taglist_buttons = awful.util.table.join( +local taglist_buttons = gears.table.join( awful.button({ }, 1, function(t) t:view_only() end), awful.button({ modkey }, 1, function(t) if client.focus then @@ -40,7 +40,7 @@ local taglist_buttons = awful.util.table.join( awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end) ) -local tasklist_buttons = awful.util.table.join( +local tasklist_buttons = gears.table.join( awful.button({ }, 1, function (c) if c == client.focus then c.minimized = true @@ -73,7 +73,7 @@ awful.screen.connect_for_each_screen(function(s) -- Create an imagebox widget which will contains an icon indicating which layout we're using. -- We need one layoutbox per screen. s.mylayoutbox = awful.widget.layoutbox(s) - s.mylayoutbox:buttons(awful.util.table.join( + s.mylayoutbox:buttons(gears.table.join( awful.button({ }, 1, function () awful.layout.inc( 1) end), awful.button({ }, 3, function () awful.layout.inc(-1) end), awful.button({ }, 4, function () awful.layout.inc( 1) end), diff --git a/awesome/utils.lua b/awesome/utils.lua index 070cb3e..b8dd97f 100644 --- a/awesome/utils.lua +++ b/awesome/utils.lua @@ -79,11 +79,11 @@ function utils.joinTables(t1, t2) end function utils.rules.append(rules) - awful.rules.rules = awful.util.table.join(awful.rules.rules, rules) + awful.rules.rules = gears.table.join(awful.rules.rules, rules) end function utils.globalkeys.append(keys) - globalkeys = awful.util.table.join(globalkeys, keys) + globalkeys = gears.table.join(globalkeys, keys) end function utils.has_battery() diff --git a/awesome/widgets/calendar.lua b/awesome/widgets/calendar.lua index 565e390..a8acb07 100644 --- a/awesome/widgets/calendar.lua +++ b/awesome/widgets/calendar.lua @@ -27,7 +27,7 @@ local calwidget = wibox.widget.textclock(" %a %b %d, %H:%M ", 10) calwidget:connect_signal("mouse::enter", function () calendar:show(0) end) calwidget:connect_signal("mouse::leave", function () calendar:hide() end) -calwidget:buttons(awful.util.table.join( +calwidget:buttons(gears.table.join( awful.button({ }, 1, function () calendar:show(-1) end), awful.button({ }, 3, function () calendar:show( 1) end), awful.button({ }, 4, function () calendar:show(-1) end), diff --git a/awesome/widgets/pomodoro b/awesome/widgets/pomodoro index a81f1f2..ef2d060 160000 --- a/awesome/widgets/pomodoro +++ b/awesome/widgets/pomodoro @@ -1 +1 @@ -Subproject commit a81f1f27ef1d2c1c8e4c062f3993bab8cd4706a2 +Subproject commit ef2d060a154198db7f4612c1d861168c1e1d10e3 diff --git a/awesome/widgets/pomodoro.lua b/awesome/widgets/pomodoro.lua index 69d312d..b6e9116 100644 --- a/awesome/widgets/pomodoro.lua +++ b/awesome/widgets/pomodoro.lua @@ -25,7 +25,7 @@ pomodoro:connect_signal("work_stop", function () awful.spawn(terminal.." -name diary -e diary") end) -globalkeys = awful.util.table.join(globalkeys, +globalkeys = gears.table.join(globalkeys, awful.key({ modkey, "Shift" }, "p", function() pomodoro:toggle() end) ) diff --git a/awesome/widgets/volume_progressbar_widget.lua b/awesome/widgets/volume_progressbar_widget.lua index d920113..6fe9116 100644 --- a/awesome/widgets/volume_progressbar_widget.lua +++ b/awesome/widgets/volume_progressbar_widget.lua @@ -22,7 +22,7 @@ if utils.host == "hactar" then device = "alsa_output.pci-0000_00_14.2.analog-s vicious.register(volwidget, vicious.contrib.pulse, "$1", 1, device) -- Mouse bindings -volwidget:buttons(awful.util.table.join( awful.button({ }, 1, function () utils.run_or_kill("kmix") end), +volwidget:buttons(gears.table.join( awful.button({ }, 1, function () utils.run_or_kill("kmix") end), awful.button({ }, 2, function () vicious.contrib.pulse.toggle(device) diff --git a/awesome/widgets/volume_widget.lua b/awesome/widgets/volume_widget.lua index 9103575..d0812ee 100644 --- a/awesome/widgets/volume_widget.lua +++ b/awesome/widgets/volume_widget.lua @@ -12,7 +12,7 @@ volwidget = wibox.widget.textbox() vicious.register(volwidget, vicious.contrib.pulse, '🔊 '.."$1", 1, device) -- Mouse bindings -volwidget:buttons(awful.util.table.join( +volwidget:buttons(gears.table.join( awful.button({ }, 1, function () utils.run_or_kill("urxvt -name pulsemixer -e pulsemixer", {class = "urxvt", instance = "pulsemixer"})