mirror of
https://github.com/donovanglover/nix-config.git
synced 2024-12-16 03:40:57 +01:00
c4b7b69f66
It turns out that placing similar config files (i.e. bspwm-related) in the same directory is not the way to go about handling dotfiles since each config file (or dotfile) *should* manipulate only a single program. This was not the case back when I used urxvt (which would require the old method of .Xresources), but now that I understand more about how *modern* dotfiles work (with $XDG_CONFIG_HOME), separating dotfiles by program became the obvious choice.
20 lines
627 B
Bash
Executable File
20 lines
627 B
Bash
Executable File
#!/bin/sh
|
|
# New Start: A modern Arch workflow built with an emphasis on functionality.
|
|
# Copyright (C) 2018 Donovan Glover
|
|
|
|
c='kitty' # Class
|
|
i='dropdown' # Instance
|
|
x='kitty --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)
|