summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--.config/zsh/alias.zsh6
-rwxr-xr-x.local/bin/dmbookm4
-rwxr-xr-x.local/bin/hddmnt21
3 files changed, 17 insertions, 14 deletions
diff --git a/.config/zsh/alias.zsh b/.config/zsh/alias.zsh
index b4dce00..6e8bfea 100644
--- a/.config/zsh/alias.zsh
+++ b/.config/zsh/alias.zsh
@@ -138,8 +138,12 @@ dgg() {
}
alias \
srcnt='find . -type f -name "*.c" -exec cat {} \; | sed "/^\//d" | sed "/^\*/d" | sed "/^ \*/d" | sed "/^\/\//d" | sed "/^$/d" | wc -l | tr -d " "' \
- v='nvim $(fzf --preview="head -$FZF_PREVIEW_LINES {}")' \
tohex='printf "0x%x\n"'
+v() {
+ file=$(fzf --preview="head -$FZF_PREVIEW_LINES {}")
+ [ -z $file ] && return
+ nvim $file
+}
ebin() {
p=$(pwd)
cd "$HOME"/.local/bin || return
diff --git a/.local/bin/dmbookm b/.local/bin/dmbookm
index fb9fdb9..18ab90a 100755
--- a/.local/bin/dmbookm
+++ b/.local/bin/dmbookm
@@ -3,9 +3,9 @@
use strict;
use warnings;
use Sys::Hostname;
+use Env qw(BROWSER);
use constant {
- BROWSER => 'firefox',
HOSTNAME => (split /\./, hostname())[0]
};
@@ -61,7 +61,7 @@ sub main
chomp $choice;
$pid = fork();
if (not $pid) {
- exec(BROWSER, LIST->{$choice});
+ exec($BROWSER, '--new-window', LIST->{$choice});
}
return;
}
diff --git a/.local/bin/hddmnt b/.local/bin/hddmnt
index 8ede464..a7c3b8a 100755
--- a/.local/bin/hddmnt
+++ b/.local/bin/hddmnt
@@ -7,39 +7,38 @@ case "$(hostname -s)" in
mother|po-rbo)
dev=$(find /dev/sd* -type b -exec bash -c 'doas cryptsetup isLuks {} && echo {}' \; | head -n1)
if [ -z "$dev" ]; then
- notify-send -u critical 'exthdd' ' crypt dev not detected'
+ herbe ' crypt dev not detected'
exit 1
fi
if ! doas cryptsetup open "$dev" "$devname"; then
- notify-send -u critical 'exthdd' " failed to uncrypt dev <b>$dev</b>"
+ herbe " failed to uncrypt dev $dev"
exit 1
fi
mkdir -p "$mountpoint"
if ! doas mount /dev/mapper/"$devname" "$mountpoint"; then
- notify-send -u critical 'exthdd' " failed to mount dev <b>$dev</b>"
+ herbe " failed to mount dev $dev"
exit 1
fi
- notify-send -t 5000 'exthdd' " crypt dev mounted to <b>$mountpoint</b>"
+ herbe " crypt dev mounted to $mountpoint"
;;
- mars)
+ mars)
if ! diskinfo da0 >/dev/null; then
- notify-send -u critical 'fathdd' ' HDD not detected'
+ herbe ' HDD not detected'
exit 1
fi
if mount | grep -F /dev/da0p1; then
- notify-send -u critical \
- 'fathdd' \
+ herbe \
" HDD already mounted to \
- <b>$(mount | grep -F '/dev/da0p1' | awk '{print $3}')</b>"
+ $(mount | grep -F '/dev/da0p1' | awk '{print $3}')"
exit 1
fi
if ! dmenu -m 0 -p 'Enter password: ' -P |
geli attach -k /root/geli_keys/fathdd_ext.key -j - da0p1; then
- notify-send -u critical 'fathdd' ' Failed to mount HDD'
+ herbe ' Failed to mount HDD'
exit 1
fi
mkdir -p "$HOME"/hdd
mount /dev/da0p1.eli "$HOME"/hdd
- notify-send -t 5000 'fathdd' ' HDD mounted to <b>~/hdd</b>'
+ herbe ' HDD mounted to ~/hdd'
;;
esac