Skip to content

Instantly share code, notes, and snippets.

@iTrauco
Created December 25, 2024 22:02
Show Gist options
  • Save iTrauco/bed82fe94961b53f570485c5b4007351 to your computer and use it in GitHub Desktop.
Save iTrauco/bed82fe94961b53f570485c5b4007351 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Install xbindkeys
echo "Installing xbindkeys..."
sudo apt update && sudo apt install xbindkeys -y
# Create the default configuration file
echo "Creating xbindkeys configuration file..."
xbindkeys --defaults > ~/.xbindkeysrc
# Add custom keybindings to ~/.xbindkeysrc
echo "Adding custom keybindings..."
cat <<EOL >> ~/.xbindkeysrc
# Control + Alt + 1 for claude1.sh
"~/scripts/claude1.sh"
Control+Alt + 1
# Control + Alt + 2 for claude2.sh
"~/scripts/claude2.sh"
Control+Alt + 2
# Control + Alt + 3 for claude3.sh
"~/scripts/claude3.sh"
Control+Alt + 3
# Control + Alt + 4 for claude4.sh
"~/scripts/claude4.sh"
Control+Alt + 4
# Control + Alt + 5 for claude-personal.sh
"~/scripts/claude-personal.sh"
Control+Alt + 5
# Control + Alt + 6 for claude-dev.sh
"~/scripts/claude-dev.sh"
Control+Alt + 6
# Control + Alt + 7 for openai-personal.sh
"~/scripts/openai-personal.sh"
Control+Alt + 7
EOL
# Create the autostart directory if it doesn't exist
echo "Setting xbindkeys to start at login..."
mkdir -p ~/.config/autostart
# Add xbindkeys to autostart
cat <<EOL > ~/.config/autostart/xbindkeys.desktop
[Desktop Entry]
Type=Application
Exec=xbindkeys
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name=XBindKeys
Comment=Start xbindkeys for custom hotkeys
EOL
# Reload xbindkeys
echo "Reloading xbindkeys..."
killall xbindkeys 2>/dev/null
xbindkeys
echo "Setup complete! Test your hotkeys using Control + Alt + 1 through Control + Alt + 7."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment