update rofi config

This commit is contained in:
Leonardo Eugênio 2022-12-06 21:59:46 -03:00
parent 9e737da231
commit 875fe5ebe4
6 changed files with 66 additions and 6 deletions

View file

@ -3,7 +3,7 @@ let
inherit (pkgs.uservars) dmenu;
available_menus = {
bmenu = "bmenu";
rofi = "rofi -dmenu";
rofi = "rofi -dmenu -sort";
};
menu_cmd = available_menus.${dmenu};
in pkgs.writeShellScriptBin "wdmenu" ''

11
scripts/wfile-picker.nix Normal file
View file

@ -0,0 +1,11 @@
{ pkgs, ... }:
let
inherit (pkgs.uservars) dmenu;
available_menus = {
bmenu = "bmenu run";
rofi = "rofi -show drun -sort";
};
menu_cmd = available_menus.${dmenu};
in pkgs.writeShellScriptBin "wlauncher" ''
exec ${menu_cmd} "$@"
''

View file

@ -3,7 +3,7 @@ let
inherit (pkgs.uservars) dmenu;
available_menus = {
bmenu = "bmenu run";
rofi = "rofi -show drun";
rofi = "rofi -show drun -sort";
};
menu_cmd = available_menus.${dmenu};
in pkgs.writeShellScriptBin "wlauncher" ''

View file

@ -0,0 +1,46 @@
define-command -override -hidden find_file \
%{ evaluate-commands %sh{
for line in `rofi -sort -show file-browser-extended -file-browser-depth 0 -file-browser-no-descend -file-browser-stdout -p "File: "`; do
echo "edit '$line'"
done
} }
define-command -override -hidden find_delete \
%{ nop %sh{
rofi -sort -show file-browser-extended -file-browser-depth 0 -file-browser-no-descend -file-browser-stdout | xargs -r trash
} }
define-command -override -hidden find_git_file \
%{ evaluate-commands %sh{
for line in `git ls-files | rofi -sort -show file-browser-extended -file-browser-depth 0 -file-browser-no-descend -file-browser-stdout -file-browser-stdin`; do
echo "edit -existing '$line'"
done
} }
define-command -override -hidden find_git_modified \
%{ evaluate-commands %sh{
for line in `git status --porcelain | sd '^.. ' ''| rofi -sort -show file-browser-extended -file-browser-no-descend -file-browser-stdout -file-browser-stdin`; do
echo "edit -existing '$line'"
done
} }
define-command -override -hidden find_dir \
%{ cd %sh{
for line in `fd --strip-cwd-prefix -Htd | rofi -sort -show file-browser-extended -file-browser-no-descend -file-browser-stdout -file-browser-stdin`; do
echo "edit '$line'"
done
} }
define-command -override -hidden find_buffer \
%{ evaluate-commands %sh{
for line in `printf "%s\n" $kak_buflist | wdmenu -i`; do
echo "buffer '$line'"
done
} }
define-command -override -hidden tree \
%{ evaluate-commands %sh{
for line in `rofi -sort -show file-browser-extended -file-browser-stdout`; do
echo "edit '$line'"
done
} }

View file

@ -1,5 +1,5 @@
{ config, pkgs, lib, font, ... }:
let inherit (import ./variables.nix) key theme color accent font;
let inherit (import ./variables.nix) key theme color accent font dmenu;
in {
config = {
programs.kakoune = {
@ -15,7 +15,7 @@ in {
brown = color.normal.brown;
};
in with colors;
lib.concatStringsSep "\n" (map (lib.readFile) [
lib.concatStringsSep "\n" (map (lib.readFile) ([
./kak/filetypes.kak
./kak/hooks.kak
./kak/indent.kak
@ -23,7 +23,7 @@ in {
./kak/plug.kak
./kak/usermode.kak
./kak/git-mode.kak
]) + ''
] ++ lib.optional (dmenu == "rofi") ./kak/rofi-commands.kak)) + ''
set global scrolloff 10,20
set global autoreload yes

View file

@ -4,7 +4,10 @@ in {
config = {
programs.rofi = {
enable = true;
package = pkgs.rofi-wayland.override { plugins = [ pkgs.rofi-emoji ]; };
package = pkgs.rofi-wayland.override { plugins = with pkgs; [
rofi-emoji
rofi-file-browser
];};
extraConfig = {
show-icons = true;
modi = "drun,emoji";