log-setup() {
if [[ ! $log_path ]]; then
mkdir -p /var/log/btrbk
- log_path=/var/log/btrbk/$(date +%F_%T%:::z).log
+ log_path=/var/log/btrbk/$(date +%F_%H_%M_%S%:::z).log
fi
}
d() {
i3-msg "workspace 2"
i3-split-maybe
$b "$@" &
- # on a fast computer, .5 is too fast, 1 is ok. on x200, 1 is too fast, 2 is ok.
- sleep 2
- i3-msg "[workspace=__focused__ class=\"$b\" instance=\"Navigator\" window_role=\"browser\"] mark abrowser"
+ # on a fast computer, .5 is too fast, 1 is ok. on x200, 2 is ok if the computer isn't busy.
+
+ for (( i=0; i < 15; i++ )); do
+ sleep 1
+ if i3-msg "[workspace=__focused__ class=\"$b\" instance=\"Navigator\" window_role=\"browser\"] mark abrowser"; then
+ break
+ fi
+ done
wait
-# else
- # # If we were streaming 1/4 of the screen without separate workspaces, we might
- # # want something like this. But as is, it is better to just focus. same deal in
- # # my other programs like this one, but I removed the code there.
- #
- # cur_workspace=$(i3-msg -t get_workspaces | jq -r '.[] | select(.focused? == true) | .name')
- # i3-msg "[con_mark=\"abrowser\"] focus"
+ # else
+ # # If we were streaming 1/4 of the screen without separate workspaces, we might
+ # # want something like this. But as is, it is better to just focus. same deal in
+ # # my other programs like this one, but I removed the code there.
+ #
+ # cur_workspace=$(i3-msg -t get_workspaces | jq -r '.[] | select(.focused? == true) | .name')
+ # i3-msg "[con_mark=\"abrowser\"] focus"
- # if [[ $cur_workspace == 2 ]]; then
- # i3-msg "swap container with mark abrowser; [con_mark=\"abrowser\"] focus"
- # else
- # i3-msg "[con_mark=\"abrowser\"] focus"
- # fi
+ # if [[ $cur_workspace == 2 ]]; then
+ # i3-msg "swap container with mark abrowser; [con_mark=\"abrowser\"] focus"
+ # else
+ # i3-msg "[con_mark=\"abrowser\"] focus"
+ # fi
fi
# primary monitor, I don't want a new workspace created on secondary
# monitor just because I happen be focused on it. This fixes that.
workspace 1 output primary
-workspace 2 output BIG-LEFT
-workspace 3 output BIG-RIGHT
-workspace 4 output BIG-RIGHT
-workspace 5 output BIG-RIGHT
-workspace 6 output BIG-RIGHT
-workspace 7 output BIG-RIGHT
-workspace 8 output BIG-RIGHT
-workspace 9 output BIG-RIGHT
-workspace 10 output BIG-RIGHT
+workspace 2 output MON-LEFT
+workspace 3 output MON-RIGHT
+workspace 4 output MON-RIGHT
+workspace 5 output MON-RIGHT
+workspace 6 output MON-RIGHT
+workspace 7 output MON-RIGHT
+workspace 8 output MON-RIGHT
+workspace 9 output MON-RIGHT
+workspace 10 output MON-RIGHT
default_orientation vertical
bindsym $mod+x workspace 6
bindsym $mod+v split vertical
-bindsym $mod+Shift+v move workspace to output BIG-LEFT
+bindsym $mod+Shift+v move workspace to output MON-LEFT
# 122 = XF86AudioLowerVolume, keyboardio function + t
bindcode 122 $ex "toggle-mute unmute"; mode "ptt"
fi
move_arg=right
-if xrandr --listmonitors | awk '$2 == "BIG-BOTTOM-LEFT"' |grep . >/dev/null; then
+if xrandr --listmonitors | awk '$2 == "MON-BOTTOM-LEFT"' |grep . >/dev/null; then
cat >>$dir/config <<'EOF'
# by default, new workspaces are created on whatever screen doesn't have
# one active or else the current one. That is annoying, I have one
# primary monitor, I don't want a new workspace created on secondary
# monitor just because I happen be focused on it. This fixes that.
workspace 1 output primary
-workspace 2 output BIG-LEFT
-workspace 3 output BIG-BOTTOM-LEFT
-workspace 4 output BIG-RIGHT
-workspace 5 output BIG-RIGHT
-workspace 6 output BIG-RIGHT
-workspace 7 output BIG-RIGHT
-workspace 8 output BIG-RIGHT
-workspace 9 output BIG-RIGHT
-workspace 10 output BIG-RIGHT
+workspace 2 output MON-LEFT
+workspace 3 output MON-BOTTOM-LEFT
+workspace 4 output MON-RIGHT
+workspace 5 output MON-RIGHT
+workspace 6 output MON-RIGHT
+workspace 7 output MON-RIGHT
+workspace 8 output MON-RIGHT
+workspace 9 output MON-RIGHT
+workspace 10 output MON-RIGHT
EOF
- move_arg="BIG-BOTTOM-LEFT BIG-RIGHT primary"
-elif xrandr --listmonitors | awk '$2 == "BIG-LEFT"' |grep . >/dev/null; then
+ move_arg="MON-BOTTOM-LEFT MON-RIGHT primary"
+elif xrandr --listmonitors | awk '$2 == "MON-LEFT"' |grep . >/dev/null; then
cat >>$dir/config <<'EOF'
# by default, new workspaces are created on whatever screen doesn't have
# one active or else the current one. That is annoying, I have one
# primary monitor, I don't want a new workspace created on secondary
# monitor just because I happen be focused on it. This fixes that.
workspace 1 output primary
-workspace 2 output BIG-LEFT
-workspace 3 output BIG-RIGHT
-workspace 4 output BIG-RIGHT
-workspace 5 output BIG-RIGHT
-workspace 6 output BIG-RIGHT
-workspace 7 output BIG-RIGHT
-workspace 8 output BIG-RIGHT
-workspace 9 output BIG-RIGHT
-workspace 10 output BIG-RIGHT
+workspace 2 output MON-LEFT
+workspace 3 output MON-RIGHT
+workspace 4 output MON-RIGHT
+workspace 5 output MON-RIGHT
+workspace 6 output MON-RIGHT
+workspace 7 output MON-RIGHT
+workspace 8 output MON-RIGHT
+workspace 9 output MON-RIGHT
+workspace 10 output MON-RIGHT
EOF
- move_arg="BIG-RIGHT primary"
+ move_arg="MON-RIGHT primary"
else
mon2=$(xrandr | awk '$2 == "connected" && $3 != "primary" {print $1}')
if [[ $mon2 ]]; then
fi
for mon_suffix in TOP-LEFT BOTTOM-LEFT LEFT RIGHT; do
- if xrandr --listmonitors | awk '$2 == "BIG-'$mon_suffix\" |grep . >/dev/null; then
- m xrandr --delmonitor BIG-$mon_suffix
+ if xrandr --listmonitors | awk '$2 == "MON-'$mon_suffix\" |grep . >/dev/null; then
+ m xrandr --delmonitor MON-$mon_suffix
fi
done
# 298 & 336 are millimeters. I took them from a monitor I was using. I
# don't know if they are important, I assume not important enough to
# change for different monitors.
- m xrandr --setmonitor BIG-LEFT $half_x/298x$target_y/336+$x_offset+0 $target_out
- m xrandr --setmonitor BIG-RIGHT $half_x/298x$target_y/336+$(( x_offset + half_x ))+0 none
+ m xrandr --setmonitor MON-LEFT $half_x/298x$target_y/336+$x_offset+0 $target_out
+ m xrandr --setmonitor MON-RIGHT $half_x/298x$target_y/336+$(( x_offset + half_x ))+0 none
- move-ws BIG-LEFT 2
- move-ws BIG-RIGHT 3 4 5 6 7 8 9 10
+ move-ws MON-LEFT 2
+ move-ws MON-RIGHT 3 4 5 6 7 8 9 10
elif $quarter; then
- m xrandr --setmonitor BIG-LEFT $half_x/298x$half_y/336+$x_offset+0 $target_out
- m xrandr --setmonitor BIG-BOTTOM-LEFT $half_x/298x$half_y/336+$x_offset+$half_y none
- m xrandr --setmonitor BIG-RIGHT $half_x/298x$target_y/336+$(( x_offset + half_x ))+0 none
+ m xrandr --setmonitor MON-LEFT $half_x/298x$half_y/336+$x_offset+0 $target_out
+ m xrandr --setmonitor MON-BOTTOM-LEFT $half_x/298x$half_y/336+$x_offset+$half_y none
+ m xrandr --setmonitor MON-RIGHT $half_x/298x$target_y/336+$(( x_offset + half_x ))+0 none
- move-ws BIG-LEFT 2
- move-ws BIG-BOTTOM-LEFT 3
- move-ws BIG-RIGHT 4 5 6 7 8 9 10
+ move-ws MON-LEFT 2
+ move-ws MON-BOTTOM-LEFT 3
+ move-ws MON-RIGHT 4 5 6 7 8 9 10
else # fullscreen
move-ws $target_out 2 3 5 6 7 8 9 10
fi