2

I'm running Xubuntu 17.10 and I would like to remove screen locking when I'm connected to my home wifi.

My current plan is something like:

  1. Use a /etc/interfaces/if.up/ script to check when I'm connected to my wifi (using iwconfig to get the SSID)
  2. To do this, I've read that the wifi interface must be in interfaces. It is currently not. But if I add it there, will it still connect to networks automatically as it does out of the box?
  3. Then, I'm not sure how to disable light-locker (and only temporarily). Can light-locker be commanded from the CLI?
  4. Then, have a if.down / if.up script that does turns on light-locker whenever I disconnect from the wifi or connect to some other network.

An alternative method would be to just have a cron script that runs every 1 min and toggles light-locker as a function of the connection.

So to summarize my questions:

  1. How to enable/disable light-locker programmatically from within a script that is run at if.down / if.up or in cron?
  2. Can I add an interface to /etc/interfaces file so that if.up / if.down scripts can run, and still manage the interface automatically using as usual?

Edit: after some research, it seems i should rather use the NetworkManager dispatcher instead of if.up/if.down scripts. This would invalidate question 1.

galoget
  • 2,943
  • 2
  • 20
  • 24
arvidj
  • 160
  • 4
  • If Eve walks past your house, her phone will register your router's SSID+mac, letting her set up a router at the café with the same name as the one you're checking against (but no encryption). I wouldn't use simply SSID/mac here, though I guess it might be fairly safe if you also try to ssh into the router and check that the host key didn't change (or something equivalent) – unhammer Mar 13 '18 at 08:39

0 Answers0