From 3ebc47ca288511c90a8d157425931d9bc18042ed Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Thu, 1 Nov 2018 15:56:03 -0400 Subject: [PATCH] bspwm: Add dropdown.sh This commit makes it possible to toggle any terminal you want with super + backslash. If the terminal doesn't exist already, it will be created for you. --- bspwm/.config/sxhkd/dropdown.sh | 19 +++++++++++++++++++ bspwm/.config/sxhkd/sxhkdrc | 4 ++++ 2 files changed, 23 insertions(+) create mode 100644 bspwm/.config/sxhkd/dropdown.sh diff --git a/bspwm/.config/sxhkd/dropdown.sh b/bspwm/.config/sxhkd/dropdown.sh new file mode 100644 index 00000000..2f7edd13 --- /dev/null +++ b/bspwm/.config/sxhkd/dropdown.sh @@ -0,0 +1,19 @@ +#!/bin/sh +# New Start: A modern Arch workflow built with an emphasis on functionality. +# Copyright (C) 2018 Donovan Glover + +c='URxvt' # Class +i='dropdown' # Instance +x='urxvtc -name' # Executable + +# Note: This solution will not work with termite since it registers two ids. +# See https://github.com/thestinger/termite/issues/634 for more information. + +id=$(xdo id -n $i) + +bspc rule -r $c:$i +bspc rule -a $c:$i sticky=on state=floating rectangle=3400x1200+220+200 + +([ -z "$id" ]) && ($x $i) || + ([[ $(xprop -id "$id" | awk '/window state: / {print $3}') == 'Withdrawn' ]] && + xdo show -n $i || xdo hide -n $i) diff --git a/bspwm/.config/sxhkd/sxhkdrc b/bspwm/.config/sxhkd/sxhkdrc index 6d110ba5..8a5b91dd 100644 --- a/bspwm/.config/sxhkd/sxhkdrc +++ b/bspwm/.config/sxhkd/sxhkdrc @@ -13,6 +13,10 @@ super + p super + {_,shift} + Return {termite -e "tmux new-session; set status",urxvtc} +# Toggle a dropdown terminal +super + backslash + ~/.config/sxhkd/dropdown.sh + # toggle polybar: top_padding depends on the height you set in polybar/config super + o (xdotool search --class --onlyvisible "Polybar" && \