DEV Community

Ayedoun Châ-Fine ADEBI
Ayedoun Châ-Fine ADEBI

Posted on

🚀 Mastering Rofi in i3: A Cool & Fun Guide

So, you've installed Rofi, jazzed it up with some sweet themes from adi1090x, and now you're ready to turn it into a powerful, futuristic multitool. Let’s dive into customizing your workflow with Rofi!


1️⃣ Install & Configure Rofi

  1. Clone the repository for amazing pre-made themes:
   git clone https://github.com/adi1090x/rofi.git ~/rofi-themes
Enter fullscreen mode Exit fullscreen mode
  1. Navigate to the cloned directory:
   cd ~/rofi-themes
Enter fullscreen mode Exit fullscreen mode
  1. Run the setup script to install the themes:
   ./setup.sh
Enter fullscreen mode Exit fullscreen mode
  1. Choose your desired theme style during setup (light, dark, or custom). Themes are installed in ~/.config/rofi.

2️⃣ Make Rofi Pop with i3 Keybindings

Add the following to your i3 configuration file (~/.config/i3/config):

🔹 Launch Rofi in "drun" mode (app launcher):

bindsym $mod+d exec --no-startup-id rofi -show drun -theme ~/.config/rofi/config.rasi
Enter fullscreen mode Exit fullscreen mode

🔹 Switch to "run" mode (execute commands):

bindsym $mod+r exec --no-startup-id rofi -show run -theme ~/.config/rofi/config.rasi
Enter fullscreen mode Exit fullscreen mode

🔹 Switch to "window" mode (manage windows):

bindsym $mod+w exec --no-startup-id rofi -show window -theme ~/.config/rofi/config.rasi
Enter fullscreen mode Exit fullscreen mode

🔹 Enable "file browser" mode (navigate files):

To browse files, ensure Rofi Scripts are installed from the adi1090x repo:

bindsym $mod+f exec --no-startup-id rofi -modi filebrowser -show filebrowser -theme ~/.config/rofi/config.rasi
Enter fullscreen mode Exit fullscreen mode

Reload i3 ($mod+Shift+R) to apply these bindings.


3️⃣ Tips & Tricks for Using Rofi

💡 Switch Between Modes Dynamically

  • While in any mode (e.g., drun), type Ctrl+Tab to cycle through modes like:
    • drun → App Launcher
    • run → Command Runner
    • window → Window Switcher
    • filebrowser → File Manager

💡 Search Smarter in "drun" Mode

  • Search for apps by typing their name (e.g., fir for Firefox).
  • Use arrow keys to navigate and hit Enter to launch.

💡 Use "run" Mode Like a Pro

  • Type commands directly:
    • htop → Launch system monitor.
    • shutdown now → Turn off your system.
  • Rofi remembers past commands, making it quicker to access frequent ones.

💡 Master the "window" Mode

  • Quickly switch between open windows:
    • Type part of the window name.
    • Example: Type "term" to jump to an open terminal.

💡 Browse Files with Rofi (Filebrowser Mode)

  • Launch the file browser mode and navigate files using:
    • Arrow keys → Navigate.
    • Tab → Auto-complete.
    • Enter → Open the file or directory.

4️⃣ Rofi Keyboard Shortcuts

Key Function
Ctrl+Tab Switch between modes (drun, run, etc.)
Enter Select an option
Esc Exit Rofi
Arrow Keys Navigate the menu
Alt+Enter Launch in a terminal (requires setup)

5️⃣ Customize Themes for a Futuristic Look

🔹 Edit a Theme:

Rofi themes are located in ~/.config/rofi. Open and tweak a theme:

nano ~/.config/rofi/config.rasi
Enter fullscreen mode Exit fullscreen mode

🔹 Change Colors for Abstract Vibes:

  • Background: Neon with transparency:
  background: rgba(0, 0, 0, 0.8);
Enter fullscreen mode Exit fullscreen mode
  • Highlight Selected Items:
  selected-background: #00FFAB;  /* Neon green */
  selected-foreground: #FFFFFF;
Enter fullscreen mode Exit fullscreen mode

🔹 Rounded Corners:

  • Add modern rounded corners for a clean UI:
  border-radius: 10px;
Enter fullscreen mode Exit fullscreen mode

6️⃣ Fun Rofi Ideas

  1. Game Launcher:

    • Bind $mod+g to launch Rofi with a custom list of games.
  2. Spotify Control:

  3. SSH Connection Manager:

    • Add a mode to manage SSH connections for servers.
  4. Calculator Mode:

    • Add a script for quick calculations using Rofi.

Now you're all set to make Rofi your supertool in i3! 🎉 Feel free to experiment and share your favorite Rofi setups!

Speedy emails, satisfied customers

Postmark Image

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay