You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

28 lines
898 B

#!/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