Compare commits

...

3 Commits

Author SHA1 Message Date
John Mertz da807b773f
Detect existing socket, or not 2023-03-13 15:54:38 -04:00
John Mertz c99674cae7
Middle-click paste menu for text snippets 2023-03-13 15:47:07 -04:00
John Mertz ccf6a8e85b
Uxterm -> alacritty
use --title to force float/position
2023-03-13 15:45:27 -04:00
3 changed files with 27 additions and 1 deletions

12
snippets.sh Executable file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env bash
# Copy snippet to primary clipboard for middle-click pasting
# Maintain list of snippets in private repository
FOLDER=${HOME}/.private-scripts/snippets
FILE=`ls ${FOLDER} | /usr/bin/rofi -dmenu`
if [ -f ${FOLDER}/${FILE} ]; then
DATA=$([ -x "${FOLDER}/${FILE}" ] && bash "${FOLDER}/${FILE}" || head --bytes=-1 ${FOLDER}/${FILE})
printf -- "${DATA}" | wl-copy -p
fi

View File

@ -1,3 +1,17 @@
#!/bin/bash
if [ -e $HOME/.spool/ssh-agent.sock ]; then
PID=$(tail -n 1 $HOME/.spool/ssh-agent.env | sed 's/echo Agent pid \([0-9]*\);/\1/')
if [ -z $PID ]; then
pkill ssh-agent
rm $HOME/.spool/ssh-agent.*
else
CMD=$(ps -p $PID -o comm | tail -n 1)
if [ ! -z $CMD ] && [ $CMD == 'ssh-agent' ]; then
echo "Valid agent already found at $HOME/.spool/ssh-agent.sock with PID $PID"
exit
fi
fi
fi
eval $(ssh-agent -a $HOME/.spool/ssh-agent.sock | tee $HOME/.spool/ssh-agent.env) >/dev/null

View File

@ -5,5 +5,5 @@ RUNNING=$(pgrep todotxt-machine)
if [ "$RUNNING" ]; then
kill $RUNNING 2&>1 /dev/null
else
/usr/bin/xterm -e "/home/jpm/.local/bin/todotxt-machine /home/jpm/nextcloud/phone/todo.txt"
/usr/bin/alacritty --title todotxt-machine -e ${HOME}/.pyenv/shims/todotxt-machine ${HOME}/export/todo.txt
fi