nixos/config/etc/rofi.rasi.nix

30 lines
915 B
Nix
Raw Normal View History

2023-09-11 20:23:04 +02:00
{pkgs}: let
2023-09-09 21:18:53 +02:00
tabMode = pkgs.writeScript "tab-finder.sh" (with pkgs; ''
2023-09-11 20:23:04 +02:00
#!/usr/bin/env bash
if [ -z ''${1} ]; then
${brotab}/bin/bt list;
else
TARGET_TAB=$(sed "s/\t.*$//g" <<< ''${1});
# activate window as focused to it is easy to switch to
${brotab}/bin/bt activate --focused ''${TARGET_TAB} > /dev/null 2>&1;
2024-02-21 21:53:58 +01:00
# TODO: Resolve at build time.
if [ -n ''${HYPRLAND_INSTANCE_SIGNATURE} ]; then
${hyprland}/bin/hyprctl dispatch focusurgentorlast > /dev/null 2>&1;
else
${i3}/bin/i3-msg -t run_command "[urgent=latest] focus" > /dev/null 2>&1;
fi
2023-09-11 20:23:04 +02:00
fi
exit 0;
2023-09-09 21:18:53 +02:00
'');
2023-09-11 21:20:14 +02:00
in
pkgs.writeText "rofi.rasi" ''
configuration {
modi: "combi,window,drun,ssh,tabFinder:${tabMode}";
font: "hack 10";
combi-modi: "window,drun,ssh,tabFinder";
icon-theme: "Papirus";
show-icons: true;
}
@theme "solarized"
''