KSnapshot-Next

KSnapshot is getting an overhaul.

It’s actually a little more complicated than that. I started to work on the KF5 port of KSnapshot (EDIT: no, contrary to what Phoronix claims that port is not my work; I simply wanted to fix anything that needed fixing) sometime in early March this year, before I realised that the codebase, while perfectly in order for being a X11-only screenshot taker for KDE (yes, KSnapshot actually has a complete and fairly decent KF5 port in its frameworks branch on KDE Git), was in need of a major overhaul if we were going to get proper Wayland support in.

To that effect, I started working on a completely new screenshot application, copying in the bits and pieces of code from KSnapshot that I could actually use. It’s called KScreenGenie, and has been living in KDE’s Git infrastructure for quite a long time. It’s currently in KDE Review, and will be moved to KDE Graphics in time for the Applications 15.12 release. Not just that, it will be renamed to KSnapshot, so people upgrading their computers will seamlessly upgrade from KSnapshot to KSnapshot 2.0 a.k.a. KScreenGenie.

But KScreenGenie in its current form and with its current name is actually going to see a public release. The code in the master branch of the git repository is currently in doc and string freeze, and is actually considered stable enough for daily use. A distribution called KaOS already ships it, I’ve been using it as my primary screenshooting tool for months now, and other KDE developers have also spent time using and testing it and fixing minor issues. So barring major blocker bugs that pop up anytime soon, KScreenGenie 2.0.0 will be released (independently of the KDE Applications) on August 15, 2015.

If you’re so inclined, here’s a little bit of technical information on how KScreenGenie is different from KSnapshot. The biggest internal change is how pictures are actually acquired - instead of using Qt’s built in screenshooting APIs, KScreenGenie uses the native API for the platform that it’s running on. Currently, only one working platform backend exists, and that’s for X11, using xcb. We use libkscreen for properly figuring out screen layout information so that we can take proper multi-monitor screenshots (we don’t support Zaphod mode though). On Wayland, because the platform specific bits are so well separated from the platform-independent bits, the application starts up, but does not actually take a screenshot. The reason is that there’s no stable API for taking screenshots in Wayland yet (Weston has its own API, and while some of KWin’s screenshot effect APIs work, all don’t), and thus we don’t actually have a working Wayland image grabber yet.

A particularly nice user-facing feature is the ability to take screenshots of transient windows (pop-up menus, for example) along with the parent window. In KSnapshot, if you chose “Window Under Cursor” as your mode and hover over a pop-up menu, only the pop-up menu is captured (technically the pop-up menu is a X11 window). In KScreenGenie, we actually have code to detect if the window is a transient window and if so, we try to figure out who the parent window is and then take a composite shot of both the parent and the transient. Note though, that this currently only works with Gtk3 and Qt5 applications, since only these toolkits set the WM_TRANSIENT_FOR property on their pop-up windows, thus enabling us to figure out who their parent is.

KScreenGenie's Window With Transient Children mode

I’m also currently working on a basic image editor integrated into KScreenGenie for editing and annotating screenshots within KScreenGenie itself. The code isn’t online yet, since it’s nowhere near even half-baked, but hopefully it’ll be there by 15.12 or at the very most 16.04.

I’d like to encourage distributions to package KScreenGenie 2.0.0 in their primary repositories, and users to use it, test it and report bugs. Distribution packagers who do include KScreenGenie in their repositories do need to mark the KSnapshot package from Applications 15.12 as replacing, providing and obsoleting the KScreenGenie package though.

Happy clicking!

Six Hundred Kilometres

It’s dark outside, although for not much longer. My eyelids open, my head peeks out from under the blanket, and adjusts to the dim light coming in from the giant window right beside me. I begin to make out the dark outline of trees and bushes whizzing past me, interrupted every second by a dark line that is one of the gantries that hold up the electric catenary. The cold air from the air conditioning hits my bare forehead, and I open my eyes fully. My mind is strangely tranquil; I have not a care in the world.

It is not often that I wake up at a hundred and thirty kilometres per hour. It is, in fact, two mornings roughly every two months, that I begin my day halfway towards enlightenment.

