Skip to main content

Rofi Menus and Scripts

Rofi provides all the interactive menus in Config-Sway, from application launching to theme switching. All menus are styled consistently and integrated with the theme system.

Directory Structure

Rofi Scripts

Script: selector-app.sh

~/.config/rofi/scripts/selector-app.sh
Features:
  • Shows all desktop applications (.desktop files)
  • Displays application icons
  • Background image overlay (if available)
  • Fuzzy search enabled
Keybinding: Super + D
Type partial application names to quickly filter. For example, “fire” will show Firefox.

Script: power-menu.sh

~/.config/rofi/scripts/power-menu.sh
Menu Options:Features:
  • Shows last login time
  • Displays system uptime
  • Background image in header
  • Safe suspend (pauses music first)
Keybinding: Super + Q
Shutdown and reboot actions execute immediately without confirmation. Use the cancel option if you change your mind.

Script: theme-switcher.sh

The theme switcher is the most complex script, handling theme application across all components.
~/.config/rofi/scripts/theme-switcher.sh
What it does:
  1. Lists available themes from ~/.config/themes/
  2. Shows theme previews using wallpaper images as icons
  3. Applies selected theme to:
    • Kitty terminal colors
    • Waybar colors and styles
    • Sway window decorations
    • Rofi color palette
    • System wallpaper
  4. Reloads all components automatically
Theme Detection:
Component Updates:
Auto-generating Rofi Colors:If a theme doesn’t include a rofi palette, colors are extracted from Sway theme:
Keybinding: Super + A
The script creates .bak-<timestamp> backups before modifying configurations. Backups are stored alongside the original files.
Similar to theme switcher, but only changes the wallpaper without modifying other theme components.Keybinding: Super + W

Script: menu-iconos.sh

A custom icon-based menu. The exact functionality depends on your configuration.Keybinding: Super + E

Rofi Styling

Color Palette

~/.config/rofi/styles/_core/palette.rasi
This file is automatically updated by the theme switcher. All menu styles import this palette. Each menu has two style files:
  1. styles/_core/<menu>.rasi - Core layout and structure
  2. styles/<menu>.rasi - Imports core + customizations
The _core/ directory contains the actual styling logic. Top-level .rasi files simply import from _core/ and can add overrides.

Available Themes

Config-Sway includes 6 pre-configured themes:

Theme Structure

Each theme directory contains:
Create your own theme by copying an existing theme directory and modifying the files. Make sure to include a wallpaper.jpg/png/webp file!

Creating Custom Menus

Basic Rofi Script Template

Adding Icons to Menu Items

Using Images as Icons

Rofi Configuration Tips

Edit ~/.config/rofi/config.rasi to add custom keybindings:
In your menu’s .rasi file:
Or use percentages:
In palette.rasi or individual menu styles:

Troubleshooting

Possible causes:
  • Missing Nerd Fonts
  • -show-icons flag not set
  • GTK icon theme not installed
Solution:
Ensure script uses: rofi -show drun -show-icons
  1. Verify palette.rasi exists:
  1. Check for syntax errors:
  1. Manually update palette by running theme switcher again
  1. Ensure script is executable:
  1. Check for errors:
  1. Verify shebang is correct: #!/usr/bin/env bash

Sway Keybindings

See all Rofi menu keybindings in Sway config

Theme System

Understand how themes affect Rofi styling

Scripts

Other utility scripts used by the system