diff options
| author | Mike Vink <mike1994vink@gmail.com> | 2023-06-25 21:36:52 +0200 |
|---|---|---|
| committer | Mike Vink <mike1994vink@gmail.com> | 2023-06-25 21:36:52 +0200 |
| commit | ba31dd00cb93b861f4955c57a1be33a63c4efe95 (patch) | |
| tree | 520d8717eac629ff3cf85472a72ae5cd26222dc5 /shell-scripts | |
| parent | 248af6f46a3fcfbdcfb313c54fb91eaa9f42cce1 (diff) | |
add some stuff
Diffstat (limited to 'shell-scripts')
| -rwxr-xr-x | shell-scripts/kakup | 26 | ||||
| -rw-r--r-- | shell-scripts/set-bg | 16 |
2 files changed, 39 insertions, 3 deletions
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 |
