dgy
/
hexagons
Archived
1
0
Fork 0
This repository has been archived on 2021-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
hexagons/bin/presel.sh

38 lines
1017 B
Bash
Raw Normal View History

#!/usr/bin/env dash
# Shamelessly stolen from https://github.com/neeasade/dotfiles/tree/master/wm/.wm/scripts/interact
# if we only have one, use our border thing
2018-08-23 19:00:30 +00:00
if bspc query -N -n focused.leaf && command -v chbpresel 2>/dev/null 1>&2; then
(
cond=true
while $cond; do
presel_win=$(xdotool search --classname "presel_feedback")
if [ ! -z "$presel_win" ]; then
cond=false
2018-08-23 19:00:30 +00:00
compton-trans -w "$presel_win" 0
fi
done
) &
2018-08-23 19:00:30 +00:00
bspc node -p "$*"
back="$(colort -t $(bspc config focused_border_color))"
2018-08-23 19:00:30 +00:00
colort -c "$back" && \
forward="$(colort -t 100 $(bspc config focused_border_color))" || \
forward="$(colort -t -100 $(bspc config focused_border_color))"
dir="$*"
case $dir in
north) dir=1 ;;
south) dir=3 ;;
east) dir=4 ;;
west) dir=2 ;;
esac
2018-08-23 19:00:30 +00:00
chbpresel -C "$forward" -c "$back" -d "$dir" "$(bspc query -N -n)"
else
2018-08-23 19:00:30 +00:00
bspc node -p "$*"
fi