diff options
| author | Mike Vink <ivi@vinkies.net> | 2025-06-20 19:28:33 +0200 |
|---|---|---|
| committer | Mike Vink <ivi@vinkies.net> | 2025-06-20 19:29:09 +0200 |
| commit | 07afa0633223edcbbd0689a2f375fbce3c1af1fb (patch) | |
| tree | 6ba8a31482b379c61e61aea70fcd910f2aac37ef | |
| parent | 9c95c55d9a0d4d6bd264c66462444a6ce6cb4411 (diff) | |
update
| -rw-r--r-- | .config/shell/aliasrc | 56 | ||||
| -rw-r--r-- | .config/shell/profile | 2 | ||||
| -rwxr-xr-x | .local/bin/backup | 4 | ||||
| -rwxr-xr-x | .local/bin/e | 9 | ||||
| -rwxr-xr-x | .local/bin/kak-desktop | 31 | ||||
| -rwxr-xr-x | .local/bin/sb-mailbox | 1 | ||||
| -rwxr-xr-x | .local/bin/vremote | 41 | ||||
| -rwxr-xr-x | .local/bin/workfs | 8 |
8 files changed, 98 insertions, 54 deletions
diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc index db026ab..5b53059 100644 --- a/.config/shell/aliasrc +++ b/.config/shell/aliasrc @@ -1,10 +1,50 @@ +#!/bin/sh + +# sudo not required for some system commands +for command in mount umount sv xbps-remove xbps-install updatedb su shutdown poweroff reboot ; do + alias $command="sudo $command" +done; unset command + +# Verbosity and settings that you pretty much just always are going to want. +alias \ + cp="cp -iv" \ + mv="mv -iv" \ + rm="rm -vI" \ + bc="bc -ql" \ + rsync="rsync -vrPlu" \ + mkd="mkdir -pv" \ + yt="yt-dlp --embed-metadata -i" \ + yta="yt -x -f bestaudio/best" \ + ytt="yt --skip-download --write-thumbnail" \ + ffmpeg="ffmpeg -hide_banner" + +# Colorize commands when possible. +alias \ + ls="ls -hN --color=auto --group-directories-first" \ + ll="ls -hNl --color=auto --group-directories-first" \ + grep="grep --color=auto" \ + diff="diff --color=auto" \ + ccat="highlight --out-format=ansi" \ + ip="ip -color=auto" + +# These common commands are just too long! Abbreviate them. +alias \ + ka="killall" \ + g="git" \ + s="{ git status --short ; git log --oneline @{push}.. ; }" \ + ga="git add " \ + gc="git commit " \ + d="docker" \ + trem="transmission-remote" \ + YT="youtube-viewer" \ + sdn="shutdown -h now" \ + e='$EDITOR' \ + v='$EDITOR' \ + p="pacman" \ + xi="xbps-install" \ + xr="xbps-remove -R" \ + xq="xbps-query" \ + z="zathura" + alias \ ref="shortcuts >/dev/null; . ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc ; . ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutenvrc" -alias g="git " -alias s="{ git status --short ; git log --oneline @{push}.. ; }" -alias ga="git add " -alias gc="git commit " -alias d="docker " -alias d=' echo cd $PWD | kak -p s; eval "[ -n \"$(jobs)\" ] && fg" ' -alias b=' eval "$(cd-kak-buf)"' -alias z='zathura ' diff --git a/.config/shell/profile b/.config/shell/profile index 59754ac..479fb76 100644 --- a/.config/shell/profile +++ b/.config/shell/profile @@ -16,7 +16,7 @@ then d="/run/user/$(id -u)" fi export TERMINAL="st" -export EDITOR="e" +export EDITOR="kak-desktop" export GIT_EDITOR="kak" export BROWSER="firefox" 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 |
