From 351a23a8b81766d7aba3bfb469f049348d13d2ec Mon Sep 17 00:00:00 2001 From: Marc Vertes Date: Sun, 7 Feb 2021 12:03:10 +0100 Subject: update --- .Xresources | 2 ++ .bashrc | 3 +++ bin/byo | 6 ++++-- bin/repairboot | 14 ++++++++++++++ 4 files changed, 23 insertions(+), 2 deletions(-) create mode 100755 bin/repairboot diff --git a/.Xresources b/.Xresources index a653af4..b1c3e3d 100644 --- a/.Xresources +++ b/.Xresources @@ -20,6 +20,8 @@ xterm*termName: xterm-256color xterm*VT100.Translations: #override \ Ctrl Next: smaller-vt-font() \n\ Ctrl Prior: larger-vt-font() \n +xterm*faceName: DejaVu Sans Mono +xterm*faceSize: 10 ! xterm*font: 7x14 ! Allow sixel graphics. (Try: "convert -colors 16 foo.jpg sixel:-"). xterm*decTerminalID: vt340 diff --git a/.bashrc b/.bashrc index 90c903e..c086d45 100644 --- a/.bashrc +++ b/.bashrc @@ -128,3 +128,6 @@ unset base # Display git status in prompt . ~/.bash-powerline.sh # export PS1='; ' + +# load Nix config files (aka auto-completion etc.) +export XDG_DATA_DIRS="$HOME/.nix-profile/share:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" diff --git a/bin/byo b/bin/byo index 389e112..bc09fb8 100755 --- a/bin/byo +++ b/bin/byo @@ -2,7 +2,7 @@ # Backup to yoda [ "$USER" = root ] || exec sudo "$0" "$@" -usage='Usage: byo [-cdk] +usage='Usage: byo [-cdk] [/dev/sda2] Backup local disk to yoda external disk. Options: @@ -19,10 +19,12 @@ while getopts :Ccdk opt; do done shift $((OPTIND - 1)) +dev=$1 yoda_uuid='8c463221-6bb7-414e-9060-c9570bb3a6bb' +[ "$dev" ] || dev=$(blkid --uuid "$yoda_uuid") dest=/mnt/backup/$(hostname) -[ -b /dev/mapper/yoda ] && noclose=1 || cryptsetup open "$(blkid --uuid "$yoda_uuid")" yoda +[ -b /dev/mapper/yoda ] && noclose=1 || cryptsetup open "$dev" yoda findmnt /dev/mapper/yoda /mnt >/dev/null && noumount=1 || mount /dev/mapper/yoda /mnt time backup -v -d "$dest" [ ! "$optC" ] || backup -v -d "$dest" clean diff --git a/bin/repairboot b/bin/repairboot new file mode 100755 index 0000000..6cb9bb4 --- /dev/null +++ b/bin/repairboot @@ -0,0 +1,14 @@ +#!/bin/sh -ex + +# Repair boot from yoda (for acer swift5) + + +[ "$USER" = root ] || exec sudo "$0" "$@" + +cryptsetup open /dev/nvme0n1p2 swift +mount /dev/mapper/swift /mnt +mount /dev/nvme0n1p1 /mnt/boot + +arch-chroot /mnt << EOT +bootctl --path=/boot install +EOT -- cgit v1.2.3