From ba31dd00cb93b861f4955c57a1be33a63c4efe95 Mon Sep 17 00:00:00 2001 From: Mike Vink Date: Sun, 25 Jun 2023 21:36:52 +0200 Subject: add some stuff --- shell-scripts/kakup | 26 +++++++++++++++++++++++--- shell-scripts/set-bg | 16 ++++++++++++++++ 2 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 shell-scripts/set-bg (limited to 'shell-scripts') diff --git a/shell-scripts/kakup b/shell-scripts/kakup index 3e45d29..2806d12 100755 --- a/shell-scripts/kakup +++ b/shell-scripts/kakup @@ -7,6 +7,7 @@ session-or-client() { pushd $project export name=${PWD#$HOME/} export name=${name//\//-} + export name=${name#-} export server=kaks@$name export client=kakc@$name @@ -45,11 +46,30 @@ is-bare() { popd >/dev/null 2>&1 } +search() { + if tty -s + then + fd -d1 "." -t d $HOME $HOME/projects | fzf -1 + else + output=$(mktemp -d /tmp/kakup.XXXXXXXX)/fifo + mkfifo ${output} + st -e bash -c "fd -d1 '.' -t d $HOME $HOME/projects | fzf -1 | tee ${output} >/dev/null 2>&1" & + cat ${output} + rm -r $(dirname ${output}) + fi +} + case "${@}" in "") client="$(pwd | session-or-client)" ;; - .) client="$(fd -d1 "." -t d $HOME $HOME/projects | fzf -1 | is-bare | session-or-client)" ;; + .) client="$(search | is-bare | session-or-client)" ;; *) client="$(echo "${@}" | session-or-client)" ;; esac -echo "client: $client" -[[ $client ]] && tmux attach -t "$client" +[[ ! -z "$client" ]] && { + if tty -s + then + tmux attach -t "$client" + else + st -e tmux attach -t "$client" + fi +} diff --git a/shell-scripts/set-bg b/shell-scripts/set-bg new file mode 100644 index 0000000..ad04730 --- /dev/null +++ b/shell-scripts/set-bg @@ -0,0 +1,16 @@ +#!@bash@/bin/bash +reload=0 +while getopts "r" opt; do + case "$opt" in + h|\?) exit 0 ;; + r) reload=1 ;; + esac +done +if [ $reload -eq 1 ]; then + (cat ~/.cache/wal/sequences &) +else + sxiv -tob ~/bg | parallel wal -i +fi +kak -l | parallel '<<< "colorscheme wal" kak -p {}' +pgrep -x st | parallel kill +st -e tmux attach -- cgit v1.2.3