Move workspace startup to its own script

The startup from within the sway autostart script that I had failed to
keep things on the correct workspaces and started things out of order.
This moves that to a bash script that calls everything with i3-toolwait
(https://gitlab.com/wef/dotfiles/-/blob/master/bin/i3-toolwait) to
attempt to control that better.
This commit is contained in:
Alex Kelly 2024-12-18 20:52:04 -05:00
commit e11c55c8f6
3 changed files with 198 additions and 31 deletions

39
scripts/workspaces.sh Executable file
View file

@ -0,0 +1,39 @@
#!/bin/bash
# Set workspace names/number
ws1=1
ws2=2
ws3=3
ws5=5
ws6=6
#Split the binary and the options so we can optionally run w/ or w/o the option
# full path to the toolwait binary itself
TOOLWAITBIN="/home/kellya/.config/sway/scripts/i3-toolwait"
# Options to pass
TOOLWAITOPTIONS="--nocheck"
# binary, with options
TOOLWAIT="$TOOLWAITBIN $TOOLWAITOPTIONS"
swaymsg workspace $ws6
$TOOLWAIT --waitfor org.mozilla.thunderbird /usr/bin/thunderbird
$TOOLWAIT --waitfor logseq /home/kellya/bin/logseq
# Start spotify
swaymsg workspace $ws5
$TOOLWAIT -- /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=spotify --file-forwarding com.spotify.Client
swaymsg workspace $ws2
$TOOLWAITBIN --waitfor slack -- flatpak run com.slack.Slack
$TOOLWAIT --waitfor teams-for-linux -- /opt/teams-for-linux/teams-for-linux --optInTeamsV2 true
swaymsg workspace $ws1
$TOOLWAITBIN --waitfor org.mozilla.firefox firefox
# Switch to the terminal/email workspace by default
swaymsg workspace $ws3
$TOOLWAIT --waitfor kitty kitty
$TOOLWAIT --waitfor 1password 1password