From: Ian Kelling Date: Mon, 8 Jul 2024 00:55:58 +0000 (-0400) Subject: minor fix X-Git-Url: https://iankelling.org/git/?a=commitdiff_plain;h=f6bb39ef78025b0338c9c0d1ed2217cd3beabde2;p=distro-setup minor fix --- diff --git a/distro-end b/distro-end index d75553a..30bb4ec 100755 --- a/distro-end +++ b/distro-end @@ -755,6 +755,7 @@ EOF if [[ ! -e /etc/apt/preferences.d/system76-apt-preferences ]]; then check_downgrade=true fi + # note this installs a kernel pi system76-firmware system76-driver fwupd if $check_downgrade && [[ -e /etc/apt/preferences.d/system76-apt-preferences ]]; then # driver installs a preferences file to give s76 packages diff --git a/myx b/myx index f71610d..7b8de6b 100755 --- a/myx +++ b/myx @@ -270,20 +270,12 @@ if [[ $secondary_out ]]; then fi echo "bindsym \$mod+Shift+t move workspace to output ${move_outputs[*]}" >>~/i3-myx.conf m /a/bin/ds/i3-sway/gen -# give it some time to reload +# give it some time to reload or adjust to new x settings. sleep 1 if (( ${#ws_outputs[@]} )); then - # this bit is so that we only move workspaces that need to be moved - # and we don't have to ignore errors. A waste of time, but - # it was fun. - declare -A ws_to_out - tmps=$(i3 -t get_workspaces) - tmps=$(jq -r '.[] | .num, .output' <<<"$tmps") - while read -r ws; do - read -r output || break - ws_to_out["$ws"]=$output - done <<<"$tmps" + + declare -A ws_expected_out for (( i=0; i 20 )); then + echo "error. moving workspaces is not working as expected" >&2 + exit 1 fi + refresh_count=$(( refresh_count + 1 )) + refresh_workspaces=false + tmps=$(i3 -t get_workspaces) + tmps=$(jq -r '.[] | .num, .output' <<<"$tmps") + while read -r ws; do + read -r output || break + if [[ ${ws_expected_out[$ws]} != "$output" ]]; then + m i3 '[workspace="'$ws'"]' move workspace to output $output + refresh_workspaces=true + break + fi + done <<<"$tmps" done fi ## end i3 config ##