diff --git a/themes/vertex/keybindings.lua b/themes/vertex/keybindings.lua index 9fcf88b..92b8b4a 100644 --- a/themes/vertex/keybindings.lua +++ b/themes/vertex/keybindings.lua @@ -10,412 +10,412 @@ local keybindings = { } function keybindings.get_global_keys(mytable, modkey, altkey, cycle_prev, browser, terminal, BLUESTATUS) - local globalkeys = mytable.join(-- Destroy all notifications - awful.key({ "Control", "Shift" }, "Escape", function() - naughty.destroy_all_notifications() - end, { - description = "destroy all notifications", - group = "hotkeys" - }), -- Take a screenshot - -- https://github.com/lcpz/dots/blob/master/bin/screenshot - awful.key({ altkey }, "p", function() - os.execute("screenshot") - end, { - description = "take a screenshot", - group = "hotkeys" - }), -- xlock screen locker - awful.key({ altkey, "Control", "Shift" }, "l", function() - os.execute("xlock") - end, { - description = "lock screen", - group = "hotkeys" - }), -- Show help - awful.key({ modkey }, "s", hotkeys_popup.show_help, { - description = "show help", - group = "awesome" - }), -- Tag browsing - awful.key({ modkey, "Ctrl" }, "Left", awful.tag.viewprev, { - description = "view previous", - group = "tag" - }), awful.key({ modkey, "Ctrl" }, "Right", awful.tag.viewnext, { - description = "view next", - group = "tag" - }), awful.key({ modkey }, "Escape", awful.tag.history.restore, { - description = "go back", - group = "tag" - }), -- Non-empty tag browsing - awful.key({ altkey }, "Left", function() - lain.util.tag_view_nonempty(-1) - end, { - description = "view previous nonempty", - group = "tag" - }), awful.key({ altkey }, "Right", function() - lain.util.tag_view_nonempty(1) - end, { - description = "view previous nonempty", - group = "tag" - }), -- Default client focus - awful.key({ altkey }, "j", function() - awful.client.focus.byidx(1) - end, { - description = "focus next by index", - group = "client" - }), awful.key({ altkey }, "k", function() - awful.client.focus.byidx(-1) - end, { - description = "focus previous by index", - group = "client" - }), -- By-direction client focus - awful.key({ modkey }, "j", function() - awful.client.focus.global_bydirection("down") - if client.focus then - client.focus:raise() - end - end, { - description = "focus down", - group = "client" - }), awful.key({ modkey }, "k", function() - awful.client.focus.global_bydirection("up") - if client.focus then - client.focus:raise() - end - end, { - description = "focus up", - group = "client" - }), awful.key({ modkey }, "h", function() - awful.client.focus.global_bydirection("left") - if client.focus then - client.focus:raise() - end - end, { - description = "focus left", - group = "client" - }), awful.key({ modkey }, "l", function() - awful.client.focus.global_bydirection("right") - if client.focus then - client.focus:raise() - end - end, { - description = "focus right", - group = "client" - }), -- Menu - -- awful.key({modkey}, "w", function() - -- awful.util.mymainmenu:show() - -- end, { - -- description = "show main menu", - -- group = "awesome" - -- }), -- Layout manipulation - awful.key({ modkey, "Shift" }, "j", function() - awful.client.swap.byidx(1) - end, { - description = "swap with next client by index", - group = "client" - }), awful.key({ modkey, "Shift" }, "k", function() - awful.client.swap.byidx(-1) - end, { - description = "swap with previous client by index", - group = "client" - }), awful.key({ modkey, "Control" }, "j", function() - awful.screen.focus_relative(1) - end, { - description = "focus the next screen", - group = "screen" - }), awful.key({ modkey, "Control" }, "k", function() - awful.screen.focus_relative(-1) - end, { - description = "focus the previous screen", - group = "screen" - }), awful.key({ modkey }, "u", awful.client.urgent.jumpto, { - description = "jump to urgent client", - group = "client" - }), awful.key({ modkey }, "Tab", function() - if cycle_prev then - awful.client.focus.history.previous() - else - awful.client.focus.byidx(-1) - end - if client.focus then - client.focus:raise() - end - end, { - description = "cycle with previous/go back", - group = "client" - }), -- Show/hide wibox - awful.key({ modkey }, "b", function() - for s in screen do - s.mywibox.visible = not s.mywibox.visible - if s.mybottomwibox then - s.mybottomwibox.visible = not s.mybottomwibox.visible - end - end - end, { - description = "toggle wibox", - group = "awesome" - }), -- On-the-fly useless gaps change - -- awful.key({ altkey, "Control" }, "+", function() - -- lain.util.useless_gaps_resize(1) - -- end, { - -- description = "increment useless gaps", - -- group = "tag" - -- }), awful.key({ altkey, "Control" }, "-", function() - -- lain.util.useless_gaps_resize(-1) - -- end, { - -- description = "decrement useless gaps", - -- group = "tag" - -- }), - -- Dynamic tagging - -- awful.key({modkey, "Shift"}, "n", function() - -- lain.util.add_tag() - -- end, { - -- description = "add new tag", - -- group = "tag" - -- }), - -- awful.key({modkey, "Shift"}, "r", function() - -- lain.util.rename_tag() - -- end, { - -- description = "rename tag", - -- group = "tag" - -- }), - awful.key({ modkey, "Shift" }, "Left", function() - lain.util.move_tag(-1) - end, { - description = "move tag to the left", - group = "tag" - }), awful.key({ modkey, "Shift" }, "Right", function() - lain.util.move_tag(1) - end, { - description = "move tag to the right", - group = "tag" - }), -- awful.key({modkey, "Shift"}, "d", function() - -- lain.util.delete_tag() - -- end, { - -- description = "delete tag", - -- group = "tag" - -- }), - -- Standard program - awful.key({ modkey }, "Return", function() - awful.spawn(terminal) - end, { - description = "open a terminal", - group = "launcher" - }), awful.key({ modkey, "Control" }, "r", awesome.restart, { - description = "reload awesome", - group = "awesome" - }), awful.key({ modkey, "Shift" }, "q", awesome.quit, { - description = "quit awesome", - group = "awesome" - }), awful.key({ modkey, altkey }, "l", function() - awful.tag.incmwfact(0.05) - end, { - description = "increase master width factor", - group = "layout" - }), awful.key({ modkey, altkey }, "h", function() - awful.tag.incmwfact(-0.05) - end, { - description = "decrease master width factor", - group = "layout" - }), awful.key({ modkey, "Shift" }, "h", function() - awful.tag.incnmaster(1, nil, true) - end, { - description = "increase the number of master clients", - group = "layout" - }), awful.key({ modkey, "Shift" }, "l", function() - awful.tag.incnmaster(-1, nil, true) - end, { - description = "decrease the number of master clients", - group = "layout" - }), awful.key({ modkey, "Control" }, "h", function() - awful.tag.incncol(1, nil, true) - end, { - description = "increase the number of columns", - group = "layout" - }), awful.key({ modkey, "Control" }, "l", function() - awful.tag.incncol(-1, nil, true) - end, { - description = "decrease the number of columns", - group = "layout" - }), awful.key({ modkey }, "space", function() - awful.layout.inc(1) - end, { - description = "select next", - group = "layout" - }), awful.key({ modkey, "Shift" }, "space", function() - awful.layout.inc(-1) - end, { - description = "select previous", - group = "layout" - }), awful.key({ modkey, "Control" }, "n", function() - local c = awful.client.restore() - -- Focus restored client - if c then - c:emit_signal("request::activate", "key.unminimize", { - raise = true - }) - end - end, { - description = "restore minimized", - group = "client" - }), -- Dropdown application - awful.key({ modkey }, "z", function() - awful.screen.focused().quake:toggle() - end, { - description = "dropdown application", - group = "launcher" - }), -- Widgets popups - -- awful.key({ altkey }, "c", function() - -- if beautiful.cal then - -- beautiful.cal.show(7) - -- end - -- end, { - -- description = "show calendar", - -- group = "widgets" - -- }), awful.key({ altkey }, "h", function() - -- if beautiful.fs then - -- beautiful.fs.show(7) - -- end - -- end, { - -- description = "show filesystem", - -- group = "widgets" - -- }), awful.key({ altkey }, "w", function() - -- if beautiful.weather then - -- beautiful.weather.show(7) - -- end - -- end, { - -- description = "show weather", - -- group = "widgets" - -- }), - -- User programs - awful.key({ modkey }, "w", function() - awful.spawn(browser) - end, { - description = "run browser", - group = "launcher" - }), -- Screen brightness - awful.key({}, "#233", function() - os.execute("light -A 10") - end, { - description = "Fn + f6 --- brightness +10%", - group = "hotkeys" - }), awful.key({}, "#232", function() - os.execute("light -U 10") - end, { - description = "Fn + f5 --- brightness -10%", - group = "hotkeys" - }), -- Max/Min Brightness - awful.key({ altkey, "Control", "Shift" }, "0", function() - os.execute("light -S 0") - end, { - description = "Min screen brightness", - group = "hotkeys" - }), awful.key({ altkey, "Control", "Shift" }, "9", function() - os.execute("light -S 100") - end, { - description = "Max screen brightness", - group = "hotkeys" - }), awful.key({ altkey, "Control", "Shift" }, "m", function() - os.execute("light -S 50") - end, { - description = "Mid screen brightness", - group = "hotkeys" - }), -- Bluetooth toggle - awful.key({ altkey, "Control", "Shift" }, "b", function() - os.execute("rfkill toggle bluetooth") - if BLUESTATUS == false then - naughty.notify({ - title = "Bluetooth", - text = "Bluetooth is ON" - }) - BLUESTATUS = true - else - naughty.notify({ - title = "Bluetooth", - text = "Bluetooth is OFF" - }) - BLUESTATUS = false - end - end, { - description = "Bluetooth toggle ON/OFF", - group = "hotkeys" - }), -- ALSA volume control - awful.key({}, "#123", function() - os.execute(string.format("amixer -q set %s 5%%+", beautiful.volume.channel)) - beautiful.volume.update() - end, { - description = "Fn + f3 --- volume up", - group = "hotkeys" - }), awful.key({}, "#122", function() - os.execute(string.format("amixer -q set %s 5%%-", beautiful.volume.channel)) - beautiful.volume.update() - end, { - description = "Fn + f2 --- volume down", - group = "hotkeys" - }), awful.key({}, "#121", function() - os.execute(string.format("amixer -q set %s toggle", - beautiful.volume.togglechannel or beautiful.volume.channel)) - beautiful.volume.update() - end, { - description = "Fn + f1 --- toggle mute", - group = "hotkeys" - }), awful.key({ altkey, "Control" }, "9", function() - os.execute(string.format("amixer -q set %s 100%%", beautiful.volume.channel)) - beautiful.volume.update() - end, { - description = "volume 100%", - group = "hotkeys" - }), awful.key({ altkey, "Control" }, "0", function() - os.execute(string.format("amixer -q set %s 0%%", beautiful.volume.channel)) - beautiful.volume.update() - end, { - description = "volume 0%", - group = "hotkeys" - }), -- Copy primary to clipboard (terminals to gtk) - awful.key({ modkey }, "c", function() - awful.spawn.with_shell("xsel | xsel -i -b") - end, { - description = "copy terminal to gtk", - group = "hotkeys" - }), -- Copy clipboard to primary (gtk to terminals) - awful.key({ modkey }, "v", function() - awful.spawn.with_shell("xsel -b | xsel") - end, { - description = "copy gtk to terminal", - group = "hotkeys" - }), awful.key({ modkey }, 'd', function() - for _, cl in ipairs(mouse.screen.selected_tag:clients()) do - local c = cl - if c then - if _G.client.focus then - c.minimized = true - else - c.minimized = false - end - end - end - end, { - description = "min/max all windows", - group = "client" - }), awful.key({ altkey, "Control" }, "n", function() - for _, cl in ipairs(mouse.screen.selected_tag:clients()) do - local c = cl - if c then - c.minimized = true - end - end - end, { - description = "minimize all windows in current tag", - group = "client" - }), awful.key({ altkey, "Control" }, "m", function() - for _, cl in ipairs(mouse.screen.selected_tag:clients()) do - local c = cl - if c then - c.minimized = false - end - end - end, { - description = "maximize all windows in current tag", - group = "client" - }), -- Default - --[[ Menubar + local globalkeys = mytable.join( -- Destroy all notifications + awful.key({ "Control", "Shift" }, "Escape", function() + naughty.destroy_all_notifications() + end, { + description = "destroy all notifications", + group = "hotkeys" + }), -- Take a screenshot + -- https://github.com/lcpz/dots/blob/master/bin/screenshot + awful.key({ altkey }, "p", function() + os.execute("screenshot") + end, { + description = "take a screenshot", + group = "hotkeys" + }), -- xlock screen locker + awful.key({ altkey, "Control", "Shift" }, "l", function() + os.execute("xlock") + end, { + description = "lock screen", + group = "hotkeys" + }), -- Show help + awful.key({ modkey }, "s", hotkeys_popup.show_help, { + description = "show help", + group = "awesome" + }), -- Tag browsing + awful.key({ modkey, "Ctrl" }, "Left", awful.tag.viewprev, { + description = "view previous", + group = "tag" + }), awful.key({ modkey, "Ctrl" }, "Right", awful.tag.viewnext, { + description = "view next", + group = "tag" + }), awful.key({ modkey }, "Escape", awful.tag.history.restore, { + description = "go back", + group = "tag" + }), -- Non-empty tag browsing + awful.key({ altkey }, "Left", function() + lain.util.tag_view_nonempty(-1) + end, { + description = "view previous nonempty", + group = "tag" + }), awful.key({ altkey }, "Right", function() + lain.util.tag_view_nonempty(1) + end, { + description = "view previous nonempty", + group = "tag" + }), -- Default client focus + awful.key({ altkey }, "j", function() + awful.client.focus.byidx(1) + end, { + description = "focus next by index", + group = "client" + }), awful.key({ altkey }, "k", function() + awful.client.focus.byidx(-1) + end, { + description = "focus previous by index", + group = "client" + }), -- By-direction client focus + awful.key({ modkey }, "j", function() + awful.client.focus.global_bydirection("down") + if client.focus then + client.focus:raise() + end + end, { + description = "focus down", + group = "client" + }), awful.key({ modkey }, "k", function() + awful.client.focus.global_bydirection("up") + if client.focus then + client.focus:raise() + end + end, { + description = "focus up", + group = "client" + }), awful.key({ modkey }, "h", function() + awful.client.focus.global_bydirection("left") + if client.focus then + client.focus:raise() + end + end, { + description = "focus left", + group = "client" + }), awful.key({ modkey }, "l", function() + awful.client.focus.global_bydirection("right") + if client.focus then + client.focus:raise() + end + end, { + description = "focus right", + group = "client" + }), -- Menu + -- awful.key({modkey}, "w", function() + -- awful.util.mymainmenu:show() + -- end, { + -- description = "show main menu", + -- group = "awesome" + -- }), -- Layout manipulation + awful.key({ modkey, "Shift" }, "j", function() + awful.client.swap.byidx(1) + end, { + description = "swap with next client by index", + group = "client" + }), awful.key({ modkey, "Shift" }, "k", function() + awful.client.swap.byidx(-1) + end, { + description = "swap with previous client by index", + group = "client" + }), awful.key({ modkey, "Control" }, "j", function() + awful.screen.focus_relative(1) + end, { + description = "focus the next screen", + group = "screen" + }), awful.key({ modkey, "Control" }, "k", function() + awful.screen.focus_relative(-1) + end, { + description = "focus the previous screen", + group = "screen" + }), awful.key({ modkey }, "u", awful.client.urgent.jumpto, { + description = "jump to urgent client", + group = "client" + }), awful.key({ modkey }, "Tab", function() + if cycle_prev then + awful.client.focus.history.previous() + else + awful.client.focus.byidx(-1) + end + if client.focus then + client.focus:raise() + end + end, { + description = "cycle with previous/go back", + group = "client" + }), -- Show/hide wibox + awful.key({ modkey }, "b", function() + for s in screen do + s.mywibox.visible = not s.mywibox.visible + if s.mybottomwibox then + s.mybottomwibox.visible = not s.mybottomwibox.visible + end + end + end, { + description = "toggle wibox", + group = "awesome" + }), -- On-the-fly useless gaps change + -- awful.key({ altkey, "Control" }, "+", function() + -- lain.util.useless_gaps_resize(1) + -- end, { + -- description = "increment useless gaps", + -- group = "tag" + -- }), awful.key({ altkey, "Control" }, "-", function() + -- lain.util.useless_gaps_resize(-1) + -- end, { + -- description = "decrement useless gaps", + -- group = "tag" + -- }), + -- Dynamic tagging + -- awful.key({modkey, "Shift"}, "n", function() + -- lain.util.add_tag() + -- end, { + -- description = "add new tag", + -- group = "tag" + -- }), + -- awful.key({modkey, "Shift"}, "r", function() + -- lain.util.rename_tag() + -- end, { + -- description = "rename tag", + -- group = "tag" + -- }), + awful.key({ modkey, "Shift" }, "Left", function() + lain.util.move_tag(-1) + end, { + description = "move tag to the left", + group = "tag" + }), awful.key({ modkey, "Shift" }, "Right", function() + lain.util.move_tag(1) + end, { + description = "move tag to the right", + group = "tag" + }), -- awful.key({modkey, "Shift"}, "d", function() + -- lain.util.delete_tag() + -- end, { + -- description = "delete tag", + -- group = "tag" + -- }), + -- Standard program + awful.key({ modkey }, "Return", function() + awful.spawn(terminal) + end, { + description = "open a terminal", + group = "launcher" + }), awful.key({ modkey, "Control" }, "r", awesome.restart, { + description = "reload awesome", + group = "awesome" + }), awful.key({ modkey, "Shift" }, "q", awesome.quit, { + description = "quit awesome", + group = "awesome" + }), awful.key({ modkey, altkey }, "l", function() + awful.tag.incmwfact(0.05) + end, { + description = "increase master width factor", + group = "layout" + }), awful.key({ modkey, altkey }, "h", function() + awful.tag.incmwfact(-0.05) + end, { + description = "decrease master width factor", + group = "layout" + }), awful.key({ modkey, "Shift" }, "h", function() + awful.tag.incnmaster(1, nil, true) + end, { + description = "increase the number of master clients", + group = "layout" + }), awful.key({ modkey, "Shift" }, "l", function() + awful.tag.incnmaster(-1, nil, true) + end, { + description = "decrease the number of master clients", + group = "layout" + }), awful.key({ modkey, "Control" }, "h", function() + awful.tag.incncol(1, nil, true) + end, { + description = "increase the number of columns", + group = "layout" + }), awful.key({ modkey, "Control" }, "l", function() + awful.tag.incncol(-1, nil, true) + end, { + description = "decrease the number of columns", + group = "layout" + }), awful.key({ modkey }, "space", function() + awful.layout.inc(1) + end, { + description = "select next", + group = "layout" + }), awful.key({ modkey, "Shift" }, "space", function() + awful.layout.inc(-1) + end, { + description = "select previous", + group = "layout" + }), awful.key({ modkey, "Control" }, "n", function() + local c = awful.client.restore() + -- Focus restored client + if c then + c:emit_signal("request::activate", "key.unminimize", { + raise = true + }) + end + end, { + description = "restore minimized", + group = "client" + }), -- Dropdown application + awful.key({ modkey }, "z", function() + awful.screen.focused().quake:toggle() + end, { + description = "dropdown application", + group = "launcher" + }), -- Widgets popups + -- awful.key({ altkey }, "c", function() + -- if beautiful.cal then + -- beautiful.cal.show(7) + -- end + -- end, { + -- description = "show calendar", + -- group = "widgets" + -- }), awful.key({ altkey }, "h", function() + -- if beautiful.fs then + -- beautiful.fs.show(7) + -- end + -- end, { + -- description = "show filesystem", + -- group = "widgets" + -- }), awful.key({ altkey }, "w", function() + -- if beautiful.weather then + -- beautiful.weather.show(7) + -- end + -- end, { + -- description = "show weather", + -- group = "widgets" + -- }), + -- User programs + awful.key({ modkey }, "w", function() + awful.spawn(browser) + end, { + description = "run browser", + group = "launcher" + }), -- Screen brightness + awful.key({}, "#233", function() + os.execute("light -A 10") + end, { + description = "Fn + f6 --- brightness +10%", + group = "hotkeys" + }), awful.key({}, "#232", function() + os.execute("light -U 10") + end, { + description = "Fn + f5 --- brightness -10%", + group = "hotkeys" + }), -- Max/Min Brightness + awful.key({ altkey, "Control", "Shift" }, "0", function() + os.execute("light -S 0") + end, { + description = "Min screen brightness", + group = "hotkeys" + }), awful.key({ altkey, "Control", "Shift" }, "9", function() + os.execute("light -S 100") + end, { + description = "Max screen brightness", + group = "hotkeys" + }), awful.key({ altkey, "Control", "Shift" }, "m", function() + os.execute("light -S 50") + end, { + description = "Mid screen brightness", + group = "hotkeys" + }), -- Bluetooth toggle + awful.key({ altkey, "Control", "Shift" }, "b", function() + os.execute("rfkill toggle bluetooth") + if BLUESTATUS == false then + naughty.notify({ + title = "Bluetooth", + text = "Bluetooth is ON" + }) + BLUESTATUS = true + else + naughty.notify({ + title = "Bluetooth", + text = "Bluetooth is OFF" + }) + BLUESTATUS = false + end + end, { + description = "Bluetooth toggle ON/OFF", + group = "hotkeys" + }), -- ALSA volume control + awful.key({}, "#123", function() + os.execute(string.format("amixer -q set %s 5%%+", beautiful.volume.channel)) + beautiful.volume.update() + end, { + description = "Fn + f3 --- volume up", + group = "hotkeys" + }), awful.key({}, "#122", function() + os.execute(string.format("amixer -q set %s 5%%-", beautiful.volume.channel)) + beautiful.volume.update() + end, { + description = "Fn + f2 --- volume down", + group = "hotkeys" + }), awful.key({}, "#121", function() + os.execute(string.format("amixer -q set %s toggle", + beautiful.volume.togglechannel or beautiful.volume.channel)) + beautiful.volume.update() + end, { + description = "Fn + f1 --- toggle mute", + group = "hotkeys" + }), awful.key({ altkey, "Control" }, "9", function() + os.execute(string.format("amixer -q set %s 100%%", beautiful.volume.channel)) + beautiful.volume.update() + end, { + description = "volume 100%", + group = "hotkeys" + }), awful.key({ altkey, "Control" }, "0", function() + os.execute(string.format("amixer -q set %s 0%%", beautiful.volume.channel)) + beautiful.volume.update() + end, { + description = "volume 0%", + group = "hotkeys" + }), -- Copy primary to clipboard (terminals to gtk) + awful.key({ modkey }, "c", function() + awful.spawn.with_shell("xsel | xsel -i -b") + end, { + description = "copy terminal to gtk", + group = "hotkeys" + }), -- Copy clipboard to primary (gtk to terminals) + awful.key({ modkey }, "v", function() + awful.spawn.with_shell("xsel -b | xsel") + end, { + description = "copy gtk to terminal", + group = "hotkeys" + }), awful.key({ modkey }, 'd', function() + for _, cl in ipairs(mouse.screen.selected_tag:clients()) do + local c = cl + if c then + if _G.client.focus then + c.minimized = true + else + c.minimized = false + end + end + end + end, { + description = "min/max all windows", + group = "client" + }), awful.key({ altkey, "Control" }, "n", function() + for _, cl in ipairs(mouse.screen.selected_tag:clients()) do + local c = cl + if c then + c.minimized = true + end + end + end, { + description = "minimize all windows in current tag", + group = "client" + }), awful.key({ altkey, "Control" }, "m", function() + for _, cl in ipairs(mouse.screen.selected_tag:clients()) do + local c = cl + if c then + c.minimized = false + end + end + end, { + description = "maximize all windows in current tag", + group = "client" + }), -- Default + --[[ Menubar awful.key({ modkey }, "p", function() menubar.show() end, {description = "show the menubar", group = "launcher"}), --]] --[[ dmenu @@ -425,103 +425,102 @@ function keybindings.get_global_keys(mytable, modkey, altkey, cycle_prev, browse end, {description = "show dmenu", group = "launcher"}), --]] -- alternatively use rofi, a dmenu-like application with more features - -- check https://github.com/DaveDavenport/rofi for more details - --[[ rofi + -- check https://github.com/DaveDavenport/rofi for more details + --[[ rofi awful.key({ modkey }, "x", function () os.execute(string.format("rofi -show %s -theme %s", 'run', 'dmenu')) end, {description = "show rofi", group = "launcher"}), --]] -- Prompt - awful.key({ modkey }, "r", function() - awful.util.spawn("rofi -show drun -matching fuzzy") - end, { - description = "run rofi", - group = "launcher" - }), awful.key({ modkey }, "g", function() - awful.util.spawn("rofisearch") - end, { - description = "run rofi", - group = "launcher" - }), awful.key({ modkey }, "x", function() - awful.prompt.run { - prompt = "Run Lua code: ", - textbox = awful.screen.focused().mypromptbox.widget, - exe_callback = awful.util.eval, - history_path = awful.util.get_cache_dir() .. "/history_eval" - } - end, { - description = "lua execute prompt", - group = "awesome" - }) - ) + awful.key({ modkey }, "r", function() + awful.util.spawn("rofi -show drun -matching fuzzy") + end, { + description = "run rofi", + group = "launcher" + }), awful.key({ modkey }, "g", function() + awful.util.spawn("rofisearch") + end, { + description = "run rofi", + group = "launcher" + }), awful.key({ modkey }, "x", function() + awful.prompt.run { + prompt = "Run Lua code: ", + textbox = awful.screen.focused().mypromptbox.widget, + exe_callback = awful.util.eval, + history_path = awful.util.get_cache_dir() .. "/history_eval" + } + end, { + description = "lua execute prompt", + group = "awesome" + }) + ) - return globalkeys + return globalkeys end function keybindings.get_user_keys(mytable, awful, lain, altkey, modkey) - -- User hey bindings - local clientkeys = mytable.join(awful.key({ altkey, "Shift" }, "m", lain.util.magnify_client, { - description = "magnify client", - group = "client" - }), awful.key({ modkey }, "f", function(c) - c.fullscreen = not c.fullscreen - c:raise() - end, { - description = "toggle fullscreen", - group = "client" - }), awful.key({ modkey }, "q", function(c) - c:kill() - end, { - description = "close", - group = "client" - }), awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle, { - description = "toggle floating", - group = "client" - }), awful.key({ modkey, "Control" }, "Return", function(c) - c:swap(awful.client.getmaster()) - end, { - description = "move to master", - group = "client" - }), awful.key({ modkey }, "o", function(c) - c:move_to_screen() - end, { - description = "move to screen", - group = "client" - }), awful.key({ modkey }, "t", function(c) - c.ontop = not c.ontop - end, { - description = "toggle keep on top", - group = "client" - }), awful.key({ modkey }, "n", function(c) - -- The client currently has the input focus, so it cannot be - -- minimized, since minimized clients can't have the focus. - c.minimized = true - end, { - description = "minimize", - group = "client" - }), awful.key({ modkey }, "m", function(c) - c.maximized = not c.maximized - c:raise() - end, { - description = "(un)maximize", - group = "client" - }), awful.key({ modkey, "Control" }, "m", function(c) - c.maximized_vertical = not c.maximized_vertical - c:raise() - end, { - description = "(un)maximize vertically", - group = "client" - }), awful.key({ modkey, "Shift" }, "m", function(c) - c.maximized_horizontal = not c.maximized_horizontal - c:raise() - end, { - description = "(un)maximize horizontally", - group = "client" - })) - - return clientkeys + -- User hey bindings + local clientkeys = mytable.join(awful.key({ altkey, "Shift" }, "m", lain.util.magnify_client, { + description = "magnify client", + group = "client" + }), awful.key({ modkey }, "f", function(c) + c.fullscreen = not c.fullscreen + c:raise() + end, { + description = "toggle fullscreen", + group = "client" + }), awful.key({ modkey }, "q", function(c) + c:kill() + end, { + description = "close", + group = "client" + }), awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle, { + description = "toggle floating", + group = "client" + }), awful.key({ modkey, "Control" }, "Return", function(c) + c:swap(awful.client.getmaster()) + end, { + description = "move to master", + group = "client" + }), awful.key({ modkey }, "o", function(c) + c:move_to_screen() + end, { + description = "move to screen", + group = "client" + }), awful.key({ modkey }, "t", function(c) + c.ontop = not c.ontop + end, { + description = "toggle keep on top", + group = "client" + }), awful.key({ modkey }, "n", function(c) + -- The client currently has the input focus, so it cannot be + -- minimized, since minimized clients can't have the focus. + c.minimized = true + end, { + description = "minimize", + group = "client" + }), awful.key({ modkey }, "m", function(c) + c.maximized = not c.maximized + c:raise() + end, { + description = "(un)maximize", + group = "client" + }), awful.key({ modkey, "Control" }, "m", function(c) + c.maximized_vertical = not c.maximized_vertical + c:raise() + end, { + description = "(un)maximize vertically", + group = "client" + }), awful.key({ modkey, "Shift" }, "m", function(c) + c.maximized_horizontal = not c.maximized_horizontal + c:raise() + end, { + description = "(un)maximize horizontally", + group = "client" + })) + return clientkeys end return keybindings diff --git a/themes/vertex/settings.lua b/themes/vertex/settings.lua index 8df60bc..8dd3ddc 100644 --- a/themes/vertex/settings.lua +++ b/themes/vertex/settings.lua @@ -1,31 +1,31 @@ local settings = { - themes = { - "powerarrow-dark", -- 1 DEFAULT - "vertex", -- 2 - }, + themes = { + "powerarrow-dark", -- 1 DEFAULT + "vertex", -- 2 + }, - chosen_theme = 2, + chosen_theme = 2, - modkey = "Mod4", - altkey = "Mod1", + modkey = "Mod4", + altkey = "Mod1", - -- Pref browser - terminal = "alacritty", + -- Pref browser + terminal = "alacritty", - vi_focus = false, -- vi-like client focus https://github.com/lcpz/awesome-copycats/issues/275 - cycle_prev = true, -- cycle with only the previously focused client or all https://github.com/lcpz/awesome-copycats/issues/274 + vi_focus = false, -- vi-like client focus https://github.com/lcpz/awesome-copycats/issues/275 + cycle_prev = true, -- cycle with only the previously focused client or all https://github.com/lcpz/awesome-copycats/issues/274 - -- Pref editor - editor = "nvim", + -- Pref editor + editor = "nvim", - -- Pref browser - browser = "librewolf", + -- Pref browser + browser = "librewolf", - -- Bluetooth - BLUESTATUS = false, + -- Bluetooth + BLUESTATUS = false, - -- Gaps - useless_gap = 8, + -- Gaps + useless_gap = 8, } return settings diff --git a/themes/vertex/startup.lua b/themes/vertex/startup.lua index 61bf621..5be9c9e 100644 --- a/themes/vertex/startup.lua +++ b/themes/vertex/startup.lua @@ -1,15 +1,14 @@ local awful = require("awful") local beautiful = require("beautiful") -local startup = -{ - awful.spawn.with_shell("nitrogen --set-zoom-fill --no-recurse --random --head=0 ~/Pictures/SFW/Nature"), - awful.spawn.with_shell("optimus-manager-qt"), - awful.spawn.with_shell("picom -b"), +local startup = { + awful.spawn.with_shell("nitrogen --set-zoom-fill --no-recurse --random --head=0 ~/Pictures/SFW/Nature"), + awful.spawn.with_shell("optimus-manager-qt"), + awful.spawn.with_shell("picom -b"), - -- Mute volume on startup - os.execute(string.format("amixer set Master 0%%")), - beautiful.volume.update(), + -- Mute volume on startup + os.execute(string.format("amixer set Master 0%%")), + beautiful.volume.update(), } return startup diff --git a/themes/vertex/theme.lua b/themes/vertex/theme.lua index 8e7e547..5752491 100644 --- a/themes/vertex/theme.lua +++ b/themes/vertex/theme.lua @@ -3,7 +3,8 @@ Vertex Awesome WM theme github.com/lcpz ---]] local gears = require("gears") +--]] +local gears = require("gears") local lain = require("lain") local awful = require("awful") local wibox = require("wibox") @@ -108,7 +109,7 @@ theme.widget_cpu = theme.icon_dir .. "/cpu.png" theme.widget_mem = theme.icon_dir .. "/mem.png" -- http://fontawesome.io/cheatsheet -awful.util.tagnames = {"", "", "", "", "", ""} +awful.util.tagnames = { "", "", "", "", "", "" } local markup = lain.util.markup @@ -118,21 +119,21 @@ local markup = lain.util.markup local mytextclock = wibox.widget.textclock(markup("#FFFFFF", "%H:%M")) mytextclock.font = theme.font theme.cal = lain.widget.cal({ - attach_to = {mytextclock}, - notification_preset = { - fg = "#FFFFFF", - bg = theme.bg_normal, - position = "top_middle", - font = theme.font - } + attach_to = { mytextclock }, + notification_preset = { + fg = "#FFFFFF", + bg = theme.bg_normal, + position = "top_middle", + font = theme.font + } }) -- Battery local baticon = wibox.widget.imagebox(theme.bat000) local battooltip = awful.tooltip({ - objects = {baticon}, - margin_leftright = dpi(15), - margin_topbottom = dpi(4) + objects = { baticon }, + margin_leftright = dpi(15), + margin_topbottom = dpi(4) }) battooltip.wibox.fg = "#fcfbf7" battooltip.wibox.widget.bg = "#404040" @@ -143,30 +144,30 @@ battooltip.timeout = 0 -- gears.shape.rounded_bar(cr, width, height) -- end) local bat = lain.widget.bat({ - settings = function() - local index, perc = "bat", tonumber(bat_now.perc) or 0 + settings = function() + local index, perc = "bat", tonumber(bat_now.perc) or 0 - if perc <= 7 then - index = index .. "000" - elseif perc <= 20 then - index = index .. "020" - elseif perc <= 40 then - index = index .. "040" - elseif perc <= 60 then - index = index .. "060" - elseif perc <= 80 then - index = index .. "080" - elseif perc <= 100 then - index = index .. "100" - end - - if bat_now.ac_status == 1 then - index = index .. "charging" - end - - baticon:set_image(theme[index]) - battooltip:set_markup(string.format("%s%% | %s", perc, bat_now.time)) + if perc <= 7 then + index = index .. "000" + elseif perc <= 20 then + index = index .. "020" + elseif perc <= 40 then + index = index .. "040" + elseif perc <= 60 then + index = index .. "060" + elseif perc <= 80 then + index = index .. "080" + elseif perc <= 100 then + index = index .. "100" end + + if bat_now.ac_status == 1 then + index = index .. "charging" + end + + baticon:set_image(theme[index]) + battooltip:set_markup(string.format("%s%% | %s", perc, bat_now.time)) + end }) -- MPD @@ -191,11 +192,11 @@ local bat = lain.widget.bat({ -- ALSA volume local volicon = wibox.widget.imagebox() local voltooltip = awful.tooltip({ - objects = {volicon}, - margin_leftright = dpi(15), - margin_topbottom = dpi(4), - preferred_alignments = {"middle", "front", "back"}, - preferred_positions = {"bottom", "left", "right", "top"} + objects = { volicon }, + margin_leftright = dpi(15), + margin_topbottom = dpi(4), + preferred_alignments = { "middle", "front", "back" }, + preferred_positions = { "bottom", "left", "right", "top" } }) voltooltip.wibox.fg = "#fcfbf7" @@ -207,110 +208,110 @@ voltooltip.timeout = 0 -- gears.shape.rounded_bar(cr, width, height) -- end) theme.volume = lain.widget.alsabar({ - -- togglechannel = "IEC958,3", - notification_preset = { - font = theme.font, - fg = theme.fg_normal - }, - settings = function() - local index, perc = "", tonumber(volume_now.level) or 0 + -- togglechannel = "IEC958,3", + notification_preset = { + font = theme.font, + fg = theme.fg_normal + }, + settings = function() + local index, perc = "", tonumber(volume_now.level) or 0 - if volume_now.status == "off" then - index = "volmutedblocked" - else - if perc <= 5 then - index = "volmuted" - elseif perc <= 25 then - index = "vollow" - elseif perc <= 75 then - index = "volmed" - else - index = "volhigh" - end - end - - volicon:set_image(theme[index]) - voltooltip:set_markup(string.format("%s%% | 100%%", perc)) + if volume_now.status == "off" then + index = "volmutedblocked" + else + if perc <= 5 then + index = "volmuted" + elseif perc <= 25 then + index = "vollow" + elseif perc <= 75 then + index = "volmed" + else + index = "volhigh" + end end + + volicon:set_image(theme[index]) + voltooltip:set_markup(string.format("%s%% | 100%%", perc)) + end }) volicon:buttons(my_table.join(awful.button({}, 1, function() - awful.spawn(string.format("%s -e alsamixer", awful.util.terminal)) + awful.spawn(string.format("%s -e alsamixer", awful.util.terminal)) end), awful.button({}, 2, function() - os.execute(string.format("%s set %s 100%%", theme.volume.cmd, theme.volume.channel)) - theme.volume.notify() + os.execute(string.format("%s set %s 100%%", theme.volume.cmd, theme.volume.channel)) + theme.volume.notify() end), awful.button({}, 3, function() - os.execute(string.format("%s set %s toggle", theme.volume.cmd, theme.volume.togglechannel or theme.volume.channel)) - theme.volume.notify() + os.execute(string.format("%s set %s toggle", theme.volume.cmd, theme.volume.togglechannel or theme.volume.channel)) + theme.volume.notify() end), awful.button({}, 4, function() - os.execute(string.format("%s set %s 5%%+", theme.volume.cmd, theme.volume.channel)) - theme.volume.notify() + os.execute(string.format("%s set %s 5%%+", theme.volume.cmd, theme.volume.channel)) + theme.volume.notify() end), awful.button({}, 5, function() - os.execute(string.format("%s set %s 5%%-", theme.volume.cmd, theme.volume.channel)) - theme.volume.notify() + os.execute(string.format("%s set %s 5%%-", theme.volume.cmd, theme.volume.channel)) + theme.volume.notify() end))) -- MEM function round_one_decimal(num) - return math.floor(num * 10) / 10 + return math.floor(num * 10) / 10 end local memicon = wibox.widget.imagebox(theme.widget_mem) local mem = lain.widget.mem({ - settings = function() - local mem_used = mem_now.used - if mem_used >= 1000 then - mem_used = round_one_decimal(mem_used / 1000) - widget:set_markup(markup.font(theme.font, " " .. mem_used .. " Gb ")) - else - widget:set_markup(markup.font(theme.font, " " .. mem_used .. " MB ")) - end + settings = function() + local mem_used = mem_now.used + if mem_used >= 1000 then + mem_used = round_one_decimal(mem_used / 1000) + widget:set_markup(markup.font(theme.font, " " .. mem_used .. " Gb ")) + else + widget:set_markup(markup.font(theme.font, " " .. mem_used .. " MB ")) end + end }) -- CPU local cpuicon = wibox.widget.imagebox(theme.widget_cpu) local cpu = lain.widget.cpu({ - settings = function() - widget:set_markup(markup.font(theme.font, " " .. cpu_now.usage .. "% ")) - end + settings = function() + widget:set_markup(markup.font(theme.font, " " .. cpu_now.usage .. "% ")) + end }) -- Network local net = lain.widget.net({ - settings = function() - widget:set_markup(markup.font(theme.font, - markup("#7AC82E", " " .. string.format("%06.1f", net_now.received)) .. " " .. - markup("#46A8C3", " " .. string.format("%06.1f", net_now.sent) .. " "))) - end + settings = function() + widget:set_markup(markup.font(theme.font, + markup("#7AC82E", " " .. string.format("%06.1f", net_now.received)) .. " " .. + markup("#46A8C3", " " .. string.format("%06.1f", net_now.sent) .. " "))) + end }) -- Wifi carrier and signal strength local wificon = wibox.widget.imagebox(theme.wifidisc) -local mywifisig = awful.widget.watch({awful.util.shell, "-c", - "awk 'NR==3 {printf(\"%d-%.0f\\n\",$2, $3*10/7)}' /proc/net/wireless; iw dev wlan0 link"}, - 2, function(widget, stdout) - local carrier, perc = stdout:match("(%d)-(%d+)") - local tiptext = stdout:gsub("(%d)-(%d+)", ""):gsub("%s+$", "") - perc = tonumber(perc) +local mywifisig = awful.widget.watch({ awful.util.shell, "-c", + "awk 'NR==3 {printf(\"%d-%.0f\\n\",$2, $3*10/7)}' /proc/net/wireless; iw dev wlan0 link" }, + 2, function(widget, stdout) + local carrier, perc = stdout:match("(%d)-(%d+)") + local tiptext = stdout:gsub("(%d)-(%d+)", ""):gsub("%s+$", "") + perc = tonumber(perc) - if carrier == "1" or not perc then - wificon:set_image(theme.wifidisc) - wifitooltip:set_markup("No carrier") - else - if perc <= 5 then - wificon:set_image(theme.wifinone) - elseif perc <= 25 then - wificon:set_image(theme.wifilow) - elseif perc <= 50 then - wificon:set_image(theme.wifimed) - elseif perc <= 75 then - wificon:set_image(theme.wifihigh) - else - wificon:set_image(theme.wififull) - end - wifitooltip:set_markup(tiptext) - end - end) + if carrier == "1" or not perc then + wificon:set_image(theme.wifidisc) + wifitooltip:set_markup("No carrier") + else + if perc <= 5 then + wificon:set_image(theme.wifinone) + elseif perc <= 25 then + wificon:set_image(theme.wifilow) + elseif perc <= 50 then + wificon:set_image(theme.wifimed) + elseif perc <= 75 then + wificon:set_image(theme.wifihigh) + else + wificon:set_image(theme.wififull) + end + wifitooltip:set_markup(tiptext) + end + end) -- Launcher -- local mylauncher = awful.widget.button({ @@ -322,7 +323,7 @@ local mywifisig = awful.widget.watch({awful.util.shell, "-c", -- Separators local space = wibox.widget.textbox(" ") --- horizontal space +-- horizontal space local hspace = wibox.widget.textbox() hspace.forced_width = dpi(18) -- vertical space @@ -330,230 +331,230 @@ local vspace = wibox.widget.textbox() vspace.forced_height = dpi(18) local barcolor = gears.color({ - type = "linear", - from = {0, dpi(46)}, - to = {dpi(46), dpi(46)}, - stops = {{0, theme.bg_focus}, {0.9, theme.bg_focus2}} + type = "linear", + from = { 0, dpi(46) }, + to = { dpi(46), dpi(46) }, + stops = { { 0, theme.bg_focus }, { 0.9, theme.bg_focus2 } } }) local barcolor2 = gears.color({ - type = "linear", - from = {0, dpi(46)}, - to = {dpi(46), dpi(46)}, - stops = {{0, "#323232"}, {1, theme.bg_normal}} + type = "linear", + from = { 0, dpi(46) }, + to = { dpi(46), dpi(46) }, + stops = { { 0, "#323232" }, { 1, theme.bg_normal } } }) local dockshape = function(cr, width, height) - gears.shape.partially_rounded_rect(cr, width, height, false, true, true, false, 6) + gears.shape.partially_rounded_rect(cr, width, height, false, true, true, false, 6) end function theme.vertical_wibox(s) - -- Create the vertical wibox - s.dockheight = (25.5 * s.workarea.height) / 100 + -- Create the vertical wibox + s.dockheight = (25.5 * s.workarea.height) / 100 - s.myleftwibox = wibox({ - screen = s, - x = 0, - y = s.workarea.height / 2 - s.dockheight / 2, - width = dpi(6), - height = s.dockheight, - fg = theme.fg_normal, - bg = barcolor2, - ontop = true, - visible = true, - type = "dock" - }) + s.myleftwibox = wibox({ + screen = s, + x = 0, + y = s.workarea.height / 2 - s.dockheight / 2, + width = dpi(6), + height = s.dockheight, + fg = theme.fg_normal, + bg = barcolor2, + ontop = true, + visible = true, + type = "dock" + }) - if s.index > 1 and s.myleftwibox.y == 0 then - s.myleftwibox.y = screen[1].myleftwibox.y + if s.index > 1 and s.myleftwibox.y == 0 then + s.myleftwibox.y = screen[1].myleftwibox.y + end + + -- Add widgets to the vertical wibox + s.myleftwibox:setup { + layout = wibox.layout.align.vertical, + { + layout = wibox.layout.fixed.vertical, + vspace, + s.mytaglist + -- s.layoutb, + -- wibox.container.margin(mylauncher, dpi(5), dpi(8), dpi(13), dpi(0)), + } + } + + -- Add toggling functionalities + s.docktimer = gears.timer { + timeout = 2 + } + s.docktimer:connect_signal("timeout", function() + local s = awful.screen.focused() + s.myleftwibox.width = dpi(9) + -- s.layoutb.visible = false + -- mylauncher.visible = false + if s.docktimer.started then + s.docktimer:stop() end + end) + tag.connect_signal("property::selected", function(t) + local s = t.screen or awful.screen.focused() + s.myleftwibox.width = dpi(38) + -- s.layoutb.visible = true + -- mylauncher.visible = true + gears.surface.apply_shape_bounding(s.myleftwibox, dockshape) + if not s.docktimer.started then + s.docktimer:start() + end + end) - -- Add widgets to the vertical wibox - s.myleftwibox:setup{ - layout = wibox.layout.align.vertical, - { - layout = wibox.layout.fixed.vertical, - vspace, - s.mytaglist - -- s.layoutb, - -- wibox.container.margin(mylauncher, dpi(5), dpi(8), dpi(13), dpi(0)), - } - } + s.myleftwibox:connect_signal("mouse::leave", function() + local s = awful.screen.focused() + s.myleftwibox.width = dpi(9) + -- s.layoutb.visible = false + -- mylauncher.visible = false + end) - -- Add toggling functionalities - s.docktimer = gears.timer { - timeout = 2 - } - s.docktimer:connect_signal("timeout", function() - local s = awful.screen.focused() - s.myleftwibox.width = dpi(9) - -- s.layoutb.visible = false - -- mylauncher.visible = false - if s.docktimer.started then - s.docktimer:stop() - end - end) - tag.connect_signal("property::selected", function(t) - local s = t.screen or awful.screen.focused() - s.myleftwibox.width = dpi(38) - -- s.layoutb.visible = true - -- mylauncher.visible = true - gears.surface.apply_shape_bounding(s.myleftwibox, dockshape) - if not s.docktimer.started then - s.docktimer:start() - end - end) - - s.myleftwibox:connect_signal("mouse::leave", function() - local s = awful.screen.focused() - s.myleftwibox.width = dpi(9) - -- s.layoutb.visible = false - -- mylauncher.visible = false - end) - - s.myleftwibox:connect_signal("mouse::enter", function() - local s = awful.screen.focused() - s.myleftwibox.width = dpi(38) - -- s.layoutb.visible = true - -- mylauncher.visible = true - gears.surface.apply_shape_bounding(s.myleftwibox, dockshape) - end) + s.myleftwibox:connect_signal("mouse::enter", function() + local s = awful.screen.focused() + s.myleftwibox.width = dpi(38) + -- s.layoutb.visible = true + -- mylauncher.visible = true + gears.surface.apply_shape_bounding(s.myleftwibox, dockshape) + end) end function theme.at_screen_connect(s) - -- Quake application - s.quake = lain.util.quake({ - app = awful.util.terminal, - border = theme.border_width - }) + -- Quake application + s.quake = lain.util.quake({ + app = awful.util.terminal, + border = theme.border_width + }) - -- If wallpaper is a function, call it with the screen - -- local wallpaper = theme.wallpaper - -- if type(wallpaper) == "function" then - -- wallpaper = wallpaper(s) - -- end - -- gears.wallpaper.maximized(wallpaper, s, true) + -- If wallpaper is a function, call it with the screen + -- local wallpaper = theme.wallpaper + -- if type(wallpaper) == "function" then + -- wallpaper = wallpaper(s) + -- end + -- gears.wallpaper.maximized(wallpaper, s, true) - -- Tags - awful.tag(awful.util.tagnames, s, awful.layout.layouts[1]) + -- Tags + awful.tag(awful.util.tagnames, s, awful.layout.layouts[1]) - -- Create a promptbox for each screen - s.mypromptbox = awful.widget.prompt() - s.mypromptbox.bg = "#00000000" + -- Create a promptbox for each screen + s.mypromptbox = awful.widget.prompt() + s.mypromptbox.bg = "#00000000" - -- 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(my_table.join(awful.button({}, 1, function() - awful.layout.inc(1) - end), awful.button({}, 2, function() - awful.layout.set(awful.layout.layouts[1]) - end), awful.button({}, 3, function() - awful.layout.inc(-1) - end), awful.button({}, 4, function() - awful.layout.inc(1) - end), awful.button({}, 5, function() - awful.layout.inc(-1) - end))) - s.layoutb = wibox.container.margin(s.mylayoutbox, dpi(8), dpi(11), dpi(3), dpi(3)) + -- 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(my_table.join(awful.button({}, 1, function() + awful.layout.inc(1) + end), awful.button({}, 2, function() + awful.layout.set(awful.layout.layouts[1]) + end), awful.button({}, 3, function() + awful.layout.inc(-1) + end), awful.button({}, 4, function() + awful.layout.inc(1) + end), awful.button({}, 5, function() + awful.layout.inc(-1) + end))) + s.layoutb = wibox.container.margin(s.mylayoutbox, dpi(8), dpi(11), dpi(3), dpi(3)) - -- Create a taglist widget - s.mytaglist = awful.widget.taglist(s, awful.widget.taglist.filter.all, awful.util.taglist_buttons, { - font = theme.taglist_font, - shape = gears.shape.rectangle, - spacing = dpi(10), - square_unsel = theme.square_unsel, - bg_focus = barcolor - }, nil, wibox.layout.fixed.vertical()) + -- Create a taglist widget + s.mytaglist = awful.widget.taglist(s, awful.widget.taglist.filter.all, awful.util.taglist_buttons, { + font = theme.taglist_font, + shape = gears.shape.rectangle, + spacing = dpi(10), + square_unsel = theme.square_unsel, + bg_focus = barcolor + }, nil, wibox.layout.fixed.vertical()) - -- Create a tasklist widget - s.mytasklist = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, awful.util.tasklist_buttons, { - bg_focus = theme.panelbg, - bg_normal = theme.panelbg - }) + -- Create a tasklist widget + s.mytasklist = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, awful.util.tasklist_buttons, { + bg_focus = theme.panelbg, + bg_normal = theme.panelbg + }) - -- Create the wibox - s.mywibox = awful.wibar({ - position = "top", - screen = s, - height = dpi(25), - bg = gears.color.create_png_pattern(theme.panelbg) - }) + -- Create the wibox + s.mywibox = awful.wibar({ + position = "top", + screen = s, + height = dpi(25), + bg = gears.color.create_png_pattern(theme.panelbg) + }) - -- LogOut widget - local logout_menu_widget = require("awesome-wm-widgets.logout-menu-widget.logout-menu") + -- LogOut widget + local logout_menu_widget = require("awesome-wm-widgets.logout-menu-widget.logout-menu") - -- BrightnessWidget - local brightness_widget = require("awesome-wm-widgets.brightness-widget.brightness") + -- BrightnessWidget + local brightness_widget = require("awesome-wm-widgets.brightness-widget.brightness") - -- Weatherwidget - local weather_widget = require("awesome-wm-widgets.weather-widget.weather") + -- Weatherwidget + local weather_widget = require("awesome-wm-widgets.weather-widget.weather") - -- Add widgets to the wibox - s.mywibox:setup{ - layout = wibox.layout.align.horizontal, - expand = "none", - { -- Left widgets - layout = wibox.layout.fixed.horizontal, - hspace, - s.layoutb, - hspace, - s.mypromptbox, - hspace, - s.mytasklist - }, - { -- Middle widgets - layout = wibox.layout.flex.horizontal, - max_widget_size = 1500, - mytextclock - }, - { -- Right widgets - layout = wibox.layout.fixed.horizontal, - -- wibox.widget { nil, nil, theme.mpd.widget, layout = wibox.layout.align.horizontal }, - hspace, - wibox.widget.systray(), - hspace, - wificon, - net.widget, - hspace, - cpuicon, - cpu.widget, - hspace, - memicon, - mem.widget, - hspace, - weather_widget({ - api_key = 'aeec45216dbe6d619167d2e9c9380fd7', - coordinates = {45.95, 24.14}, - time_format_12h = true, - units = 'metric', - both_units_widget = true, - font_name = 'Carter One', - icons = 'VitalyGorbachev', - icons_extension = '.svg', - show_hourly_forecast = true, - show_daily_forecast = true - }), - hspace, - brightness_widget({ - type = 'icon_and_text', - program = 'light', - step = 10, - base = 20 - }), - hspace, - volicon, - hspace, - baticon, - hspace, - logout_menu_widget({ - font = theme.font - }), - hspace - } + -- Add widgets to the wibox + s.mywibox:setup { + layout = wibox.layout.align.horizontal, + expand = "none", + { -- Left widgets + layout = wibox.layout.fixed.horizontal, + hspace, + s.layoutb, + hspace, + s.mypromptbox, + hspace, + s.mytasklist + }, + { -- Middle widgets + layout = wibox.layout.flex.horizontal, + max_widget_size = 1500, + mytextclock + }, + { -- Right widgets + layout = wibox.layout.fixed.horizontal, + -- wibox.widget { nil, nil, theme.mpd.widget, layout = wibox.layout.align.horizontal }, + hspace, + wibox.widget.systray(), + hspace, + wificon, + net.widget, + hspace, + cpuicon, + cpu.widget, + hspace, + memicon, + mem.widget, + hspace, + weather_widget({ + api_key = 'aeec45216dbe6d619167d2e9c9380fd7', + coordinates = { 45.95, 24.14 }, + time_format_12h = true, + units = 'metric', + both_units_widget = true, + font_name = 'Carter One', + icons = 'VitalyGorbachev', + icons_extension = '.svg', + show_hourly_forecast = true, + show_daily_forecast = true + }), + hspace, + brightness_widget({ + type = 'icon_and_text', + program = 'light', + step = 10, + base = 20 + }), + hspace, + volicon, + hspace, + baticon, + hspace, + logout_menu_widget({ + font = theme.font + }), + hspace } + } - gears.timer.delayed_call(theme.vertical_wibox, s) + gears.timer.delayed_call(theme.vertical_wibox, s) end return theme