Adding parts from i3 and smartrap