mirror of
https://github.com/donovanglover/nix-config.git
synced 2025-06-03 00:15:35 +02:00
fish: Convert to home-manager module
The home-manager module seems to be fixed now and doesn't cause an abnormal startup time anymore.
This commit is contained in:
parent
006a3592e6
commit
8e4c9981ea
@ -4,7 +4,10 @@ let
|
||||
inherit (pkgs) gsettings-desktop-schemas prisma-engines gtk3;
|
||||
in
|
||||
{
|
||||
xdg.configFile."fish/config.fish".text = /* fish */ ''
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
|
||||
shellInit = /* fish */ ''
|
||||
set -U fish_greeting ""
|
||||
|
||||
export PATH="$HOME/.deno/bin:$HOME/.cargo/bin:$HOME/.yarn/bin:$HOME/.local/bin:$HOME/.go/bin:$PATH"
|
||||
@ -34,8 +37,14 @@ in
|
||||
# Always use the default keybindings in fish
|
||||
fish_default_key_bindings
|
||||
|
||||
# Convert unnecessarily large wav files to flac
|
||||
function wav2flac
|
||||
# Always use kitty ssh since it's our default terminal
|
||||
if string match -qe -- "/dev/pts/" (tty)
|
||||
alias ssh="kitty +kitten ssh"
|
||||
end
|
||||
'';
|
||||
|
||||
functions = {
|
||||
wav2flac = /* fish */ ''
|
||||
set ORIGINAL_SIZE (du -hs | cut -f1)
|
||||
|
||||
fd -e wav -x ffmpeg -i "{}" -loglevel quiet -stats "{.}.flac"
|
||||
@ -44,10 +53,9 @@ in
|
||||
set NEW_SIZE (du -hs | cut -f1)
|
||||
|
||||
echo "Done. Reduced file size from $ORIGINAL_SIZE to $NEW_SIZE"
|
||||
end
|
||||
'';
|
||||
|
||||
# Convert wav/flac to opus
|
||||
function opus
|
||||
opus = /* fish */ ''
|
||||
set ORIGINAL_SIZE (du -hs | cut -f1)
|
||||
|
||||
fd -e wav -e flac -x ffmpeg -i "{}" -c:a libopus -b:a 128K -loglevel quiet -stats "{.}.opus"
|
||||
@ -56,11 +64,7 @@ in
|
||||
set NEW_SIZE (du -hs | cut -f1)
|
||||
|
||||
echo "Done. Reduced file size from $ORIGINAL_SIZE to $NEW_SIZE"
|
||||
end
|
||||
|
||||
# Always use kitty ssh since it's our default terminal
|
||||
if string match -qe -- "/dev/pts/" (tty)
|
||||
alias ssh="kitty +kitten ssh"
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user