Rofi Dmenu

about | blog | config | notes | github

Rofi is a window switcher, application launcher and dmenu program for X11.

1. Configuration

1.1. Package Install

Install the rofi package. Ensure that Xorg X11 Window System is install first however.

(require 'init-xorg)
(zamlz/system-packages-ensure "rofi")
(provide 'init-rofi-dmenu)

1.2. Configuration

Here is a simple function that will capture the current fixed font that we have setup in GNU/Emacs.

configuration {
      modi: "window,run,ssh";
      font: "Iosevka Term 14";
      location: 0;
      yoffset: 0;
      xoffset: 0;
      fixed-num-lines: true;
      show-icons: false;
      terminal: "rofi-sensible-terminal";
      ssh-client: "ssh";
      ssh-command: "{terminal} -e {ssh-client} {host} [-p {port}]";
      run-command: "{cmd}";
      run-list-command: "";
      run-shell-command: "{terminal} -e {cmd}";
      window-command: "wmctrl -i -R {window}";
      window-match-fields: "all";
      icon-theme: "";
      drun-match-fields: "name,generic,exec,categories,keywords";
/*    drun-categories: ; */
      drun-show-actions: false;
      drun-display-format: "{name} [<span weight='light' size='small'><i>({generic})</i></span>]";
      drun-url-launcher: "xdg-open";
      disable-history: false;
      ignored-prefixes: "";
      sort: false;
      sorting-method: "normal";
      case-sensitive: false;
      cycle: true;
      sidebar-mode: false;
      hover-select: false;
      eh: 1;
      auto-select: false;
      parse-hosts: false;
      parse-known-hosts: true;
      combi-modi: "window,run";
      matching: "normal";
      tokenize: true;
      m: "-5";
/*    filter: ; */
      dpi: -1;
      threads: 0;
      scroll-method: 0;
      window-format: "{w}    {c}   {t}";
      click-to-exit: true;
      theme: "default-theme";
      max-history-size: 25;
      combi-hide-mode-prefix: false;
      matching-negate-char: '-';
      window-thumbnail: false;
      drun-use-desktop-cache: false;
      drun-reload-desktop-cache: false;
      normalize-match: false;
      steal-focus: false;
  timeout {
      action: "kb-cancel";
      delay:  0;
  }
  filebrowser {
      directories-first: true;
      sorting-method:    "name";
  }
}

1.3. Theme

*{
    red:                         rgba ( 220, 50, 47, 100 % );
    blue:                        rgba ( 38, 139, 210, 100 % );
    background:                  rgba ( 0, 0, 0, 100 % );
    foreground:                  rgba ( 225, 225, 225, 100 % );
    background-color:            rgba ( 0, 0, 0, 0 % );
    normal-background:           var(background);
    normal-foreground:           var(foreground);
    lightbg:                     rgba ( 32, 32, 32, 100 % );
    lightfg:                     var(foreground);
    selected-normal-background:  var(lightfg);
    selected-normal-foreground:  var(lightbg);
    alternate-normal-background: var(lightbg);
    alternate-normal-foreground: var(foreground);
    active-background:           var(background);
    active-foreground:           var(blue);
    selected-active-background:  var(blue);
    selected-active-foreground:  var(background);
    alternate-active-background: var(lightbg);
    alternate-active-foreground: var(blue);
    urgent-background:           var(background);
    urgent-foreground:           var(red);
    selected-urgent-background:  var(red);
    selected-urgent-foreground:  var(background);
    alternate-urgent-background: var(lightbg);
    alternate-urgent-foreground: var(red);
    separatorcolor:              var(foreground);
    border-color:                var(foreground);
    spacing:                     2;
}
element {
    padding: 1px ;
    cursor:  pointer;
    spacing: 5px ;
    border:  0;
}
element normal.normal {
    background-color: var(normal-background);
    text-color:       var(normal-foreground);
}
element normal.urgent {
    background-color: var(urgent-background);
    text-color:       var(urgent-foreground);
}
element normal.active {
    background-color: var(active-background);
    text-color:       var(active-foreground);
}
element selected.normal {
    background-color: var(selected-normal-background);
    text-color:       var(selected-normal-foreground);
}
element selected.urgent {
    background-color: var(selected-urgent-background);
    text-color:       var(selected-urgent-foreground);
}
element selected.active {
    background-color: var(selected-active-background);
    text-color:       var(selected-active-foreground);
}
element alternate.normal {
    background-color: var(alternate-normal-background);
    text-color:       var(alternate-normal-foreground);
}
element alternate.urgent {
    background-color: var(alternate-urgent-background);
    text-color:       var(alternate-urgent-foreground);
}
element alternate.active {
    background-color: var(alternate-active-background);
    text-color:       var(alternate-active-foreground);
}
element-text {
    background-color: rgba ( 0, 0, 0, 0 % );
    cursor:           inherit;
    highlight:        inherit;
    text-color:       inherit;
}
element-icon {
    background-color: rgba ( 0, 0, 0, 0 % );
    size:             1.0000em ;
    cursor:           inherit;
    text-color:       inherit;
}
window {
    padding:          5;
    background-color: var(background);
    border:           1;
    width:            1000;
    y-offset:         -15%;
}
mainbox {
    padding: 0;
    border:  0;
}
message {
    padding:      1px ;
    border-color: var(separatorcolor);
    border:       2px dash 0px 0px ;
}
textbox {
    text-color: var(foreground);
}
listview {
    padding:      2px 0px 0px ;
    scrollbar:    true;
    border-color: var(separatorcolor);
    spacing:      2px ;
    fixed-height: false;
    dynamic:      true;
    border:       2px dash 0px 0px ;
}
scrollbar {
    width:        4px ;
    padding:      0;
    handle-width: 8px ;
    border:       0;
    handle-color: var(normal-foreground);
}
sidebar {
    border-color: var(separatorcolor);
    border:       2px dash 0px 0px ;
}
button {
    cursor:     pointer;
    spacing:    0;
    text-color: var(normal-foreground);
}
button selected {
    background-color: var(selected-normal-background);
    text-color:       var(selected-normal-foreground);
}
num-filtered-rows {
    expand:     false;
    text-color: rgba ( 128, 128, 128, 100 % );
}
num-rows {
    expand:     false;
    text-color: rgba ( 128, 128, 128, 100 % );
}
textbox-num-sep {
    expand:     false;
    str:        "/";
    text-color: rgba ( 128, 128, 128, 100 % );
}
inputbar {
    padding:    1px ;
    spacing:    0px ;
    text-color: var(normal-foreground);
    children:   [ prompt,textbox-prompt-colon,entry,num-filtered-rows,textbox-num-sep,num-rows,case-indicator ];
}
case-indicator {
    spacing:    0;
    text-color: var(normal-foreground);
}
entry {
    text-color:        var(normal-foreground);
    cursor:            text;
    spacing:           0;
    placeholder-color: rgba ( 128, 128, 128, 100 % );
    placeholder:       "Type to filter";
}
prompt {
    spacing:    0;
    text-color: var(normal-foreground);
}
textbox-prompt-colon {
    margin:     0px 0.3000em 0.0000em 0.0000em ;
    expand:     false;
    str:        ":";
    text-color: inherit;
}

Created: 2021-11-13

Emacs 26.1 (Org mode 9.5)