This is the second in a series of several posts on how to do way more than you really need to with rofi
. It’s a neat little tool that does so many cool things. I don’t have a set number of posts, and I don’t have a set goal. I just want to share something I find useful.
This post looks at basic rofi
configuration.
Assumptions
I’m running Fedora 27. Most of the instructions are based on that OS. This will translate fairly well to other RHEL derivatives. The Debian ecosystem should also work fairly well, albeit with totally different package names. This probably won’t work at all on Windows, and I have no intention of fixing that.
You’re going to need a newer version of rofi
, >=1.4
. I’m currently running this:
$ rofi -version |
If you installed from source, you should be good to go.
Code
You can view the code related to this post under the post-02-basic-config
tag.
Config File
At the momemnt, rofi
is using default values and (probably) refers to a config file that doesn’t exist.
$ rofi --help \ |
rofi
provides a couple of ways to load config (plus templating it for new users). We’ll need to create the user directory via $XDG_USER_CONFIG_DIR
first:
$ echo $XDG_USER_CONFIG_DIR || echo "export XDG_USER_CONFIG_DIR=/path/to/desired/.config" >> ~/.whateverrc && source ~/.whateverrc |
Since we’re running >=1.4
, we can use the new config format.
$ rofi -dump-config > $XDG_USER_CONFIG_DIR/rofi/config.rasi |
We’ve now got a super basic config file that contains every possible option (I think) commented out.
Theme File
While we’re at it, we might as well dump the theme too.
$ rofi -dump-theme > $XDG_USER_CONFIG_DIR/rofi/theme.rasi |
To ensure the theme is actually consumed, we’ll need to update the config.
$ sed \ |
Scripted
If you’re like me, you’re going to mess up the config on a fairly regular basis. Same goes if you’re actively developing with rofi
. It’s useful to have a quick method to rebuild defaults.
force-default-config | |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | #!/bin/bash |
This script works both via the CLI and via the GUI, thanks to rofi
.
$ scripts/force-default-config all |