Lots of stuff
This commit is contained in:
0
.config/gnupg/gpg.conf
Normal file
0
.config/gnupg/gpg.conf
Normal file
Submodule .config/nvim updated: 2b5957097a...40b9ec87f9
@@ -46,7 +46,6 @@ alias \
|
||||
ag="alias | grep" \
|
||||
lc="clone_from_labs" \
|
||||
gc="clone_from_github" \
|
||||
enp="enpasscli -vault="$HOME/Documents/Enpass/Vaults/primary" -sort show" \
|
||||
dgit="git --git-dir ~/.config/dotfiles/.git --work-tree=$HOME"
|
||||
|
||||
# Clone from labs
|
||||
|
||||
@@ -26,6 +26,7 @@ export XINITRC="${XDG_CONFIG_HOME:-$HOME/.config}/x11/xinitrc"
|
||||
export NOTMUCH_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/notmuch-config"
|
||||
export GTK2_RC_FILES="${XDG_CONFIG_HOME:-$HOME/.config}/gtk-2.0/gtkrc-2.0"
|
||||
export LESSHISTFILE="-"
|
||||
export GNUPGHOME="${XDG_CONFIG_HOME:-$HOME/.config}/gnupg"
|
||||
export WGETRC="${XDG_CONFIG_HOME:-$HOME/.config}/wget/wgetrc"
|
||||
export INPUTRC="${XDG_CONFIG_HOME:-$HOME/.config}/shell/inputrc"
|
||||
export ZDOTDIR="${XDG_CONFIG_HOME:-$HOME/.config}/zsh"
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
#!/bin/sh
|
||||
#!/bin/sh
|
||||
|
||||
files="$(find -L "$HOME/Tower/Library")"
|
||||
files="$(find -L "$HOME/Tower/Library" -name '*.pdf' -or -name '*.epub')"
|
||||
|
||||
options=$(echo $files | xargs --delimiter="\n" basename -a)
|
||||
options=$(echo "$files" | xargs --delimiter="\n" basename -a)
|
||||
|
||||
# Get user selection via dmenu from emoji file.
|
||||
chosen=$(cut -d ';' -f1 ~/.local/share/emojis | dmenu -i -l 30 | sed "s/ .*//")
|
||||
chosen=$(echo "$options" | dmenu -i -ix -c -l 30)
|
||||
|
||||
# Exit if none chosen.
|
||||
[ -z "$chosen" ] && exit
|
||||
|
||||
# If you run this command with an argument, it will automatically insert the
|
||||
# character. Otherwise, show a message that the emoji has been copied.
|
||||
if [ -n "$1" ]; then
|
||||
xdotool type "$chosen"
|
||||
else
|
||||
printf "$chosen" | xclip -selection clipboard
|
||||
notify-send "'$chosen' copied to clipboard." &
|
||||
fi
|
||||
line="$(($chosen + 1))"
|
||||
|
||||
file="$(echo "$files" | sed "${line}q;d")"
|
||||
|
||||
zathura "$file"
|
||||
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
# This script is the SUDO_ASKPASS variable, meaning that it will be used as a
|
||||
# password prompt if needed.
|
||||
|
||||
dmenu -fn Monospace-18 -P -p "$1" <&- && echo
|
||||
dmenu -P -p "$1" <&- && echo
|
||||
|
||||
44
.local/bin/enp
Executable file
44
.local/bin/enp
Executable file
@@ -0,0 +1,44 @@
|
||||
#! /usr/bin/zsh
|
||||
|
||||
pwdpath="/tmp/pwd.gpg"
|
||||
pinpath="${XDG_DATA_HOME:-$HOME/.local/share}/pin.gpg"
|
||||
|
||||
if [ -f "$pwdpath" ]
|
||||
then
|
||||
PIN="$(dmenupass "PIN")"
|
||||
export MASTERPW="$(gpg --batch --yes --passphrase "$PIN" --decrypt "$pwdpath" 2&>/dev/null)"
|
||||
elif [ -f "$pinpath" ]
|
||||
then
|
||||
export MASTERPW="$(dmenupass "Password")"
|
||||
PIN="$(gpg --batch --yes --passphrase "$MASTERPW" --decrypt "$pinpath" 2&>/dev/null)"
|
||||
echo "$MASTERPW" | gpg --symmetric --batch --yes --passphrase "$PIN" --output "$pwdpath"
|
||||
else
|
||||
export MASTERPW="$(dmenupass "Password")"
|
||||
PIN="$(dmenupass "PIN")"
|
||||
echo "$PIN" | gpg --symmetric --batch --yes --passphrase "$MASTERPW" --output "$pinpath"
|
||||
echo "$MASTERPW" | gpg --symmetric --batch --yes --passphrase "$PIN" --output "$pwdpath"
|
||||
fi
|
||||
|
||||
[ -z "$MASTERPW" ] && exit 1;
|
||||
|
||||
choices="$(enpasscli -vault="$HOME/Documents/Enpass/Vaults/primary" -sort show 2>&1 | sed -n '/level=info/p')"
|
||||
|
||||
awkcommand='
|
||||
{
|
||||
if (length($3)) {
|
||||
$line = $2" ("$3")"; # If username exists wrap it in brackets
|
||||
} else {
|
||||
$line = $2; # Otherwise just show title
|
||||
}
|
||||
print $line;
|
||||
}
|
||||
'
|
||||
|
||||
chosen="$(echo "$choices" | awk -F '\\s*(title|login|pass|cat\\.)\\s*:\\s*' "$awkcommand" | dmenu -i -ix -l 30)"
|
||||
|
||||
linenumber="$((chosen + 1))"
|
||||
|
||||
line="$(echo "$choices" | sed "${linenumber}q;d")"
|
||||
|
||||
echo $line | sed -n -e 's/.*? pass : (.*)+$/\\1/p'
|
||||
|
||||
@@ -32,3 +32,6 @@ setupdev
|
||||
setupwacom
|
||||
setupmaptool
|
||||
setupkeyring
|
||||
setupfirefox
|
||||
setupjoplin
|
||||
setupnextcloud
|
||||
|
||||
9
.local/bin/setup/setupenpass
Normal file
9
.local/bin/setup/setupenpass
Normal file
@@ -0,0 +1,9 @@
|
||||
#! /bin/bash
|
||||
|
||||
|
||||
[ -z MASTERPW ] &&
|
||||
export MASTERPW=$(dialog --no-cancel --passwordbox "Enter Enpass master password." 10 60 3>&1 1>&2 2>&3 3>&1 | sed 's/\s//g')
|
||||
|
||||
PIN=$(dialog --no-cancel --passwordbox "Enter short term PIN for master password." 10 60 3>&1 1>&2 2>&3 3>&1 | sed 's/\s//g')
|
||||
|
||||
|
||||
@@ -4,8 +4,27 @@ TOWER=$(enpasscli -vault="$HOME/Documents/Enpass/Vaults/primary" -sort show "Sca
|
||||
TOWERUN=$(echo "$TOWER" | grep -Po "(?<=login: )\w+")
|
||||
TOWERPW=$(echo "$TOWER" | grep -Po "(?<=pass : ).+(?=\")")
|
||||
|
||||
path="https://tower.scarif.space/remote.php/dav/files/chris/Joplin"
|
||||
|
||||
joplin config sync.target 5
|
||||
joplin config sync.5.path https://tower.scarif.space/remote.php/dav/files/chris/Joplin
|
||||
joplin config sync.5.path "$path"
|
||||
joplin config sync.5.username "$TOWERUN"
|
||||
joplin config sync.5.password "$TOWERPW"
|
||||
joplin sync
|
||||
joplin sync &
|
||||
|
||||
echo "$path" | xclip -selection clipboard -i
|
||||
|
||||
joplin-desktop &
|
||||
|
||||
clipnotify
|
||||
|
||||
echo "$TOWERUN" | xclip -selection clipboard -i
|
||||
|
||||
clipnotify
|
||||
|
||||
echo "$TOWERPW" | xclip -selection clipboard -i
|
||||
|
||||
read -n 1 -r -s -p $'Press enter when you have synced Joplin...\n'
|
||||
|
||||
echo "" | xclip -selection clipboard -i
|
||||
|
||||
|
||||
Reference in New Issue
Block a user