From 51b342568a7ff6684bf933265d35fc29c16c1347 Mon Sep 17 00:00:00 2001 From: Carlos de la Torre <48769508+c-torre@users.noreply.github.com> Date: Sun, 7 Aug 2022 22:30:46 +0300 Subject: [PATCH] create wmpid --- .local/bin/wmpid | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .local/bin/wmpid 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