Enable On-screen navigation in CM12 (Lollipop) using shell?
I experimented and found that when On-screen nav. is enabled, the value for dev_force_show_navbar changes to 1 from 0... Both names are under Settings.db (Table:secure).


You actually mentioned the key to the answer but somehow (I suppose) didn't know how to use it. Many thanks to Andrew T. and DavisNT for this answer since it would lead to a solution for your problem.

I myself is a owner of OnePlus One running stock CM12 so you may now expect a working answer.

From the shell, be it adb, or a Terminal app, or Tasker's "Run Shell" action, enter the following command with root privileges:

settings put secure dev_force_show_navbar 1


You would now see that On-screen navigation bar is enabled just like in your pic posted here.

Don't worry about button_brightness since the changes in its value would be reflected automatically by the above command.

I tested that command in Tasker by manual execution of action "Code -> Run Shell -> command" with "Use Root", and its working good. 

The changes are exactly same as doing it from "Settings -> Buttons" so nothing to worry, i.e. only Soft-keys are visible and Hard keys are disabled. Coolest part -- no reboot needed. 

You can revert back by using 0 in place of 1 in the aforesaid command.