This commit is contained in:
2020-07-23 15:03:08 +09:00
parent 307b48d398
commit ea79306772
2 changed files with 25 additions and 18 deletions

View File

@@ -1,19 +1,24 @@
#!/bin/bash #!/bin/bash
bspc subscribe node_add | while read -r _ _ desktop _ node; do function node_monitor {
num=$(bspc query -N -d $desktop | grep -f <(bspc query -N -n .leaf) | wc -l) while read -r _ _ desktop _ node; do
if [ $num = "1" ];then num=$(bspc query -N -d $desktop | grep -f <(bspc query -N -n .leaf) | wc -l)
xprop -id "$node" -f _PICOM_ROUNDED 32c -set _PICOM_ROUNDED 0 if [ $1 = "add" ]; then
else if [ $num = "1" ];then
bspc query -N -d | while read -r node; do xprop -id "$node" -f _PICOM_ROUNDED 32c -set _PICOM_ROUNDED 0
xprop -id "$node" -remove _PICOM_ROUNDED else
done bspc query -N -d | while read -r node; do
fi xprop -id "$node" -remove _PICOM_ROUNDED
done & done
bspc subscribe node_remove | while read -r _ _ desktop _ node; do fi
num=$(bspc query -N -d $desktop | grep -f <(bspc query -N -n .leaf) | wc -l) elif [ $1 = "remove" ];then
if [ $num = "1" ];then if [ $num = "1" ];then
bspc query -N -d | while read -r node; do bspc query -N -d | while read -r node; do
xprop -id "$node" -f _PICOM_ROUNDED 32c -set _PICOM_ROUNDED 0 xprop -id "$node" -f _PICOM_ROUNDED 32c -set _PICOM_ROUNDED 0
done done
fi fi
done & fi
done
}
bspc subscribe node_add | node_monitor add &
bspc subscribe node_remove | node_monitor remove &

View File

@@ -101,5 +101,7 @@ source $ZSH/oh-my-zsh.sh
# Example aliases # Example aliases
# alias zshconfig="mate ~/.zshrc" # alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh" # alias ohmyzsh="mate ~/.oh-my-zsh"
export GPG_TTY=$(tty)
alias vim=nvim alias vim=nvim
ufetch ufetch