Improve setup in many small ways
- ircgay command for catgirl - fish keybinds for launching $EDITOR - uptimes script - fix neovide launch flags
This commit is contained in:
parent
21b6215dee
commit
424a1db3a7
7 changed files with 80 additions and 38 deletions
home/features/cli
|
@ -1,5 +1,5 @@
|
|||
# Catgirl is a terminal based irc client
|
||||
{ config, pkgs, hostname ? "hermes", ... }:
|
||||
{ config, pkgs, lib, hostname ? "hermes", ... }:
|
||||
let
|
||||
mkCatgirlNetwork = network: ''
|
||||
host = ${network}.irc.moonythm.dev
|
||||
|
@ -7,9 +7,14 @@ let
|
|||
user = ${hostname}
|
||||
port = 6697
|
||||
'';
|
||||
|
||||
# prints an irc message in rainbow text
|
||||
ircgay = pkgs.writeShellScriptBin "ircgay" ''
|
||||
${lib.getExe pkgs.toilet} -f term --irc --gay "$*"
|
||||
'';
|
||||
in
|
||||
{
|
||||
satellite.persistence.at.state.apps.catgirl.directories = [ "${config.xdg.dataHome}/catgirl" ];
|
||||
home.packages = [ pkgs.catgirl ];
|
||||
home.packages = [ ircgay pkgs.catgirl ];
|
||||
xdg.configFile."catgirl/tilde".text = mkCatgirlNetwork "tilde";
|
||||
satellite.persistence.at.state.apps.catgirl.directories = [ "${config.xdg.dataHome}/catgirl" ];
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{ pkgs, inputs, ... }: {
|
||||
imports = [
|
||||
./scripts
|
||||
./eza.nix
|
||||
./bat.nix
|
||||
./ssh.nix
|
||||
|
|
|
@ -43,6 +43,14 @@ function fish_user_key_bindings
|
|||
bind -M default \cg "nvim +Neogit"
|
||||
bind -M insert \cg "nvim +Neogit"
|
||||
# }}}
|
||||
# {{{ C-e to open $EDITOR
|
||||
bind -M default \ce "$EDITOR"
|
||||
bind -M insert \ce "$EDITOR"
|
||||
# }}}
|
||||
# {{{ C-S-e to open commandline in $EDITOR
|
||||
bind -M default \e\[69\;5u "commandline -f edit_command_buffer"
|
||||
bind -M insert \e\[69\;5u "commandline -f edit_command_buffer"
|
||||
# }}}
|
||||
end
|
||||
# }}}
|
||||
# {{{ Helpers
|
||||
|
|
6
home/features/cli/scripts/default.nix
Normal file
6
home/features/cli/scripts/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{ pkgs, ... }:
|
||||
let uptimes = pkgs.writeShellScriptBin "uptimes" (builtins.readFile ./uptimes.sh);
|
||||
in
|
||||
{
|
||||
home.packages = [ uptimes ];
|
||||
}
|
21
home/features/cli/scripts/uptimes.sh
Executable file
21
home/features/cli/scripts/uptimes.sh
Executable file
|
@ -0,0 +1,21 @@
|
|||
print_uptime() {
|
||||
local HOST=$1
|
||||
local EMOJI=$2
|
||||
|
||||
# -n: do not echo a newline
|
||||
echo -n "$EMOJI $HOST: "
|
||||
|
||||
# The output of `uptime` looks like this:
|
||||
# `18:40:54 up 1 day 0:51, 0 users, load average: 0.79, 0.68, 0.69`,
|
||||
# so we use awk to trim it down to the parts we care about.
|
||||
#
|
||||
# For awk:
|
||||
# -F: splits the input by a string
|
||||
ssh adrielus@$HOST uptime \
|
||||
| awk -F "up" '{print $2}' \
|
||||
| awk -F " " '{print $1, $2}'
|
||||
}
|
||||
|
||||
echo "Uptimes:"
|
||||
print_uptime "tethys" "🔥"
|
||||
print_uptime "lapetus" "⛵"
|
Loading…
Add table
Add a link
Reference in a new issue