Browse reddit threads from rofi!
This is a rofi plugin that allows you to browse Reddit threads from rofi. It uses the Reddit API to fetch the threads and display them in a rofi menu.
Run rofi like:
rofi -show reddit -modi reddityay -S rofi-redditparu -S rofi-redditYou need a C compilation toolchain (a C compiler like clang or gcc, meson and pkg-config), libcurl and rofi. The rest of the dependencies will be resolved by meson.
You will also need development headers for rofi. Depending on your distribution these may be included in different packages:
- Arch Linux, Gentoo: included with
rofiandmeson - OpenSUSE:
zypper in rofi rofi-devel meson - Debian:
apt install rofi-dev meson - Ubuntu:
apt install rofi-dev meson - Solus:
eopkg it rofi-devel - CentOS: Install
meson(findrofi-develheaders yourself) - Fedora:
dnf install meson libtool cairo-devel rofi-devel - VoidLinux:
xbps-install -S rofi-devel meson libtool - Others: look it up :)
rofi-reddit uses meson as a build system:
git clone https://github.com/valdebrutal/rofi-reddit.git
cd rofi-reddit/
meson setup build -Dtests=false
meson compile -C build/
meson install -C buildYou will need to create a Reddit application bound to your Reddit account to allow this plugin to browse Reddit on your behalf. As of now, the plugin only supports fetching the "hot" threads from a given subreddit.
To create a Reddit application, follow these steps:
- Go to your Reddit account preferences: https://www.reddit.com/prefs/apps
- Scroll down to the "Developed Applications" section.
- Click on "Create App"
- Fill in the required fields making sure to select "script" as the application type:

- Having installed
rofi-reddit, go to/usr/share/rofi-reddit/config.tomland fill in theclient_id,client_secretandclient_namefields. You can find all of these in the application you just created by going to https://www.reddit.com/prefs/apps and clicking "edit" on your application. These are the values for each field:
You can verify that your reddit app works fine by trying to get an access token:
curl --request POST \
--url https://www.reddit.com/api/v1/access_token \
-A '<client-name>' \
-u '<client-id>:<client-secret>' \
--header 'content-type: application/x-www-form-urlencoded' \
--data scope=read \
--data grant_type=client_credentials...and then trying to use it:
curl --request GET \
--url https://oauth.reddit.com/r/libertarian/hot \
--header 'Authorization: Bearer <access-token>'Run the tests (requires ruby 2.7!):
meson setup build && meson test -C build
