Last active
December 5, 2023 11:15
-
-
Save daemonp/8cf2e43dc2514c67b17d049783b191aa to your computer and use it in GitHub Desktop.
Bash script to open slack and superhuman as chrome "shortcuts" in dedicated windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Function to open an app if not already open | |
open_app() { | |
local app_id="$1" | |
local profile_dir="$2" | |
swaymsg -t get_tree | rg "$app_id-$profile_dir" > /dev/null || \ | |
chromium --app-id="$app_id" --profile-directory="$profile_dir" | |
} | |
# Define an array of apps to open | |
apps=( | |
"chalmapbddplheaokboeplomioemmjma,Default" # Slack | |
"cabkgbgkeonbpeoedbaeolhgfkempoka,Default" # Superhuman | |
"hnpfjngllnobngcgfapefoaidbinmjnm,Default" # Whatsapp | |
"cabkgbgkeonbpeoedbaeolhgfkempoka,PC" # Superhuman | |
"hcimieaacndoabfofdcldodbhlhnacok,PC" # Slack | |
) | |
# Loop through the apps array and open them | |
for app in "${apps[@]}"; do | |
IFS=',' read -r app_id profile_dir <<< "$app" | |
open_app "$app_id" "$profile_dir" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment