jump to navigation

Mark irssi window as unread 2013 September 24 16:00

Posted by diamond in : Tech , add a comment

Someone messages me on irc/im, i change to the irssi window, see that it’s something i want to leave for later, then promptly forget about it. This has been happening for many years. Today, it finally ends. I present unread.pl, a tiny irssi script that allows me to mark windows as unread:


$ cat unread.pl
#!/usr/bin/perl -w
 
sub cmd_unread {
my ($data, $server, $witem) = @_;
my $base = Irssi::window_find_refnum(1);
my $target;
 
if ($data eq "") {
$target = Irssi::active_win();
$base->set_active();
} else {
$target = Irssi::window_find_refnum($data);
}
 
$target->activity(4);
}
 
Irssi::command_bind("unread", "cmd_unread");

If given no argument, it marks the current window as unread and switches to window 1. Otherwise it just marks the specified window as unread.

Google chrome per-workspace profiles

Posted by diamond in : Tech , add a comment

Do you use chrome and find it irritating that when you click on a link outside of the browser, it’ll just use whatever chrome window you last had active? I sure do. Here’s my fix for gnome classic:

1) A custom launcher script that detects which workspace i’m on, and decides which browser profile to send the request to:

$ cat bin/google-chrome-launcher
#!/bin/bash
workspace=$(xprop -root -notype _NET_CURRENT_DESKTOP | sed 's/^.* = //')
profiledir=""
 
case "$workspace" in
0) profiledir="Default";;
1) profiledir="Profile 1";;
esac
 
if [ -n "$profiledir" ]; then
exec google-chrome --profile-directory="$profiledir" "$@"
else
exec google-chrome "$@"
fi

2) A custom .desktop to invoke my custom script:

$ cat .local/share/applications/google-chrome-custom.desktop
[Desktop Entry]
Version=1.0
Name=Google Chrome Custom
Exec=google-chrome-launcher %U
Terminal=false
Icon=google-chrome
Type=Application
Categories=Network;WebBrowser;
MimeType=text/html;text/xml;application/xhtml_xml;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;

3) Make this the default. Gnome Classic/Fallback being the horrible hybrid broken beast that it is, i could find no gui way of doing this, so i simply edited ~/.local/share/applications/mimeapps.list and changed every occurrence of google-chrome.desktop to google-chrome-custom.desktop, and that seemed to do the trick.

I’ve found a new bio one-liner 2011 May 9 18:41

Posted by diamond in : Random , add a comment

A friend of mine, Tobias, when asked to describe me in one line came out up with this gem:

“He’s the reason babies cry when they’re born.”

This is hands-down the best thing that’s ever been said about me.

It is done 2011 May 4 20:04

Posted by diamond in : Random , 2 comments

Yesterday myself and noirin got divorced. It took 8 months of separation before we finally saw a divorce lawyer, but only 3 weeks to actually get a court date and all the paperwork in order. As for the court hearing itself, it went as well as it could. By the end i was monosyllabic.

During the last hour as my wife, noirin made me look at pictures of shoes, and promise to never be in charge of a power plant. It was a glimpse into what we’d shared.

The marriage is over. This is not a cause for celebration, nor is it a cause for regret. It is simply necessary, it is what it is.

It is what it is.

Running, depression & energy 2011 April 24 18:15

Posted by diamond in : Health , 2 comments

To the surprise of everyone (well ok, me), i’ve actually kept up the c25k program i started back in march. It starts out with intervals of run 60s, walk 90s, and repeat for 20 mins. Week 5 is the real killer. Up till that point the longest you’ve ran is 5 mins. Week 5 day 1 involves 3 runs of 5 mins, day 2 kicks it up a big notch up to 2 runs of 8 mins, but day 3 is the one that terrified me. Run 20 minutes. I’ve never run that long in my life. And today i finished week 5. I may have lifted my arms and screamed “FUCK YES!” in the gym *kof*.

My theory about keeping the barrier to exercise to the absolute minimum appears to have paid off. I’ve had about 2.5 weeks of breaks from the training, 10 days because i’d hurt my back, and another week because i was away. Apart from that i’ve been running on schedule. My physio gave me some warmup exercises to do before, and some stretches to do after, which have prevented the back injury from becoming an issue. My routine is:

  1. warmup exercises for my back
  2. walk at 6kmph for 5 minutes as a general warmup
  3. run at 9.5kmph, walk at 5.5kmph, following the c25k intervals
  4. cooldown walk at 5kmph
  5. stretches for my hamstrings and back

Now onto more general health stuff that i’ve been meaning to write about for a long time.

I’ve been tired for the last 10 years. For a very long time i believed the issue was a problem with my bladder preventing me from sleeping properly, i saw urologists for 9 years and was even diagnosed with Interstitial Cystitis in ireland. Eventually the specialists said that though my bladder was behaving abnormally, that there was nothing functionally wrong with it. I saw a sleep specialist last year, they did a sleep study where i was hooked up to about 18 different sensors. I slept really badly that night, felt utterly exhausted after it, and yet the actual results showed that my sleep was perfectly normal. My theory for the previous 9 years was therefore out the window. The only remaining explanation was the depression, which has always struck me as a very hand-wavy cop-out of a diagnosis. But after chewing it over for close to a year, i finally understand.

If you sit down and study hard for an exam, at the end of the day you’ll be exhausted even though you haven’t been doing any physical labour. A brain that’s trying to process lots of stuff sucks vast amounts of energy. And the cause of my depression is that my subconscious has spent the last decade trying to resolve an issue it can’t cope with, the conflict between my human nature and my religious beliefs (this is not something i’m going to go into here). This is why i’m so exhausted all the time, it’s going round and round in circles, from the moment i wake up till the moment i fall asleep. This is why my memory is so awful, this is why my concentration is so distracted, this is why i have trouble thinking clearly, because a large part of my brain is totally occupied with this huge issue and keeps disrupting normal operation. This is why when i wake up at around 06:00 i immediately get stressed and find it nearly impossible to fall back to sleep even though i’m not consciously thinking about anything stressful.

I never thought i’d actually get to a place where all of this made sense. I never thought it could actually be understood in any rational way. So despite the fact that it’s still a massive issue to tackle, it’s an incredible relief to finally have a handle on the situation.