batter widget
This commit is contained in:
parent
29b0263dfa
commit
33f8e11557
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
battery-widget
|
||||||
@ -7,6 +7,14 @@ function run {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# utilities in top bar
|
||||||
|
# network manager
|
||||||
|
run /usr/bin/nm-applet
|
||||||
|
# bluetooth indicator
|
||||||
|
run /usr/bin/blueman-manager
|
||||||
|
# screenshot utility
|
||||||
|
run /usr/bin/shutter
|
||||||
|
|
||||||
# tag 1
|
# tag 1
|
||||||
run /usr/local/bin/idea
|
run /usr/local/bin/idea
|
||||||
# tag 2
|
# tag 2
|
||||||
|
|||||||
2
install-deps.sh
Normal file
2
install-deps.sh
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
git clone https://github.com/deficient/battery-widget.git
|
||||||
|
sudo apt-get install acpid
|
||||||
35
rc.lua
35
rc.lua
@ -13,6 +13,7 @@ local hotkeys_popup = require("awful.hotkeys_popup").widget
|
|||||||
-- Enable hotkeys help widget for VIM and other apps
|
-- Enable hotkeys help widget for VIM and other apps
|
||||||
-- when client with a matching name is opened:
|
-- when client with a matching name is opened:
|
||||||
require("awful.hotkeys_popup.keys")
|
require("awful.hotkeys_popup.keys")
|
||||||
|
local battery_widget = require("battery-widget")
|
||||||
|
|
||||||
-- Load Debian menu entries
|
-- Load Debian menu entries
|
||||||
local debian = require("debian.menu")
|
local debian = require("debian.menu")
|
||||||
@ -20,6 +21,20 @@ local has_fdo, freedesktop = pcall(require, "freedesktop")
|
|||||||
|
|
||||||
local KEY_ALT = "Mod1"
|
local KEY_ALT = "Mod1"
|
||||||
|
|
||||||
|
local tag1 = "1:idea"
|
||||||
|
local tag2 = "2:brow"
|
||||||
|
local tag3 = "3:term"
|
||||||
|
local tag4 = "4:code"
|
||||||
|
local tag5 = "5:zoom"
|
||||||
|
local tag6 = "6:chat"
|
||||||
|
local tag7 = "7:pass"
|
||||||
|
local tag8 = "8"
|
||||||
|
local tag9 = "9"
|
||||||
|
|
||||||
|
local tags = {
|
||||||
|
tag1,tag2,tag3,tag4,tag5,tag6,tag7,tag8,tag9
|
||||||
|
}
|
||||||
|
|
||||||
-- {{{ Error handling
|
-- {{{ Error handling
|
||||||
-- Check if awesome encountered an error during startup and fell back to
|
-- Check if awesome encountered an error during startup and fell back to
|
||||||
-- another config (This code will only ever execute for the fallback config)
|
-- another config (This code will only ever execute for the fallback config)
|
||||||
@ -48,6 +63,7 @@ end
|
|||||||
-- {{{ Variable definitions
|
-- {{{ Variable definitions
|
||||||
-- Themes define colours, icons, font and wallpapers.
|
-- Themes define colours, icons, font and wallpapers.
|
||||||
beautiful.init(gears.filesystem.get_themes_dir() .. "default/theme.lua")
|
beautiful.init(gears.filesystem.get_themes_dir() .. "default/theme.lua")
|
||||||
|
beautiful.font = "DejaVu Sans 12"
|
||||||
|
|
||||||
-- This is used later as the default terminal and editor to run.
|
-- This is used later as the default terminal and editor to run.
|
||||||
terminal = "x-terminal-emulator"
|
terminal = "x-terminal-emulator"
|
||||||
@ -138,7 +154,10 @@ mykeyboardlayout = awful.widget.keyboardlayout()
|
|||||||
|
|
||||||
-- {{{ Wibar
|
-- {{{ Wibar
|
||||||
-- Create a textclock widget
|
-- Create a textclock widget
|
||||||
mytextclock = wibox.widget.textclock()
|
-- mytextclock = wibox.widget.textclock()
|
||||||
|
mytextclock = wibox.widget.textclock("%Y-%m-%d, %a, %H:%M:%S",1)
|
||||||
|
|
||||||
|
mybatterywidget = battery_widget { adapter = "BAT0", ac = "AC" }
|
||||||
|
|
||||||
-- Create a wibox for each screen and add it
|
-- Create a wibox for each screen and add it
|
||||||
local taglist_buttons = gears.table.join(
|
local taglist_buttons = gears.table.join(
|
||||||
@ -198,19 +217,6 @@ end
|
|||||||
-- Re-set wallpaper when a screen's geometry changes (e.g. different resolution)
|
-- Re-set wallpaper when a screen's geometry changes (e.g. different resolution)
|
||||||
screen.connect_signal("property::geometry", set_wallpaper)
|
screen.connect_signal("property::geometry", set_wallpaper)
|
||||||
|
|
||||||
local tag1 = "1:idea"
|
|
||||||
local tag2 = "2:brow"
|
|
||||||
local tag3 = "3:term"
|
|
||||||
local tag4 = "4:code"
|
|
||||||
local tag5 = "5:zoom"
|
|
||||||
local tag6 = "6:chat"
|
|
||||||
local tag7 = "7:pass"
|
|
||||||
local tag8 = "8"
|
|
||||||
local tag9 = "9"
|
|
||||||
|
|
||||||
local tags = {
|
|
||||||
tag1,tag2,tag3,tag4,tag5,tag6,tag7,tag8,tag9
|
|
||||||
}
|
|
||||||
|
|
||||||
awful.screen.connect_for_each_screen(function(s)
|
awful.screen.connect_for_each_screen(function(s)
|
||||||
-- Wallpaper
|
-- Wallpaper
|
||||||
@ -260,6 +266,7 @@ end
|
|||||||
mykeyboardlayout,
|
mykeyboardlayout,
|
||||||
wibox.widget.systray(),
|
wibox.widget.systray(),
|
||||||
mytextclock,
|
mytextclock,
|
||||||
|
mybatterywidget,
|
||||||
s.mylayoutbox,
|
s.mylayoutbox,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user