Friday, June 15, 2012

Music and tags

After a long search for a tool that allows me to modify music file's tags in a text interface I decided to do my own. The main reason was that I couldn't find anyone that I liked and command line tools (there's a lot of them) didn't make it.

My requirements are simple, I need a tool that I can use over ssh to organize and modify the tags in my music files. X11 forwarding and VNCs are not an option since my client (Efika MX Smartbook) is limited and I can't stand the delay.

I decided to make it in C, for no particular reason other than it is my favorite programming language. But, I have to admit, if you ever consider doing GUI programming you should use an object orientated programming language. Every major GUI toolkit is using it. Oh, but what about gtk+? you may ask, well, gtk+ uses C, but they realized the need for OOP and build their own object-oriented framework for C, called GObject and gtk+ is build on top of that.

It will use ncurses and TagLib, hence the name nctagger.

That said, my code is still unusable, it is so basic that I haven't even pushed anything to github. I'm sure I will publish something eventually, but well you know, "my new job's a hassle and kids have the flu"

Thursday, June 7, 2012

Pomodoro

Recently I have been trying to improve my production. During my (quick) search I came up across the Pomodoro Technique, which is a time management method created by Francesco Cirillo in the 80s. Wikipedia explains all about it much better than I will ever do.

Basically you work for 25 minutes (a pomodoro) and after that you get a 5 minutes break, after 4 pomodoros you get a longer break, from 15 to 20 minutes.

Luckily for me there's a module available for my main work tool: Emacs. The module works well except for the fact that it doesn't beep when the pomodoro ends, adding this feature was super easy, even for someone that has never code in lisp before, like myself.

For Emac's beep (visible beep) notifications to work on Awesome WM, the following needs to be added to your .emacs:

(defun urgent-hint ()
  (let ((wm-hints (append (x-window-property "WM_HINTS" nil "WM_HINTS" nil nil t) nil)))
    (setcar wm-hints (logior (car wm-hints) #x00000100))
    (x-change-window-property "WM_HINTS" wm-hints nil "WM_HINTS" 32 t)))

(defun urgent-hint-helper (a b c)
  (urgent-hint))

(setq ring-bell-function 'urgent-hint)