-
Notifications
You must be signed in to change notification settings - Fork 0
Rofi
Rofi is the application launcher used in NullOS, providing a fast and customizable way to launch applications and run commands.
Configuration Files:
-
home/rofi/default.nix- Main configuration -
home/rofi/rofi.nix- Rofi settings -
home/rofi/config-long.nix- Alternative layout
Launch: SUPER + SHIFT + Return or tap SUPER twice
- Press
SUPER + SHIFT + Return - Type application name
- Press
Enterto launch
- Fuzzy search - Type partial names (e.g., "fire" matches Firefox)
- Navigate - Arrow keys or Vim keys (j/k)
- Launch - Enter
- Cancel - Escape
Rofi supports different modes:
- drun - Desktop applications (default)
- run - All executables in PATH
- window - Switch between open windows
- ssh - SSH to configured hosts
Switch modes with Shift + Arrow Left/Right
programs.rofi = {
enable = true;
package = pkgs.rofi-wayland;
font = "JetBrainsMono Nerd Font 12";
terminal = "${pkgs.ghostty}/bin/ghostty";
extraConfig = {
modi = "drun,run,window,ssh";
show-icons = true;
icon-theme = "Papirus";
display-drun = " Apps";
display-run = " Run";
display-window = " Windows";
drun-display-format = "{name}";
kb-row-up = "Up,Control+k";
kb-row-down = "Down,Control+j";
};
};extraConfig = {
# Window width
width = 50; # Percentage
# Number of lines
lines = 10;
# Columns for grid layout
columns = 1;
# Show/hide scrollbar
hide-scrollbar = true;
# Case sensitivity
case-sensitive = false;
# Sidebar mode selector
sidebar-mode = true;
};Rofi is automatically themed by Stylix in NullOS.
# In home/stylix.nix
stylix.targets.rofi.enable = true;Disable Stylix and create custom theme:
stylix.targets.rofi.enable = false;
programs.rofi.theme = {
"*" = {
background = "#1e1e2e";
foreground = "#cdd6f4";
selected-background = "#89b4fa";
selected-foreground = "#1e1e2e";
};
window = {
background-color = "@background";
border = 2;
border-color = "@selected-background";
border-radius = 10;
padding = 10;
};
inputbar = {
background-color = "@background";
text-color = "@foreground";
padding = 5;
border-radius = 5;
};
listview = {
background-color = "@background";
columns = 1;
lines = 8;
spacing = 5;
padding = 5;
};
element = {
background-color = "transparent";
text-color = "@foreground";
padding = 5;
border-radius = 5;
};
"element selected" = {
background-color = "@selected-background";
text-color = "@selected-foreground";
};
};Use community themes:
rofi-theme-selectorOr manually:
programs.rofi.theme = "/path/to/theme.rasi";NullOS includes a custom launcher script:
File: home/scripts/rofi-launcher.nix
#!/usr/bin/env bash
rofi -show drun \
-theme-str 'window {width: 35%;}' \
-theme-str 'listview {lines: 8;}'Create a power menu:
#!/usr/bin/env bash
options="⏻ Shutdown\n⏾ Reboot\n⏸ Suspend\n Lock"
chosen=$(echo -e "$options" | rofi -dmenu -p "Power Menu")
case $chosen in
"⏻ Shutdown")
systemctl poweroff
;;
"⏾ Reboot")
systemctl reboot
;;
"⏸ Suspend")
systemctl suspend
;;
" Lock")
hyprlock
;;
esacAdd to configuration:
home.file.".local/bin/rofi-power" = {
executable = true;
text = ''
#!/usr/bin/env bash
# Script above
'';
};Bind to key:
# In Hyprland binds
bind = SUPER SHIFT, P, exec, rofi-powerWith cliphist:
#!/usr/bin/env bash
cliphist list | rofi -dmenu | cliphist decode | wl-copyCreate custom modes for Rofi:
# Emoji selector
"custom/emoji" = {
script = "rofi-emoji";
entry = " Emoji";
};extraConfig = {
modi = "drun,filebrowser";
filebrowser = {
directory = "/home/${username}";
};
};extraConfig = {
modi = "drun,calc";
};Install calculator:
home.packages = [ pkgs.rofi-calc ];| Key | Action |
|---|---|
↑/↓
|
Navigate up/down |
Ctrl+j/k
|
Navigate (Vim style) |
Tab |
Next entry |
Shift+Tab |
Previous entry |
Enter |
Select |
Esc |
Cancel |
| Key | Action |
|---|---|
Shift+← |
Previous mode |
Shift+→ |
Next mode |
extraConfig = {
kb-accept-entry = "Return,KP_Enter";
kb-remove-to-eol = "";
kb-mode-next = "Shift+Right,Control+Tab";
kb-mode-previous = "Shift+Left,Control+ISO_Left_Tab";
kb-row-up = "Up,Control+k,Shift+Tab,Shift+ISO_Left_Tab";
kb-row-down = "Down,Control+j";
};# In home/hyprland/binds.nix
bind = [
"SUPER SHIFT, Return, exec, rofi -show drun"
"SUPER, D, exec, rofi -show run"
"SUPER, Tab, exec, rofi -show window"
];
# Tap Super twice for launcher
bindr = [
"SUPER, SUPER_L, exec, rofi -show drun"
];Use same colors as Hyprland border:
programs.rofi.theme = {
"*" = {
selected-background = config.wayland.windowManager.hyprland.settings.general."col.active_border";
};
};Create script to show Hyprland keybindings in Rofi:
#!/usr/bin/env bash
hyprctl binds | rofi -dmenu -p "Keybindings"#!/usr/bin/env bash
options="Screenshot\nScreen Record\nColor Picker\nWallpaper"
chosen=$(echo -e "$options" | rofi -dmenu -p "Quick Actions")
case $chosen in
"Screenshot")
screenshotin
;;
"Screen Record")
wf-recorder
;;
"Color Picker")
hyprpicker | wl-copy
;;
"Wallpaper")
wallsetter
;;
esacCheck if installed:
which rofiRun manually to see errors:
rofi -show drunEnable icons:
extraConfig = {
show-icons = true;
icon-theme = "Papirus";
};Install icon theme:
home.packages = [ pkgs.papirus-icon-theme ];Update desktop database:
update-desktop-database ~/.local/share/applicationsReduce displayed items:
extraConfig = {
lines = 8; # Reduce number of lines
lazy-grab = true; # Improve performance
};Lighter alternative to Rofi:
programs.wofi = {
enable = true;
settings = {
width = 600;
height = 400;
show = "drun";
};
};Minimal launcher:
programs.fuzzel = {
enable = true;
settings = {
main = {
terminal = "${pkgs.ghostty}/bin/ghostty";
font = "JetBrainsMono Nerd Font:size=12";
};
};
};- Hyprland - Window manager keybindings
- Waybar - Status bar customization
- Theming - Customize appearance
- Customization Guide - General customization