1
0
Fork 0
guix-home-laptop/fish/config.fish

109 lines
2.3 KiB
Fish
Raw Permalink Normal View History

2024-07-15 13:24:16 +00:00
if status is-interactive
# Commands to run in interactive sessions can go here
end
function sudo
if count $argv >/dev/null
command sudo $argv
else
command sudo (history | read -l)
end
end
set -x GPG_TTY (tty)
set -Ua fish_user_paths /home/sudoer777/.config/guix/current/bin/
set -x GUIX_HOME /home/sudoer777/.guix-home/profile
set -x GUILE_LOAD_PATH $GUIX_HOME/share/guile/site/3.0
set -x GUILE_LOAD_COMPILED_PATH $GUIX_HOME/share/guile/3.0/site-ccache $GUILE_LOAD_PATH
set -x ZATHURA_PLUGINS_PATH $GUIX_HOME/lib/zathura
2024-08-04 04:20:14 +00:00
set -x SSL_CERT_DIR $GUIX_HOME/etc/ssl/certs
set -x SSL_CERT_FILE $GUIX_HOME/etc/ssl/certs/ca-certificates.crt
set -x GIT_SSL_CAINFO $SSL_CERT_FILE
2024-08-04 21:37:25 +00:00
set -x EDITOR $GUIX_HOME/bin/hx
set -x VISUAL $GUIX_HOME/bin/hx
2024-07-15 13:24:16 +00:00
alias ls='exa'
function o
xdg-open $argv & disown
end
2024-07-15 13:24:16 +00:00
function home-reconfig
cd ~/src/guix-config
just
end
function home-edit
emacs ~/src/guix-config/home-configuration.scm
end
2024-07-15 13:46:27 +00:00
function home-update
cd ~/src/guix-config
just update
end
2024-08-04 21:33:43 +00:00
function hotspot
sudo sysctl net.ipv4.ip_default_ttl=65
end
2024-08-12 21:58:44 +00:00
function send-email
set -l from "guix-home@ethanreece.com"
set -l to ""
set -l subject ""
# Parse the arguments
for arg in $argv
switch $arg
case '--from=*'
set from (string split '=' -- $arg)[2]
case '--to=*'
set to (string split '=' -- $arg)[2]
case '--subject=*'
set subject (string split '=' -- $arg)[2]
end
end
set temp_file (mktemp)
# Add required headers to the temporary file
echo "To: $to" >>$temp_file
echo "From: $from" >>$temp_file
echo "Subject: $subject" >>$temp_file
echo "" >>$temp_file # Add a blank line to separate headers from the body
# Open the temporary file with $EDITOR
$EDITOR $temp_file
# Extract the recipient from the file if not provided as an argument
if test -z "$to"
set to (grep -m 1 '^To: ' $temp_file | sed 's/^To: //')
end
echo "Do you want to send the email? (y/n)"
read -l response
if test "$response" = y
# Send the email using msmtp
msmtp $to <$temp_file
echo "Email sent."
else
echo "Email not sent."
end
# Delete the temporary file
rm $temp_file
end
2024-07-15 13:24:16 +00:00
fish_add_path -g