Echo AreaJust a blog, ok2014-06-24T21:57:00Ztekutihttp://blog.ryuslash.org/feed/atomTom Willemsenhttp://blog.ryuslash.org/HabitRPGhttp://blog.ryuslash.org/2014/06/24/habitrpg2014-06-24T21:57:00Z2014-06-24T21:57:00Z

A quick post just to have written one, it���s been awhile…

HabitRPG is a to-do application unlike many others. It gamifies your task list by adding Role Playing Game elements. You create a character, you have HP, XP, (eventually) MP and gold. There are three categories of tasks: habits, dailies and to-dos. They���re colored from red (bad) to yellow (neutral) and blue (good). Not completing dailies will cost you HP and turn them red, leave them incomplete for too long and your character will die and lose a level. You gain XP and coins by completing tasks. You can use your MP for certain special abilities, for example strike hard at a task and shift its color more towards blue. You can use coins to buy rewards, either self-made or thought-up by the HabitRPG developers.

You can also start a party and go questing with friends, or join a guild. There are also challenges, which are sets of tasks specified by someone else, as a challenge.

I���ve tried many a to-do application. I���ve even tried writing my own a few times. I���ve never really been satisfied. For a long while now I���ve been using org-mode for Emacs, both because it is Emacs and because it flexible enough to change completely to your own needs. The only problems remaining are identifying your needs and keeping up with your task list. Both are tricky to me, but that last one gets worse the bigger my task list gets.

Unexpectedly, HabitRPG���s rewards and random loot are stimulation enough for me to keep completing tasks. I���ve been using it for a couple of weeks now and I���m still completing stuff, which is quite unusual for me. And I put lots of stuff in there, such as ���Drink water���, which is a habit I want to stimulate; or ���Exercise��� (three days a week as a daily), which is something I���ve been needing to do in a long time and so far I���m keeping it up well; or single tasks like ���Clean up ~/projects ���, which I���ve yet to do.

I suppose it helps that I���ve always liked computer RPGs, and this wouldn���t work if I didn���t feel that the reward of being able to buy a new weapon for my character is any kind of motivation.

Anyway, if you have trouble motivating yourself to actually complete tasks on your to-do list and it sounds like fun to you, you might try it.

Tom Willemsenhttp://blog.ryuslash.org/Different roleshttp://blog.ryuslash.org/2013/01/10/different-roles2013-01-10T02:49:33Z2013-01-10T02:49:33Z

The other day I noticed that when I'm working I find it very annoying to have tasks for my personal projects appear in either my agenda or my todo list, so I was thinking if I couldn't make it somewhat more flexible.

First I've added some separation between my org files, I've split them into personal-org-agenda-files, work-org-agenda-files and common-org-agenda-files, since there are also some tasks that I would like to know about in either situation.

(defvar oni:personal-agenda-files
  (list (expand-file-name "~/documents/org/tasks"))
  "My personal agenda, should only show up at times I don't have
  to work.")

(defvar oni:work-agenda-files
  (list (expand-file-name "~/documents/org/work"))
  "My work agenda, should only show up at times I work.")

(defvar oni:common-agenda-files
  (list (expand-file-name "~/documents/org/misc"))
  "Agenda files that are work-agnostic, should always show up.")

At first I only seperated them with org-agenda-custom-commands:

(setq org-agenda-custom-commands
      '(("P" . "Personal only")
        ("Pa" "Personal agenda" agenda ""
         ((org-agenda-files (append oni:personal-agenda-files
                                    oni:common-agenda-files))))
        ("Pt" "Personal todo" agenda ""
         ((org-agenda-files (append oni:personal-agenda-files
                                    oni:common-agenda-files))))
        ("W" . "Work only")
        ("Wa" "Work agenda" agenda ""
         ((org-agenda-files (append oni:work-agenda-files
                                    oni:common-agenda-files))))
        ("Wt" "Work todo" todo ""
         ((org-agenda-files (append oni:work-agenda-files
                                    oni:common-agenda-files))))))

But it's clunky to have to use a separate command just to see a clean todo list. Then I thought, and tried, to have a function that checks the time to see which it should use, since I work from 09:00 to 17:00, if the current time is between those times I should only look at my work todo list, most of the time, outside of those hours I don't really care what I have to do for work.

(defun oni:set-org-agenda-files ()
  (interactive)
  (let ((current-time (current-time-string))
        (start-time (format-time-string "%a %b %e 09:00:00 %Y"))
        (end-time (format-time-string "%a %b %e 17:00:00 %Y")))
    (if (or (and (string< current-time start-time)
                 (string< current-time end-time))
            (and (string< start-time current-time)
                 (string< end-time current-time)))
        (setq org-agenda-files
              (append oni:personal-agenda-files
                      oni:common-agenda-files))
      (setq org-agenda-files
            (append oni:work-agenda-files
                    oni:common-agenda-files)))))

It's weird, but since Emacs doesn't have any real datetime functions for creation/comparison, for as far as I know, it seemed easiest to just create some strings representing the time and compare these.

Then it should be, if the current time is either before both start and end time or after both start and end time it should return my personal todo list, otherwise it should return my work todo list.

Now, it would be silly to have to call that manually every so-often, so I've set it up to do so automatically.

(oni:set-org-agenda-files)
(run-at-time "09:01" nil 'oni:set-org-agenda-files)
(run-at-time "17:01" nil 'oni:set-org-agenda-files)

First, I set my agenda files to whatevers they should be right now. Then I have this function run at 09:01 and 17:01, if either or both have already passed, they won't be executed today. This effectively tells Emacs to switch to my work "role" after 09:00 and back to my personal "role" after 17:00.

It's not perfect yet, but I felt like writing something. The things I would change might include:

  • Check the times for either < or = the start/end times, so I don't
    have to check for :01 every time, but Emacs doesn't have a string<=
    function so I'll have to mimic it.

  • Always set it to my personal "role" during weekends.

  • Have them repeat every 24 hours, just in case I don't turn off my
    PC for a few days.

I'll fix those soon, they're not hard to do, but this works for now. It has worked well for me today, but I might throw it out again tomorrow, as I sometimes tend to do.