The Linke-Hoffman-Busch coaches rumble along, gently, very gently, rocking from side to side on the continuously welded rails as it thunders east towards the rising sun. Every now and then, it goes over a set of track switches that remind the riders that they are indeed travelling at great speeds, for the coaches suddenly oscillate wildly, and then almost as suddenly subside as it returns to a stable track.

The sky outside is now bright violet. The outlines turn into distinct trees with leaves and trunks, the fields outside are full of rice and paddy, the tracks are lined with bushes. Inside, it is still dark, the rumble interrupted occasionally by snores from a few of the other seventy-one occupants of the coach. There are bags hanging from hooks above window opposite mine, and there are two half-full bottles of water on the table. The water inside is barely moving.

I prop my pillow up, raise myself and lower the blanket, and stare outside. Daylight is upon us, the brightness rapidly increasing. The farmers are out with their tractors. Out in the distance, a forlorn little scarecrow. Further away, cellphone towers dot the skyline. I am suddenly reminded to look at the time. I take my phone out and look. It is almost six.

The train slows down. A station, which it will not stop at. Ah, it is Dehri-On-Sone. In a minute, the train will climb on top of the Upper Sone Bridge, the country’s longest railway bridge over a river. It is so long that in the middle I will lose my cellphone signal.

As the train trundles along, I see that the river beneath has very little water. Wherever there is water though, the early morning sun makes the ripples glisten with golden light. I wonder if the farmer on the tractor has ever witnessed this sight. Then I wonder if the farmer has any inkling that a boy sitting on a train that passed in front of him a few minutes ago is right now crossing a bridge, looking at the sunlight glistening on the water, wondering if he has ever seen such a sight. The balance of probability suggests he does not.

An attendant comes up, with a carrier full of red cups and red flasks full of hot water. He sees that I am awake and asks me if I would like some tea. I ask if he has any coffee. He hands me a cup, a flask, and sachets of powdered milk, granulated sugar and instant coffee powder, with a small stirrer. He goes away, looking for other passengers who might want some tea. I am left to preparing my coffee.

I savour every sip of the cheap coffee. The scenery outside changes every few minutes, from paddy fields to thick woods, and back again. Birds are flying out in great big flocks, the villagers are sending their children to school in cycle-vans. Two farmers argue, while a mustering of storks drink from the water meant to submerge the rice in. Everyone around me is still asleep, oblivious to the life happening outside. I’m not much better, I realise, for I merely observe from my safe and comfortable cocoon while the people outside toil.

Two hours have since passed and the train is slowly winding along through the hills and the tunnels just beyond Gaya. The sun is still fresh and golden, and as the train curves tightly, the light reflects off the red coaches, offering spectacular sights. A long way ahead, the white locomotive whines along as it pulls its twenty or so fully loaded coaches, as it has been since the previous evening. The drivers have changed twice since.

Dhanbad arrives, and breakfast is served - two slices of bread, two vegetable cutlets with four slivers of fried potato and boiled peas. There’s some butter, sauce, and a small carton of mango juice. I spread butter on the bread, put a cutlet and roll the slice around it, and gobble it up. As I’m finishing, the attendant is here with another round of tea.

The train leaves Dhanbad with a new driver, the final change before I reach my destination. The mood has changed drastically. People are awake, and have descended from the upper berths. Some are calling up their families to report on their progress and telling them to be there at the station at such-o’clock. The blankets, pillows and sheets have all been thrown higgledy-piggledy on the top berth.

My coupe-mate engages me in idle chatter, I share a small joke. Then he goes back to reading the morning paper, I go back to looking outside. I report on my progress to my family. As Barddhaman passes by, my father reports that he’s already at the station to pick me up. The last hour has begun.

The train nears Kolkata. We overtake local trains heading into the city, chock full of people taking their daily commute into the city to earn their livelihood. We’re almost neck-and-neck with one such train. Just as it begins to slow down into the next station, I catch a glimpse of a couple standing at the door, laughing together. I am reminded of my time when I would return from my tutions by the local train, standing at the door, letting the cold wind batter my face into oblivion. Inexpensive happiness, but true happiness.

