battery + volume indicator
This commit is contained in:
parent
6b7c87f237
commit
4bf7b29e2f
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
|||||||
*.jpg
|
*.jpg
|
||||||
*.png
|
*.png
|
||||||
|
*.svg
|
||||||
|
76
rc.lua
76
rc.lua
@ -8,6 +8,8 @@ local awful = require("awful")
|
|||||||
require("awful.autofocus")
|
require("awful.autofocus")
|
||||||
-- Widget and layout library
|
-- Widget and layout library
|
||||||
local wibox = require("wibox")
|
local wibox = require("wibox")
|
||||||
|
-- more widgets
|
||||||
|
local vicious = require("vicious")
|
||||||
-- Theme handling library
|
-- Theme handling library
|
||||||
local beautiful = require("beautiful")
|
local beautiful = require("beautiful")
|
||||||
-- Notification library
|
-- Notification library
|
||||||
@ -151,6 +153,38 @@ local tasklist_buttons = gears.table.join(
|
|||||||
awful.client.focus.byidx(-1)
|
awful.client.focus.byidx(-1)
|
||||||
end))
|
end))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
--{{ Battery Widget }} --
|
||||||
|
baticon = wibox.widget.imagebox()
|
||||||
|
baticon:set_image(beautiful.baticon)
|
||||||
|
|
||||||
|
batwidget = wibox.widget.textbox()
|
||||||
|
vicious.register( batwidget, vicious.widgets.bat, '<span background="#92B0A0" font="sans 11"><span font="Overpass 13.2" color="#FFFFFF" background="#92B0A0">$2% </span></span>', 30, "BAT1" )
|
||||||
|
|
||||||
|
|
||||||
|
----{{--| Volume / volume icon |----------
|
||||||
|
volume = wibox.widget.textbox()
|
||||||
|
vicious.register(volume, vicious.widgets.volume,
|
||||||
|
'<span background="#4B3B51" font="sans 11"><span font="sans 11" color="#EEEEEE"> $1% </span></span>', 1, "Master")
|
||||||
|
|
||||||
|
volumeicon = wibox.widget.imagebox()
|
||||||
|
vicious.register(volumeicon, vicious.widgets.volume, function(widget, args)
|
||||||
|
local paraone = tonumber(args[1])
|
||||||
|
|
||||||
|
if args[2] == "♩" or paraone == 0 then
|
||||||
|
volumeicon:set_image(beautiful.mute)
|
||||||
|
elseif paraone >= 67 and paraone <= 100 then
|
||||||
|
volumeicon:set_image(beautiful.volhi)
|
||||||
|
elseif paraone >= 33 and paraone <= 66 then
|
||||||
|
volumeicon:set_image(beautiful.volmed)
|
||||||
|
else
|
||||||
|
volumeicon:set_image(beautiful.vollow)
|
||||||
|
end
|
||||||
|
|
||||||
|
end, 1, "Master")
|
||||||
|
|
||||||
|
--
|
||||||
local function set_wallpaper(s)
|
local function set_wallpaper(s)
|
||||||
-- Wallpaper
|
-- Wallpaper
|
||||||
if beautiful.wallpaper then
|
if beautiful.wallpaper then
|
||||||
@ -200,24 +234,30 @@ awful.screen.connect_for_each_screen(function(s)
|
|||||||
-- Create the wibox
|
-- Create the wibox
|
||||||
s.mywibox = awful.wibar({ position = "top", screen = s })
|
s.mywibox = awful.wibar({ position = "top", screen = s })
|
||||||
|
|
||||||
-- Add widgets to the wibox
|
-- left widgets
|
||||||
s.mywibox:setup {
|
local left_layout = wibox.layout.fixed.horizontal()
|
||||||
layout = wibox.layout.align.horizontal,
|
left_layout:add(mylauncher)
|
||||||
{ -- Left widgets
|
left_layout:add(s.mytaglist)
|
||||||
layout = wibox.layout.fixed.horizontal,
|
left_layout:add(s.mypromptbox)
|
||||||
mylauncher,
|
|
||||||
s.mytaglist,
|
-- right widgets
|
||||||
s.mypromptbox,
|
local right_layout = wibox.layout.fixed.horizontal()
|
||||||
},
|
right_layout:add(wibox.widget.systray())
|
||||||
s.mytasklist, -- Middle widget
|
right_layout:add(mykeyboardlayout)
|
||||||
{ -- Right widgets
|
right_layout:add(baticon)
|
||||||
layout = wibox.layout.fixed.horizontal,
|
right_layout:add(batwidget)
|
||||||
mykeyboardlayout,
|
right_layout:add(volumeicon)
|
||||||
wibox.widget.systray(),
|
right_layout:add(mytextclock)
|
||||||
mytextclock,
|
right_layout:add(s.mylayoutbox)
|
||||||
s.mylayoutbox,
|
|
||||||
},
|
-- taskbar
|
||||||
}
|
local layout = wibox.layout.align.horizontal()
|
||||||
|
layout:set_left(left_layout)
|
||||||
|
layout:set_middle(s.mytasklist)
|
||||||
|
layout:set_right(right_layout)
|
||||||
|
|
||||||
|
s.mywibox:set_widget(layout)
|
||||||
|
|
||||||
end)
|
end)
|
||||||
-- }}}
|
-- }}}
|
||||||
|
|
||||||
|
@ -126,6 +126,15 @@ theme.awesome_icon = theme_assets.awesome_icon(
|
|||||||
-- from /usr/share/icons and /usr/share/icons/hicolor will be used.
|
-- from /usr/share/icons and /usr/share/icons/hicolor will be used.
|
||||||
theme.icon_theme = nil
|
theme.icon_theme = nil
|
||||||
|
|
||||||
|
|
||||||
|
-- battery icon
|
||||||
|
theme.baticon = themes_path.."default/icons/battery.png"
|
||||||
|
-- volume icon
|
||||||
|
theme.mute = themes_path.."default/icons/audio-volume-muted.svg"
|
||||||
|
theme.vollow = themes_path.."default/icons/audio-volume-low.svg"
|
||||||
|
theme.volmed = themes_path.."default/icons/audio-volume-medium.svg"
|
||||||
|
theme.volhi = themes_path.."default/icons/audio-volume-high.svg"
|
||||||
|
|
||||||
return theme
|
return theme
|
||||||
|
|
||||||
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
||||||
|
Loading…
x
Reference in New Issue
Block a user