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
bspc subscribe node_add | while read -r _ _ desktop _ node; do
num=$(bspc query -N -d $desktop | grep -f <(bspc query -N -n .leaf) | wc -l)
if [ $num = "1" ];then
xprop -id "$node" -f _PICOM_ROUNDED 32c -set _PICOM_ROUNDED 0
else
bspc query -N -d | while read -r node; do
xprop -id "$node" -remove _PICOM_ROUNDED
done
fi
done &
bspc subscribe node_remove | while read -r _ _ desktop _ node; do
num=$(bspc query -N -d $desktop | grep -f <(bspc query -N -n .leaf) | wc -l)
if [ $num = "1" ];then
bspc query -N -d | while read -r node; do
xprop -id "$node" -f _PICOM_ROUNDED 32c -set _PICOM_ROUNDED 0
done
fi
done &
function node_monitor {
while read -r _ _ desktop _ node; do
num=$(bspc query -N -d $desktop | grep -f <(bspc query -N -n .leaf) | wc -l)
if [ $1 = "add" ]; then
if [ $num = "1" ];then
xprop -id "$node" -f _PICOM_ROUNDED 32c -set _PICOM_ROUNDED 0
else
bspc query -N -d | while read -r node; do
xprop -id "$node" -remove _PICOM_ROUNDED
done
fi
elif [ $1 = "remove" ];then
if [ $num = "1" ];then
bspc query -N -d | while read -r node; do
xprop -id "$node" -f _PICOM_ROUNDED 32c -set _PICOM_ROUNDED 0
done
fi
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
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
export GPG_TTY=$(tty)
alias vim=nvim
ufetch