At noon, the Rajdhani Express from New Delhi has wound into the city and set itself into Platform 9B at Sealdah Railway Station. My father is on the platform, here to pick me up. I am happy to be home. A different happy from that which I was when I woke up this morning, more than six hundred kilometres away. I am sad that the journey is over.

It will happen again, I remind myself. Two weeks later, I will go back. On the train. There will be much to see outside, and even more to see and hear inside. Right now, the city beckons. There is much to enjoy.

Incredible India

The 12311 Up Howrah Delhi Kalka Mail for 22nd December was 12 and a half hours late. Yes, 12 and a half hours. It left at 8:10 AM on December 23rd. It was thus at 6:30 PM that it reached Mughalsarai Jn.

The train stopped for almost 45 minutes at Mughalsarai. They attached a Pantry Car and removed a couple of coaches. That was plenty of time to see some “this happens only in India” antics. What was more, we didn’t even have to leave our seats.

We were booked on coach B2, an AC 3 Tier coach. We were on berths 1, 2 and 3, which is at one extreme end of the coach. About 30 minutes into the stop at Mughalsarai, we saw a beggar enter the coach from the other end, sitting on the floor and dragging himself from coupé to coupé.

Our coupé had a BSF administrator. Him and his friend was having dinner. When the beggar reached us and asked for alms, he said:

“Nahin denge. Hum logo ko bhi aise nahin milte paise, kich kaam na karke. Aap jao, chaye waye bana lo station pe.”
“We won’t give you any money. Even we don’t get money without doing anything. Why don’t you go and make tea at the station?” [People will buy that. On Indian trains, in a single journey, the average person will consume a week’s worth of tea.]

The guy kept whining. Finally, the BSF guy said:

“Mere paas change nahin hai.”
“I don’t have any small change”

The guy replied:

“Aap do na. Mere paas change hai”
“Give me whatever you have. I have change.”

Just to remind you, we’re talking about a beggar who’s dragging himself along the floor of the coach because he can’t walk.

Anyway, the BSF dude gave him a few coins.

Then the beggar calmly stood up, brushed himself, opened the door to the vestibule and walked straight out.

Bengalis Killed The Floppy Disk

That day, I was at a computer store, and a typical “Bangali babu” came in. He wanted a hard disk.

Typical Bengalis have a pronunciation that can kill Englishmen.

So this guy wanted a hard disk. The typical Bengali will pronounce an “sk” as a “ks”, or an “x”. So this guy, who wanted a hard disk, asked the guy:

“Dada, hard disk achhé?”

Which in English, is:

“Dude, do you have a hard disk?”

Except that when he said disk, he, like all Bengalis, pronounced the “sk” as a “ks”.

So Disk became Diks.

Dicks.

And his question became:

“Dada, hard dicks achhé?”

In English:

“Dude, you got hard dicks?”

It wouldn’t stop at that. Poor shopkeeper, he kept hard disks of varying capacities. So he replied,

“Koto boro chai?”

Which in English would loosely mean, “How big do you want?”

Now the word “boro”, in proper Bengali means big. In everyday Bengali, it also means long.

No wonder people don’t want floppy disks anymore.

The Travelogue

It’s 1:53 AM here on Sunday, January 30 2011, and I have suddenly remembered that train journey that we went through during the Durga Puja holidays in 2006. I’m pretty sure that if I go off to sleep now, I’m not going to remember any of this so vividly as I’m recollecting right now, so I’m going to write it down right now. So let’s begin.

We were supposed to visit my aunt, uncle and cousin, who at that time stayed at Hyderabad, in the Monsoon of 2006. Durga Puja was held early that year, with Saptami falling on Friday the 29th of September. Monsoon was also pretty late and quite heavy that year. We got booked on the 8645 East Coast Express from Howrah to Hyderabad departing Tuesday, 26th September 2006. Our school had just hired a new principal that academic year, and part of her “crackdown on leniency by the former principal”, as she called it, involved refusing early holidays to students. We were leaving on the 26th, which involved missing the last two days of pre-puja vacation school. My parents approached the principal for permission for an early holiday, and got refused in a very strict manner. Nonetheless, we had to go, since our tickets had been booked.

