Skip to content

Instantly share code, notes, and snippets.

@allankayan
Created November 1, 2025 17:43
Show Gist options
  • Select an option

  • Save allankayan/0b64ba8f020ebb34cb66d0a64ade6be5 to your computer and use it in GitHub Desktop.

Select an option

Save allankayan/0b64ba8f020ebb34cb66d0a64ade6be5 to your computer and use it in GitHub Desktop.
Omarchy: Install Vicinae and Replace Default App Launcher/Emoji Picker
#!/bin/bash
# --- Configuration Variables ---
HYPR_CONFIG_DIR="$HOME/.config/hypr"
AUTOSTART_FILE="$HYPR_CONFIG_DIR/autostart.conf"
BINDINGS_FILE="$HYPR_CONFIG_DIR/bindings.conf"
echo "=========================================="
echo " Vicinae Hyprland Installation Script"
echo "=========================================="
# 1. Prerequisite Check (yay)
echo ""
echo "--- 1. Checking prerequisites (yay) ---"
if ! command -v yay &> /dev/null; then
echo "ERROR: 'yay' package manager not found. Please install 'yay' first."
exit 1
fi
# 2. Install Vicinae
echo ""
echo "--- 2. Installing vicinae-bin via yay ---"
# Use --noconfirm for non-interactive installation
yay -S vicinae-bin --noconfirm
if [ $? -ne 0 ]; then
echo "ERROR: 'vicinae-bin' installation failed. Aborting."
exit 1
fi
# 3. Prepare Hyprland Configuration Files
echo ""
echo "--- 3. Ensuring Hyprland config files exist ---"
mkdir -p "$HYPR_CONFIG_DIR"
touch "$AUTOSTART_FILE" "$BINDINGS_FILE"
# 4. Configure Autostart
echo ""
echo "--- 4. Adding 'exec-once = vicinae server' to $AUTOSTART_FILE ---"
AUTOSTART_LINE="exec-once = vicinae server"
if grep -qF "$AUTOSTART_LINE" "$AUTOSTART_FILE"; then
echo "Autostart entry already exists. Skipping."
else
echo "" >> "$AUTOSTART_FILE"
echo "# Vicinae Server Autostart" >> "$AUTOSTART_FILE"
echo "$AUTOSTART_LINE" >> "$AUTOSTART_FILE"
echo "Autostart entry added."
fi
# 5. Configure Keybinds
echo ""
echo "--- 5. Adding keybinds to $BINDINGS_FILE ---"
BINDINGS_CONTENT=$(cat <<'EOF'
# --- Vicinae Launcher Binds ---
unbind = SUPER, SPACE
unbind = SUPER CTRL, E
bindd = SUPER, SPACE, Launch apps, exec, vicinae toggle
bindd = SUPER CTRL, E, Emoji picker, exec, vicinae vicinae://extensions/vicinae/vicinae/search-emojis
# --- End Vicinae Launcher Binds ---
EOF
)
if grep -q "vicinae toggle" "$BINDINGS_FILE"; then
echo "Keybinds appear to already exist. Skipping."
else
echo "$BINDINGS_CONTENT" >> "$BINDINGS_FILE"
echo "Keybinds added successfully. NOTE: Ensure the 'unbinds' do not conflict with your current setup."
fi
# 6. Immediate Server Execution
echo ""
echo "--- 6. Attempting to start 'vicinae server' immediately ---"
# Kill existing process to ensure a clean start
if pgrep -x "vicinae" > /dev/null; then
echo "Vicinae server already active. Killing existing process..."
pkill -f "vicinae server"
sleep 1
fi
# Start the server in background, suppressing all output (stdout and stderr)
vicinae server > /dev/null 2>&1 &
if pgrep -x "vicinae" > /dev/null; then
echo "Vicinae server started successfully in the background."
else
echo "WARNING: Failed to start 'vicinae server' immediately."
echo "Autostart config was added and should work on next login/reboot."
fi
# 7. Reload Hyprland
echo ""
echo "--- 7. Reloading Hyprland to apply keybinds and ensure autostart persistence ---"
hyprctl reload
if [ $? -ne 0 ]; then
echo "WARNING: 'hyprctl reload' failed. You may need to manually restart Hyprland or log back in."
fi
echo ""
echo "=========================================="
echo " Vicinae Installation and Setup Complete!"
echo " The server is running. Press SUPER + SPACE to use Vicinae."
echo "=========================================="
@gelzinn

gelzinn commented Nov 1, 2025

Copy link
Copy Markdown

nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment