#!/bin/bash #---------------------------------------------------------------- # autoapp — Launch the application assigned to current workspace # # Adapted from the ratflow autoapp script. # Reads workspace assignments and launches the matching app. # Uses swaymsg instead of i3-msg. # # Dependencies: sway, jq #---------------------------------------------------------------- # Get current workspace name WORKSPACE=$(swaymsg -t get_workspaces | jq -r '.[] | select(.focused) | .name') # Map workspace names to applications # Customize these to match your workflow case "$WORKSPACE" in *">_"*) kitty ;; *"dev"*) kitty ;; *"www"*) firefox ;; *"files"*) thunar ;; *"e-mail"*) thunderbird ;; *"IM"*) telegram-desktop ;; *"video"*) mpv ;; *"Music"*) spotify ;; *"VM"*) virt-manager ;; *) echo "No app assigned to workspace: $WORKSPACE" ;; esac