Showing posts with label open source. Show all posts
Showing posts with label open source. Show all posts

Monday, May 27, 2013

Solved: The "Preventing laptop from suspending on lid close Gnome" headache

    Locking your screen on closing the lid is no longer an option in Gnome. Don't you hate it? I for one have to close the lid often and I hate it when the laptop is suspended. I had to go over a lot of places for getting a solution and finally got one after lots of IRC discussions, a bug report (which I marked invalid myself ;) ) and obviously googling.

TL; DR version:
There are 2 possible solutions:
1. Changing "HandleLidSwitch=lock" in /etc/systemd/logind.conf (didn't work for me...)
2. Run this on a terminal: systemd-inhibit --what=handle-power-key:handle-suspend-key:handle-lid-switch sleep 999999. Don't put in bashrc file, I am not able to log back in my OpenSuSE 12.3 installation!!

Now, the longer version:
    The problem started when the gnome devs got frustrated with the system inhibitors preventing their laptops from suspending. In the comments, you could literally see the devs crying about this problem and fearing that their laptop batteries would soon die.
Solution: Gnome has default removed the lid switch handle and even if it is present, it ignores it by default.    This means, no matter what setting you have, the laptop would suspend on lid close. The points made by the devs will make you agree with their solution.
    I was not aware of all this discussion and hence thought the problem was with Gnome-Tweak-Tool which gives you an option to set the action on laptop lid close. Hence, reported a bug. Later on, after some Google search for alternatives I realized that the problem was not with the tool but with Gnome, but didn't know what.
    I discussed the issue at #suse irc channel but turns out they are mostly KDE users. On trying a gsettings solutions, I found an error saying that the power schema itself was missing! Then I went to the Gnome channel and luckily Florian Müllner was online the third time I posted the question. He told me that the problem was not about the power schema but about system-inhibitors and gave me a heads up for the solution. He is a really patient guy!! A little bit of Googling brought me to the above mentioned 2 solutions.
    Unfortunately the first one doesn't work for me but works for others. The second one worked for me though. The solution may have worked but I didn't want to enter the command everytime and hence I put it in my bashrc file as I never want my laptop to suspend on lid close. Turns out, I am unable to login to my OpenSuSE installation ever since I modified the bashrc file!! Will have to modify the file now :(
    I must say the Gnome experience since Gnome 3 has not been that good.

  

Friday, July 27, 2012

cenv: create your own environments

     Everytime I start coding for GTG, I have to start terminal, nautilus and a browser(in case of bugs ;) ). For a lazy person like me, this is a very boring task. Hence i just came up with an easy solution : environment creator which takes a set of your tasks and turns them into a linux command.
     With all the tasks done in just one go, I can consider it to be a productivity enhancing tool (though it's primary purpose was to help lazy bums like me :P ). All sorts of work environments can be created with this tool. You can have one called "work" which like mine, starts terminal with vim/gedit, nautilus and browser. You can keep one for home which could maybe contain nautilus with your songs folder opened up, a music player, a todo list manager if you have one etc.
     Another added advantage for this tool, is that you can create macros for yourself. Say you have a habit of backing up your files to your external device regularly, you can just create an environment called "backup" with all the copy commands. Heck, you can even add one environment inside another environment because these all are actually turned into linux commands only!
     Right now I have features like "new", "remove" , "rename", "edit" etc. but further more features will come up in a week of 2. The very basic version is ready and I plan to launch the version 0.1 by next Saturday.
     Here is the link to the homepage of the launchpad project: https://launchpad.net/cenv
     I'll let others contribute to the code after the launch of version 0.1