How do I add Sublime Text 2 to rofi

Rofi on i3 doesn’t have an entry for Sublime Text 2. How do I add it?

I have sublime-text2.desktop file in /usr/share/applications:

[Desktop Entry]
Type=Application
Name=Sublime Text 2
GenericName=Editor
Comment=Sophisticated text editor for code, html and prose (legacy version)
Exec=subl %F
Icon=sublime-text2
Categories=Utility;TextEditor;
Terminal=false
StartupWMClass=sublime_text
MimeType=text/plain;

In .Xresources rofi is configured like this (default I think):

! Rofi
rofi.font: monospace 12
rofi.padding: 20
rofi.line-padding: 2
rofi.color-enabled: true
rofi.hide-scrollbar: true
rofi.separator-style: solid
rofi.color-window: #1c2023, #919ba0, #1c2023
rofi.color-normal: #1c2023, #919ba0, #1c2023, #a4a4a4, #1c2023
rofi.color-urgent: argb:00000000, #f43753, argb:00000000, argb:00000000, #e29a49
rofi.color-active: argb:00000000, #49bbfb, argb:00000000, argb:00000000, #e29a49
rofi.kb-cancel: Escape,Alt+F1

Isn’t Sublime 2 a little out of date?

What command are you using to start rofi?

rofi -show drun

should show everything in /usr/share/applications - sublime shows in my rofi menu.

Try this line:

Categories=TextEditor;Development;

in your sublime-text2.desktop instead of what you currently have.

Where is your sublime-text2 installed? I tested the pkg from AUR and it’s installed in /opt. A link from /usr/bin to /opt makes rofi/dmenu pick it up.

sudo ln -s /opt/sublime-text2/sublime_text /usr/bin/sublime_text

1 Like