some nice programs using the rofi interface
Go to file
Nathan Dwarshuis cfe0607e2e ADD dismount all option 2023-01-24 09:22:19 -05:00
app ADD dismount all option 2023-01-24 09:22:19 -05:00
lib ADD dbus interface to get a specific password 2021-02-14 13:17:17 -05:00
scripts REF rename runtime package lister 2022-07-31 23:30:56 -04:00
.gitignore init commit 2020-04-23 23:32:29 -04:00
LICENSE init commit 2020-04-23 23:32:29 -04:00
README.md ENH call rofi directly 2022-08-07 22:18:40 -04:00
fourmolu.yaml ADD formatting config 2023-01-24 09:21:46 -05:00
make_pkgs FIX typo 2022-08-01 00:31:05 -04:00
package.yaml ENH call rofi directly 2022-08-07 22:18:40 -04:00
stack.yaml ENH update resolver 2022-08-06 18:50:45 -04:00
stack.yaml.lock ENH update resolver 2022-08-06 18:50:45 -04:00

README.md

rofi-extras

These are some personal programs that use the rofi interface.

Installation

Clone this repo and run the following in the repo root.

Install packages needed for building:

pacman -S --needed - < make_pkgs

Build and install (choose individual targets as needed):

stack install

See individual sections for other dependencies to install.

Putting Rofi on the correct screen (rofi)

This is a total hack...actually it isn't because it's written in Haskell and not bash.

The problem is that when used with xmonad, rofi doesn't place itself on the "current" workspace since the concept of a "workspace" is weird and specific to xmonad. The solution is to use this program to query _NET_DESKTOP_VIEWPORT (which my xmonad config sets) and use this determine the name of the active workspace which can then be fed to rofi using the -m flag.

See comments of this binary for details.

Dependencies

  • X11

Bitwarden (rofi-bw)

Bitwarden is an open-source password management server and this program functions as a client. Unlike many other similar clients, this only presents a simple lookup interface for usernames and passwords in the vault; editing and creating entries is not in the intendend scope.

Usage

This operates in a client/daemon fashion (locally, not with respect to the bitwarden server). The daemon holds the session key and the client presents the interface for username/password lookup.

Make sure bw-cli is properly configured to contact your bitwarden server using bw config server url.of.your.server.

Start the daemon in xinitrc or similar. This will start the deamon with a 60 second timeout for the session key (after which you would need to enter a new password):

rofi-bw -d 60

Then launch the client to browse through the vault.

rofi-bw -c

Any options after -c will be passed to rofi.

Dependencies

Device Mounting (rofi-dev)

This is a manual mounting helper for removable drives, MTP devices, and fstab entries. It will transparently handle mountpoint creation/destruction.

Usage

Launch the device manager:

rofi-dev

Any options after -- will be passed to rofi.

Select a device to mount/unmount it. Asterisks indicate that the device is mounted and that selecting it will unmount it. Removable devices will be mounted at the default for usdisksctl (usually /run/media/USER) and everything else will be mounted in /media/USER unless the -d option is specified (see rofi-dev -h). In the latter case the directory should be owned by the user.

Fstab entries should specify the users mount option (not user) to enable non-root users to mount and unmount. The mountpoint should either be in /media/USER (or whatever is specified by -d) or already exist.

Credentials

For fstab entries, rofi-dev will attempt to obtain a password if no options are supplied in the mount options (eg keyfiles for sshfs or credential files for cifs).

To specifify that /media/USER/foo should use secret-tool to find its password, specify the -s option. This would lookup a password for the entry whose username is bar and hostname is example.com:

Veracrypt

This tool can mount veracrypt vaults...with some hacky effort. Since veracrypt works at the block device level, it needs root permissions to mount a volume (which actually involves mounting several devices). The easiest way to make sure this works is to give veracrypt sudo access like so:

<user> ALL=(root) NOPASSWD: /usr/bin/veracrypt,/usr/bin/uptime

No idea why uptime is also needed for this.

rofi-dev -s '/media/USER/foo:username=bar,hostname=example.com'

To simply prompt for a password, use the -p option:

rofi-dev -p '/media/USER/foo'

Dependencies

  • udisks2: removable drive mounting
  • sshfs: mounting network devices in fstab over ssh
  • cifs-utils: mounting network devices in fstab using CIFS/Samba
  • veracrypt: to mount veracrypt vaults
  • jmtpfs: mounting MTP devices
  • libnotify: desktop notifications
  • libsecret: password lookup with secret-tool

Autorandr (rofi-autorandr)

This allows selection of the autorandr configuration via a rofi menu.

Dependencies

  • autorandr

Bluetooth (rofi-bw)

This presents a nice menu to select the current bluetooth device.

Dependencies

  • bluez (which should provide the dbus interface for this to work)

ExpressVPN (rofi-evpn)

This presents a menu to select the current ExpressVPN gateway.

Dependencies

  • expressvpn (from AUR)
  • libnotify

Pinentry (pinentry-rofi)

Analogous to the default pinentry prompts, this presents a rofi prompt for a password with the GPG keyring is unlocked.

Requires the following in gpg-agent.conf:

pinentry-program /path/to/pinentry-rofi

Unlike the other pinentry programs, this one can integrate with bitwarden (via the above client) by retrieving the password for the gpg keyring if it is stored in bitwarden. This requires a yaml configuration in the gpg home directoring as such:

bitwarden-name: <name of GPG bitwarden entry>

Dependencies

  • rofi-bw (see above): bitwarden integration