Cut to Friday, 22nd September, and incessant rains began, flooding the front of our house and turning it into an island. The school declared a holiday, and I got myself an extended weekend. However, even when the rains subsided on Saturday, fresh spells on Sunday only increased the water level. The school refused to declare a holiday on Monday, but I could not attend due to the waterlogging. In fact, I vaguely remember a friend telling me the attendance in Class VI-C, which ha a strength of 35, being in the single digits, something like 7, on that Monday.

Rewind back to Sunday, the heavy rains caused a landslide of sorts at Tikiapara. This shut down the entire South Eastern Railway section of Howrah Station. Most of the trains were cancelled, and some were moved to depart from Santragachi. All incoming trains were being short-terminated at Santragachi.

On Tuesday morning, I woke up at 6 AM. Looking back at those days, I’m pretty surprised at what I could do. Right now I wake up no earlier than 11 AM, and in those days, 7 AM was late by my standards. Oh, I forgot to tell you that my Dad would not be travelling with us, due to issues with his job - he would be joining us later during the weekend - and it would be just the three of us, Mom, Bro and me who would be travelling. I woke Dad up and went off to sleep again, waking up at 7. I found Dad watching the news intently, and I remember images of submerged villages, with people sitting on the roof of a hut in the middle of what looked like a fast-flowing ocean of water, being shown on the news. I think the channel was Tara News. Anyway, at about 7:30, headlines showed up telling that 8645 Up East Coast Express would be departing from Shalimar, 3 hours late at 1:45 PM.

We - the three journeymen, Dad and my maternal grandmother - took a taxi and departed for the station at about 11 AM. We descended from the Vidyasagar Setu and got confused for a while, before taking the Upper Foreshore Road until we got to a signboard showing that we needed to go left to get to Shalimar. Anyhow, we reached there somewhere ‘round 1:15, because I remember we had very little time in our hands while we were stuck in the level crossing just outside the station. Shalimar station isn’t very big. In fact, it has something like 20 tracks, with 18 of them being in a freight yard. There’s one long island platform with Platform numbers 1 and 2. The platform has a concrete roof. There are no shops, no coolies - no nothing. Just a platform and tracks.

We got to the platform after crossing the Platform 1 track on foot - there’s no over-bridge, heck, there isn’t even an entrance to the station - kept our luggage somewhere in the middle of the platform and began waiting. And waiting. 1:45 came and passed. So did 2. And then 2:30. We explored many possibilities - such the train having left from Santragachi, or having been cancelled - until somewhere around 2:50, a voice on the PA system (which we didn’t know even existed until that announcement came through) said that the rake had left the Tikiapara yard and would be arriving on Platform 2 in some time.

And the train did arrive, pulled by the same Jhansi-based WAM-4 electric engine that would take us all the way to Vishakapatnam. While we boarded our coach - and stormed out after keeping the luggage because the AC had not been switched on and it was stuffier than hell inside - the engine decoupled and attached to the other end of the train. We bade our goodbyes, and the train pulled out from the station at 3:45 PM, a full 4 hours behind schedule and departing from the wrong station.

The rest of the day was pretty uneventful. The coach was almost empty until Kharagpur, and even then we had the entire 6-birth coupe to ourselves all that day and night. I was awake all night, watching out of the window - which I always do, even nowadays, in trains - and remember the train stopping numerous times after passing the Chilka Lake station. I couldn’t make out the lake itself because it was so dark, so I daydreamt about fighter planes having a dogfight in the skies above us while I communicated with them over a radio and watched them on a Radar screen in an imaginary laptop. Ahh, those innocent days.

I must have dozed off around 3 or so, and woke up at 6, just as the train arrived at Srikakulam Road. One glance outside and I was captivated by the scenery of the eastern coastal plains. I have traveled along many routes in the Indian Railways, and trust me, you will not see a more scenic mainline route than the Srikakulam Road - Rajahmundry stretch. I quickly took a look at the time and calculated that we were running 8 hours late, and concluded that we would not be reaching Hyderabad until 2AM that night. Resignedly, I took my toothbrush and went off to brush my teeth, while Mom inventoried our food and water supplies. We concluded we had enough biscuits and cake to last us till the evening, and that we had to buy a couple of bottles of water. We also called up Mashimoni and Mesho, giving them our progress report.

