1
0
forked from extern/nix-config

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.
This commit is contained in:
Donovan Glover 2018-11-01 15:56:03 -04:00
parent f3d129362e
commit 3ebc47ca28
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
2 changed files with 23 additions and 0 deletions

View File

@ -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)

View File

@ -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" && \