programs: add rofi (dmenu-style launcher/file browser)

This commit is contained in:
Colin 2024-02-26 20:57:35 +00:00
parent 1098d121b4
commit 617525a317
3 changed files with 74 additions and 0 deletions

View File

@ -77,6 +77,7 @@
./playerctl.nix
./rhythmbox.nix
./ripgrep.nix
./rofi
./sane-scripts.nix
./sfeed.nix
./signal-desktop.nix

View File

@ -0,0 +1,33 @@
/* to show active config: `rofi -dump-config`
* to show keybindings: `rofi -show keys`
* to show theme config: `rofi -dump-theme`
* - for live theme switching: `rofi-theme-selector`
*/
configuration {
modes: "combi";
show-icons: true;
combi-modes: "filebrowser,drun,run";
kb-accept-entry: "Return,KP_Enter,XF86PowerOff";
kb-row-up: "Up,XF86AudioRaiseVolume";
kb-row-down: "Down,XF86AudioLowerVolume";
filebrowser {
/* filebrowser starting directory */
directory: "/home";
/* display-name: text to prepend in combi mode */
display-name: "/";
}
drun {
display-name: " ";
}
run {
display-name: "run ";
}
/* combi-display-format: "{mode} {text}"; */
/* combi-display-format: "{text}"; */
combi-display-format: "{mode}{text}";
drun-use-desktop-cache: true;
}
@theme "gruvbox-light"

View File

@ -0,0 +1,40 @@
# rofi: app-launcher/file-browser/omni-menu
#
# select options:
# - `rofi -show`
# - use as a launcher/file browser
# - `rofi -sidebar-mode`
# - separate tabs for filebrowser, drun, etc.
# - `rofi -pid /run/user/$UID/rofi.pid -replace`
# - single-instance mode
# - pid is probably optional, just need `-replace`.
#
# ROFI POWERSCRIPTS/EXTENSIONS/PLUGINS:
# collections:
# - <https://github.com/adi1090x/rofi>
# - <https://github.com/giomatfois62/rofi-desktop>
# - turns rofi into a hierarchical menu, like sxmo
#
# - <https://github.com/adi1090x/rofi>
# - <https://github.com/marvinkreis/rofi-file-browser-extended>
# - <https://github.com/Mange/rofi-emoji>
# - <https://github.com/fdw/rofimoji>
# - <https://github.com/jluttine/rofi-power-menu>
# - <https://github.com/ceuk/rofi-screenshot>
# - <https://gitlab.com/DamienCassou/rofi-pulse-select>
{ pkgs, ... }:
{
sane.programs.rofi = {
# 2024/02/26: wayland is only supported by the fork: <https://github.com/lbonn/rofi>.
# it's actively maintained though, and more of an overlay than a true fork.
packageUnwrapped = pkgs.rofi-wayland;
fs.".config/rofi/config.rasi".symlink.target = ./config.rasi;
# redirect its default drun cache location
fs.".cache/rofi-drun-desktop.cache".symlink.target = "rofi/rofi-drun-desktop.cache";
persist.byStore.plaintext = [
# optional, for caching .desktop files rofi finds on disk (perf)
".cache/rofi"
];
};
}