diff --git a/.local/bin/wmpid b/.local/bin/wmpid new file mode 100644 index 00000000..28616cc7 --- /dev/null +++ b/.local/bin/wmpid @@ -0,0 +1,12 @@ +#!/bin/sh + +# This function is needed if there are multiple instances of the window manager. + +export WM="dwm" +wmpid(){ + tree="$(pstree -ps $$)" + tree="${tree#*$WM(}" + echo "${tree%%)*}" +} + +eval wmpid