Sunday, 20 October 2013

arch linux, awesomewm, screensaver and lightdm

I did extensive study on options available in arch linux in comination with awesome as my window manager under Xorg without any DE running. Usually linux users of Xorg run a DE like gnome or kde. My case is different in that I have decided to go without a DE. I am happy after removing gnome-shell. I see my apps are faster without the memory hogs of gnome and also i like the tiling option of awesome and also awesomewm allows you to use the old method of stacking window for the apps that dont work well on tiling. I read windows 8 also trying make users to switch to tiling window management. Tiling is great but web browser aren't made for tiling. For example some website wants to do pop-up with their definition of window measurement in pop up. Common example of where it happens is banking websites upon trying to login they throw a custom measured popup. One application that works fantastically in tiling is the terminal emulator. Some terminal emulator like terminator has this feature build in to them. So they act like tiling even without a tiling wm. But that is not perfect. A tiling wm handles perfectly ,  than a build in feature of terminator to split windows.
I was using xautolock and slock combination to lock screen. It worked fine (but not perfect). I had a keybinding in awesomewm to trigger a screen lock. That also worked. It worked till I had xdm as display manager. xdm is not very pretty and lacks many basic features like passwordless account login, autologin. I am not a fan of auto login, but i strongly feel, you should be allowed to login with a account that has no password. So i decided the xdm is a legacy software and i ditched it in favour of lightdm. As far as i can see lightdm has more features than xdm, like passwordless account login , autologin and also it has the xdm feature of XDMCP . But the bad thing is , it no longer invokes ~/.xinitrc . So my xautolock failed to invoke. Since xautolock is not running, keybinding in awesomewm to lock screen fails (as expected). So i tried write a service unit file for running xautolock via systemd. I wrote xautolock.service and the service almost worked. It failed becuase it tried to connect to X display as root and I was running the display as ashwin. So it failed to connect and it exited with failure error code. Workaround would be disable the auth check for X. But it is a ugly solution , possible brining in host of other problems. So I dont want to do that. I dont want to run it as ashwin user , since i am looking for a generic solution that will work for any user. The other solution also shares the same problem being this incident specific. The other solution is to write a xautolock.desktop file in /home/ashwin/.config/autostart/xautolock.desktop. This solution is user specific. If I put the file in global path then it would invoked as root and wont be able to connect to display and fail as in the systemd problem. So the best solution is to invoke it via lightdm configuration file to autostart when greeter starts and have the locking mechanism in my old way as keybinding. Since the xautolock is invoked in greeter level , it will work for all user. Then i hit upon another problem, which is similar to xdm problem. I haven't found if my suspect is true. My suspect is slock invoked via xautolock wont unlock for passwordless account and it will keep prompting for password which does not exists. So the passwordless user in my PC is again in a bad problem. I found a better way. Instead of screenlocking after a period of inactivity, i realised the better way would be turn off the display after a period of inactivity.There are many benefits to it. Like saving on power consumption and no hacks, simply works. the setting i am trying to implement is like sleep 5;xset dpms force off. 

No comments:

Post a Comment