summaryrefslogtreecommitdiff
path: root/rc.lua
diff options
context:
space:
mode:
authorAdrian C. (anrxc) <anrxc@sysphere.org>2024-05-29 14:48:08 +0200
committerAdrian C. (anrxc) <anrxc@sysphere.org>2024-05-29 14:48:08 +0200
commit38c18f7b3dd3bee4678058ec226538ff91075fda (patch)
treedff200e2719bd54709c157fe81f315f893ebce9c /rc.lua
parent9a9d75a93c98628a5421ea88b640d04f410778f2 (diff)
downloadawesome-configs-38c18f7b3dd3bee4678058ec226538ff91075fda.tar.xz
rc.lua: replace tasklist with flexible wibox
Diffstat (limited to 'rc.lua')
-rw-r--r--rc.lua56
1 files changed, 41 insertions, 15 deletions
diff --git a/rc.lua b/rc.lua
index f428213..0a2a47b 100644
--- a/rc.lua
+++ b/rc.lua
@@ -32,6 +32,7 @@ editor = "emacs"
editor_cmd = terminal .. " -e emacs -nw"
modkey = "Mod4"
altkey = "Mod1"
+home = os.getenv("HOME")
exec = awful.spawn
scount = screen.count()
@@ -67,11 +68,11 @@ awful.layout.layouts = {
-- {{{ Wibar
--
-- {{{ Reusable separator
-myseparator = wibox.widget.imagebox("/home/anrxc/.config/awesome/icons/separator.png", false)
+myseparator = wibox.widget.imagebox(home .. "/.config/awesome/icons/separator.png", false)
-- }}}
-- {{{ CPU temperature
-mycpuicon = wibox.widget.imagebox("/home/anrxc/.config/awesome/icons/cpu.png", false)
+mycpuicon = wibox.widget.imagebox(home .. "/.config/awesome/icons/cpu.png", false)
-- Initialize widget
mycpuwidget = wibox.widget.textbox()
-- Register widget
@@ -79,7 +80,7 @@ vicious.register(mycpuwidget, vicious.widgets.thermal, "$1C", 19, "thermal_zone0
-- }}}
-- {{{ Battery state
-mybaticon = wibox.widget.imagebox("/home/anrxc/.config/awesome/icons/bat.png", false)
+mybaticon = wibox.widget.imagebox(home .. "/.config/awesome/icons/bat.png", false)
-- Initialize widget
mybatwidget = wibox.widget.textbox()
-- Register widget
@@ -87,8 +88,8 @@ vicious.register(mybatwidget, vicious.widgets.bat, "$1$2%", 61, "BAT0")
-- }}}
-- {{{ Network usage
-mydnicon = wibox.widget.imagebox("/home/anrxc/.config/awesome/icons/down.png", false)
-myupicon = wibox.widget.imagebox("/home/anrxc/.config/awesome/icons/up.png", false)
+mydnicon = wibox.widget.imagebox(home .. "/.config/awesome/icons/down.png", false)
+myupicon = wibox.widget.imagebox(home .. "/.config/awesome/icons/up.png", false)
-- Initialize widget
mynetwidget = wibox.widget.textbox()
vicious.register(mynetwidget, vicious.widgets.net, '<span color="'
@@ -96,8 +97,21 @@ vicious.register(mynetwidget, vicious.widgets.net, '<span color="'
.. beautiful.fg_netup_widget ..'">${eth0 up_kb}</span>', 3)
-- }}}
+-- {{{ Volume level
+myvolicon = wibox.widget.imagebox(home .. "/.config/awesome/icons/vol.png", false)
+-- Initialize widget
+myvolwidget = wibox.widget.textbox()
+vicious.register(myvolwidget, vicious.widgets.volume, "$1%", 2, "Master")
+-- Register buttons
+myvolwidget:buttons(gears.table.join(
+ awful.button({ }, 1, function () exec("urxvt -T Alsamixer -e alsamixer") end),
+ awful.button({ }, 4, function () exec("amixer -q -c 0 set Master 1dB+") end),
+ awful.button({ }, 5, function () exec("amixer -q -c 0 set Master 1dB-") end)
+))
+-- }}}
+
-- {{{ Date and time
-mydateicon = wibox.widget.imagebox("/home/anrxc/.config/awesome/icons/time.png", false)
+mydateicon = wibox.widget.imagebox(home .. "/.config/awesome/icons/time.png", false)
-- Initialize widgets
mydatewidget = wibox.widget.textbox()
mydatestwidget = wibox.widget.textbox()
@@ -106,6 +120,10 @@ vicious.register(mydatewidget, vicious.widgets.date, "%R", 61) -- Amst
vicious.register(mydatestwidget, vicious.widgets.date, "%R", 61, -21600) -- New York
-- }}}
+-- {{{ Flexible widget
+myflexeidget = wibox.widget.textbox()
+-- }}}
+
-- {{{ Wibox initialisation
local taglist_buttons = gears.table.join(
@@ -187,11 +205,11 @@ awful.screen.connect_for_each_screen(function(s)
}
-- Create the tasklist
- s.mytasklist = awful.widget.tasklist {
- screen = s,
- filter = awful.widget.tasklist.filter.currenttags,
- buttons = tasklist_buttons
- }
+ --s.mytasklist = awful.widget.tasklist {
+ -- screen = s,
+ -- filter = awful.widget.tasklist.filter.currenttags,
+ -- buttons = tasklist_buttons
+ --}
-- Create the wibox
-- * theme font "Terminus 8" or "ProFont 8" for this widget bar height
@@ -207,7 +225,11 @@ awful.screen.connect_for_each_screen(function(s)
myseparator,
s.mypromptbox,
},
- s.mytasklist, -- Middle widget
+ { -- Middle widget
+ layout = wibox.layout.flex.horizontal,
+ myflexwidget,
+ },
+ --s.mytasklist,
{ -- Right widgets
layout = wibox.layout.fixed.horizontal,
myseparator,
@@ -221,6 +243,9 @@ awful.screen.connect_for_each_screen(function(s)
mynetwidget,
myupicon,
myseparator,
+ myvolicon,
+ myvolwidget,
+ myseparator,
mydateicon,
mydatestwidget,
myseparator,
@@ -523,6 +548,7 @@ awful.rules.rules = {
name = {
"Library", -- firefox downloads, history...
"Event Tester", -- xev
+ "Alsamixer",
},
role = {
@@ -619,7 +645,7 @@ end
-- {{{ Autostart
-awful.spawn("/usr/bin/xinput set-prop 9 334 0 1 0") -- touchpad single finger scrolling
-awful.spawn("/home/anrxc/bin/autostart-keychain-agent.sh") -- launch the ssh-agent
-awful.spawn("/home/anrxc/bin/autostart-xmodmap-xdefaults.sh") -- xrdb merge defaults and keymap
+awful.spawn("/usr/bin/xinput set-prop 9 334 0 1 0") -- touchpad single finger scrolling
+awful.spawn(home .. "/bin/autostart-keychain-agent.sh") -- launch the ssh-agent
+awful.spawn(home .. "/bin/autostart-xmodmap-xdefaults.sh") -- xrdb merge defaults and keymap
-- }}}