launch legendary game with fzf

This commit is contained in:
Noah Masur 2022-06-03 21:58:20 -04:00
parent 350d7bb3cd
commit aa8765b2a2
2 changed files with 23 additions and 1 deletions

View File

@ -15,6 +15,7 @@
lutris
amdvlk
wineWowPackages.stable
# vulkan-tools
# Required according to https://lutris.net/games/league-of-legends/
openssl
@ -25,5 +26,7 @@
];
environment.sessionVariables = { QT_X11_NO_MITSHM = "1"; };
};
}

View File

@ -1,4 +1,8 @@
{ config, pkgs, lib, ... }: {
{ config, pkgs, lib, ... }:
let home-packages = config.home-manager.users.${config.user}.home.packages;
in {
options.gaming.legendary =
lib.mkEnableOption "Legendary - Epic Games Launcher";
@ -33,6 +37,21 @@
".fdignore".text = ignorePatterns;
};
programs.fish.functions =
lib.mkIf (builtins.elem pkgs.fzf home-packages) {
epic-games = {
body = ''
set game (legendary list 2>/dev/null \
| tail -n +3 \
| head -n -2 \
| sed -e 's/ (.*)$//' -e 's/ \* //' \
| awk '!/^ / { print $0; }' \
| fzf)
and legendary launch "$game" 2>/dev/null
'';
};
};
};
};