summaryrefslogtreecommitdiff
path: root/.local/bin
diff options
context:
space:
mode:
authorMike Vink <ivi@vinkies.net>2025-06-20 19:28:33 +0200
committerMike Vink <ivi@vinkies.net>2025-06-20 19:29:09 +0200
commit07afa0633223edcbbd0689a2f375fbce3c1af1fb (patch)
tree6ba8a31482b379c61e61aea70fcd910f2aac37ef /.local/bin
parent9c95c55d9a0d4d6bd264c66462444a6ce6cb4411 (diff)
update
Diffstat (limited to '.local/bin')
-rwxr-xr-x.local/bin/backup4
-rwxr-xr-x.local/bin/e9
-rwxr-xr-x.local/bin/kak-desktop31
-rwxr-xr-x.local/bin/sb-mailbox1
-rwxr-xr-x.local/bin/vremote41
-rwxr-xr-x.local/bin/workfs8
6 files changed, 49 insertions, 45 deletions
diff --git a/.local/bin/backup b/.local/bin/backup
new file mode 100755
index 0000000..bff84f4
--- /dev/null
+++ b/.local/bin/backup
@@ -0,0 +1,4 @@
+#!/bin/sh
+backup-rsync-tm -p 22 \
+ /home ivi@192.168.178.22:/volume1/NetBackup/lemptop/homes \
+ "${XDG_CONFIG_HOME:-$HOME/.config}/backup/exclude.txt"
diff --git a/.local/bin/e b/.local/bin/e
index b5a395d..02a30c7 100755
--- a/.local/bin/e
+++ b/.local/bin/e
@@ -1,5 +1,6 @@
#!/bin/sh
-if [ -n "$1" ]
-then kak-shell "" a "$@"
-else kak-shell ""
-fi
+$EDITOR "$@"
+#if [ -n "$1" ]
+#then kak-shell "" a "$@"
+#else kak-shell ""
+#fi
diff --git a/.local/bin/kak-desktop b/.local/bin/kak-desktop
new file mode 100755
index 0000000..f9c1aa3
--- /dev/null
+++ b/.local/bin/kak-desktop
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+main() {
+ # Send the edit command to the client
+ if [ "$IN_KAKOUNE_CONNECT" ]; then
+ :edit "$@"
+
+ # Terminal
+ elif test -t 0 -a -t 1; then
+ kak "$@"
+
+ # GUI apps
+ else
+ open "$@"
+ fi
+}
+
+open() {
+ # Skip options
+ [ "$1" = '--' ] && shift
+
+ file=$1 line=$2 column=$3
+ kak -ui dummy -e "
+ new %{
+ hook -always -once global ClientClose %val{client} kill!
+ edit %{$file} %{$line} %{$column}
+ }
+ "
+}
+
+main "$@"
diff --git a/.local/bin/sb-mailbox b/.local/bin/sb-mailbox
index 8fd2d5b..4e72d72 100755
--- a/.local/bin/sb-mailbox
+++ b/.local/bin/sb-mailbox
@@ -15,6 +15,7 @@ esac
# NOTE(): can't figure out why this one doesn't work, emails don't end up in new folder always
# unread="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/*/[Ii][Nn][Bb][Oo][Xx]/new/* -type f | wc -l 2>/dev/null)"
+notmuch new --quiet
unread="$(notmuch search tag:inbox and tag:unread | wc -l 2>/dev/null)"
pidof mbsync >/dev/null 2>&1 && icon="🔃"
diff --git a/.local/bin/vremote b/.local/bin/vremote
deleted file mode 100755
index 4d0d417..0000000
--- a/.local/bin/vremote
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/usr/bin/env bash
-if [ -z "$PATH" ]; then
- PATH="/etc/profiles/per-user/$USER/bin:/run/current-system/sw/bin:/usr/bin:/bin"
-fi
-server_pipe="$XDG_CACHE_HOME/nvim/server.pipe"
-if ! [ -e "$server_pipe" ]; then
- nohup nvim --listen "$server_pipe" --headless >/dev/null 2>&1 &
-fi
-
-(
- file_names=()
- if [ -n "$1" ]; then
- for file_name in "${@}"; do
- if [[ "${file_name:0:1}" == / || "${file_name:0:2}" == ~[/a-zA-Z0-9] ]]
- then
- file_names+=("$file_name")
- else
- file_names+=("${PWD}/$file_name")
- fi
- done
- echo "got file_names: ${file_names[*]}"
- fi
-
- if ! nvim \
- --headless \
- --server ~/.cache/nvim/server.pipe \
- --remote-expr 'luaeval("vim.json.encode(vim.iter(vim.api.nvim_list_uis()):map(function(v) return v.chan end):totable())")' \
- | jq -er '.[]'
- then
- nvim --server "$server_pipe" --remote "${file_names[@]}" >/dev/tty
- exec nvim --server "$server_pipe" --remote-ui >/dev/tty
- else
- if ! command -v osascript >/dev/null 2>&1; then
- notify-send "already existing ui
-starting new nvim instance"
- else
- osascript -e 'display notification "already existing ui..." with title "vremote"'
- fi
- exec nvim "${file_names[@]}" >/dev/tty </dev/tty
- fi
-) > ~/vremote_logs 2>&1
diff --git a/.local/bin/workfs b/.local/bin/workfs
new file mode 100755
index 0000000..e9089ab
--- /dev/null
+++ b/.local/bin/workfs
@@ -0,0 +1,8 @@
+#!/bin/sh
+dir="$HOME/workfs"
+if [ -d "dir" ]
+then
+ fusermount -u "$dir"
+else
+ sshfs "$WORKSSH" "$dir"
+fi