We reached Vishakapatnam around 9, where the train stopped for around 40 minutes. Mom went down and bought a couple of bottles of water. The train got a new engine (which I later saw was a rusty old WAG-5) which was slow as hell. Our coupe got another passenger, bringing the total to four. The train finally started off, in the opposite direction, branching out into another line just before a station called Duvvada. We got our breakfast of Idli and Chutney from a vendor with a bucketful of that stuff. After that, we rolled about on our berths and I read a Famous Five book until we reached Rajahmundry, sometime around 2 in the afternoon. We ordered lunch from the Pantry Car, and waited until it arrived.

It arrived just as the train departed. The train picked up speed very slowly, but then slowed down again as it climbed on top of the bridge over the Godavari. The first two spans of the cantilever bridge are curved, meaning the train curved almost through 75 degrees while over water. It was breathtaking, watching the train curve on a bridge, out of the window.

The scenery changed after crossing the river, and got very boring. I went back to my book, and finished that before climbing up to the upper berth, turning the AC vent towards me and dozing off until I suddenly woke up, found that the train was moving along very slowly, came down and found that it was entering Vijayawada. The train waited for 20 minutes, getting a new engine. Mom bought some stuff from an IRCTC vendor who’d come on the train, and paid him with a 100 rupee note for a bill amounting to 34 rupees. The vendor got off the train, telling us he was going to get change. Anyway, the train departed, again in the reverse direction, five minutes later, and the vendor never returned with the change. Two coupes up front, another family had been duped, this time of a 500 rupee note.

As the train curved to the left to enter the branch line towards Kazipet, I got a good look at the engine, which was a new WAP-4 painted in flaming red. Then things got very interesting. When the train had departed Vijayawada, it was 7 hours late, with a projected arrival time of 1:30 AM. The train suddenly picked up some frightening speed, with the coaches shaking so much that water bottles kept falling off the center table. I looked out of the window and I could see the train skipping one red signal after another. We again had the coupe to ourselves, since the other occupant had left at Vijayawada, and we munched on our cakes and biscuits, not daring to stand up lest we fall down due to the coach’s swinging.

We stopped along the route at Khammam and Warangal, when we decided to call up Mashimoni to give them the latest progress report. It was then that we decided to get off the train at Secunderabad itself, rather than go all the way to Nampally (Hyderabad Station). That way it’d be easier for them to pick us up, and we could get off the train earlier. They told us to call them when the train reached Kazipet, so that they could then leave their house for the station.

We reached Kazipet just half an hour later, sometime around 8. We called them up to inform them of the progress. After the train left Kazipet, it began going even faster. The time it normally takes for the train to get from Kazipet to Secunderabad is four hours. That day, we did it in two and a half.

We reached Secunderabad around 10:45 or so. The train was now running, down from seven hours, five hours late, having made up for two hours along the Vijayawada-Secunderabad stretch. In fact, it had made up for so much time in between Kazipet and Secunderabad that Mashimoni and Mesho didn’t have enough time to get to the station. We had to wait.

Anyway, the train attendant, a young Bengali fellow with a cheery face who’d been very helpful all through the journey, helped us down with our luggage and set us down on the platform. The train left ten minutes after it arrived, for its final stop at Hyderabad. We waited around until 11, until Mashimoni and Mesho showed up and asked us to exit the station and come up to the car park where they were waiting.

We did the meet and greet, and hopped onto Mesho’s car. Mesho was driving, since the driver had gone home as it was so late. We left the station talking nineteen to the dozen, supposedly driving towards their home at Banjara Hills, before we found that since Mesho was paying more attention to the talking, he’d been absent-mindedly driving around a putla three times. But that’s another story altogether.

It’s 3:20 AM here, and I need to get my dose of sleep now. Adios, then :-)