From 4dfdc10f53d523542f50bfe7689557f52ccc47c9 Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Fri, 19 Oct 2018 17:28:27 -0400 Subject: [PATCH] sxhkd: Properly toggle polybar visibility I tried to do this before, but couldn't figure it out. Now that I understand more about how windows in X11 work, and now that I know more about shell scripting, writing this functionality became trivial to do. --- .config/sxhkd/sxhkdrc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc index a27a9637..2e9e757f 100644 --- a/.config/sxhkd/sxhkdrc +++ b/.config/sxhkd/sxhkdrc @@ -77,12 +77,11 @@ super + f # ======= polybar ======= # ======================= -super + o - xdo hide -N "Polybar" && bspc config top_padding 0 - # top_padding depends on the height you set in polybar/config -super + O - xdo show -N "Polybar" && bspc config top_padding 80 +super + o + (xdotool search --class --onlyvisible "Polybar" && \ + (xdo hide -N "Polybar" && bspc config top_padding 0)) || \ + (xdo show -N "Polybar" && bspc config top_padding 80) # ===================== # ===== Preselect =====