Skip to content
Permalink
Browse files

Add AwesomeWM Agenda

  • Loading branch information...
frioux committed Jun 11, 2019
1 parent 5aba878 commit dd590f274aeb6edc70cdcd9371045de0eb600e61
Showing with 40 additions and 7 deletions.
  1. +2 −0 README.mdwn
  2. +17 −3 awesome/gross/calendar_popup.lua
  3. +7 −2 awesome/rc.lua
  4. +7 −1 awesome/widgets.lua
  5. +5 −0 crontab.d/hourly/gcal
  6. +1 −1 install.sh
  7. +1 −0 packages.x11.sh
@@ -125,6 +125,8 @@ Ensure permissions are correct:

Also set up Firefox Sync

Run `gcalcli list` to authenticate to google.

# Add / Replace SSH Key

* Generate Key: `ssh-keygen -t ed25519 -o -a 100`
@@ -201,7 +201,7 @@ local function get_geometry(widget, screen, position)
x = wa.x + math.floor((wa.width - width) / 2)
end

return {x=x, y=y, width=width, height=height}
return {x=x, y=y, width=width, height=2*height}
end

--- Call the calendar with offset
@@ -217,7 +217,14 @@ function calendar_popup:call_calendar(offset, position, screen)

self.offset = inc_offset ~= 0 and self.offset + inc_offset or 0

local widget = self:get_widget()
local t = self:get_widget().children[2]
local path = os.getenv("TMPDIR")
if not path then path = "/tmp" end
local f = assert(io.open(path .. "/cal", "rb"))
local content = f:read("*all")
f:close()
t:set_text(content)
local widget = self:get_widget().children[1]
local raw_date = os.date("*t")
local date = {day=raw_date.day, month=raw_date.month, year=raw_date.year}
if widget._private.type == "month" and self.offset ~= 0 then
@@ -325,6 +332,7 @@ local function get_cal_wibox(caltype, args)
ret.screen = args.screen

local t = wibox.widget.textbox()
t:set_font("Ubuntu Mono Regular 14")
local widget = wibox.widget {
font = args.font or beautiful.font,
spacing = args.spacing,
@@ -335,7 +343,13 @@ local function get_cal_wibox(caltype, args)
_calendar_margin = args.margin,
widget = caltype == "year" and wibox.widget.calendar.year or wibox.widget.calendar.month,
}
ret:set_widget(widget)
local composite = wibox.widget({
widget,
t,
layout = wibox.layout.flex.vertical,
spacing = 2,
})
ret:set_widget(composite)

ret:buttons(gears.table.join(
abutton({ }, 1, function ()
@@ -220,7 +220,7 @@ awful.screen.connect_for_each_screen(function(s)
-- Create the wibox
s.mywibox = awful.wibar({ position = "top", screen = s, height = 32 })

local mytextclock = widgets.clock(s)
s.mytextclock = widgets.clock(s)

-- Add widgets to the wibox
local right = {
@@ -234,7 +234,7 @@ awful.screen.connect_for_each_screen(function(s)
smweatherwidget,
osweatherwidget,
volumecfg.widget,
mytextclock,
s.mytextclock,
s.mylayoutbox,
}
if DEBUGGING then
@@ -277,6 +277,11 @@ globalkeys = gears.table.join(
{description = "view next", group = "tag"}),
awful.key({ modkey, }, "Escape", awful.tag.history.restore,
{description = "go back", group = "tag"}),
awful.key({ modkey }, "c",
function ()
awful.screen.focused().mytextclock._cal:toggle()
end,
{description = "toggle calendar", group = "awesome"}),

awful.key({ modkey, }, "j",
function () awful.client.focus.byidx( 1) end,
@@ -3,6 +3,8 @@ local vicious = require("vicious")
local wibox = require("wibox")
local gears = require("gears")

local calendar_popup = require("gross.calendar_popup")

local widgets = {}

function widgets.battery()
@@ -45,7 +47,11 @@ end

function widgets.clock(screen)
local widget = wibox.widget.textclock()
local self = awful.widget.calendar_popup.month({ screen = screen })
local self = calendar_popup.month({
screen = screen,
bg = "#111111",
})
widget._cal = self

-- inlined from calendar_popup:attach
local position = "tr"
@@ -0,0 +1,5 @@
#!/bin/zsh

gcalcli --calendar fREW agenda "$(date)" "$(date --date=@$(( $(date +%s) + 8 * 60 * 60 )) )" |
cut -b 13- |
skip 1 > $TMPDIR/cal
@@ -24,7 +24,7 @@ if [ -e ~/.frewmbot-local ]; then

link-file terminator_config ~/.config/terminator/config
link-file xsession ~/.xinitrc
link-file taffybar/taffybar.hs ~/.config/taffybar/taffybar.hs
link-file crontab.d/hourly/gcal ~/.crontab.d/hourly/gcal
if [ -d "$HOME/var/mail" ]; then
link-file crontab.d/hourly/notmuch ~/.crontab.d/hourly/notmuch
else
@@ -8,6 +8,7 @@ exec apt-get --no-install-recommends \
feh \
firefox \
fonts-lohit-knda \
gcalcli \
gnome-system-monitor \
gnome-power-manager \
gtk2-engines \

0 comments on commit dd590f2

Please sign in to comment.
You can’t perform that action at this time.