Lots of stuff

This commit is contained in:
2021-06-13 11:43:14 +01:00
parent dad3e90dcf
commit 61b9707ae7
10 changed files with 90 additions and 19 deletions

0
.config/gnupg/gpg.conf Normal file
View File

View File

@@ -46,7 +46,6 @@ alias \
ag="alias | grep" \ ag="alias | grep" \
lc="clone_from_labs" \ lc="clone_from_labs" \
gc="clone_from_github" \ gc="clone_from_github" \
enp="enpasscli -vault="$HOME/Documents/Enpass/Vaults/primary" -sort show" \
dgit="git --git-dir ~/.config/dotfiles/.git --work-tree=$HOME" dgit="git --git-dir ~/.config/dotfiles/.git --work-tree=$HOME"
# Clone from labs # Clone from labs

View File

@@ -26,6 +26,7 @@ export XINITRC="${XDG_CONFIG_HOME:-$HOME/.config}/x11/xinitrc"
export NOTMUCH_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/notmuch-config" 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 GTK2_RC_FILES="${XDG_CONFIG_HOME:-$HOME/.config}/gtk-2.0/gtkrc-2.0"
export LESSHISTFILE="-" export LESSHISTFILE="-"
export GNUPGHOME="${XDG_CONFIG_HOME:-$HOME/.config}/gnupg"
export WGETRC="${XDG_CONFIG_HOME:-$HOME/.config}/wget/wgetrc" export WGETRC="${XDG_CONFIG_HOME:-$HOME/.config}/wget/wgetrc"
export INPUTRC="${XDG_CONFIG_HOME:-$HOME/.config}/shell/inputrc" export INPUTRC="${XDG_CONFIG_HOME:-$HOME/.config}/shell/inputrc"
export ZDOTDIR="${XDG_CONFIG_HOME:-$HOME/.config}/zsh" export ZDOTDIR="${XDG_CONFIG_HOME:-$HOME/.config}/zsh"

View File

@@ -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=$(echo "$options" | dmenu -i -ix -c -l 30)
chosen=$(cut -d ';' -f1 ~/.local/share/emojis | dmenu -i -l 30 | sed "s/ .*//")
# Exit if none chosen.
[ -z "$chosen" ] && exit [ -z "$chosen" ] && exit
# If you run this command with an argument, it will automatically insert the line="$(($chosen + 1))"
# character. Otherwise, show a message that the emoji has been copied.
if [ -n "$1" ]; then file="$(echo "$files" | sed "${line}q;d")"
xdotool type "$chosen"
else zathura "$file"
printf "$chosen" | xclip -selection clipboard
notify-send "'$chosen' copied to clipboard." &
fi

View File

@@ -3,4 +3,4 @@
# This script is the SUDO_ASKPASS variable, meaning that it will be used as a # This script is the SUDO_ASKPASS variable, meaning that it will be used as a
# password prompt if needed. # password prompt if needed.
dmenu -fn Monospace-18 -P -p "$1" <&- && echo dmenu -P -p "$1" <&- && echo

44
.local/bin/enp Executable file
View 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'

View File

@@ -32,3 +32,6 @@ setupdev
setupwacom setupwacom
setupmaptool setupmaptool
setupkeyring setupkeyring
setupfirefox
setupjoplin
setupnextcloud

View 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')

View File

@@ -4,8 +4,27 @@ TOWER=$(enpasscli -vault="$HOME/Documents/Enpass/Vaults/primary" -sort show "Sca
TOWERUN=$(echo "$TOWER" | grep -Po "(?<=login: )\w+") TOWERUN=$(echo "$TOWER" | grep -Po "(?<=login: )\w+")
TOWERPW=$(echo "$TOWER" | grep -Po "(?<=pass : ).+(?=\")") 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.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.username "$TOWERUN"
joplin config sync.5.password "$TOWERPW" 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