View Single Post
Benson's Avatar
Posts: 4,930 | Thanked: 2,272 times | Joined on Oct 2007
#21
That, sir, is wonderful! Many thanks!

And once again, we (users at large, not me) have fixed Nokia's problem for them. I could get really grouchy about their software, if the hardware wasn't so sweet.

But, to my mind, it's as useful, or perhaps more, to have in personal menu a toggle for lockability...

Being too lazy to remember the precise details of sudo syntax (I think it's shell globbing, not regex?), I'm also going to fall back on two lines where one would do:

in /etc/sudoers (i.e. use visudo):
Code:
user ALL = NOPASSWD: /usr/bin/chattr -i /home/user/.osso/hildon-desktop/home-layout.conf
user ALL = NOPASSWD: /usr/bin/chattr +i /home/user/.osso/hildon-desktop/home-layout.conf
Then something like:
Code:
#!/bin/sh
if [ x`lsattr /home/user/.osso/hildon-desktop/home-layout.conf | grep '^[^ ]i'` != x ] ; then
  sudo /usr/bin/chattr -i /home/user/.osso/hildon-desktop/home-layout.conf
else
  sudo /usr/bin/chattr +i /home/user/.osso/hildon-desktop/home-layout.conf
fi
Throw that in a script to toggle it from p-menu...

Oh, and one thing; chattr is e2fs only, AFAIK. So only for SD-booting people?