summaryrefslogtreecommitdiff
path: root/shell-scripts
diff options
context:
space:
mode:
Diffstat (limited to 'shell-scripts')
-rwxr-xr-xshell-scripts/kakup26
-rw-r--r--shell-scripts/set-bg16
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