Giter VIP home page Giter VIP logo

awmodoro's Introduction

#Awmodoro ###Clutter-free Pomodoro sessions in Awesome WM The basic idea is to at start (with for instance a keybinding)

  • hide clutter (widgets/wibox)
  • show a very out-of-our-way and subtle indication of elapsed and left time

and at stop

  • bring back user to the real world

Awmodoro is in itself a very simple timer (with a progress bar ui) specifically made with regards to the Pomodoro Technique. It can be used as a regular widget, however - awmodoro provides the user with hooks allowing lua-code to be executed at start and end of each session. This allows for setup and teardown of distraction free environments.

##Usage cd ~/.config/awesome git clone git://github.com/optama/awmodoro.git

Example configuration, in rc.lua:

local awmodoro = require("awmodoro")

--pomodoro wibox
pomowibox = awful.wibox({ position = "top", screen = 1, height=4})
pomowibox.visible = false
local pomodoro = awmodoro.new({
	minutes 			= 25,
	do_notify 			= true,
	active_bg_color 	= '#313131',
	paused_bg_color 	= '#7746D7',
	fg_color			= {type = "linear", from = {0,0}, to = {pomowibox.width, 0}, stops = {{0, "#AECF96"},{0.5, "#88A175"},{1, "#FF5656"}}},
	width 				= pomowibox.width,
	height 				= pomowibox.height, 

	begin_callback = function()
		for s = 1, screen.count() do
			mywibox[s].visible = false
		end
		pomowibox.visible = true
	end,

	finish_callback = function()
		for s = 1, screen.count() do
			mywibox[s].visible = true
		end
		pomowibox.visible = false
	end})
pomowibox:set_widget(pomodoro)

In globalkeys:

awful.key({	modkey			}, "p", function () pomodoro:toggle() end),
awful.key({	modkey, "Shift"	}, "p", function () pomodoro:finish() end),

This creates a separate minimal and initially hidden wibox containing only the awmodoro widget. We set callbacks to hide other wiboxes at start and to show them again when finished. We add a keyboard shortcut to start a session and yes one to also end one ;-)

Default mouse bindings are

  • Button 1 Toggle pause/resume
  • Button 2 (mid) End session
  • Button 3 Reset timer

These can be overriden by adding and changing

pomodoro:buttons(awful.util.table.join(
	awful.button({ }, 1, function() pomodoro:toggle() end),
	awful.button({ }, 2, function() pomodoro:finish() end),
	awful.button({ }, 3, function() pomodoro:reset() end)
))

##Widget parameters minutes Minutes defining duration of a session. active_bg_color Background color of progress bar when timer is running. paused_bg_color Background color of progress bar when timer is paused. fg_color Foreground color(s) of progress bar. do_notify Boolean value specifying wether notifications should be shown at begin, pause, resume, finish and reset. width Width of widget. height Height of widget.

Colors are provided according to format specified by http://awesome.naquadah.org/doc/api/modules/gears.color.html

###Note If you prefer indivisible sessions (no ability to pause) then instead of pomodoro:toggle() use pomodoro:begin() and override mouse button 1 to something else but toggle/pause.

awmodoro's People

Contributors

interskh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.