dotwryn/bin/desktop/i3/launch-all-scratchpad-applications.sh

33 lines
885 B
Bash
Raw Normal View History

#!/usr/bin/zsh
2021-05-03 21:24:09 +00:00
APPLICATION_BIN="$HOME/.config/wryn/default-applications"
APPLICATION_CLASSES=(
'audio ^Pavucontrol$'
'discord ^discord$'
'email ^Thunderbird$'
'media ^youtubemusic-nativefier'
'message ^android-messages-desktop$'
'phone ^google-voice-desktop'
'slack ^Slack$'
2021-05-03 21:24:09 +00:00
)
for APP_CLS_STR in $APPLICATION_CLASSES; do
APPLICATION_CLASS=($(echo $APP_CLS_STR))
APPLICATION=${APPLICATION_CLASS[1]}
CLIENT_CLASS=${APPLICATION_CLASS[2]}
2021-05-03 21:24:09 +00:00
echo "launching $APPLICATION_BIN/$APPLICATION"
xdotool search --class "$CLIENT_CLASS" >/dev/null 2>&1 && echo "found existing" || {
2021-05-03 21:24:09 +00:00
i3-msg "exec --no-startup-id $APPLICATION_BIN/$APPLICATION;"
}
done
sleep 10;
for APP_CLS_STR in $APPLICATION_CLASSES; do
APPLICATION_CLASS=($(echo $APP_CLS_STR))
CLIENT_CLASS=${APPLICATION_CLASS[2]}
echo "hiding application $CLIENT_CLASS"
2021-05-03 21:24:09 +00:00
i3-msg "[class=$CLIENT_CLASS] move scratchpad";
done