Tuesday, January 29, 2013

How to shutdown computer under Linux?

You can't!

Maybe this sounds very ignorant, as you will immediately go and try it, or remember the last time you shut down it without problems. Well guys, today shutting down Linux powered desktop is a rocket science...

Let we see how it all started.

In the beginning we had shutdown -h now; people were happy, developers were happy. You knew exactly how it behaved: you (as ordinary user) had to be a super user or user with elevated privileges to call it; developers also had their method: check your id and simply system() that command.

The best of all, this was portable way even between BSD's, Solaris and (presumably) other Unix flavors popular in that time.

But, someone at some point decided this approach is too complicated, so not cool and so stone aged and decided to give ordinary user privileges to put down the computer without asking password. Who was it, I don't know; most likely those guys with idea that mouse and keyboard with a single button are enough for all your problems...

And we got HAL (Hardware Abstraction Layer); resemblance with more famous HAL is probably just coincident, but both had one thing in common: they started as cool thing and ended up as pretty uncool crap.

So, our Linux HAL was also cool: DBus powered, supported all sort of things like receiving events for newly plugged in or off devices, restarting and shutting down computer, giving user privileges and so on.

It was so cool that distros started to ship it and we (users and developers) thought we had a golden egg: no more /proc parsing, no more ask-a-password-to-restart and so on...

But, those guys decided it was (again) too complicated; if you see all sort of things it supported, even on portable way, it was complicated; just they needed time to figure it out. So we got a bunch of *Kit stuff: ConsoleKit, DeviceKit...

If you ever had any touch with API from Apple, you will notice *Kit naming inspiration origin... Doesn't this sounds too biased? Now, if I'm going to add some of LPCTSTR-ed HWORD-like call (MS Windows lowlevel API) over standard Linux calls, people will probably call me nuts because Windows API is a big NO NO; and it happens to be not cool.

Like somene on Slashdot said once: if they like Apple so much, why don't they simple develop apps for it, instead ruining Linux desktop? Sure, they would like it, but Apple would not a give a fuck about their 'cool ideas': those guys are serious and they know you don't wanna fuck with user who pays you a bunch of $$$ for your OS, hardware and devices.

Let we back to our beloved Linux: again, desktop evolved and they decided those *Kit stuff is deprecated (whatever it means today) and we got UPower (for 'power' support and all things they considers had to do with powering your computer), 'policy' and 'console' went to systemd and I'm not sure what crap they think again; but don't be fooled: shutting down or restarting your computer has nothing to do with 'power' so UPower only support suspending and hibernating your PC.

standards

Now, if you are developer and you just want to restart or shutdown your computer, you have 4 (yes four) different way to do it and all depends on distribution: on Fedora you can still use ConsoleKit (although it has systemd); Slackware does not come with systemd and has ConsoleKit by default up, but you have to manualy start UPower, Arch recenly deprecated ConsoleKit in favor of systemd-logind...

Are you getting confused?

But, on other more serious OS-es like FreeBSD, developers don't have time to think about Kits, systemd and all that crap someone came up during toilet session; they are, from Linux developer perspective, stuck on stone age: they are still using HAL.

Sure, those guys are serious and have much better things to do, like improving SMP support, adding support for new hardware, fixing freaking bugs in kernel and userland apps instead of thinking the way how to power of your machine.

One famous Gnome developer said how Linux desktop is dead: yes, guys like him messed things up and flew away saying how nothing could be done... Linux desktop is slowly becoming a corporation led by small number of developers with influence and powerful companies, where even a single damn thing like turning of computer was made so complicated you wish to puke.

Do you know what is the main irony? Solaris, AIX, BSD's in some features are more portable than Linux distros. Go figure out why.

Monday, January 28, 2013

EDE and FLTK talks on FOSDEM

I got a really nice chance to speak about EDE and FLTK on FOSDEM, in two separate talks.

Both talks, EDE related lighting talk and FLTK talk, are scheduled in Sunday; FLTK talk will be held in cross-desktop devroom.

See you there!

Friday, January 11, 2013

Another update

After some period of inactivity here, due various obligations and increased work on EDE, I'm putting a short list of completed changes; some of them are visible and some not.

First the biggest one: a big overhaul of window container inside panel (the place where window icons/buttons are hold). In previous iteration, every window list change, which is emitted by window manager, would trigger buttons cleanup and recreation; not very efficient because this would make many C++ new/delete calls.

Now, those calls were dramatically reduced by tracking window states and desktop position, outside window list received from window manager; this also fixes one bug that annoyed me for some time: when you would focus window by clicking on window titlebar, order of window buttons inside panel would be changed. This is probably pekwm optimization for faster access of top level windows.

The next one is tray icon removal fix: when you had a bunch of apps inside tray and after you did some manipulation with them (close app, reopen and such), tray would leave empty boxes around. No more ;)

jam, a tool for building EDE and edelib, is now bundled with edelib. Beside it is easier to install it on platforms where is not installed (just go to edelib/tools/jam and hit make && make install), it is much easier to fix issues in it and distribute those fixes; you always get updated version with fresh edelib release.

Also, the last but not least, EDE and edelib are updated to compile and work on OpenIndiana, a fork of OpenSolaris. I'm not sure why, but I always get warm feeling around Solaris-es, no matter if they aren't popular much these days.

Upcomming planned changes should be mostly related to EDE Manual transfer to wiki and adding configuration for panel.

Manual is quite incomplete and will be much easier to update it (and contribute with proofreading and fixes) on wiki. Also, this will make code lighter (bundled asciidoc will be removed) making default EDE non dependable on python; however, to build icon theme you will still need it, unless you are using official releases, where theme comes already prepared).

Panel configuration is must feature before 2.1 release because it is often requested feature. Some people would like any kind of configuration and some GUI frontend; I'll see how can be added without delaying release 2-3 months more.