Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/applications-setup/tab_data.toml
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,4 @@ script = "kitty-setup.sh"
[[data]]
name = "ZSH Prompt"
description = "The Z shell is a Unix shell that can be used as an interactive login shell and as a command interpreter for shell scripting. Zsh is an extended Bourne shell with many improvements, including some features of Bash, ksh, and tcsh. This command installs ZSH prompt and provides basic configuration."
script = "zsh-setup.sh"
script = "zsh-setup.sh"
55 changes: 55 additions & 0 deletions scripts/system-setup/alttab-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/bin/sh -e

# shellcheck source=../common-script.sh
. ../common-script.sh

Check warning on line 4 in scripts/system-setup/alttab-setup.sh

View workflow job for this annotation

GitHub Actions / Shellcheck

[shellcheck] reported by reviewdog 🐶 Not following: ../common-script.sh was not specified as input (see shellcheck -x). Raw Output: ./scripts/system-setup/alttab-setup.sh:4:3: info: Not following: ../common-script.sh was not specified as input (see shellcheck -x). (ShellCheck.SC1091)

installAltTab() {
if ! brewprogram_exists alt-tab; then
printf "%b\n" "${YELLOW}Installing AltTab...${RC}"
if ! brew install --cask alt-tab; then
printf "%b\n" "${RED}Failed to install AltTab. Please check your Homebrew installation or try again later.${RC}"
exit 1
fi
printf "%b\n" "${GREEN}AltTab installed successfully!${RC}"

# Configure AltTab for optimal experience
configureAltTab
else
printf "%b\n" "${GREEN}AltTab is already installed.${RC}"
printf "%b\n" "${YELLOW}Applying configuration...${RC}"
configureAltTab
fi
}

configureAltTab() {
printf "%b\n" "${YELLOW}Configuring AltTab preferences...${RC}"

# Kill AltTab if it's running to ensure clean configuration
pkill -f "AltTab" 2>/dev/null || true

# Wait a moment for the process to terminate
sleep 1

# Show hidden windows
defaults write com.lwouis.alt-tab-macos showHiddenWindows -bool true

# Overwrite the default hold shortcut to Cmd (Windows-like behavior)
defaults write com.lwouis.alt-tab-macos holdShortcut -string "⌘"

# Enable start at login
defaults write com.lwouis.alt-tab-macos startAtLogin -bool true

# Start AltTab silently in the background to initialize settings
open -g -a "AltTab" 2>/dev/null || true

printf "%b\n" "${GREEN}AltTab configuration applied successfully!${RC}"
printf "%b\n" "${CYAN}Note: You may need to grant AltTab accessibility permissions in System Settings > Privacy & Security > Accessibility${RC}"
}

checkEnv
installAltTab

printf "%b\n" "${GREEN}AltTab setup completed!${RC}"
printf "%b\n" "${CYAN}You can now use Cmd+Tab to switch between individual windows (Windows-like behavior)${RC}"
printf "%b\n" "${CYAN}AltTab will start automatically on your next login.${RC}"
printf "%b\n" "${CYAN}To configure further options or start it now, find AltTab in your Applications folder.${RC}"
7 changes: 6 additions & 1 deletion scripts/system-setup/tab_data.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,9 @@ script = "fix-finder.sh"
[[data.entries]]
name = "Remove Animations"
description = "This script is designed to remove snap packages and the snapd service from your system"
script = "remove-animations.sh"
script = "remove-animations.sh"

[[data.entries]]
name = "AltTab"
description = "AltTab brings Windows-like Alt+Tab functionality to macOS, allowing you to switch between individual windows instead of just applications. Perfect for users who work with multiple windows of the same application."
script = "alttab-setup.sh"
Loading