rebuild script now has a -U flag for updating the flake before rebuilding
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
{ lib, config, self, ... }:
|
||||
{ lib, config, pkgs, self, ... }:
|
||||
{
|
||||
programs.fern = {
|
||||
aliases = {
|
||||
mv = "mv -v";
|
||||
cp = "cp -vr";
|
||||
gt = "gtrash";
|
||||
gtp = "playshellsound ${self}/assets/sound/rm.wav";
|
||||
gtp = "${pkgs.myScripts.playshellsound}/bin/playshellsound ${self}/assets/sound/rm.wav && gtrash put";
|
||||
diff = "diff --color=auto";
|
||||
sr = "source ~/.fernrc";
|
||||
psg = "ps aux | grep -v grep | grep -i -e VSZ -e";
|
||||
mkdir = "mkdir -p";
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
|
||||
FZF_DEFAULT_COMMAND = "fd";
|
||||
FZF_DEFAULT_OPTS = "--height 40% --layout=reverse --border";
|
||||
|
||||
LESS = "-R"; # pager uses alt buffer
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -8,13 +8,15 @@ in
|
||||
programs.fern = {
|
||||
settings.extraPreConfig = ''
|
||||
prompt_topline() {
|
||||
local last_cmd_status
|
||||
local last_cmd_runtime
|
||||
if [ "$?" -eq "0" ]; then
|
||||
last_cmd_status="\e[1;32m\e[0m"
|
||||
else
|
||||
last_cmd_status="\e[1;31m\e[0m"
|
||||
fi
|
||||
user_and_host="\e[1m$USER\e[1;36m@\e[1;31m$HOST\e[0m"
|
||||
last_runtime_raw="$(echo -p "\t")"
|
||||
local user_and_host="\e[1m$USER\e[1;36m@\e[1;31m$HOST\e[0m"
|
||||
local last_runtime_raw="$(echo -p "\t")"
|
||||
if [ -z "$last_runtime_raw" ]; then
|
||||
last_cmd_runtime=""
|
||||
last_cmd_status=""
|
||||
@@ -27,19 +29,19 @@ in
|
||||
prompt_midline() {
|
||||
git rev-parse --is-inside-work-tree > /dev/null 2>&1 || return
|
||||
|
||||
status="$(git status --porcelain 2>/dev/null)"
|
||||
gitsigns=""
|
||||
local gitsigns
|
||||
local status="$(git status --porcelain 2>/dev/null)"
|
||||
|
||||
[ -n "$status" ] && echo "$status" | command grep -q '^ [MADR]' && gitsigns="$gitsigns!"
|
||||
[ -n "$status" ] && echo "$status" | command grep -q '^??' && gitsigns="$gitsigns?"
|
||||
[ -n "$status" ] && echo "$status" | command grep -q '^[MADR]' && gitsigns="$gitsigns+"
|
||||
|
||||
ahead="$(git rev-list --count @{upstream}..HEAD 2>/dev/null)"
|
||||
behind="$(git rev-list --count HEAD..@{upstream} 2>/dev/null)"
|
||||
local ahead="$(git rev-list --count @{upstream}..HEAD 2>/dev/null)"
|
||||
local behind="$(git rev-list --count HEAD..@{upstream} 2>/dev/null)"
|
||||
[ $ahead -gt 0 ] && gitsigns="$gitsigns↑"
|
||||
[ $behind -gt 0 ] && gitsigns="$gitsigns↓"
|
||||
|
||||
branch="$(git branch --show-current 2>/dev/null)"
|
||||
local branch="$(git branch --show-current 2>/dev/null)"
|
||||
|
||||
if [ -n "$gitsigns" ] || [ -n "$branch" ]; then
|
||||
if [ -n "$gitsigns" ]; then
|
||||
@@ -54,12 +56,14 @@ in
|
||||
}
|
||||
|
||||
prompt() {
|
||||
top="$(prompt_topline)"
|
||||
mid="$(prompt_midline)"
|
||||
bot="$(prompt_botline)"
|
||||
dollar="$(echo -p "\$ ")"
|
||||
dollar="$(echo -e "\e[1;32m$dollar\e[0m")"
|
||||
echo -en "$top$mid$bot\n$dollar"
|
||||
local top="$(prompt_topline)"
|
||||
local mid="$(prompt_midline)"
|
||||
local bot="$(prompt_botline)"
|
||||
local dollar="$(echo -p "\$ ")"
|
||||
local dollar="$(echo -e "\e[1;32m$dollar\e[0m")"
|
||||
local prompt="$top$mid$bot\n$dollar"
|
||||
|
||||
echo -en "$prompt"
|
||||
}
|
||||
|
||||
export PS1="\n\!prompt "
|
||||
@@ -125,7 +129,7 @@ in
|
||||
fi
|
||||
}
|
||||
gitcommit_sfx() {
|
||||
output="$(git commit "$@")"
|
||||
local output="$(git commit "$@")"
|
||||
if [ "$?" -eq "0" ]; then
|
||||
${shellsound} ${sndpath}/gitcommit.wav
|
||||
echo "$output" | ${color-commit}
|
||||
@@ -166,6 +170,13 @@ in
|
||||
${shellsound} ${sndpath}/cd.wav
|
||||
}
|
||||
|
||||
vipe() {
|
||||
local tmp=$(mktemp)
|
||||
$EDITOR "$tmp" >/dev/tty </dev/tty
|
||||
cat "$tmp"
|
||||
rm "$tmp"
|
||||
}
|
||||
|
||||
if [ "$0" = "-fern" ]; then
|
||||
${shellsound} $FLAKEPATH/assets/sound/login.wav
|
||||
fi
|
||||
|
||||
@@ -11,6 +11,9 @@
|
||||
email = "kylerclay@proton.me";
|
||||
name = "${username}";
|
||||
};
|
||||
alias = {
|
||||
draft = "!if git rev-parse > /dev/null 2>&1; then echo \"$1\" >> $(git rev-parse --git-dir)/DRAFT_MSG; else exit 1; fi #";
|
||||
};
|
||||
core.pager = "delta";
|
||||
interactive.diffFilter = "delta --color-only";
|
||||
delta.navigate = "true";
|
||||
|
||||
Reference in New Issue
Block a user