Sensor for adjustable standing desk
If you would mount a distance sensor like a HC-SR04, LV-EZ4 or similar on the underside of the desk looking at the floor you would not only be able to see when the desk is moving but also you would see the height of the desk. (For detecting when the desk is moving simply check to see if the distance changes more than the )

Example of someone who hooked up a HC-SR04 to a pi