commit f52a400c4ddabd472bcb7db6f561447f34b14e8b
parent e4a240452746894599f7d3c5bec73297bf2ad85b
Author: jacobsGit <JacobDoesLinux@protonmail.com>
Date: Tue, 14 Jan 2020 12:41:35 -0800
sorting and tweaking
Diffstat:
3 files changed, 53 insertions(+), 9 deletions(-)
diff --git a/bspwm/.config/bspwm/bspc-utils/bspc-snap b/bspwm/.config/bspwm/bspc-utils/bspc-snap
@@ -0,0 +1,37 @@
+#!/bin/dash
+# Jacob Edwards, 2020
+# bspwm utility to snap floating windows to edges
+
+
+getpos(){
+ window="$( xdotool getactivewindow )"
+
+ display="$( xdotool getdisplaygeometry )"
+ Xdis="$( printf "$display" | awk '{print $1}' )"
+ Ydis="$( printf "$display" | awk '{print $2}' )"
+
+ pos="$( xdotool getwindowgeometry "$window" | head -n 2 | tail -n 1 | awk '{print $2}' )"
+ Xpos="$( printf "$pos" | awk -F ',' '{print $1}' )"
+ Ypos="$( printf "$pos" | awk -F ',' '{print $2}' )"
+
+ geometry="$( xdotool getwindowgeometry "$window" | tail -n 1 | awk '{print $2}' )"
+ Xgeo="$( printf "$geometry" | awk -F 'x' '{print $1}' )"
+ Ygeo="$( printf "$geometry" | awk -F 'x' '{print $2}' )"
+}
+
+getpos
+
+if [ "$1" = '--left' ]; then
+ bspc node focused.floating --move "-$Xpos" 0
+elif [ "$1" = '--right' ]; then
+ upleft="$( expr "$Xpos" + "$Xgeo" )"
+ jump="$( expr "$Xdis" - "$upleft" )"
+ bspc node focused.floating --move "$jump" 0
+elif [ "$1" = '--up' ]; then
+ bspc node focused.floating --move 0 "-$Ypos"
+elif [ "$1" = '--down' ]; then
+ downleft="$( expr "$Ypos" + "$Ygeo" )"
+ jump="$( expr "$Ydis" - "$downleft" )"
+ bspc node focused.floating --move 0 "$jump"
+fi
+
diff --git a/bspwm/.config/bspwm/bspc-utils/bspc-subscribe-desktop b/bspwm/.config/bspwm/bspc-utils/bspc-subscribe-desktop
@@ -9,7 +9,7 @@ if [ "$1" = '--help' ]; then
printf 'error, no arguments `--help` for help\n'
exit 1
elif [ -z "$1" ]; then
- delay=0.2
+ delay=0.15
else
delay="$1"
fi
@@ -27,7 +27,7 @@ bspc subscribe desktop_focus > "$tmpfile" &
while true; do
if [ "$focus" != "$( tail -n 1 "$tmpfile" )" ]; then
desktop="$(bspc query --desktops --desktop --names)"
- notify-send-replace "$desktop" &
+ notifysend-replace "$desktop" &
fi
focus="$( tail -n 1 "$tmpfile" )"
diff --git a/bspwm/.config/bspwm/bspwmrc b/bspwm/.config/bspwm/bspwmrc
@@ -11,23 +11,30 @@ bspc-subscribe-desktop 0.1 &
bspc monitor -d I II III IV V VI
-# borders
-bspc config border_width 4
-#bspc config focused_border_color #2c2cfc
-bspc config focused_border_color #5c0000
-bspc config normal_border_color #000000
+# borders, gaps, and padding
+bspc config left_padding 8
+bspc config right_padding 8
+bspc config top_padding 8
+bspc config bottom_padding 8
+
+bspc config window_gap 8
+bspc config border_width 2
+bspc config focused_border_color '#2c2cfc'
+#bspc config focused_border_color '#5c0000'
+bspc config normal_border_color '#000000'
+
# node mode
-bspc config window_gap 12
bspc config split_ratio 0.5
# mono mode
-bspc config single_monocle true
+bspc config single_monocle false
bspc config borderless_monocle true
bspc config gapless_monocle true
# rules
bspc rule --add mpv state=fullscreen
+bspc rule --add Zathura state=tiled